@@ -54,16 +54,6 @@ class ProfiledThread : public ThreadLocalData {
5454 static int popFreeSlot (); // Returns -1 if no free slots
5555 static void pushFreeSlot (int slot_index);
5656
57- // In-flight state for monitor contention tracking (MonitorContendedEnter →
58- // MonitorContendedEntered). Keyed on obj_addr == 0 meaning "no contention in
59- // progress". Object addresses are never 0 in the JVM.
60- struct MonitorBlockState {
61- u64 start_ticks;
62- u64 span_id;
63- u64 root_span_id;
64- uintptr_t obj_addr;
65- };
66-
6757 u64 _pc;
6858 u64 _sp;
6959 u64 _span_id;
@@ -81,7 +71,6 @@ class ProfiledThread : public ThreadLocalData {
8171 bool _ctx_tls_initialized;
8272 bool _crash_protection_active;
8373 Context* _ctx_tls_ptr;
84- MonitorBlockState _monitor_block{};
8574
8675 ProfiledThread (int buffer_pos, int tid)
8776 : ThreadLocalData(), _pc(0 ), _sp(0 ), _span_id(0 ), _root_span_id(0 ), _crash_depth(0 ), _buffer_pos(buffer_pos), _tid(tid), _cpu_epoch(0 ),
@@ -90,7 +79,20 @@ class ProfiledThread : public ThreadLocalData {
9079 void releaseFromBuffer ();
9180
9281public:
82+ // In-flight state for monitor contention tracking (MonitorContendedEnter →
83+ // MonitorContendedEntered). Keyed on obj_addr == 0 meaning "no contention in
84+ // progress". Object addresses are never 0 in the JVM.
85+ struct MonitorBlockState {
86+ u64 start_ticks;
87+ u64 span_id;
88+ u64 root_span_id;
89+ uintptr_t obj_addr;
90+ u64 unblocking_span_id;
91+ };
92+ MonitorBlockState _monitor_block{};
93+
9394 static ProfiledThread *forTid (int tid) { return new ProfiledThread (-1 , tid); }
95+ static ProfiledThread* findByTid (int tid);
9496 static ProfiledThread *inBuffer (int buffer_pos) {
9597 return new ProfiledThread (buffer_pos, 0 );
9698 }
0 commit comments