Skip to content
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

stall-analyser: add output support for flamegraph #2174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Apr 2, 2024

a typical session is like:

$ ./stall-analyser.py --format trace -e scylla/libexec/scylla \
  reactor_stalled_231d31df_2022_2_twcs_3h.log  > out.folded
$ flamegraph.pl out.folded > /tmp/folded.svg
$ xdg-open /tmp/folded.svg

@tchaikov tchaikov requested a review from bhalevy April 2, 2024 17:27
@bhalevy
Copy link
Member

bhalevy commented Apr 2, 2024

Can you please upload an example of the result?

@tchaikov
Copy link
Contributor Author

tchaikov commented Apr 3, 2024

sure. the log file and executable come from scylladb/scylladb#11971

$ sudo dnf install flamegraph # install flamegraph if it's not available
$ ./stall-analyser.py --format trace -e scylla/libexec/scylla \
  reactor_stalled_231d31df_2022_2_twcs_3h.log | \
  flamegraph.pl --title 'Reactor Stalls' --countname "ms" > /tmp/folded.svg
$ xdg-open /tmp/folded.svg

folded.log
folded

@tchaikov tchaikov force-pushed the stall-analyser branch 2 times, most recently from b7f6010 to fcf367b Compare April 3, 2024 02:23
@tchaikov
Copy link
Contributor Author

tchaikov commented Apr 3, 2024

@bhalevy hi Benny, if the general direction is sane, we could render an SVG on the fly without using flamegraph. this way, we could customize the blocks further. the render will be implemented based on Graph, which has done the heavy lifting. but before that i will try to work on our in-house web service to hook up with this tool.

@bhalevy
Copy link
Member

bhalevy commented Apr 3, 2024

It looks nice visually, but I don't see how it helps understanding the stack traces any better.
Seems distracting to me.

@tchaikov
Copy link
Contributor Author

tchaikov commented Apr 4, 2024

@bhalevy hi Benny, thank you for your review. i think it does not provide more information, even worse, it provides less information than the existing plain text output. but the reason i added this output was not just for offering an eye candy.

with a graph we can identify the the hotspot with a quick glance. then we can continue looking at the text output and the logging messages. it serves the same purpose of https://www.brendangregg.com/flamegraphs.html

i am extracting the refactor part out into #2178. would be great to make stall-analyser an importable module in future.

a typical session is like:

```console
$ ./stall-analyser.py --format trace -e scylla/libexec/scylla \
  reactor_stalled_231d31df_2022_2_twcs_3h.log  > out.folded
$ flamegraph.pl out.folded > /tmp/folded.svg
$ xdg-open /tmp/folded.svg
```

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
@tchaikov tchaikov changed the title stall-analyser: add output support for flamegraph and cleanups stall-analyser: add output support for flamegraph May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants