You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMHO we should bring back the old behavior and move the "weighting" behavior behind a command line option.
The scripts should not silently add a weight to the samples and still report them as "samples". This makes the output confusing.
The output of the script now does not match the documentation on the web site.
The weighting is done using the number of cycles elapsed the last sample. I do not think this makes sense in all use cases, especially when dealing with samples that happen irregularly.
The change hides the fact that we are still dealing with a bunch of samples and that we don't know what happens between the samples. Instead it tries to account for cycles, which only makes sense when the time between samples approaches 0.
With older versions, some simple statistic checks were easy:
"Is it only one sample? Then it has no significance, let's ignore it". Now we can't discern heavily weighted outliers from multiple, lower weighted samples that carry significant information.
I understand that there's demand to have the samples weighted by the amount the cycle counter increased between the last sample and this sample.
So my proposal would is:
Let's bring back the old behavior (sample count) as default behavior and add new command line option to enable the period-weighting of samples.
--periods "Weight samples according to the reported event period"
What do you think? I'll be happy to create the PR. @kgibm already did most of the work in #297 ;-)
Issue
When using the instruction from https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html the number of samples according to perf and the number of samples according to the flame graph differ greatly.
Example numbers:
The flame graph reports billions of samples:
Notes
The example flamegraph on https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html does report correct numbers.
First Analysis
This change has been introduced with #165 in PR #250
From there on, samples are weighted by a factor but still reported as "samples", making the output of perf and flamegraph contradictory.
The text was updated successfully, but these errors were encountered: