From 2ef014608f49b6bc7e1753c50ddaf617c023fed5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 28 Apr 2022 23:50:13 +0200 Subject: [PATCH] Notify when software sampling setup has failed. --- client/TracySysTrace.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 6c7d51b9..e1f81f97 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -859,7 +859,11 @@ bool SysTraceStart( int64_t& samplingPeriod ) pe.exclude_kernel = 1; ProbePreciseIp( pe, currentPid ); fd = perf_event_open( &pe, currentPid, i, -1, PERF_FLAG_FD_CLOEXEC ); - if( fd == -1 ) break; + if( fd == -1 ) + { + TracyDebug( " Failed to setup!\n"); + break; + } TracyDebug( " No access to kernel samples\n" ); } new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCallstack );