Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add tracing to rustc_codegen_spirv #193

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Jan 2, 2025

Fixes #192

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

Open questions:

  1. Do we want to do it in __rustc_codegen_backend() so we can trace very early?
  2. Do we want to use our own env var? (I mirrored it off rustc and rustdoc, but I can see a case for reusing RUSTC_LOG)
  3. Do we want a tracing feature that completely compiles tracing-related code out if we want? There is some non-trivial work in Replace printing codegen args with tracing #196 to generate info for the logs. It looks like tracing has a couple of knobs to query, so I gated code behind that but it will still be in the binary. I would lean towards compiling it in always without a feature, as that is what rustc does
  4. Do we want a test? We can probably put an "I am alive" type log item and then run a passing compiletest asserting on the stderr output.

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

tokio-rs/tracing#3183 for nu-ansi-term version fix.

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

I'm not sure I agree with the lint...I am mirroring what rustc and rustdoc do themselves. Thoughts? Should I change it to only use codegen args? For now I have updated the lint to allow it.

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 2, 2025

tokio-rs/tracing#3184 for regex stuff.

@LegNeato LegNeato force-pushed the tracing branch 3 times, most recently from 6621970 to 892f3d8 Compare January 3, 2025 02:49
@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 3, 2025

I am not going to document this until a future PR where there is actually logging in place.

@LegNeato LegNeato changed the title Add tracing to rustc_codegen_spirv Add tracing to rustc_codegen_spirv Jan 3, 2025
@LegNeato LegNeato enabled auto-merge January 5, 2025 13:52
@LegNeato
Copy link
Collaborator Author

@Firestar99 any thoughts on the open questions in #193 (comment) ?

@Firestar99
Copy link
Member

To most of these: I don't really know, as I haven't used the tracing feature, nor done more than 2 weeks of hacking in the actual compiler. Most of my contributions have been intrinsics, which don't need deep end compiler changes, or just rebasing stuff.

  1. I don't think we really need a feature for the compiler

@LegNeato
Copy link
Collaborator Author

Ok, I am going to land these then and we can change later.

@LegNeato LegNeato disabled auto-merge January 21, 2025 14:49
@LegNeato LegNeato merged commit d5754d0 into Rust-GPU:main Jan 21, 2025
7 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tracing support to rustc_codegen_spirv
2 participants