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

Replace printing codegen args with tracing #196

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Jan 3, 2025

Depends on #193.

This removes the following options and replaces them with tracing:

  • --specializer-debug => RUSTGPU_LOG=rustc_codegen_spirv::specializer=debug
  • --print-zombie => RUSTGPU_LOG=print_zombie=debug
  • --print-all-zombie => RUSTGPU_LOG=print_all_zombie=debug

This removes the following options and replaces them with `tracing`:

* `--specializer-debug` => RUSTGPU_LOG=rustc_codegen_spirv::specializer=debug
* `--print-zombie` => RUSTGPU_LOG=print_zombie=debug
* `--print-all-zombie` => RUSTGPU_LOG=print_all_zombie=debug
@LegNeato LegNeato force-pushed the remove_codegen_args branch from 8dc5c17 to 0f38dad Compare January 3, 2025 21:11
@LegNeato LegNeato marked this pull request as ready for review January 3, 2025 21:34
@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 6, 2025

Questions:

  1. Do we want some sort of prefix for all these instead of print for future expansion?
  2. Do we want to do kebab case or underscore?

@Firestar99
Copy link
Member

Suggestion: use the profiling crate instead of tracing

Profiling uses features to specify which profiler you want to use, and ofc it has profile-with-tracing to forward all the zones to tracing. But can also support other profilers, like the excellent tracy profiler. And only the final binary has to specify the features, the intermediary crates can just use profiling without any features and incur no runtime overhead or feature forwarding hell.
However, debugging via logging would no longer be universally available and require a feature flag to work.

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 7, 2025

I think that is a good idea, but this isn't for profiling--just logging debug data. Rustc uses tracing so I'd prefer to start with the same solution. Looks like profiling suggests still using tracing for non-profiling / more advanced use cases. We do want profiling, but that is orthogonal (and can use tracing as its backend)

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 8, 2025

I also found https://docs.rs/tracing-tracy/latest/tracing_tracy/. Not sure which way is ultimately better, will probably require some hands on experience.

@LegNeato
Copy link
Collaborator Author

LegNeato commented Jan 8, 2025

Looks like rustc has profiling built in, so we should probably use that for profiling I think.

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