From e0b7db7ade75cdf98bc0571865e583d04078db58 Mon Sep 17 00:00:00 2001 From: tajila Date: Sat, 16 Nov 2024 17:09:09 -0500 Subject: [PATCH] Add tracepoint to unpark Signed-off-by: tajila --- thread/common/omrthread.c | 4 ++++ thread/j9thr.tdf | 2 ++ 2 files changed, 6 insertions(+) diff --git a/thread/common/omrthread.c b/thread/common/omrthread.c index 9c865a564b4..7b4f44e9798 100644 --- a/thread/common/omrthread.c +++ b/thread/common/omrthread.c @@ -3345,6 +3345,7 @@ omrthread_park(int64_t millis, intptr_t nanos) void omrthread_unpark(omrthread_t thread) { + uintptr_t slowPath = 0; ASSERT(thread); THREAD_LOCK(thread, CALLER_UNPARK_THREAD); @@ -3352,10 +3353,13 @@ omrthread_unpark(omrthread_t thread) thread->flags |= J9THREAD_FLAG_UNPARKED; if (thread->flags & J9THREAD_FLAG_PARKED) { + slowPath = 1; NOTIFY_WRAPPER(thread); } THREAD_UNLOCK(thread); + + Trc_THR_Unpark(slowPath); } diff --git a/thread/j9thr.tdf b/thread/j9thr.tdf index 8d0358e49bc..16e648af06c 100644 --- a/thread/j9thr.tdf +++ b/thread/j9thr.tdf @@ -73,3 +73,5 @@ TraceException=Trc_THR_omrthread_get_cpu_time_ex_clock_gettime_failed Overhead=1 TraceException=Trc_THR_fixupThreadAccounting_omrthread_get_cpu_time_ex_error Overhead=1 Level=1 NoEnv Test Template="omrthread_get_cpu_time_ex returned error=%zd for thread=0x%p" TraceEvent=Trc_THR_EnableRawMonitorSpin_CustomSpinOption Overhead=1 Level=3 NoEnv Test Template="(ENABLE_RAW_MONITOR_SPIN) Using custom spin counts: %s, monitor: %p, threeTierSpinCount1: %zu, threeTierSpinCount2: %zu, threeTierSpinCount3: %zu, adaptSpin: %zu" + +TraceEvent=Trc_THR_Unpark Overhead=1 Level=5 NoEnv Test Template="Unpark slow path taken=%zu"