mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
fix can`t caputure context swithces on rooted Android 11 devices
This commit is contained in:
parent
fb18a81d79
commit
266ba396b1
@ -768,11 +768,16 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
#endif
|
||||
|
||||
int switchId = -1, wakeupId = -1, vsyncId = -1;
|
||||
const auto switchIdStr = ReadFile( "/sys/kernel/debug/tracing/events/sched/sched_switch/id" );
|
||||
auto switchIdStr = ReadFile( "/sys/kernel/debug/tracing/events/sched/sched_switch/id" );
|
||||
if( !switchIdStr) switchIdStr = ReadFile( "/sys/kernel/tracing/events/sched/sched_switch/id" );
|
||||
if( switchIdStr ) switchId = atoi( switchIdStr );
|
||||
const auto wakeupIdStr = ReadFile( "/sys/kernel/debug/tracing/events/sched/sched_wakeup/id" );
|
||||
|
||||
auto wakeupIdStr = ReadFile( "/sys/kernel/debug/tracing/events/sched/sched_wakeup/id" );
|
||||
if( !wakeupIdStr) wakeupIdStr = ReadFile( "/sys/kernel/tracing/events/sched/sched_wakeup/id" );
|
||||
if( wakeupIdStr ) wakeupId = atoi( wakeupIdStr );
|
||||
const auto vsyncIdStr = ReadFile( "/sys/kernel/debug/tracing/events/drm/drm_vblank_event/id" );
|
||||
|
||||
auto vsyncIdStr = ReadFile( "/sys/kernel/debug/tracing/events/drm/drm_vblank_event/id" );
|
||||
if( !vsyncIdStr) vsyncIdStr = ReadFile( "/sys/kernel/tracing/events/drm/drm_vblank_event/id" );
|
||||
if( vsyncIdStr ) vsyncId = atoi( vsyncIdStr );
|
||||
|
||||
TracyDebug( "sched_switch id: %i\n", switchId );
|
||||
|
Loading…
Reference in New Issue
Block a user