summaryrefslogtreecommitdiff
path: root/lib/xray
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-06-05 10:27:20 +0000
committerDean Michael Berris <dberris@google.com>2018-06-05 10:27:20 +0000
commita99ae33c7f9965e19ecb4494cfd865b5495562b9 (patch)
treec038efbd825780ceed0b1789590c8a9bbf719c50 /lib/xray
parent1a0bb0a7543138d5460a58cfd0f9beeeab922055 (diff)
[XRay][compiler-rt] Use DCHECK instead of assert(...) (NFC)
Use DCHECK instead of assert(...) in the XRay runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray')
-rw-r--r--lib/xray/xray_fdr_logging.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
index d7d73c7af..610689ffc 100644
--- a/lib/xray/xray_fdr_logging.cc
+++ b/lib/xray/xray_fdr_logging.cc
@@ -15,8 +15,6 @@
//
//===----------------------------------------------------------------------===//
#include "xray_fdr_logging.h"
-
-#include <cassert>
#include <errno.h>
#include <limits>
#include <pthread.h>
@@ -363,10 +361,10 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC,
decrementExtents(FunctionRecSize);
FunctionRecord FuncRecord;
internal_memcpy(&FuncRecord, TLD.RecordPtr, FunctionRecSize);
- assert(FuncRecord.RecordKind ==
+ DCHECK(FuncRecord.RecordKind ==
uint8_t(FunctionRecord::RecordKinds::FunctionEnter) &&
"Expected to find function entry recording when rewinding.");
- assert(FuncRecord.FuncId == (FuncId & ~(0x0F << 28)) &&
+ DCHECK(FuncRecord.FuncId == (FuncId & ~(0x0F << 28)) &&
"Expected matching function id when rewinding Exit");
--TLD.NumConsecutiveFnEnters;
LastTSC -= FuncRecord.TSCDelta;
@@ -388,7 +386,7 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC,
FunctionRecord ExpectedTailExit;
internal_memcpy(&ExpectedTailExit, RewindingRecordPtr, FunctionRecSize);
- assert(ExpectedTailExit.RecordKind ==
+ DCHECK(ExpectedTailExit.RecordKind ==
uint8_t(FunctionRecord::RecordKinds::FunctionTailExit) &&
"Expected to find tail exit when rewinding.");
RewindingRecordPtr -= FunctionRecSize;
@@ -396,10 +394,10 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC,
FunctionRecord ExpectedFunctionEntry;
internal_memcpy(&ExpectedFunctionEntry, RewindingRecordPtr,
FunctionRecSize);
- assert(ExpectedFunctionEntry.RecordKind ==
+ DCHECK(ExpectedFunctionEntry.RecordKind ==
uint8_t(FunctionRecord::RecordKinds::FunctionEnter) &&
"Expected to find function entry when rewinding tail call.");
- assert(ExpectedFunctionEntry.FuncId == ExpectedTailExit.FuncId &&
+ DCHECK(ExpectedFunctionEntry.FuncId == ExpectedTailExit.FuncId &&
"Expected funcids to match when rewinding tail call.");
// This tail call exceeded the threshold duration. It will not be erased.
@@ -576,7 +574,7 @@ static void processFunctionHook(int32_t FuncId, XRayEntryType Entry,
// handleArg0 to happen at any given time.
RecursionGuard Guard{Running};
if (!Guard) {
- assert(Running == true && "RecursionGuard is buggy!");
+ DCHECK(Running == true && "RecursionGuard is buggy!");
return;
}
@@ -630,7 +628,7 @@ static void processFunctionHook(int32_t FuncId, XRayEntryType Entry,
}
// By this point, we are now ready to write up to 40 bytes (explained above).
- assert((TLD.RecordPtr + MaxSize) - static_cast<char *>(TLD.Buffer.Data) >=
+ DCHECK((TLD.RecordPtr + MaxSize) - static_cast<char *>(TLD.Buffer.Data) >=
static_cast<ptrdiff_t>(MetadataRecSize) &&
"Misconfigured BufferQueue provided; Buffer size not large enough.");
@@ -859,7 +857,7 @@ XRayLogFlushStatus fdrLoggingFlush() XRAY_NEVER_INSTRUMENT {
// data.
MetadataRecord ExtentsRecord;
auto BufferExtents = atomic_load(&B.Extents->Size, memory_order_acquire);
- assert(BufferExtents <= B.Size);
+ DCHECK(BufferExtents <= B.Size);
ExtentsRecord.Type = uint8_t(RecordType::Metadata);
ExtentsRecord.RecordKind =
uint8_t(MetadataRecord::RecordKinds::BufferExtents);