From b1b7be0a467bcba6e39e2f4596bc00b0894b265c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 12 Aug 2020 01:27:59 +0200 Subject: [PATCH] Adjust kernel tracing threads priorities. --- client/TracySysTrace.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 8875b9a9..e1000b58 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -974,6 +974,8 @@ void SysTraceWorker( void* ptr ) if( dup2( pipefd[1], STDOUT_FILENO ) >= 0 ) { close( pipefd[1] ); + sched_param sp = { 4 }; + pthread_setschedparam( pthread_self(), SCHED_FIFO, &sp ); #if defined __ANDROID__ && ( defined __aarch64__ || defined __ARM_ARCH ) execlp( "su", "su", "-c", "/data/tracy_systrace", (char*)nullptr ); #endif @@ -985,6 +987,8 @@ void SysTraceWorker( void* ptr ) { // parent close( pipefd[1] ); + sched_param sp = { 5 }; + pthread_setschedparam( pthread_self(), SCHED_FIFO, &sp ); ProcessTraceLines( pipefd[0] ); close( pipefd[0] ); } @@ -1042,6 +1046,8 @@ void SysTraceWorker( void* ptr ) int fd = open( tmp, O_RDONLY ); if( fd < 0 ) return; + sched_param sp = { 5 }; + pthread_setschedparam( pthread_self(), SCHED_FIFO, &sp ); ProcessTraceLines( fd ); close( fd ); }