Flame Graph segment width seems to be weighted by sample count rather than time
See original GitHub issueThis comes up particularly with off-cpu profiling, where one stack sample (when a thread blocks on IO or mutex) might represent a large wall-clock duration.
Compare this screenshot, where a segment has 237 samples and takes 49ms:
With this screenshot, where a segment has 75 samples and takes 9600ms:
I’d expect the 9600ms section to be about 9600/49=195 times larger, but instead the 49ms span is wider.
Here’s an offcpu profile to reproduce with: 2021-09-17-200119506-obfuscated.firefox.json.gz
This was generated using Android simpleperf using off-cpu tracing @4000Hz for 30s:
$ simpleperf/app_profiler.py -p com.google.android.apps.maps -r "-f 4000 -g -e cpu-clock --trace-offcpu --duration 30" --activity com.google.android.maps.MapsActivity --skip_collect_binaries
Then converted to firefox profiler format.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Top Results From Across the Web
CPU Flame Graphs - Brendan Gregg
The width of the box shows the total time it was on-CPU or part of an ancestry that was on-CPU (based on sample...
Read more >Summarizing Xperf CPU Usage with Flame Graphs
Xperf includes a sampling profiler and a very capable viewer of the ... Any type of weighted call stack can be converted to...
Read more >Does imprecise sample frequency affect correctness of flame ...
According to the source code, the flamegraph generation is totally relying on the sample counts of the stack traces. However, as experiments ...
Read more >Graphs | Microsoft Learn
Flame graphs The width of each flame group is determined by its weight value in the view. For example, with CPU stacks,...
Read more >What is a Flame Graph? How it Works & Use Cases - Datadog
How to Interpret a Flame Graph (with Example). Application monitoring tools use flame graphs to visualize a request's execution path and unify its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we’re still interested! Thanks a lot for looking at this 😃
fyi, i created a very rough pr to fix this. at least, it should be working #4320
is anyone still interested? if so, i may prioritize finishing up the pr.