-
Notifications
You must be signed in to change notification settings - Fork 1.7k
internal: add some tracing
to {Request, Notification}Dispatch
#16394
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
internal: add some tracing
to {Request, Notification}Dispatch
#16394
Conversation
|
On a related note, would be nice if we could replace our |
Yeah, I'd personally feel pretty strongly about not building two profiling infras. At this point, going all-in on tracing makes sense. I used tracing with https://github.com/matklad/tracing-span-tree/ at NEAR, and the end-result was pretty similar to hprof. If someone is looking into this seriously, I'd also recommend taking a closer look tracing-tracy: |
I'll swap the hprof infrastructure over to As for the |
Oh, rust-analyzer is already using |
Note our salsa fork is at https://github.com/rust-analyzer/salsa |
Quick update:
|
👍 |
Few updates: I've swapped the hprof infrastructure over to a vendored version of |
@bors delegate+ |
✌️ @davidbarsky, you can now approve this pull request! If @Veykril told you to " |
c87fdd3
to
1f0209f
Compare
While CI is passing, I'd like to hold on merging to squash this history and ensure that unreported profiles are, well, actually reported as they were before this change. |
☔ The latest upstream changes (presumably #16439) made this pull request unmergeable. Please resolve the merge conflicts. |
a27c7c9
to
5972410
Compare
This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher, bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and removes the homegrown `hprof` implementation in favor of a vendored tracing-span-tree.
5972410
to
e1ea7c8
Compare
☀️ Test successful - checks-actions |
internal: `tracing` improvements and followups Hi folks! Building on #16394, I've got a few small tweaks: - Removed the accidental `mod.rs` usage that I introduced. - Removed a panic in `pat_analysis.rs`. - Recorded the event kind in `handle_event` to better distinguish what _kind_ of event is being handled. - Did a small refactor of `hprof` to have somewhat more linear control flow, and more importantly, write the recorded fields to the output. The end result is the following: <img width="1530" alt="A screenshot of Visual Studio Code on a Mac. `hprof.rs` is open, with " src="https://github.com/rust-lang/rust-analyzer/assets/2067774/bd11dde5-b2da-4774-bc38-bcb4772d1192">
Some of the tracing config would need to be changed in order to benefit more from this (especially
.with_span_events(FmtSpan::CLOSE)
), which provides span events like the following:I dunno if y'all need
LoggerFormatter
in here, but if you don't, I'd be happy to yeet it out of rust-analyzer. In any case, this provided a pretty decent amount of information in the logs, and I can expand this as needed or we can land this PR and expand later.