Skip to content

Commit d42900d

Browse files
authored
[Offload] [OMPT] Fixed missing trace records in ompt_flush_trace. (llvm#1566)
2 parents a7910aa + f94c5c6 commit d42900d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

offload/src/OmptTracingBuffer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ OmptTracingBufferMgr::findAndReserveFlushedBuf(uint64_t flush_id) {
508508
}
509509
assert(flush_itr->second.FlushStatus == Flush_waiting);
510510
flush_itr->second.FlushStatus = Flush_processing;
511+
// Update the metadata cursor since more trace records may have been
512+
// generated.
513+
flush_itr->second.FlushCursor =
514+
flush_itr->second.FlushBuf->Cursor.load(std::memory_order_acquire);
515+
511516
FlushInfo flush_info(flush_itr->first, flush_itr->second.FlushCursor,
512517
flush_itr->second.FlushBuf);
513518
DP("Reserved buffer: flush_id:%lu, cursor:%p, buf:%p\n", flush_itr->first,

0 commit comments

Comments
 (0)