mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-23 01:00:54 +00:00
Search backward for the correct zone
Needed to make tracing more intense applications work.
This commit is contained in:
@@ -6044,9 +6044,15 @@ void Worker::ProcessGpuZoneAnnotation( const QueueGpuZoneAnnotation& ev )
|
||||
// TODO: Get thread ID properly
|
||||
// TODO: Search for the query from the back
|
||||
assert( ctx->threadData.size() );
|
||||
assert( ctx->threadData.begin()->second.timeline.size() );
|
||||
auto & zone = ctx->threadData.begin()->second.timeline.back();
|
||||
assert( zone->query_id == ev.queryId );
|
||||
auto & timeline = ctx->threadData.begin()->second.timeline;
|
||||
assert( timeline.size() );
|
||||
ssize_t i = timeline.size() - 1;
|
||||
for ( ; i >= 0 ; i--) {
|
||||
if( timeline[i]->query_id == ev.queryId ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
auto& zone = timeline[i];
|
||||
assert( zone->note_count < 10 );
|
||||
zone->note_ids[zone->note_count] = ev.noteId;
|
||||
zone->note_vals[zone->note_count] = ev.value;
|
||||
|
||||
Reference in New Issue
Block a user