-
Notifications
You must be signed in to change notification settings - Fork 418
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
feat(profiling): add experimental outside-in stack sampling method (stack v2) #8471
Merged
Conversation
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
sanchda
changed the title
Title TBD, but something something stack v2 something profiling profiling faster, and then some emojis I don't know I'm not very good at this template I should probably read the standard more carefully
feat(profiling): add experimental outside-in stack sampling method (stack v2)
Feb 21, 2024
danielsn
reviewed
Feb 22, 2024
ddtrace/internal/datadog/profiling/stack_v2/include/sampler.hpp
Outdated
Show resolved
Hide resolved
ddtrace/internal/datadog/profiling/stack_v2/include/sampler.hpp
Outdated
Show resolved
Hide resolved
ddtrace/internal/datadog/profiling/stack_v2/include/sampler.hpp
Outdated
Show resolved
Hide resolved
ddtrace/internal/datadog/profiling/stack_v2/src/stack_renderer.cpp
Outdated
Show resolved
Hide resolved
ddtrace/internal/datadog/profiling/stack_v2/src/stack_renderer.cpp
Outdated
Show resolved
Hide resolved
ddtrace/internal/datadog/profiling/stack_v2/src/stack_renderer.cpp
Outdated
Show resolved
Hide resolved
Moved things around to streamline the build process a bit. Also discovered that recent changes were leaking intermediate artifacts into the final .whl, which was causing auditwheel issues when the .so.debug from libdatadog was being inspected.
danielsn
reviewed
Feb 26, 2024
danielsn
reviewed
Feb 26, 2024
majorgreys
approved these changes
Mar 4, 2024
P403n1x87
reviewed
Mar 5, 2024
Co-authored-by: Gabriele N. Tornetta <[email protected]>
Co-authored-by: Gabriele N. Tornetta <[email protected]>
…ace-py into sanchda/profiling_stack_v2
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport-8471-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 33d0af1c205f512858179d13306caf2dea0c414d
# Push it to GitHub
git push --set-upstream origin backport-8471-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7 Then, create a pull request where the |
sanchda
added a commit
that referenced
this pull request
Mar 7, 2024
…tack v2) (#8471) This allows users to optionally use a new stack sampling technique. Briefly, * Avoids issues in Python 3.11 and later where the C struct backing Python frame objects may contain invalid pointers (causing segfaults within standard API calls) * Addresses a bias in the "normal" stack sampler where we had a tendency to sample threads only at the points where they transitioned off-GIL * Hopefully removes some serialization overhead, although in the first few versions the overall consumption of this technique may be higher. There are a few tests around the new code, those will be added to CI in a later update. - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: sanchda <[email protected]> Co-authored-by: Gabriele N. Tornetta <[email protected]> Co-authored-by: Tahir H. Butt <[email protected]> (cherry picked from commit 33d0af1)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport-8471-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 33d0af1c205f512858179d13306caf2dea0c414d
# Push it to GitHub
git push --set-upstream origin backport-8471-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7 Then, create a pull request where the |
Merged
18 tasks
sanchda
added a commit
that referenced
this pull request
Mar 7, 2024
…ackport #8471 to 2.7] (#8635) Backport of #8471 to 2.7 This allows users to optionally use a new stack sampling technique. Briefly, * Avoids issues in Python 3.11 and later where the C struct backing Python frame objects may contain invalid pointers (causing segfaults within standard API calls) * Addresses a bias in the "normal" stack sampler where we had a tendency to sample threads only at the points where they transitioned off-GIL * Hopefully removes some serialization overhead, although in the first few versions the overall consumption of this technique may be higher. There are a few tests around the new code, those will be added to CI in a later update. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
sanchda
added a commit
that referenced
this pull request
Mar 7, 2024
…ackport #8471 to 2.7] (#8636) Backport of #8615 to 2.7 This fixes a few defects in how the ddup and stack_v2 native extensions permitted failure. It also modifies the cmake invocation in setup.py so as to use the one provided by the `cmake` module we already depended upon. I thought the old way would have given it to us, but it appears as though the 2.7.1 release revealed the profiling-related native extensions failed to build. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: sanchda <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows users to optionally use a new stack sampling technique. Briefly,
There are a few tests around the new code, those will be added to CI in a later update.
Checklist
changelog/no-changelog
is set@DataDog/apm-tees
.@DataDog/security-design-and-guidance
.Reviewer Checklist