1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

make fallback seamless by hiding stderr

This commit is contained in:
Benoit Jacob 2020-11-24 15:23:16 -05:00
parent ff78d71913
commit 602d38630f

View File

@ -1180,8 +1180,11 @@ void SysTraceWorker( void* ptr )
close( pipefd[1] );
sched_param sp = { 4 };
pthread_setschedparam( pthread_self(), SCHED_FIFO, &sp );
// Try `cat /sys/kernel/debug/tracing/trace_pipe` first, and then
// possibly as a fallback /data/tracy_systrace. To make the fallback
// seamless, we redirect cat's stderr to /dev/null.
execlp( "su", "su", "root", "sh", "-c",
"cat /sys/kernel/debug/tracing/trace_pipe"
"cat /sys/kernel/debug/tracing/trace_pipe 2>/dev/null"
#if defined __ANDROID__ && ( defined __aarch64__ || defined __ARM_ARCH )
" || /data/tracy_systrace"
#endif