Skip to content

the way GC recognizes which ETW events are enabled/disabled does not work for multiple consumers scenario #34423

Closed
@Maoni0

Description

since GC lives separately from the VM side, we keep track of which events are enabled/disabled on the GC side so we can test if an event is enabled quickly. we track this by keyword/level in EtwCallback (vm\eventtrace.cpp) -

        GCEventKeyword keywords = static_cast<GCEventKeyword>(MatchAnyKeyword);
        GCEventLevel level = static_cast<GCEventLevel>(Level);
        GCHeapUtilities::RecordEventStateChange(!!bIsPublicTraceHandle, keywords, level);

however, this does not work when there are multiple consumers - one consumer might disable some events but another consumer still wants them. we need to keep track of this per session, ie, each time EtwCallback is called to enable, we need to increment the counter for these keywords/level and decrement accordingly when EtwCallback is called to disable, and only truly disable if no consumer wants them. I don't think there can be a very large # of sessions so we could also just have a datastructure that records what each session wanted and check with each one to see if we should inform the GC side of the disabled/enabled events.

CC @benmwatson, @brianrob

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions