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

Feature Request: Ability to track deep recursion using frame pointers. #126

Open
hargoniX opened this issue Mar 26, 2024 · 1 comment
Open

Comments

@hargoniX
Copy link

In programs with very deep recursion samply begins producing flamegraphs that are "chopped apart" like in the below picture:
image

(Link to profile: https://share.firefox.dev/49aeiVw)
The majority of these calls are in fact not happening at the same stack depth but are instead part of a very deep recursion in the profiled program. Even setting kernel.perf_event_max_stack to a high value does not help in this situation.

perf together with a perf.data visualizer like flamegraph.pl on the other hand, can make use of the framepointer that is included in this build of the binary to produce a more accurate flamegraph:

image

And then futher up:
image

It would be very nice if samply provided an option to track deep recursion. Presumably using framepointers as the current approach appears to be unable of doing this?

@ishitatsuyuki
Copy link
Contributor

FWIW you can perf record then load the resulting perf.data into Firefox Profiler UI with samply load perf.data. This should give you a decent workaround in the meantime.

samply does support kernel-provided stacks but it's not exposed right now. Ideally we should make more of perf_event_attr we pass to the kernel configurable.

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

2 participants