Skip to content

Make dotnet-gcdump work with native AOT#5506

Merged
noahfalk merged 1 commit intomainfrom
MichalStrehovsky-patch-1
Jun 18, 2025
Merged

Make dotnet-gcdump work with native AOT#5506
noahfalk merged 1 commit intomainfrom
MichalStrehovsky-patch-1

Conversation

@MichalStrehovsky
Copy link
Member

Pretty much just adjusts what we had for Project N:

  • IsProjectN is not true for native AOT because we use the same provider GUID as JIT-based CoreCLR and not Project N (which is by design)
  • It is still possible to handle both Project N and native AOT the same way where it matters because both Project N and native AOT emit the same flags (TypeFlags.ModuleBaseAddress and ModuleFlags.Native)
  • Looks like Project N GCDump always relied on Windows kernel module load data only. I'm adding a path that can also use our own module load events (Project N also generates those)

Cc @dotnet/ilc-contrib

Pretty much just adjusts what we had for Project N:

* `IsProjectN` is not true for native AOT because we use the same provider GUID as JIT-based CoreCLR and not Project N (which is by design)
* It is still possible to handle both Project N and native AOT the same way where it matters because both Project N and native AOT emit the same flags (`TypeFlags.ModuleBaseAddress` and `ModuleFlags.Native`)
* Looks like Project N GCDump always relied on Windows kernel module load data only. I'm adding a path that can also use our own module load events (Project N also generates those)
@MichalStrehovsky MichalStrehovsky requested a review from a team as a code owner June 17, 2025 10:50
@MichalStrehovsky
Copy link
Member Author

GCDumps taken with this can be opened with PerfView and PerfView will prompt for the PDBs. If available, (mangled) type names will show up in PerfView UI.

MichalStrehovsky added a commit to MichalStrehovsky/perfview that referenced this pull request Jun 17, 2025
With this, PerfView will be able to create native AOT gcdumps. It activates the same codepaths we had for Project N, so it will also properly decode type names.

The changes to DotNetHeapDumpGraphReader match dotnet/diagnostics#5506.
Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@noahfalk noahfalk merged commit 7b93285 into main Jun 18, 2025
19 checks passed
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-1 branch June 19, 2025 22:25
brianrob pushed a commit to microsoft/perfview that referenced this pull request Jun 20, 2025
With this, PerfView will be able to create native AOT gcdumps. It activates the same codepaths we had for Project N, so it will also properly decode type names.

The changes to DotNetHeapDumpGraphReader match dotnet/diagnostics#5506.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants