Set EventSource version for all events#7497
Conversation
|
I think I'll never touch the event source in MSBuild ever again, somehow I keep messing it up... |
There was a problem hiding this comment.
Does this first version update update any method signature changes that already exist? If so, I'd say it makes sense to just update the version of a particular event whenever we need to. This way leads to extra events being updated unnecessarily.
Edit: Sounds like yes, so I'd slightly prefer assigning them all (individually) version 1 (or 100) and updating start/stop pairs together but separately from the rest.
| /// <summary> | ||
| /// Represents the version of the events. Be sure to increment this any time you modify an existing event method. | ||
| /// </summary> | ||
| public const int EventVersion = 100; |
There was a problem hiding this comment.
Is there some reason you starting at 100 instead of 1? Does the version comparer think 9 > 10?
|
I spent a few hours trying to understand ETW more and when and when not to use this Version attribute metadata and couldn't find anything obvious. I don't have any more time to spend on this so I'm going to close this for now since my solution doesn't seem desirable. |
Fixes #
Context
In #7390 I modified some of the event source methods but I just noticed that things look wrong in the latest internal preview. It seems like Start/Stop event methods need to have the same version in order to be linked up.
I'm working on event messages like this in NuGet and just used a constant to rev the version of all event methods at the same time which seems like a better practice in general.
Changes Made
Add a constant to represent the event method version and use that version in all event methods.
Testing
Manually tested locally, these are the events logged now:
Here is a sample for others to verify as well:
PerfViewData.etl.zip
Notes