Skip to content

Conversation

@markples
Copy link
Contributor

@markples markples commented Oct 8, 2024

Summary: This includes multiple fixes to reenable the viewing of GC stress log events (from GC dprintf) in StressLogAnalyzer. It makes a small subset of the events available in all _DEBUG builds, which provides a build check in CI without overwhelming the stress log or runtime. This includes an audit of dprintf(1, ...) sites. More detailed GC stress logs can be enabled by changing the sources (as before).

Fixes to StressLogAnalyzer are least-effort because it is intended to be replaced by a C# version in #104999.

Details:

  • gcDetailedStartMsg
    • Split gcDetailedStartMsg to fit under the 16-argument limit for the stress log but keep all arguments for SIMPLE_DPRINTF
    • Cleanup
  • StressLogAnalyzer
    • Handle 16-argument messages
    • Look for a prefix for IS_GCSTART
    • Avoid buffer over-reads
    • Avoid crash on %5s
  • TRACE_GC
    • Enable TRACE_GC in _DEBUG builds
    • Change default behavior to not (re)use upper bits of LogFacility. Leave the mechanism for private builds.
    • Audit dprintf(1) sites and change frequent ones to other values

Includes #108089 until it is merged
Fixes #108628

@markples markples force-pushed the stresslog-gcstart branch 2 times, most recently from df9e20d to 018d47c Compare October 9, 2024 23:07
@markples
Copy link
Contributor Author

"ILC: error IL1013: Error processing 'name'" is #108031

@markples markples changed the title Fix GCStart message in StressLog and StressLogAnalyzer Fix GC stress log and analysis Oct 10, 2024
@markples markples marked this pull request as ready for review October 10, 2024 18:16
@markples markples mentioned this pull request Oct 10, 2024
Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

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

other than the few minor changes you took notes of, the rest LGTM!

@mangod9
Copy link
Member

mangod9 commented Jul 21, 2025

@Maoni0, is this good to merge or there are some changes still needed?

@Maoni0
Copy link
Member

Maoni0 commented Jul 21, 2025

I see the typos in the 2 comments in gcpriv.h were still not fixed...

// HOST_64BIT is required because logging dprintf to the stress log us only
should be
// HOST_64BIT is required because logging dprintf to the stress log is only

// similarly on log messages. A dprintf(1) is generally called about once per
should be
// similarly on log messages. A dprintf(1) is generally called about a few times per

@mangod9
Copy link
Member

mangod9 commented Jul 22, 2025

Ok, thanks. @mrsharm, can you please look into merging this PR (looks like some conflicts need to be resolved and the comments updated per Maoni above). Thx!

@mrsharm
Copy link
Member

mrsharm commented Jul 23, 2025

@mangod9 / @Maoni0: addressed the merge conflict + the comment update. Do let me know if any more changes are needed.

@mrsharm mrsharm requested a review from jkoritzinsky July 23, 2025 01:28
@mrsharm mrsharm enabled auto-merge (squash) July 23, 2025 01:29
@jkoritzinsky
Copy link
Member

jkoritzinsky commented Jul 23, 2025

@mrsharm You've added back the native version of the StressLogAnalyzer. Can you apply the changes that were in conflict to the managed implementation and delete the native implementation? In particular the changes to the recognition of GCStart messages

@mrsharm
Copy link
Member

mrsharm commented Jul 24, 2025

Thanks for catching that, @jkoritzinsky! Removed the old files and updated the comment. And checked the build. Do let me know if any other changes are needed.

@mrsharm mrsharm merged commit 27c8534 into dotnet:main Jul 24, 2025
97 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable TRACE_GC validation build once the build has been fixed

5 participants