about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/emitter.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-08-01 09:59:04 +0200
committerGitHub <noreply@github.com>2025-08-01 09:59:04 +0200
commitd9f794a158e961889345d43e878c1dee11c4527e (patch)
tree1e5b90bed00eaf3f232c584dba94ac1dea2a91f6 /compiler/rustc_errors/src/emitter.rs
parentfce677141065524f56c9ac8528a3c1172cdb444b (diff)
parent88c9a256a94dfc3545dadd33fef15e52a6b7d73e (diff)
downloadrust-d9f794a158e961889345d43e878c1dee11c4527e.tar.gz
rust-d9f794a158e961889345d43e878c1dee11c4527e.zip
Rollup merge of #144708 - Stypox:add-tracing-to-step, r=RalfJung
Add tracing to step.rs and friends

Adds tracing calls to functions in `step.rs` (01717ffecfd47eb51f4877da6ad867b329a1ddd5), to friend functions related to evaluation and stepping (cbfa7c4b96b2ea26c1db185da9b59506bf8c8e55), and adds a new trait method `EnteredTraceSpan::or_if_tracing_disabled` (f0d0d1f5ecdf174696c8a74a5bc98967a2751c93).

Adding `EnteredTraceSpan::or_if_tracing_disabled` is optional and is only useful to avoid having both `tracing::info!()` calls (that existed before) and `enter_trace_span!()` calls (that this PR adds) that would be redundant and would slow down the collection of traces. I say it is optional because it adds some cognitive complexity around `EnteredTraceSpan`, which is possibly not worth the reduced redundancy. Let me know if I should revert that commit.

The tracing calls added in this PR are meant to make it easier to understand what was being executing at a particular point when looking at a trace. But they are likely not useful for the purpose of understanding which components are fast/slow, hence why I used `tracing_separate_thread` for them. After opening a trace generated using the code in this PR in https://ui.perfetto.dev, and after executing the following query and then pressing on "Show debug track", you will see something like the following image in the timeline:

```sql
select slices.id, ts, dur, track_id, category, args.string_value as name, depth, stack_id, parent_stack_id, parent_id, slices.arg_set_id, thread_ts, thread_instruction_count, thread_instruction_delta, cat, slice_id from slices inner join args USING (arg_set_id) where args.key = "args." || slices.name and name = "step"
```

<img width="739" height="87" alt="image" src="https://github.com/user-attachments/assets/74ad9619-9a1f-40e5-9ef4-3db31e33d6e1" />
Diffstat (limited to 'compiler/rustc_errors/src/emitter.rs')
0 files changed, 0 insertions, 0 deletions