Skip to content

Commit e8ef201

Browse files
jbachorikclaude
andcommitted
Merge _root_span_id into _otel_local_root_span_id in ProfiledThread
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 63d494c commit e8ef201

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

ddprof-lib/src/main/cpp/thread.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ void ProfiledThread::releaseFromBuffer() {
8787
_pc = 0;
8888
_sp = 0;
8989
_span_id = 0;
90-
_root_span_id = 0;
9190
_crash_depth = 0;
9291
_cpu_epoch = 0;
9392
_wall_epoch = 0;

ddprof-lib/src/main/cpp/thread.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class ProfiledThread : public ThreadLocalData {
5656
u64 _pc;
5757
u64 _sp;
5858
u64 _span_id;
59-
u64 _root_span_id;
6059
volatile u32 _crash_depth;
6160
int _buffer_pos;
6261
int _tid;
@@ -77,7 +76,7 @@ class ProfiledThread : public ThreadLocalData {
7776
u64 _otel_local_root_span_id;
7877

7978
ProfiledThread(int buffer_pos, int tid)
80-
: ThreadLocalData(), _pc(0), _sp(0), _span_id(0), _root_span_id(0), _crash_depth(0), _buffer_pos(buffer_pos), _tid(tid), _cpu_epoch(0),
79+
: ThreadLocalData(), _pc(0), _sp(0), _span_id(0), _crash_depth(0), _buffer_pos(buffer_pos), _tid(tid), _cpu_epoch(0),
8180
_wall_epoch(0), _call_trace_id(0), _recording_epoch(0), _misc_flags(0), _filter_slot_id(-1), _otel_ctx_initialized(false), _crash_protection_active(false),
8281
_otel_ctx_record{}, _otel_tag_encodings{}, _otel_local_root_span_id(0) {};
8382

@@ -119,14 +118,13 @@ class ProfiledThread : public ThreadLocalData {
119118
u64 lookupWallclockCallTraceId(u64 pc, u64 sp, u32 recording_epoch,
120119
u64 span_id, u64 root_span_id) {
121120
if (_pc == pc && _sp == sp && _span_id == span_id &&
122-
_root_span_id == root_span_id && _recording_epoch == recording_epoch &&
121+
_otel_local_root_span_id == root_span_id && _recording_epoch == recording_epoch &&
123122
_call_trace_id != 0) {
124123
return _call_trace_id;
125124
}
126125
_pc = pc;
127126
_sp = sp;
128127
_span_id = span_id;
129-
_root_span_id = root_span_id;
130128
_recording_epoch = recording_epoch;
131129
return 0;
132130
}

0 commit comments

Comments
 (0)