Allow ETW to use thread's activity ID #286
Open
+140
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit is contains several related changes that ultimately allow ETW events to set their activity ID to the current thread's value. By setting the thread's activity ID, win32 API calls from that thread will be able to access it and either continue using it or set it as the related activity ID, improving tracing on Windows.
Update mkwisyscall to import arbitrary other packages, so generated functions can types defined elsewhere.
Switch ETW functions to use
guid.GUID
instead ofwindows.GUID
.Add convenience
IsEmpty
function for GUIDs.Add
EventActivityIdControl
function to manipulate the thread's activity ID, and related*ThreadActivityID
functions to set the thread activity ID to a non-empty value.Update
writeEventRaw
to only pass (related) activity ID toeventWriteTransfer
if they are non-empty.This is not a breaking change, since related activity ID will remain the same, and the activity ID will only be changed when not specified if
InitializeThreadActivityID
orSetThreadActivityID
are called before-hand.