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

Add script to generate flamegraphs #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kouloumos
Copy link
Contributor

Chasing Concept ACKs and opinions on approach taken.

After researching on flamegraphs I've concluded that for my system (macOS) the best way to generate flamegraphs is using DTrace to sample the active stack frames of the specified process and then https://github.com/brendangregg/FlameGraph to convert the stack traces into the flame graph. Therefore this initial approach is a script to simplify the execution process, from profiling to flamegraphs generation.

The logic is based off some work by fanquake, which I tried to enhance and pack into a script for ease of use.
It's an issue that the process is not the same for all systems, but hopefully with some minor changes this will also work for Linux using perf.

There are 2 scenarios for flame graphs usage, real-life and custom scenarios. This PR is for the latter, although paving the way towards real scenarios where we will create flame graphs on actual usage of the accumulator.

No documentation has been written, as I am still not sure of this approach, but I tried to explain everything with comments in the code.

Note: for this to work, you need to clone the FlameGraph repo and set the appropriate variable at generate_flamegraph.

Bellow are some of the flamegraphs, hosted at my own domain to take advantage of the .svg capabilities:

allows flexibility for profiling and flame graph generation of a
custom scenario
The script allows for DTrace profiling and flamegraphs generation of
the profiling_demo or individual benchmarks
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.

1 participant