diff options
| -rw-r--r-- | thirdparty/trace/trace.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/thirdparty/trace/trace.h b/thirdparty/trace/trace.h index 612173ce1..28fe6a66e 100644 --- a/thirdparty/trace/trace.h +++ b/thirdparty/trace/trace.h @@ -5879,6 +5879,7 @@ private: uint64 PrevTimestamp = 0;
uint8* Cursor = Buffer;
uint32 ThreadIdOverride = 0;
+ uint16 Depth = 0;
uint8 Buffer[BufferSize];
};
@@ -5890,7 +5891,7 @@ void ScopeBuffer::Flush(bool Force) if (Cursor == Buffer)
return;
- if (!Force && (Cursor <= (Buffer + BufferSize - Overflow)))
+ if (Depth > 0 && !Force && (Cursor <= (Buffer + BufferSize - Overflow)))
return;
if (ThreadIdOverride)
@@ -5911,6 +5912,7 @@ void ScopeBuffer::Enter(uint64 Timestamp, uint32 ScopeId, int32 Flags) PrevTimestamp += Timestamp;
Cursor += encode64_7bit((Timestamp) << 1 | EnterLsb, Cursor);
Cursor += encode32_7bit(ScopeId, Cursor);
+ Depth++;
bool ShouldFlush = (Flags & CpuScopeFlags::CpuFlush);
Flush(ShouldFlush);
@@ -5922,6 +5924,7 @@ void ScopeBuffer::Leave(uint64 Timestamp) Timestamp -= PrevTimestamp;
PrevTimestamp += Timestamp;
Cursor += encode64_7bit((Timestamp << 1) | LeaveLsb, Cursor);
+ Depth--;
Flush(false);
}
|