diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index 7cf961b7..a1f8f5bc 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -7,8 +7,10 @@ #endif #ifdef __linux__ -#include -#include +# ifndef __ANDROID__ +# include +# endif +# include #endif #include @@ -148,7 +150,11 @@ const char* GetThreadName( uint64_t id ) # elif defined __linux__ int cs, fd; char path[32]; +# ifdef __ANDROID__ + int tid = gettid(); +# else int tid = (int) syscall( SYS_gettid ); +# endif snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid ); sprintf( buf, "%" PRIu64, id ); pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );