Skip to content

windows-tracing - #4787

Merged
kennykerr merged 1 commit into
masterfrom
windows-tracing
Aug 5, 2026
Merged

windows-tracing#4787
kennykerr merged 1 commit into
masterfrom
windows-tracing

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

Add simple ETW tracing support.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-tracing runtime (no_std) + windows-tracing-macros proc macros for defining providers and writing compile-time schema events.
  • Wires ETW bindings generation via tool_bindings and adds an end-to-end test_tracing crate (including an ETL + TDH decode roundtrip).
  • Adds a Reactor App::on_exit hook and a reactor_startup_perf sample 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, use OsStrExt::encode_wide to build the null-terminated string directly.
            let file_name = wide(path.to_str().unwrap());

Comment thread crates/tests/libs/tracing/src/lib.rs Outdated
Copilot-Session: 44d1ca2a-4c13-4228-8f61-dfe6d2914340
@kennykerr
kennykerr merged commit 32df961 into master Aug 5, 2026
35 checks passed
@kennykerr
kennykerr deleted the windows-tracing branch August 5, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants