-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiling): add experimental outside-in stack sampling method (s…
…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. ## 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]> Co-authored-by: Gabriele N. Tornetta <[email protected]> Co-authored-by: Tahir H. Butt <[email protected]>
- Loading branch information
1 parent
d5445a7
commit 33d0af1
Showing
44 changed files
with
1,333 additions
and
582 deletions.
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
31 changes: 31 additions & 0 deletions
31
ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
include(CheckIPOSupported) | ||
|
||
function(add_ddup_config target) | ||
target_compile_options(${target} PRIVATE | ||
"$<$<CONFIG:Debug>:-Og;-ggdb3>" | ||
"$<$<CONFIG:Release>:-Os>" | ||
-ffunction-sections -fno-semantic-interposition -Wall -Werror -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast | ||
) | ||
target_link_options(${target} PRIVATE | ||
"$<$<CONFIG:Release>:-s>" | ||
-Wl,--as-needed -Wl,-Bsymbolic-functions -Wl,--gc-sections | ||
) | ||
set_property(TARGET ${target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
check_ipo_supported(RESULT result) | ||
if (result) | ||
set_property(TARGET ${target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
endif() | ||
|
||
# Propagate sanitizers | ||
if (SANITIZE_OPTIONS) | ||
# Some sanitizers (or the analysis--such as symbolization--tooling thereof) work better with frame | ||
# pointers, so we include it here. | ||
target_compile_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS} -fno-omit-frame-pointer) | ||
target_link_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS}) | ||
endif() | ||
|
||
# If DO_FANALYZER is specified and we're using gcc, then we can use -fanalyzer | ||
if (DO_FANALYZER AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
target_compile_options(${target} PRIVATE -fanalyzer) | ||
endif() | ||
endfunction() |
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
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
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.