Skip to content

[Profiling] Raise max stack depth to 512#1681

Merged
bwoebi merged 3 commits into
masterfrom
levi/profiling-max-depth
Aug 2, 2022
Merged

[Profiling] Raise max stack depth to 512#1681
bwoebi merged 3 commits into
masterfrom
levi/profiling-max-depth

Conversation

@morrisonlevi

@morrisonlevi morrisonlevi commented Aug 1, 2022

Copy link
Copy Markdown
Collaborator

Description

Some customers are seeing truncated stacks. This PR allows going up
to 512 frames deep now but it no longer allocates the max stack depth
when initializing samples buffer. This avoids waste when the stack is
much smaller than the limit, which it very often will be with a higher
limit.

Readiness checklist

  • Changelog has been added to the release document.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.

The exact fake frame name may change to align with other profilers,
but currently this information is missing and we can't easily tell if
a customer has hit a stalk walking bug, genuinely has weird stacks, or
if it's been truncated.
Some customers are seeing truncated stacks. This PR allows going up
to 512 frames deep now but it no longer allocates the max stack depth
when initializing samples buffer. This avoids waste when the stack is
much smaller than the limit, which it very often is.
@morrisonlevi morrisonlevi added 🏆 enhancement A new feature or improvement profiling Relates to the Continuous Profiler labels Aug 1, 2022
@morrisonlevi morrisonlevi added this to the 0.77.0 milestone Aug 1, 2022
@morrisonlevi
morrisonlevi marked this pull request as ready for review August 1, 2022 16:13
@morrisonlevi
morrisonlevi requested a review from a team as a code owner August 1, 2022 16:13
r1viollet
r1viollet previously approved these changes Aug 1, 2022

@r1viollet r1viollet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

let max_depth = 128;
samples.reserve(max_depth); // todo: try_reserve
let max_depth = 512;
let mut samples = Vec::with_capacity(max_depth >> 3);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: We could explicitly write the reserve size

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We could, but then we should probably assert it is less than max_depth. Didn't seem worth it.

Base automatically changed from levi/profiling-truncated-frames to master August 1, 2022 18:40

@bwoebi bwoebi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-ack

@bwoebi
bwoebi merged commit fc6ff48 into master Aug 2, 2022
@bwoebi
bwoebi deleted the levi/profiling-max-depth branch August 2, 2022 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏆 enhancement A new feature or improvement profiling Relates to the Continuous Profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants