Index: compiler-rt/trunk/lib/xray/tests/unit/buffer_queue_test.cc =================================================================== --- compiler-rt/trunk/lib/xray/tests/unit/buffer_queue_test.cc +++ compiler-rt/trunk/lib/xray/tests/unit/buffer_queue_test.cc @@ -32,9 +32,9 @@ ASSERT_TRUE(Success); BufferQueue::Buffer Buf; ASSERT_EQ(Buffers.getBuffer(Buf), BufferQueue::ErrorCode::Ok); - ASSERT_NE(nullptr, Buf.Buffer); + ASSERT_NE(nullptr, Buf.Data); ASSERT_EQ(Buffers.releaseBuffer(Buf), BufferQueue::ErrorCode::Ok); - ASSERT_EQ(nullptr, Buf.Buffer); + ASSERT_EQ(nullptr, Buf.Data); } TEST(BufferQueueTest, GetUntilFailed) { @@ -53,7 +53,7 @@ BufferQueue Buffers(kSize, 1, Success); ASSERT_TRUE(Success); BufferQueue::Buffer Buf; - Buf.Buffer = reinterpret_cast(0xdeadbeef); + Buf.Data = reinterpret_cast(0xdeadbeef); Buf.Size = kSize; EXPECT_EQ(BufferQueue::ErrorCode::UnrecognizedBuffer, Buffers.releaseBuffer(Buf)); @@ -65,7 +65,7 @@ ASSERT_TRUE(Success); BufferQueue::Buffer Buf; ASSERT_EQ(Buffers.getBuffer(Buf), BufferQueue::ErrorCode::Ok); - ASSERT_NE(nullptr, Buf.Buffer); + ASSERT_NE(nullptr, Buf.Data); ASSERT_EQ(Buffers.finalize(), BufferQueue::ErrorCode::Ok); BufferQueue::Buffer OtherBuf; ASSERT_EQ(BufferQueue::ErrorCode::QueueFinalizing, Index: compiler-rt/trunk/lib/xray/xray_buffer_queue.h =================================================================== --- compiler-rt/trunk/lib/xray/xray_buffer_queue.h +++ compiler-rt/trunk/lib/xray/xray_buffer_queue.h @@ -33,7 +33,7 @@ }; struct Buffer { - void *Buffer = nullptr; + void *Data = nullptr; size_t Size = 0; BufferExtents* Extents; }; Index: compiler-rt/trunk/lib/xray/xray_buffer_queue.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_buffer_queue.cc +++ compiler-rt/trunk/lib/xray/xray_buffer_queue.cc @@ -37,7 +37,7 @@ return; } auto &Buf = T.Buff; - Buf.Buffer = Tmp; + Buf.Data = Tmp; Buf.Size = B; Buf.Extents = reinterpret_cast(Extents); OwnedBuffers[i] = Tmp; @@ -68,7 +68,7 @@ // Blitz through the buffers array to find the buffer. bool Found = false; for (auto I = OwnedBuffers, E = OwnedBuffers + BufferCount; I != E; ++I) { - if (*I == Buf.Buffer) { + if (*I == Buf.Data) { Found = true; break; } @@ -86,7 +86,7 @@ // Now that the buffer has been released, we mark it as "used". First->Buff = Buf; First->Used = true; - Buf.Buffer = nullptr; + Buf.Data = nullptr; Buf.Size = 0; --LiveBuffers; if (++First == (Buffers + BufferCount)) @@ -106,7 +106,7 @@ for (auto I = Buffers, E = Buffers + BufferCount; I != E; ++I) { auto &T = *I; auto &Buf = T.Buff; - InternalFree(Buf.Buffer); + InternalFree(Buf.Data); InternalFree(Buf.Extents); } delete[] Buffers; Index: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc +++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc @@ -136,8 +136,8 @@ retryingWriteAll(Fd, reinterpret_cast(&ExtentsRecord), reinterpret_cast(&ExtentsRecord) + sizeof(MetadataRecord)); - retryingWriteAll(Fd, reinterpret_cast(B.Buffer), - reinterpret_cast(B.Buffer) + BufferExtents); + retryingWriteAll(Fd, reinterpret_cast(B.Data), + reinterpret_cast(B.Data) + BufferExtents); } }); @@ -341,7 +341,7 @@ auto EC = TLD.BQ->releaseBuffer(TLD.Buffer); if (EC != BufferQueue::ErrorCode::Ok) Report("At thread exit, failed to release buffer at %p; error=%s\n", - TLD.Buffer.Buffer, BufferQueue::getErrorString(EC)); + TLD.Buffer.Data, BufferQueue::getErrorString(EC)); }); return false; }(); Index: compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h =================================================================== --- compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h +++ compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h @@ -235,7 +235,7 @@ clockid_t, struct timespec *)) XRAY_NEVER_INSTRUMENT { auto &TLD = getThreadLocalData(); auto &B = TLD.Buffer; - TLD.RecordPtr = static_cast(B.Buffer); + TLD.RecordPtr = static_cast(B.Data); pid_t Tid = syscall(SYS_gettid); timespec TS{0, 0}; // This is typically clock_gettime, but callers have injection ability. @@ -447,7 +447,7 @@ auto &TLD = getThreadLocalData(); auto EC = BQArg.releaseBuffer(TLD.Buffer); if (EC != BufferQueue::ErrorCode::Ok) { - Report("Failed to release buffer at %p; error=%s\n", TLD.Buffer.Buffer, + Report("Failed to release buffer at %p; error=%s\n", TLD.Buffer.Data, BufferQueue::getErrorString(EC)); return false; } @@ -459,7 +459,7 @@ struct timespec *), size_t MaxSize) XRAY_NEVER_INSTRUMENT { auto &TLD = getThreadLocalData(); - char *BufferStart = static_cast(TLD.Buffer.Buffer); + char *BufferStart = static_cast(TLD.Buffer.Data); if ((TLD.RecordPtr + MaxSize) > (BufferStart + TLD.Buffer.Size)) { if (!releaseThreadLocalBuffer(*TLD.BQ)) return false; @@ -507,7 +507,7 @@ TLD.RecordPtr = nullptr; } - if (TLD.Buffer.Buffer == nullptr) { + if (TLD.Buffer.Data == nullptr) { auto EC = LBQ->getBuffer(TLD.Buffer); if (EC != BufferQueue::ErrorCode::Ok) { auto LS = __sanitizer::atomic_load(&LoggingStatus, @@ -573,7 +573,7 @@ inline void endBufferIfFull() XRAY_NEVER_INSTRUMENT { auto &TLD = getThreadLocalData(); - auto BufferStart = static_cast(TLD.Buffer.Buffer); + auto BufferStart = static_cast(TLD.Buffer.Data); if ((TLD.RecordPtr + MetadataRecSize) - BufferStart <= ptrdiff_t{MetadataRecSize}) { if (!releaseThreadLocalBuffer(*TLD.BQ)) @@ -656,7 +656,7 @@ } // By this point, we are now ready to write up to 40 bytes (explained above). - assert((TLD.RecordPtr + MaxSize) - static_cast(TLD.Buffer.Buffer) >= + assert((TLD.RecordPtr + MaxSize) - static_cast(TLD.Buffer.Data) >= static_cast(MetadataRecSize) && "Misconfigured BufferQueue provided; Buffer size not large enough.");