-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve flamegraph profiling instructions #12521
Conversation
FYI @Rachelint |
Nice! I am double checking the steps in docs in my local. |
Co-authored-by: kamille <[email protected]>
echo "select * from table;" >> test.sql | ||
sudo dtrace -c './target/debug/datafusion-cli -f test.sql' -o out.stacks -n 'profile-997 /execname == "datafusion-cli"/ { @[ustack(100)] = count(); }' | ||
/tmp/fg/FlameGraph/stackcollapse.pl out.stacks | /tmp/fg/FlameGraph/flamegraph.pl > flamegraph.svg | ||
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root --unit-test datafusion -- dataframe::tests::test_array_agg |
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.
Should we disable lto when profiling?
Seems it makes a small difference to flamegraph, and will lead to very very long building time...
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.
I personally don't change the build settings when profiling -- it seems to work just fine for me
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.
I personally don't change the build settings when profiling -- it seems to work just fine for me
OK, the setting may be not something matters.
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.
I try it following the instructions, and it works well.
Thanks @alamb |
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.
great thanks @alamb
Thank you @Rachelint and @comphead |
Which issue does this PR close?
Related to #11682
Rationale for this change
While working on #12092 I found myself needing to make flamegraphs and the instructions were a bit lackign.
I also made a short (5 min) video to help this process along https://youtu.be/2z11xtYw_xs that I wanted to link as well
What changes are included in this PR?
Update the flamegraph creation cookbook. Here is how it looks rendered:
Are these changes tested?
I tested them locally
Are there any user-facing changes?
Better docs