-
Notifications
You must be signed in to change notification settings - Fork 375
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
[PROF-10128] Refactor and speed up profiler stack sampling #3837
Merged
ivoanjo
merged 17 commits into
master
from
ivoanjo/prof-10128-stack-sampling-improvements
Aug 13, 2024
+177
−210
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d5062c5
Minor: Make argument name in header match actual function
ivoanjo 9c61d60
Add helper function to clear per_thread_context
ivoanjo 3d4b7fc
Remove sampling_buffer argument from record_placeholder_stack
ivoanjo 5fd0460
Extract checking max_frames into a separate function
ivoanjo dc59c0a
Make sampling_buffers per-thread
ivoanjo 99d5915
Avoid allocating locations for every sampling_buffer/thread
ivoanjo 05e552c
Use smaller type for max_frames
ivoanjo 71839e0
Avoid repeating call to rb_profile_frame_path for cframes
ivoanjo ca04090
Avoid retrieving rb_callable_method_entry_t in ddtrace_rb_profile_frames
ivoanjo 9039572
Introduce `frame_info` to contain sampled stack frame information
ivoanjo 47044b0
Introduce caching for sampled stacks
ivoanjo 360aba2
Use cheaper `RSTRING_PTR` when converting string to char slice
ivoanjo be447a9
Fix build/running with DDTRACE_DEBUG
ivoanjo c09aaae
Directly use VM iseq query functions instead of going through rb_prof…
ivoanjo 2fc03d5
Add workaround for spec that started flaking
ivoanjo e6c9122
Clarify why code is being left commented out
ivoanjo 607d5d5
Pick up upstream fix for `start` parameter
ivoanjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I seem to remember Ruby taking into account register values in its heuristic to detect potential usages of objects. May just be that with the extra caching of things like iseq and what not we make it slightly more likely to hit these edge cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is my suspicion -- Ruby's GC is conservative, in that if anything "looks" like a
VALUE
, it assumes it is. Actually debugging this would mean going into the GC marking code and understand why exactly it's making this decision which is somewhat of a time investment which is why I took the slightly-easier way out 😅.