[PATCH] D31345: [XRay] [compiler-rt] Unwriting FDR mode buffers when functions are short.

Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 01:25:15 PDT 2017


kpw marked an inline comment as done.
kpw added inline comments.


================
Comment at: lib/xray/xray_fdr_logging_impl.h:110-112
+// Hardcoded setting to skip logging simple functions that run less than 5 us.
+// Will probably be customized at a later time.
+const uint64_t FuncDurationThresholdMicros = 5;
----------------
dberris wrote:
> We should start by making this a flag right away, so we can test effectively.
Is there a typical style of writing flags in compiler-rt I should follow or by flag do you just mean a global that can be set via a call to a header?


================
Comment at: lib/xray/xray_fdr_logging_impl.h:511-513
+      AlignedFuncStorage AlignedFuncRecordBuffer;
+      const auto &FuncRecord = *reinterpret_cast<FunctionRecord *>(
+          std::memcpy(&AlignedFuncRecordBuffer, RecordPtr, FunctionRecSize));
----------------
dberris wrote:
> Why are we copying from the log buffer into the local aligned record buffer? This seems unused now.
I should probably reinterpret cast directly from the buffer. I can make that fix easily enough.


https://reviews.llvm.org/D31345





More information about the llvm-commits mailing list