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

Add tracing support to rustc_codegen_spirv #192

Open
LegNeato opened this issue Jan 2, 2025 · 2 comments · May be fixed by #193
Open

Add tracing support to rustc_codegen_spirv #192

LegNeato opened this issue Jan 2, 2025 · 2 comments · May be fixed by #193
Assignees
Labels
enhancement New feature or request

Comments

@LegNeato
Copy link
Collaborator

LegNeato commented Jan 2, 2025

When working on or debugging the rust-gpu compiler backend, it is extremely hard to see what is going on. Ideally we have tracing support so that we can put logs and spans in to see what the compiler is doing (behind a feature).

rustc already has support: https://rustc-dev-guide.rust-lang.org/tracing.html

One complication is that rustc_codegen_spirv is used as a dylib and I don't believe tracing works in that situation. I found https://github.com/JakkuSakura/tracing-shared-rs, but it doesn't look great.

@LegNeato LegNeato added the enhancement New feature or request label Jan 2, 2025
@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

For posterity that page mentions that the official compiler includes tracing for info:

"This is an info! log rather than a debug! log so it will work on the official compilers."

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

Looks like we can reuse rustc's version, but again we hit the only info is supported. Rustdoc deals with this by using both:

https://github.com/rust-lang/rust/blob/bf6f8a4d328f7f3b0f6ea8205ad28591cc11aafd/src/librustdoc/lib.rs#L167

I am investigating this solution.

@LegNeato LegNeato self-assigned this Jan 2, 2025
LegNeato added a commit to LegNeato/rust-gpu that referenced this issue Jan 2, 2025
@LegNeato LegNeato linked a pull request Jan 2, 2025 that will close this issue
LegNeato added a commit to LegNeato/rust-gpu that referenced this issue Jan 2, 2025
LegNeato added a commit to LegNeato/rust-gpu that referenced this issue Jan 2, 2025
LegNeato added a commit to LegNeato/rust-gpu that referenced this issue Jan 3, 2025
LegNeato added a commit to LegNeato/rust-gpu that referenced this issue Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant