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

flamegraph.pl search() function erroneusly counts hidden frames #295

Open
qbolec opened this issue Nov 15, 2022 · 0 comments
Open

flamegraph.pl search() function erroneusly counts hidden frames #295

qbolec opened this issue Nov 15, 2022 · 0 comments

Comments

@qbolec
Copy link

qbolec commented Nov 15, 2022

The loop in https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl#L1077 which iterates over <g> elements, does not check if they have currently the .hide class. These elements still have their x and width values from before zoom, and seem to be collected in the matches hashmap, and counted towards count.

What I expected:
The "Matched: x%" text should mean that the frames that (match the CTRL+F query) AND (are currently visible) consititute x% of the visible region.

What happens instead:
The "Matched: x%" text seams to mean that the frames that (match the CTRL+F query) consititute x% of the visible region.

Why does it matter:
This results in the Matched: 69.5% instead of Matched: 55.8% text in my case, but in general the differece can be arbitrarily huge.
This is a problem to me, because I have function outer() which calls inner() and I wanted to know relation of inner()/outer() for each callstack separately - so I've zoomed to each call of outer() one by one and noted down the ratio, and was puzzled that the ratio is always larger than the average ratio (which I computed by zooming out and searching for outer() and inner() separately).

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

No branches or pull requests

1 participant