summaryrefslogtreecommitdiff
path: root/tools/llvm-xray
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-02-17 01:47:16 +0000
committerDean Michael Berris <dberris@google.com>2017-02-17 01:47:16 +0000
commit73d4ebd6202e0b477b4699617c6a6aaa71c490bc (patch)
tree0ba6994b835d6eeebcb5e05651ec0c925f205a54 /tools/llvm-xray
parent58318dec58edc46bb54e494dc2e5412c90a1d5bf (diff)
[XRAY] [x86_64] Adding a Flight Data filetype reader to the llvm-xray Trace implementation.
Summary: The file type packs function trace data onto disk from potentially multiple threads that are aggregated and flushed during the course of an instrumented program's runtime. It is named FDR mode or Flight Data recorder as an analogy to plane blackboxes, which instrument a running system without access to IO. The writer code is defined in compiler-rt in xray_fdr_logging.h/cc Reviewers: rSerge, kcc, dberris Reviewed By: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29697 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-xray')
-rw-r--r--tools/llvm-xray/xray-converter.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-xray/xray-converter.cc b/tools/llvm-xray/xray-converter.cc
index 96850f032bf..2583ec95149 100644
--- a/tools/llvm-xray/xray-converter.cc
+++ b/tools/llvm-xray/xray-converter.cc
@@ -118,7 +118,9 @@ void TraceConverter::exportAsRAWv1(const Trace &Records, raw_ostream &OS) {
// format.
for (const auto &R : Records) {
Writer.write(R.RecordType);
- Writer.write(R.CPU);
+ // The on disk naive raw format uses 8 bit CPUs, but the record has 16.
+ // There's no choice but truncation.
+ Writer.write(static_cast<uint8_t>(R.CPU));
switch (R.Type) {
case RecordTypes::ENTER:
Writer.write(uint8_t{0});