0.1.0 Oct 12, 2021

#12 in #etw


99 lines


Emit ETW events in tracing-enabled Rust applications.

This crate depends on rust_win_etw.

There are four ETW events.

fn NewSpan(span_id: u64, name: &str, file: &str, line: u32);
fn EnterSpan(span_id: u64);
fn ExitSpan(span_id: u64);
fn Event(span_id: u64, message: &str);

Collecting a Rust ETW trace

We are going to use PerfView to collect a tracing-etw enabled Rust program.

  1. Build your app with cargo build. To build the example, cargo build --example test.

  2. Open PerfView.exe.

  3. In the menu bar, Collect > Run.

  4. Enter your program's location in the Command box

  5. Choose Advanced options.

  6. The upper part of the Advanced options area includes check boxes and fields that specify the providers from which to collect event trace data. For now, Uncheck all.

  7. In Additional Providers, enter 9c211c60-a6bc-43c3-8d4d-232c121b1852. This is the GUID of the tracing-etw provider.

  8. Click Run Command


This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.


~78K SLoC