Skip to content

Commit b6216c4

Browse files
author
Salinas, David
authored
[Offload] [OMPT] Fixed missing trace records in ompt_flush_trace. (llvm#1590)
2 parents f8f2573 + 499e10d commit b6216c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

offload/src/OpenMP/OMPT/OmptTracingBuffer.cpp

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

0 commit comments

Comments
 (0)