summaryrefslogtreecommitdiff
path: root/lib/xray/xray_fdr_logging.cc
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-10-17 10:33:24 +0000
committerDean Michael Berris <dberris@google.com>2017-10-17 10:33:24 +0000
commit4276b6704ef74a1af2fa7598759d2c7d6cdeddb4 (patch)
tree78c0787da16c22a0ed395a4dc6d18e49dcc8824b /lib/xray/xray_fdr_logging.cc
parent1e1c09d32ef392045ccb8cfadb9b29c905eae2c0 (diff)
[XRay][compiler-rt] Always place the CPU record first for every buffer
Summary: In FDR Mode, when we set up a new buffer for a thread that's just overflowed, we must place the CPU identifier with the TSC record as the first record. This is so that we can reconstruct all the function entry/exit with deltas rooted on a TSC record for the CPU at the beginning of the buffer. Without doing this, the tools are rejecting the log for cases when we've overflown and have different buffers that don't have the CPU and TSC records as the first entry in the buffers. Reviewers: pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38995 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_fdr_logging.cc')
-rw-r--r--lib/xray/xray_fdr_logging.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
index bd79893f6..90eb6c572 100644
--- a/lib/xray/xray_fdr_logging.cc
+++ b/lib/xray/xray_fdr_logging.cc
@@ -206,17 +206,17 @@ getTimestamp() XRAY_NEVER_INSTRUMENT {
void fdrLoggingHandleArg0(int32_t FuncId,
XRayEntryType Entry) XRAY_NEVER_INSTRUMENT {
auto TSC_CPU = getTimestamp();
- __xray_fdr_internal::processFunctionHook(
- FuncId, Entry, std::get<0>(TSC_CPU), std::get<1>(TSC_CPU), 0,
- clock_gettime, *BQ);
+ __xray_fdr_internal::processFunctionHook(FuncId, Entry, std::get<0>(TSC_CPU),
+ std::get<1>(TSC_CPU), 0,
+ clock_gettime, *BQ);
}
void fdrLoggingHandleArg1(int32_t FuncId, XRayEntryType Entry,
uint64_t Arg) XRAY_NEVER_INSTRUMENT {
auto TSC_CPU = getTimestamp();
- __xray_fdr_internal::processFunctionHook(
- FuncId, Entry, std::get<0>(TSC_CPU), std::get<1>(TSC_CPU), Arg,
- clock_gettime, *BQ);
+ __xray_fdr_internal::processFunctionHook(FuncId, Entry, std::get<0>(TSC_CPU),
+ std::get<1>(TSC_CPU), Arg,
+ clock_gettime, *BQ);
}
void fdrLoggingHandleCustomEvent(void *Event,
@@ -248,7 +248,7 @@ void fdrLoggingHandleCustomEvent(void *Event,
// - The metadata record we're going to write. (16 bytes)
// - The additional data we're going to write. Currently, that's the size of
// the event we're going to dump into the log as free-form bytes.
- if (!prepareBuffer(clock_gettime, MetadataRecSize + EventSize)) {
+ if (!prepareBuffer(TSC, CPU, clock_gettime, MetadataRecSize + EventSize)) {
TLD.LocalBQ = nullptr;
return;
}