diff --git a/ddtrace/internal/datadog/profiling/stack_v2/src/sampler.cpp b/ddtrace/internal/datadog/profiling/stack_v2/src/sampler.cpp index 0ee1a6eb3f6..c05ae45477e 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/src/sampler.cpp +++ b/ddtrace/internal/datadog/profiling/stack_v2/src/sampler.cpp @@ -7,7 +7,6 @@ #include "echion/threads.h" #include -#include using namespace Datadog; @@ -22,20 +21,13 @@ Sampler::sampling_thread(const uint64_t seq_num) auto wall_time_us = duration_cast(sample_time_now - sample_time_prev).count(); sample_time_prev = sample_time_now; - // Collect native thread_ids - std::unordered_set seen_native_thread_ids; - // Perform the sample for_each_interp([&](PyInterpreterState* interp) -> void { for_each_thread(interp, [&](PyThreadState* tstate, ThreadInfo& thread) { thread.sample(interp->id, tstate, wall_time_us); - seen_native_thread_ids.insert(static_cast(thread.native_id)); }); }); - // Clear thread spans link using seen native thread_ids - ThreadSpanLinks::get_instance().clear_unseen(seen_native_thread_ids); - // Before sleeping, check whether the user has called for this thread to die. if (seq_num != thread_seq_num.load()) { break;