Add debug_output_tracing crate to oss/support#2936
Add debug_output_tracing crate to oss/support#2936benhillis wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Windows-only tracing infrastructure that routes tracing events to OutputDebugStringA with a per-layer filter that avoids formatting overhead when no debugger is attached.
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
| ] | ||
|
|
||
| [workspace.metadata.xtask.unused-deps] | ||
| ignored = ["debug_output_tracing"] |
There was a problem hiding this comment.
this was needed because the crate is only used in our closed source repo
There was a problem hiding this comment.
Pull request overview
Adds a new Windows-only support crate that integrates tracing with the Win32 debug output stream, enabling low-overhead debug logging by filtering events out entirely when no debugger is attached.
Changes:
- Introduces
support/debug_output_tracingwithDebugOutputWriter(writes toOutputDebugStringA) andDebuggerPresentFilter(gates on both level andIsDebuggerPresent()). - Registers the crate in the workspace and workspace dependencies.
- Updates workspace unused-deps metadata and lockfile for the new crate.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| support/debug_output_tracing/src/lib.rs | Implements the OutputDebugStringA writer and IsDebuggerPresent-based per-layer filter. |
| support/debug_output_tracing/Cargo.toml | Declares Windows-only dependencies (tracing, tracing-subscriber, winapi). |
| Cargo.toml | Adds the crate to workspace members/dependencies and ignores it in xtask unused-deps checks. |
| Cargo.lock | Adds the new crate entry. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
| # support crates consumed by closed-source only | ||
| "support/debug_output_tracing", |
There was a problem hiding this comment.
The workspace member entry is grouped under a comment saying it’s “consumed by closed-source only”, but this PR is adding an OSS support crate. This label is confusing/misleading for future maintainers; consider moving this entry to an appropriate group (or adjusting the comment to reflect its intended OSS usage).
There was a problem hiding this comment.
I feel like this is fine but I'm open to other opinions.
| [workspace.metadata.xtask.unused-deps] | ||
| ignored = ["debug_output_tracing"] | ||
|
|
There was a problem hiding this comment.
debug_output_tracing is added to [workspace.dependencies] but is not referenced anywhere in the repo (and then globally ignored by the unused-deps xtask pass). If the crate isn’t meant to be used by any OSS members yet, it would be cleaner to avoid adding it to workspace.dependencies until it has an in-repo consumer (or add a small Windows-only integration that uses it) so the ignore isn’t needed.
| [workspace.metadata.xtask.unused-deps] | |
| ignored = ["debug_output_tracing"] |
There was a problem hiding this comment.
If there's a better way to do this I'm open to it, there is a user it's just internal.
Windows-only tracing infrastructure that routes tracing events to OutputDebugStringA with a per-layer filter that avoids formatting overhead when no debugger is attached.