mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Fast callstack retrieval for linux.
This commit is contained in:
parent
1bbf296351
commit
4509412efb
@ -314,12 +314,28 @@ static inline char* CopyString( const char* src )
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int FastCallstackDataCb( void* data, uintptr_t pc, const char* fn, int lineno, const char* function )
|
||||||
|
{
|
||||||
|
if( function )
|
||||||
|
{
|
||||||
|
strcpy( data, function );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*data = '\0';
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void FastCallstackErrorCb( void* data, const char* /*msg*/, int /*errnum*/ )
|
||||||
|
{
|
||||||
|
*data = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
const char* DecodeCallstackPtrFast( uint64_t ptr )
|
const char* DecodeCallstackPtrFast( uint64_t ptr )
|
||||||
{
|
{
|
||||||
static char ret[1024];
|
static char ret[1024];
|
||||||
|
backtrace_pcinfo( cb_bts, ptr, FastCallstackDataCb, FastCallstackErrorCb, ret );
|
||||||
// TODO
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user