Skip to content

Parsing of new GC events - #1758

Merged
Brian Robbins (brianrob) merged 6 commits into
microsoft:mainfrom
cshung:public/new-gc-events
Mar 27, 2023
Merged

Parsing of new GC events#1758
Brian Robbins (brianrob) merged 6 commits into
microsoft:mainfrom
cshung:public/new-gc-events

Conversation

@cshung

@cshung Andrew Au (cshung) commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

This change performs the parsing of the new events introduced in dotnet/runtime#55888.

At a high level, here are the code changes:

  • Make the GenAware trace parsing more consistent with the manifest, in particular, I collapsed the GenAwareBeginTraceData and GenAwareEndTraceData into a single class GenAwareTemplateTraceData. These two classes are identical anyway. I also renamed the event GCGenAwareStart to GCGenAwareBegin to be consistent with the manifest as well.

My motivation for doing this change is to experiment with my idea at https://github.com/cshung/perfview/tree/private/trace-event-matcher. It is a prototype that I built to compare ClrTraceEventParser.cs with ClrEtwAll.man so that we can find holes in our event parsing logic. I have no plans to productize yet.

  • Introduce the new GCLOHCompact, GCFitBucketInfo, and GCSettingsRundown events. These events are newly introduced in .NET 6.

  • Parse the new V4 GCAllocationTick event that includes a new field named ObjectSize

  • Parse the new V4 GCGlobalHeapHistory event that includes an array of timestamps.

  • Add the missed PinnedObjectHeap enum value for the CreateSegment event.

  • Add the GC keyword to the default rundown keywords.

In addition to the events exposed on ClrTraceEventParser, we also expose the data through TraceGarbageCollector as public property and TraceGC as public fields (to be consistent with other fields).

This info is also reflected in the raw XML for the GCStat page.

Comment thread src/TraceEvent/Computers/TraceManagedProcess.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
@cshung
Andrew Au (cshung) marked this pull request as draft December 14, 2022 19:57
@cshung
Andrew Au (cshung) force-pushed the public/new-gc-events branch 5 times, most recently from 2f2d465 to 6c0019c Compare December 17, 2022 22:32
@cshung Andrew Au (cshung) changed the title Low-level parsing of new GC events Parsing of new GC events Dec 17, 2022
@cshung
Andrew Au (cshung) marked this pull request as ready for review December 17, 2022 22:52
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs
@brianrob

Copy link
Copy Markdown
Member
        sb.Append("/>");

I would expect the Count and Times to be written out here.


Refers to: src/TraceEvent/Parsers/ClrTraceEventParser.cs:6977 in 6c0019c. [](commit_id = 6c0019c, deletion_comment = False)

Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated

@brianrob Brian Robbins (brianrob) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Andrew Au (@cshung), a few comments, but overall, looks good.

Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs
Comment thread src/PerfView/GcStats.cs Outdated
Comment thread src/PerfView/GcStats.cs Outdated
@cshung

Copy link
Copy Markdown
Contributor Author
        sb.Append("/>");

Similarly, Times is an array, how exactly do we do that?


In reply to: 1370367894


Refers to: src/TraceEvent/Parsers/ClrTraceEventParser.cs:6977 in 6c0019c. [](commit_id = 6c0019c, deletion_comment = False)

@Maoni0 Maoni Stephens (Maoni0) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs Outdated
Comment thread src/TraceEvent/Parsers/ClrTraceEventParser.cs
@brianrob
Brian Robbins (brianrob) merged commit 92801bd into microsoft:main Mar 27, 2023
@cshung
Andrew Au (cshung) deleted the public/new-gc-events branch March 27, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants