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

pkg/query: Correctly sum up total cumulative value #3440

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

metalmatze
Copy link
Member

We were counting inlined functions additionally.

We were counting inlined functions additionally.
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess as long as this is consistent with our previous flamegraph implementation I'm happy with it, but I'll be honest I don't understand this change.

@metalmatze
Copy link
Member Author

metalmatze commented Jul 12, 2023

It is now.
The real root cause is folded away by GitHub, it's the lines above:

for k := len(location.Lines) - 1; k >= 0; k-- {
	line := location.Lines[k]

We were adding the cumulative value multiple times if the leaf is an inlined function.

@metalmatze metalmatze merged commit 6c171f9 into main Jul 12, 2023
34 checks passed
@metalmatze metalmatze deleted the flamegraph-arrow-cumulative branch July 12, 2023 13:27
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