diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-11-12 11:31:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 11:31:49 +0100 |
| commit | d3244df6b6b7d834d5ba4ac0e7fa7c6be82918a5 (patch) | |
| tree | 5fc100447c3ea4605b92488333467841ebcff615 | |
| parent | 6d41735e363c06215135476b6ff58d52e27d8a74 (diff) | |
| parent | 6e9ed8b486876d6ac4a57342315eeba839f73eca (diff) | |
| download | rust-d3244df6b6b7d834d5ba4ac0e7fa7c6be82918a5.tar.gz rust-d3244df6b6b7d834d5ba4ac0e7fa7c6be82918a5.zip | |
Rollup merge of #78933 - jyn514:tracing-output, r=oli-obk
Don't print thread ids and names in `tracing` logs
Before:
```
2:rustc INFO rustc_interface::passes Pre-codegen
2:rustcTy interner total ty lt ct all
2:rustc Adt : 1078 81.3%, 0.0% 0.0% 0.0% 0.0%
2:rustc Array : 1 0.1%, 0.0% 0.0% 0.0% 0.0%
2:rustc Slice : 1 0.1%, 0.0% 0.0% 0.0% 0.0%
2:rustc RawPtr : 2 0.2%, 0.0% 0.0% 0.0% 0.0%
2:rustc Ref : 4 0.3%, 0.1% 0.1% 0.0% 0.0%
2:rustc FnDef : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc FnPtr : 76 5.7%, 0.0% 0.0% 0.0% 0.0%
2:rustc Placeholder : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Generator : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc GeneratorWitness : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Dynamic : 3 0.2%, 0.0% 0.0% 0.0% 0.0%
2:rustc Closure : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Tuple : 13 1.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Bound : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Param : 146 11.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Infer : 2 0.2%, 0.1% 0.0% 0.0% 0.0%
2:rustc Projection : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Opaque : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc Foreign : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
2:rustc total 1326 0.2% 0.1% 0.0% 0.0%
2:rustcInternalSubsts interner: #437
2:rustcRegion interner: #355
2:rustcStability interner: #1
2:rustcConst Stability interner: #0
2:rustcAllocation interner: #0
2:rustcLayout interner: #0
```
After:
```
INFO rustc_interface::passes Post-codegen
Ty interner total ty lt ct all
Adt : 1078 81.3%, 0.0% 0.0% 0.0% 0.0%
Array : 1 0.1%, 0.0% 0.0% 0.0% 0.0%
Slice : 1 0.1%, 0.0% 0.0% 0.0% 0.0%
RawPtr : 2 0.2%, 0.0% 0.0% 0.0% 0.0%
Ref : 4 0.3%, 0.1% 0.1% 0.0% 0.0%
FnDef : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
FnPtr : 76 5.7%, 0.0% 0.0% 0.0% 0.0%
Placeholder : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Generator : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
GeneratorWitness : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Dynamic : 3 0.2%, 0.0% 0.0% 0.0% 0.0%
Closure : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Tuple : 13 1.0%, 0.0% 0.0% 0.0% 0.0%
Bound : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Param : 146 11.0%, 0.0% 0.0% 0.0% 0.0%
Infer : 2 0.2%, 0.1% 0.0% 0.0% 0.0%
Projection : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Opaque : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Foreign : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
total 1326 0.2% 0.1% 0.0% 0.0%
InternalSubsts interner: #437
Region interner: #355
Stability interner: #1
Const Stability interner: #0
Allocation interner: #0
Layout interner: #0
```
Closes https://github.com/rust-lang/rust/issues/78931
r? ``@oli-obk``
| -rw-r--r-- | compiler/rustc_driver/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index f434673c39e..a192c2eb94e 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -1288,12 +1288,12 @@ pub fn init_env_logger(env: &str) { .with_indent_lines(true) .with_ansi(true) .with_targets(true) - .with_thread_ids(true) - .with_thread_names(true) .with_wraparound(10) .with_verbose_exit(true) .with_verbose_entry(true) .with_indent_amount(2); + #[cfg(parallel_compiler)] + let layer = layer.with_thread_ids(true).with_thread_names(true); use tracing_subscriber::layer::SubscriberExt; let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer); |
