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

Allow ETW to use thread's activity ID #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 26, 2023

  1. Allow ETW to use thread's activity ID

    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 of `windows.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 to
    `eventWriteTransfer` 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` or `SetThreadActivityID` are called
    before-hand.
    
    Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
    helsaawy committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    9f9ea49 View commit details
    Browse the repository at this point in the history