rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.62k stars 1.49k forks source link

fix: Tracing span names should match function names #17148

Closed Wilfred closed 2 weeks ago

Wilfred commented 3 weeks ago

When viewing traces, it's slightly confusing when the span name doesn't match the function name. Ensure the names are consistent.

(It might be worth moving most of these to use #[tracing::instrument] so the name can never go stale. @davidbarsky suggested that is marginally slower, so I've just done the simple change here.)

davidbarsky commented 3 weeks ago

(It might be worth moving most of these to use #[tracing::instrument] so the name can never go stale. @davidbarsky suggested that is marginally slower, so I've just done the simple change here.)

it's also kinda more annoying if you only want to record some parameters. The runtime speed should be the same, it's just a papercut in compile times.

Veykril commented 3 weeks ago

Fwiw, using the attribute is also worse for rust-analyzer analysis performance

Veykril commented 2 weeks ago

@bors delegate+

bors commented 2 weeks ago

:v: @Wilfred, you can now approve this pull request!

If @Veykril told you to "r=me" after making some further change, please make that change, then do @bors r=@Veykril

Wilfred commented 2 weeks ago

@bors r=@Veykril

bors commented 2 weeks ago

:pushpin: Commit c981ff09442cf04cf469223d7690a365126f45ea has been approved by Veykril

It is now in the queue for this repository.

bors commented 2 weeks ago

:hourglass: Testing commit c981ff09442cf04cf469223d7690a365126f45ea with merge 49e502b277a8126a9ad10c802d1aaa3ef1a280ef...

bors commented 2 weeks ago

:sunny: Test successful - checks-actions Approved by: Veykril Pushing 49e502b277a8126a9ad10c802d1aaa3ef1a280ef to master...