diff options
author | Dean Michael Berris <dberris@google.com> | 2018-11-01 00:18:52 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-11-01 00:18:52 +0000 |
commit | 6b67ff03002f39adf773f456aa4fd79bb22f3a04 (patch) | |
tree | 69edb04de2b575e8af2eaae3fae04c9d65fc8797 /llvm/lib/XRay/FDRTraceWriter.cpp | |
parent | d4891a1b7add681782e1e2ea8922facbf2c10f4c (diff) | |
download | bcm5719-llvm-6b67ff03002f39adf773f456aa4fd79bb22f3a04.tar.gz bcm5719-llvm-6b67ff03002f39adf773f456aa4fd79bb22f3a04.zip |
[XRay] Add CPU ID in Custom Event FDR Records
Summary:
This change cuts across compiler-rt and llvm, to increment the FDR log
version number to 4, and include the CPU ID in the custom event records.
This is a step towards allowing us to change the `llvm::xray::Trace`
object to start representing both custom and typed events in the stream
of records. Follow-on changes will allow us to change the kinds of
records we're presenting in the stream of traces, to incorporate the
data in custom/typed events.
A follow-on change will handle the typed event case, where it may not
fit within the 15-byte buffer for metadata records.
This work is part of the larger effort to enable writing analysis and
processing tools using a common in-memory representation of the events
found in traces. The work will focus on porting existing tools in LLVM
to use the common representation and informing the design of a
library/framework for expressing trace event analysis as C++ programs.
Reviewers: mboerger, eizan
Subscribers: hiraditya, mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D53920
llvm-svn: 345798
Diffstat (limited to 'llvm/lib/XRay/FDRTraceWriter.cpp')
-rw-r--r-- | llvm/lib/XRay/FDRTraceWriter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/XRay/FDRTraceWriter.cpp b/llvm/lib/XRay/FDRTraceWriter.cpp index d0206e775a8..4f40593cba0 100644 --- a/llvm/lib/XRay/FDRTraceWriter.cpp +++ b/llvm/lib/XRay/FDRTraceWriter.cpp @@ -94,9 +94,10 @@ Error FDRTraceWriter::visit(TSCWrapRecord &R) { } Error FDRTraceWriter::visit(CustomEventRecord &R) { - if (auto E = writeMetadata<5u>(OS, R.size(), R.tsc())) + if (auto E = writeMetadata<5u>(OS, R.size(), R.tsc(), R.cpu())) return E; - ArrayRef<char> Bytes(R.data().data(), R.data().size()); + auto D = R.data(); + ArrayRef<char> Bytes(D.data(), D.size()); OS.write(Bytes); return Error::success(); } @@ -127,7 +128,7 @@ Error FDRTraceWriter::visit(FunctionRecord &R) { OS.write(TypeRecordFuncId); OS.write(R.delta()); return Error::success(); -} // namespace xray +} } // namespace xray } // namespace llvm |