Skip to content

Increase maximum frames and make maximum tail calls configurable#59

Closed
umanwizard wants to merge 1 commit into
mainfrom
framecount
Closed

Increase maximum frames and make maximum tail calls configurable#59
umanwizard wants to merge 1 commit into
mainfrom
framecount

Conversation

@umanwizard

@umanwizard umanwizard commented Apr 3, 2025

Copy link
Copy Markdown
Collaborator

Bump the number of frames in the trace struct to 256, and also make the maximum number of allowed tail calls, so downstream users of the library (e.g. Parca) can choose to support deeper stacks possibly at the cost of not working on older kernels.

@umanwizard umanwizard changed the title [test, do not merge] bump frame count Increase maximum frames and make maximum tail calls configurable Apr 3, 2025
@umanwizard umanwizard changed the base branch from arm_tls to main April 3, 2025 21:25
@umanwizard umanwizard requested review from brancz and gnurizen April 3, 2025 21:25
@brancz

brancz commented Apr 4, 2025

Copy link
Copy Markdown
Member

Why not submit this upstream right away?

@gnurizen

gnurizen commented Apr 4, 2025

Copy link
Copy Markdown
Collaborator

Oh I see the problem is the native unwinder only does 4 frames per invocation. That’s seems low, does doing more frames per program hit the 4K limit?

@gnurizen

gnurizen commented Apr 4, 2025

Copy link
Copy Markdown
Collaborator

What is the tail call limit in the kernel of concern?

@umanwizard

Copy link
Copy Markdown
Collaborator Author

@brancz I have. I decided to also submit it to our fork in case the upstream PR takes a while to land.

@umanwizard

Copy link
Copy Markdown
Collaborator Author

@gnurizen according to the comment, the limit is 32, and we need to reserve a few in order to call UNWIND_STOP.

@gnurizen

gnurizen commented Apr 4, 2025

Copy link
Copy Markdown
Collaborator

So if we only get 30 invocations of the native unwinder at 4 frames a pop how have we enabled more than 120 frames to be unwound or am I missing something?

@umanwizard

Copy link
Copy Markdown
Collaborator Author

This PR doesn't actually bump the limit, it just makes it configurable. I will bump the limit in a follow-up PR once this lands.

@umanwizard umanwizard closed this Apr 10, 2025
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.

3 participants