Skip to content
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

ci(profiling): gh action to run native tests with sanitizers #11623

Merged
merged 28 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f90b8d3
chore(profiling): gh action with sanitized native tests
taegyunkim Dec 4, 2024
457850e
fix(profiling): recreate locks after fork
taegyunkim Dec 5, 2024
1eb7ae5
release note
taegyunkim Dec 5, 2024
4a99f13
also recreate thread_info_map_lock
taegyunkim Dec 5, 2024
289fc2f
chore(profiling): update fork death native test
taegyunkim Dec 5, 2024
dcec7d4
join after ddup_upload() to make it more realistic
taegyunkim Dec 5, 2024
6ff4b9c
delete as not used
taegyunkim Dec 5, 2024
6b67da9
use pthread for emulate samplers
taegyunkim Dec 5, 2024
1465f84
reset string table
taegyunkim Dec 5, 2024
cb168ed
reset after fork
taegyunkim Dec 5, 2024
7cd6df2
Update releasenotes/notes/profiling-reset-lock-51a032479617f038.yaml
taegyunkim Dec 6, 2024
73a54cb
Merge branch 'main' into taegyunkim/prof-10916-profile-locks
taegyunkim Dec 6, 2024
b58cc6c
Merge branch 'taegyunkim/prof-10916-profile-locks' into taegyunkim/pr…
taegyunkim Dec 6, 2024
3599a66
revert changes
taegyunkim Dec 9, 2024
b8bd58d
Merge branch 'main' into taegyunkim/prof-10916-fork-death
taegyunkim Dec 9, 2024
87973ad
take address of vector elem
taegyunkim Dec 9, 2024
586ef82
merge changes from fix pr
taegyunkim Dec 9, 2024
23f06ee
Merge branch 'main' into taegyunkim/prof-10916-gh-actions
taegyunkim Dec 9, 2024
5ae9ec2
Merge branch 'main' into taegyunkim/prof-10916-gh-actions
taegyunkim Dec 9, 2024
37c8f97
use taegyunkim/algorithm-include
taegyunkim Dec 9, 2024
b25c8fa
Merge branch 'taegyunkim/prof-10916-fork-death' into taegyunkim/prof-…
taegyunkim Dec 9, 2024
e0cd647
update tsan suppressions
taegyunkim Dec 9, 2024
71d84b8
also run when profiling python files are changed
taegyunkim Dec 9, 2024
9ec78a8
do not persist git credentials
taegyunkim Dec 9, 2024
95acec8
Merge branch 'main' into taegyunkim/prof-10916-gh-actions
taegyunkim Dec 9, 2024
ac4d514
update tsan suppressions
taegyunkim Dec 9, 2024
4217e3d
update paths
taegyunkim Dec 9, 2024
9c4ff3d
Merge branch 'main' into taegyunkim/prof-10916-gh-actions
taegyunkim Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/profiling-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Profiling Native Tests with Sanitizers

on:
push:
branches:
- main
- "mq-working-branch**"
pull_request:
paths:
- ddtrace/internal/datadog/profiling/**
- ddtrace/profiling/**
workflow_dispatch: {}

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
sanitizer: ["safety", "thread"]

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install llvm 19
run: |
# Ubuntu-24.04 GH actions image has llvm-18, but we use 19 as it's
# the latest one available.
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19

- name: Run tests with sanitizers
run: |
# DEV: We currently have tests in dd_wrapper and stack_v2, setting
# stack_v2 here will also run tests in dd_wrapper. Revisit this when
# that changes.
./ddtrace/internal/datadog/profiling/build_standalone.sh --${{matrix.sanitizer}} RelWithDebInfo stack_v2_test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ function(dd_wrapper_add_test name)
target_link_libraries(${name} PRIVATE gmock gtest_main dd_wrapper nlohmann_json::nlohmann_json)
add_ddup_config(${name})

gtest_discover_tests(${name})
gtest_discover_tests(${name}
PROPERTIES
# We start new threads after fork(), and we want to continue
# running the tests after that instead of dying.
ENVIRONMENT "TSAN_OPTIONS=die_after_fork=0:suppressions=${CMAKE_CURRENT_SOURCE_DIR}/TSan.supp"
)

set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/..")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# libdd is not compiled with sanitizers so probably that's why we get these
# data races from ddog_ArrayQueue and Datadog::Sample operations
race:ddog_ArrayQueue
race:Datadog::Sample::
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ endif()

# Add echion
set(ECHION_COMMIT
"9d5bcc5867d7aefff73c837adcba4ef46eecebc6"
"ed744987f224fae3f93c842b2b5ffb083984ff8b"
CACHE STRING "Commit hash of echion to use")
FetchContent_Declare(
echion
Expand Down
Loading