-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Make GCDump work on Linux #116816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make GCDump work on Linux #116816
Conversation
Fixes dotnet#116686. Turns out the test was failing because everything involved in GCDump was disabled outside Windows.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR re-enables GCDump functionality on Linux by removing OS-specific exclusions and adapting ETW and interlocked calls for cross-platform support.
- Removes the Linux-specific test exclusion for GCDump so tests now run on Linux.
- Un-guards and adjusts the ETW heap-walk helper and event tracing code for non-Windows builds.
- Updates atomic exchange calls, header includes, and adds null-safety in bulk-type event logging.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/tests/issues.targets | Removed the Linux exclusion for tracing/eventpipe/gcdump to allow the GCDump test to run on Linux. |
src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp | Dropped the FEATURE_ETW guard so heap walking runs on Linux. |
src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp | Swapped Windows-only InterlockedExchange64 for PalInterlockedExchange64 for portability. |
src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp | Fixed casing on include, added nothrow allocation and null check, and ensured a default case. |
src/coreclr/nativeaot/Runtime/eventtrace.h | Removed fallback inline stubs for non-ETW builds (now absent). |
src/coreclr/nativeaot/Runtime/eventtrace.cpp | Changed filter parsing to skip on Unix and removed the FEATURE_ETW guard around ForceGC. |
src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt | Reordered sources to include profheapwalkhelper.cpp under the eventtrace list. |
Comments suppressed due to low confidence (3)
src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp:175
- This ETW call is now unconditionally compiled on all platforms, but the ETW methods may not be defined when FEATURE_ETW is disabled, leading to build errors. Consider reintroducing the FEATURE_ETW guard or providing stub declarations.
if (ETW::GCLog::ShouldWalkHeapObjectsForEtw())
src/coreclr/nativeaot/Runtime/eventtrace.cpp:277
- The ForceGC call was previously guarded by FEATURE_ETW. With the guard removed, this call will be compiled when ETW support is absent, leading to missing symbols. Re-add an appropriate guard or ensure the methods exist on Linux.
ETW::GCLog::ForceGC(l64ClientSequenceNumber);
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
Fixes #116686.
Turns out the test was failing because everything involved in GCDump was disabled outside Windows.
Cc @dotnet/ilc-contrib