From b36c8f2fc5b970abaea95ebd23de93c6e0aeae05 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 30 Aug 2026 16:46:42 +0200 Subject: [PATCH] Refuse to start without tracefs. The client's system tracing cannot start without a tracefs (or debugfs) mount - the tracepoint ids live under it - so starting anyway would capture no samples. --- monitor/src/monitor.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/monitor/src/monitor.cpp b/monitor/src/monitor.cpp index 168a2bc0..e72cae9b 100644 --- a/monitor/src/monitor.cpp +++ b/monitor/src/monitor.cpp @@ -482,6 +482,12 @@ static int RunAttached( pid_t pid ) int hwErrno = 0; if( !PreflightSamplingEvent( pid, kernelFrames, hwStats, hwErrno ) ) return 1; + if( !GetTraceFsPath() ) + { + fprintf( stderr, "No tracefs mount found: the client's system tracing cannot start without it, so no samples would be captured.\n" ); + return 1; + } + tracy::StartupProfiler(); if( tracy::IsSystemTracingFailed() ) { @@ -608,6 +614,14 @@ static int RunForked( int argc, char** argv ) return 1; } + if( !GetTraceFsPath() ) + { + fprintf( stderr, "No tracefs mount found: the client's system tracing cannot start without it, so no samples would be captured.\n" ); + kill( childPid, SIGKILL ); + waitpid( childPid, nullptr, 0 ); + return 1; + } + tracy::StartupProfiler(); if( tracy::IsSystemTracingFailed() ) {