-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Feature] Add tracing::instrument to allow generating flame graphs
#2887
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
base: staging
Are you sure you want to change the base?
Conversation
f9ee562 to
8de48b0
Compare
8de48b0 to
d0ce260
Compare
d0ce260 to
0d0b94b
Compare
0d0b94b to
a42fe8c
Compare
tracing::instrument to allow generating flamegraphstracing::instrument to allow generating flame graphs
ljedrz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general, left some nits and suggestions
|
@vicsn I added a short motivation to the PR description. |
Thank you, that seems valuable. Would this approach be able to replace ProvableHQ/snarkOS#3930 and create a similar graph? Or will we get a different representation? I'm happy to delay merging snarkOS PR 3930 until we hone in on the specific method we want to support long-term |
|
I think there are ways to generate similar graphs with tracing. However, I should be fine to keep both for now, and we can revise it later. |
This feature adds `tracing::instrument` to various functions in snarkVM.
68bc54d to
0ba29ef
Compare
Motivation
Generating flamegraphs using stack-based profilers, such as
perftoolsorcargo flamegraphis great to measure CPU-bound synchronous workloads. For asynchronous or I/O bound-codetracingallows emitting information ("spans") about when a certain async function was started and finished, even if that function started/stopped multiple times, was waiting for a system call, or moved between threads.The tracing spans can then be passed to different backends. I am particular interested in flamegraph/flamechart generation for my use case, but it also works with, for example, real-time profilers, such as
tracy.Proposed Changes
This PR adds
tracing::instrumentto various performance-critical functions when theinstrumentationfeature is enabled.This allows, for example, generating flame graphs as is done in snarkOS PR #3916