mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Apparently sampled call stacks may be empty.
This commit is contained in:
parent
d43461584a
commit
9b8eb69886
@ -144,14 +144,17 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record )
|
||||
if( sw->stackProcess == s_pid && ( sw->stack[0] & 0x8000000000000000 ) == 0 )
|
||||
{
|
||||
const uint64_t sz = ( record->UserDataLength - 16 ) / 8;
|
||||
auto trace = (uint64_t*)tracy_malloc( ( 1 + sz ) * sizeof( uint64_t ) );
|
||||
memcpy( trace, &sz, sizeof( uint64_t ) );
|
||||
memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz );
|
||||
TracyLfqPrepare( QueueType::CallstackSample );
|
||||
MemWrite( &item->callstackSample.time, sw->eventTimeStamp );
|
||||
MemWrite( &item->callstackSample.thread, (uint64_t)sw->stackThread );
|
||||
MemWrite( &item->callstackSample.ptr, (uint64_t)trace );
|
||||
TracyLfqCommit;
|
||||
if( sz > 0 )
|
||||
{
|
||||
auto trace = (uint64_t*)tracy_malloc( ( 1 + sz ) * sizeof( uint64_t ) );
|
||||
memcpy( trace, &sz, sizeof( uint64_t ) );
|
||||
memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz );
|
||||
TracyLfqPrepare( QueueType::CallstackSample );
|
||||
MemWrite( &item->callstackSample.time, sw->eventTimeStamp );
|
||||
MemWrite( &item->callstackSample.thread, (uint64_t)sw->stackThread );
|
||||
MemWrite( &item->callstackSample.ptr, (uint64_t)trace );
|
||||
TracyLfqCommit;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user