- Notifications
You must be signed in to change notification settings - Fork5.2k
Check EnabledFor* individually for non-self-describing events#46555
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
josalem left a comment
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.
This looks good to me. Do we have any data for what the before/after perf impact of this is? Based on your statement, my understanding is that a similar change for self-describing events would require changes inWriteMultiMerge as well as a means of passing in this state. Is that correct?
brianrob commentedJan 5, 2021
Thanks for the review@josalem. I don't have any before/after data. The improvement is likely to be low. Ultimately, what caused me to actually submit the PR is that it bugs me that we spend any time in EventPipe when it's disabled (or in ETW when it's disabled but EventPipe is enabled). In order to implement this for self-describing events, you would need to keep track of the set of enabled keywords per My guess is that the self-describing path isn't nearly as worthwhile to implement as the manifest-based path, simply because the overhead of emitting a self-describing event is much higher, and so this wasted pinvoke is likely to get lost in the noise for self-describing events. |
sywhang left a comment
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.
LGTM - thanks!
Recently, I've seen EventPipe overhead in ETW traces where EventPipe is disabled. Upon drilling down further, this shows up because if either ETW or EventPipe is enabled for an EventSource, then EventSource assumes that both are enabled. This results in pinvokes into native code for each logger to emit the event. When a logger is disabled, this pinvoke wasted work.
Given that we know the state of each logger, it's easy enough to check them individually before the pinvoke. This change does not extend this behavior to self-describing events because this code is quite different, and there isn't easy to consume state that will tell us which events are enabled for each source.