Skip to content
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

EventListener doesn't support expose embedded structures on Runtime events #12678

Closed
noahfalk opened this issue May 9, 2019 · 3 comments
Closed

Comments

@noahfalk
Copy link
Member

noahfalk commented May 9, 2019

Much thanks to @chrisnas who found this issue:

I see missing details with EventListeners/EventPipes. For example, I’m currently focusing on details that are supposed to come with GCPerHeapHistory_V3 event.
The embedded Values structure (https://github.com/dotnet/coreclr/blob/master/src/vm/ClrEtwAll.man#L1074) is not present in the payload received by the EventListener EventWrittenEventArgs:

ID = 204 Name = GCPerHeapHistory_V3  |  opcode=Info  ==>  System.Diagnostics.Tracing.EventWrittenEventArgs
    Name = "ClrInstanceID" Value = "8"  type=System.UInt16
    Name = "FreeListAllocated" Value = "0"  type=System.IntPtr
    Name = "FreeListRejected" Value = "0"  type=System.IntPtr
    Name = "EndOfSegAllocated" Value = "0"  type=System.IntPtr
    Name = "CondemnedAllocated" Value = "0"  type=System.IntPtr
    Name = "PinnedAllocated" Value = "0"  type=System.IntPtr
    Name = "PinnedAllocatedAdvance" Value = "0"  type=System.IntPtr
    Name = "RunningFreeListEfficiency" Value = "0"  type=System.UInt32
    Name = "CondemnReasons0" Value = "0"  type=System.UInt32
    Name = "CondemnReasons1" Value = "0"  type=System.UInt32
    Name = "CompactMechanisms" Value = "2147483650"  type=System.UInt32
    Name = "ExpandMechanisms" Value = "0"  type=System.UInt32
    Name = "HeapIndex" Value = "0"  type=System.UInt32
    Name = "ExtraGen0Commit" Value = "1456816"  type=System.IntPtr
    Name = "Count" Value = "4"  type=System.UInt32
    Task=65330

Maybe due to the <UserData> section of the definition (https://github.com/dotnet/coreclr/blob/master/src/vm/ClrEtwAll.man#L1086) in which there is no Value field. Note that I quickly looked at the other GC event templates and I did not find any other “missing” <UserData>. However, this is also happening for BulkType and GCBulk* other events: the definition is not present under the <UserData> node.

Investigating a bit I think at least the beginning of the missing support is here. This code parses the ETW manifest and produces C# code that will ultimately be the strongly-typed .NET event type that EventListener returns. This code skips the struct keyword entirely. Assuming we solved that aspect there is probably a second layer that occurs at runtime when EventListener needs to read the serialized data and populate it into the object model. Just having the fields declared doesn't necessarily mean that the translating code will write the appropriate values into them.

@chrisnas
Copy link
Contributor

Thanks for following-up on that topic @noahfalk!

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Nov 23, 2021
Validate the debug mappings generated by the JIT using the
MethodILToNative event. Unfortunately we can not use EventListener as
the event there does not contain the actual mappings (dotnet#12678) so this
reuses some of the facilities from the tracing tests to use EventPipe
and TraceEvent.

This only adds the infrastructure and a small number of tests, but
at least this should make it easier to add more tests in this area in
the future.

There are some more limitations, for example we cannot validate the
CALL_INSTRUCTION mappings generated for the managed return value feature
because the debugger filters them out of the table reported. I am hoping
we can change these mappings to be included as normal in the future.
jakobbotsch added a commit that referenced this issue Nov 24, 2021
Validate the debug mappings generated by the JIT using the
MethodILToNative event. Unfortunately we can not use EventListener as
the event there does not contain the actual mappings (#12678) so this
reuses some of the facilities from the tracing tests to use EventPipe
and TraceEvent.

This only adds the infrastructure and a small number of tests, but
at least this should make it easier to add more tests in this area in
the future.

There are some more limitations, for example we cannot validate the
CALL_INSTRUCTION mappings generated for the managed return value feature
because the debugger filters them out of the table reported. I am hoping
we can change these mappings to be included as normal in the future.

The tests themselves are added by adding a method to tests.il with an
ExpectedILMappings attribute that allows specifying a subset of IL
offsets that we expect mappings to be generated for, with separate
subsets under Debug and when optimizing. This was the best way I could
think of to be able to refer to the right IL offsets.
@ghost
Copy link

ghost commented Feb 21, 2024

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@ghost ghost added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Feb 21, 2024
@ghost
Copy link

ghost commented Mar 6, 2024

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@ghost ghost closed this as completed Mar 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2024
@dotnet-policy-service dotnet-policy-service bot removed no-recent-activity backlog-cleanup-candidate An inactive issue that has been marked for automated closure. labels Apr 7, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants