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

take period into account when collapsing stacks #250

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

guoshimin
Copy link
Contributor

Fixes #165

@mhansen
Copy link

mhansen commented Sep 4, 2021

Thank you, this is just the patch I need, to weight the samples by time taken rather than uniformly by 1.

mdcallag added a commit to mdcallag/FlameGraph that referenced this pull request Mar 31, 2022
Summary:

Disclaimer - I am not an expert on Perl, perf or FlameGraph.

This is a hack for brendangregg#165
By hack I mean that it works for me but I didn't update all of the test files.
The problem is that stackcollapse assumes that all stack traces have an equal
weight but they don't based on based on current perf output. For example,
there can be lines like this where 90689, 32298287 and 1 are the weights
but stackcollapse assumes they all have weight 1, and by weight I mean the
equivalent of the number of times this stack trace happens. Thus, the relative
frequency of xpl_accept-3 is 1 / (90689 + 32289287 + 1).

xpl_accept-1 2777710 12891973.429160: 90689 cycles:
xpl_accept-2 2777710 12891975.431112: 32289287 cycles:
xpl_accept-3 2777710 12891975.431112: 1 cycles:

This is based on brendangregg#250 but
I am not sure that PR is correct, it is also ~20 diffs behind current FlameGraph.

Test Plan:

works for me

Reviewers:

Subscribers:

Tasks:

Tags:
@brendangregg brendangregg merged commit f79a352 into brendangregg:master Sep 18, 2022
@brendangregg
Copy link
Owner

Thanks, merging. If this goes badly for people then please see the discussion in #165 to understand how we got here and how maybe to fix it!

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.

stackcollapse-perf.pl ignores period of samples
4 participants