Skip to content

DOTNET_PerfMapEnabled behavior in .NET 10.0 #120419

@EgorBo

Description

@EgorBo

It seems that in .NET 10.0 DOTNET_PerfMapStubGranularity=2 (or =3) is required, otherwise managed symbols don't show up.

Minimal repro:

class Program
{
    static void Main(string[] args)
    {
        for (int i = 0; i < 30000000; i++)
            Guid.Parse(Guid.NewGuid().ToString());
        Console.WriteLine("Done");
    }
}

run.sh:

TFM=net10.0
rm -rf bin obj out$TFM
dotnet publish -f $TFM  --sc -r linux-x64 -o out$TFM  -p:PublishTrimmed=true -p:PublishReadyToRun=true
dotnet-symbol --symbols ./out$TFM/System.Private.CoreLib.dll
dotnet-symbol --symbols ./out$TFM/libcoreclr.so

DOTNET_PerfMapEnabled=1 perf record -k 1 -g -- ./out$TFM/myapp
perf inject --input perf.data --jit --output perfjit.data
perf report --input perfjit.data --no-children

.NET 9.0:

Image

.NET 10.0:

Image

.NET 10.0 with DOTNET_PerfMapStubGranularity=2:

Image

cc @davidwrighton

PS: looks like it still makes sense to disable W^X during

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions