Skip to content

Commit 01abfae

Browse files
authored
chore(profiling): replace stack_v2 with stack (#15613)
## Description Mostly mechanical change of replacing `stack_v2` with `stack`, as we no longer have `v1` implementation in the codebase. Except for https://github.com/DataDog/dd-trace-py/blob/3d46d4af5637deb52b7c3ea7710dd0ff7419ee32/ddtrace/internal/settings/profiling.py#L389-L392 ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent e06c50b commit 01abfae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+171
-170
lines changed

.github/workflows/profiling-native.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ jobs:
4747
4848
- name: Run tests with sanitizers
4949
run: |
50-
# DEV: We currently have tests in dd_wrapper and stack_v2, setting
51-
# stack_v2 here will also run tests in dd_wrapper. Revisit this when
50+
# DEV: We currently have tests in dd_wrapper and stack, setting
51+
# stack here will also run tests in dd_wrapper. Revisit this when
5252
# that changes.
5353
if [ "${{matrix.memcpy-mode}}" == "fast" ]; then
5454
export ECHION_USE_FAST_COPY_MEMORY=1
5555
else
5656
export ECHION_USE_FAST_COPY_MEMORY=0
5757
fi
5858
59-
./ddtrace/internal/datadog/profiling/build_standalone.sh --${{matrix.sanitizer}} RelWithDebInfo stack_v2_test
59+
./ddtrace/internal/datadog/profiling/build_standalone.sh --${{matrix.sanitizer}} RelWithDebInfo stack_test

ddtrace/internal/datadog/profiling/build_standalone.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CLANGTIDY_CMD=${highest_clangxx/clang++/clang-tidy}
7676
# Targets to target dirs
7777
declare -A target_dirs
7878
target_dirs["ddup"]="ddup"
79-
target_dirs["stack_v2"]="stack_v2"
79+
target_dirs["stack"]="stack"
8080
target_dirs["dd_wrapper"]="dd_wrapper"
8181

8282
# Compiler options
@@ -224,8 +224,8 @@ print_help() {
224224
echo ""
225225
echo "Targets:"
226226
echo " all_test (default)"
227-
echo " stack_v2 (also builds dd_wrapper)"
228-
echo " stack_v2_test (also builds dd_wrapper_test)"
227+
echo " stack (also builds dd_wrapper)"
228+
echo " stack_test (also builds dd_wrapper_test)"
229229
echo " ddup (also builds dd_wrapper)"
230230
echo " ddup_test (also builds dd_wrapper_test)"
231231
}
@@ -350,11 +350,11 @@ add_target() {
350350

351351
case "${target}" in
352352
all|--)
353-
targets+=("stack_v2")
353+
targets+=("stack")
354354
targets+=("ddup")
355355
;;
356-
stack_v2)
357-
targets+=("stack_v2")
356+
stack)
357+
targets+=("stack")
358358
;;
359359
ddup)
360360
targets+=("ddup")

ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function(add_ddup_config target)
8787
target_compile_options(${target} PRIVATE -fanalyzer)
8888
endif()
8989

90-
# The main targets, ddup, crashtracker, stack_v2, and dd_wrapper are built as dynamic libraries, so PIC is required.
90+
# The main targets, ddup, crashtracker, stack, and dd_wrapper are built as dynamic libraries, so PIC is required.
9191
# And setting this is also fine for tests as they're loading those dynamic libraries.
9292
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
9393

ddtrace/internal/datadog/profiling/docs/Design.md

Lines changed: 1 addition & 1 deletion

ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt renamed to ddtrace/internal/datadog/profiling/stack/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ if(NOT DEFINED BUILD_TESTING)
88
endif()
99

1010
# The exact name of this extension determines aspects of the installation and build paths, which need to be kept in sync
11-
# with setup.py. Accordingly, take the name passed in by the caller, defaulting to "stack_v2" if needed.
11+
# with setup.py. Accordingly, take the name passed in by the caller, defaulting to "stack" if needed.
1212
set(EXTENSION_NAME
13-
"_stack_v2"
13+
"_stack"
1414
CACHE STRING "Name of the extension")
1515
project(${EXTENSION_NAME})
1616
message(STATUS "Building extension: ${EXTENSION_NAME}")
@@ -55,8 +55,8 @@ if(NOT Threads_FOUND OR NOT CMAKE_USE_PTHREADS_INIT)
5555
endif()
5656

5757
# Specify the target C-extension that we want to build
58-
add_library(${EXTENSION_NAME} SHARED src/echion/danger.cc src/echion/frame.cc src/sampler.cpp src/stack_renderer.cpp
59-
src/stack_v2.cpp src/thread_span_links.cpp)
58+
add_library(${EXTENSION_NAME} SHARED src/echion/danger.cc src/echion/frame.cc src/sampler.cpp src/stack.cpp
59+
src/stack_renderer.cpp src/thread_span_links.cpp)
6060

6161
# Add common config
6262
add_ddup_config(${EXTENSION_NAME})

ddtrace/internal/datadog/profiling/stack_v2/__init__.py renamed to ddtrace/internal/datadog/profiling/stack/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ddtrace._trace import context
1111
from ddtrace._trace import span as ddspan
1212

13-
from ._stack_v2 import * # noqa: F403, F401
13+
from ._stack import * # noqa: F403, F401
1414

1515
is_available = True
1616

@@ -19,7 +19,7 @@ def link_span(span: typing.Optional[typing.Union[context.Context, ddspan.Span]])
1919
span_id = span.span_id
2020
local_root_span_id = span._local_root.span_id
2121
local_root_span_type = span._local_root.span_type
22-
_stack_v2.link_span(span_id, local_root_span_id, local_root_span_type) # type: ignore # noqa: F405
22+
_stack.link_span(span_id, local_root_span_id, local_root_span_type) # type: ignore # noqa: F405
2323

2424
except Exception as e:
2525
failure_msg = str(e)

ddtrace/internal/datadog/profiling/stack_v2/__init__.pyi renamed to ddtrace/internal/datadog/profiling/stack/__init__.pyi

File renamed without changes.

ddtrace/internal/datadog/profiling/stack_v2/echion/echion/cache.h renamed to ddtrace/internal/datadog/profiling/stack/echion/echion/cache.h

File renamed without changes.

ddtrace/internal/datadog/profiling/stack_v2/echion/echion/config.h renamed to ddtrace/internal/datadog/profiling/stack/echion/echion/config.h

File renamed without changes.

ddtrace/internal/datadog/profiling/stack_v2/echion/echion/cpython/tasks.h renamed to ddtrace/internal/datadog/profiling/stack/echion/echion/cpython/tasks.h

File renamed without changes.

0 commit comments

Comments
 (0)