Skip to content

Replace printing codegen args with tracing - #196

Merged
LegNeato merged 2 commits into
Rust-GPU:mainfrom
LegNeato:remove_codegen_args
Jan 21, 2025
Merged

LegNeato merged 2 commits into
Rust-GPU:mainfrom
LegNeato:remove_codegen_args

Conversation

@LegNeato

@LegNeato LegNeato commented Jan 3, 2025 •

Copy link
Copy Markdown
Collaborator

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

@LegNeato
LegNeato force-pushed the remove_codegen_args branch 2 times, most recently 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

LegNeato commented Jan 6, 2025

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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

LegNeato commented Jan 7, 2025 •

Copy link
Copy Markdown
Collaborator Author

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

LegNeato commented Jan 8, 2025

Copy link
Copy Markdown
Collaborator Author

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

LegNeato commented Jan 8, 2025

Copy link
Copy Markdown
Collaborator Author

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

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 0f38dad to 0616f07 Compare January 21, 2025 15:14
@LegNeato
LegNeato merged commit 6e2c84d into Rust-GPU:main Jan 21, 2025
@LegNeato
LegNeato deleted the remove_codegen_args branch January 21, 2025 15:16
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