windows-tracing - #4787
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new windows-tracing crate (and companion proc-macro crate) to provide simple, manifest-free ETW TraceLogging support across the windows-* ecosystem, along with documentation, bindings generation wiring, tests, and a Reactor startup tracing sample.
Changes:
- Introduces
windows-tracingruntime (no_std) +windows-tracing-macrosproc macros for defining providers and writing compile-time schema events. - Wires ETW bindings generation via
tool_bindingsand adds an end-to-endtest_tracingcrate (including an ETL + TDH decode roundtrip). - Adds a Reactor
App::on_exithook and areactor_startup_perfsample emitting startup lifecycle TraceLogging markers.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/readme.md | Adds crate index entries for windows-tracing and windows-tracing-macros. |
| docs/crates/windows-tracing.md | New crate documentation and contributor notes for the tracing runtime. |
| docs/crates/windows-tracing-macros.md | New crate documentation for the proc-macro companion. |
| docs/crates/windows-reactor.md | Documents the new App::on_exit behavior. |
| crates/tools/bindings/src/tracing.txt | New tool_bindings config to generate ETW FFI for the tracing crate. |
| crates/tools/bindings/src/main.rs | Runs tool_bindings for tracing.txt. |
| crates/tests/libs/tracing/src/lib.rs | New integration test capturing/decoding ETW events via TDH. |
| crates/tests/libs/tracing/Cargo.toml | New test_tracing crate manifest. |
| crates/samples/readme.md | Lists the new reactor_startup_perf sample. |
| crates/samples/reactor/startup_perf/src/main.rs | New Reactor sample emitting TraceLogging events across startup/exit lifecycle. |
| crates/samples/reactor/startup_perf/readme.md | Documents provider/keyword and event markers for the sample. |
| crates/samples/reactor/startup_perf/Cargo.toml | New sample crate manifest. |
| crates/samples/reactor/startup_perf/build.rs | Marks the sample as framework-dependent via windows-reactor-setup. |
| crates/libs/tracing/src/lib.rs | New tracing runtime: provider state, registration, filtering, and event write entrypoint. |
| crates/libs/tracing/src/bindings.rs | Generated ETW bindings (advapi32 EventRegister/EventWriteTransfer/etc.). |
| crates/libs/tracing/readme.md | User-facing README and basic usage example for windows-tracing. |
| crates/libs/tracing/Cargo.toml | New windows-tracing crate manifest. |
| crates/libs/tracing-macros/src/lib.rs | New proc macros: define_provider! and write_event! with compile-time metadata encoding. |
| crates/libs/tracing-macros/readme.md | User-facing README for the proc-macro crate. |
| crates/libs/tracing-macros/Cargo.toml | New windows-tracing-macros crate manifest. |
| crates/libs/reactor/src/app.rs | Adds App::on_exit plumbing and tests for one-shot execution/reset. |
| crates/libs/reactor/readme.md | Notes App::on_exit in Reactor’s user README. |
| Cargo.toml | Adds workspace dependencies for windows-tracing and windows-tracing-macros. |
Suppressed comments (1)
crates/tests/libs/tracing/src/lib.rs:247
path.to_str().unwrap()can panic on non-UTF-8 paths. Since this is Windows-only code and you already work with UTF-16 buffers, useOsStrExt::encode_wideto build the null-terminated string directly.
let file_name = wide(path.to_str().unwrap());
kennykerr
force-pushed
the
windows-tracing
branch
from
August 5, 2026 16:54
a706199 to
4e034a1
Compare
Copilot-Session: 44d1ca2a-4c13-4228-8f61-dfe6d2914340
kennykerr
force-pushed
the
windows-tracing
branch
from
August 5, 2026 16:54
4e034a1 to
f1ef1ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add simple ETW tracing support.