diff options
author | Dean Michael Berris <dberris@google.com> | 2018-11-07 04:37:42 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-11-07 04:37:42 +0000 |
commit | 59439dd0698418c125fdd669dcfef194c598986d (patch) | |
tree | c343bb90406fed8006806d072152dba9669ddbcf /llvm/lib/XRay/Trace.cpp | |
parent | 4a67035da24bc68e7543de7f063226971b8f41f9 (diff) | |
download | bcm5719-llvm-59439dd0698418c125fdd669dcfef194c598986d.tar.gz bcm5719-llvm-59439dd0698418c125fdd669dcfef194c598986d.zip |
[XRay] Use TSC delta encoding for custom/typed events
Summary:
This change updates the version number for FDR logs to 5, and update the
trace processing to support changes in the custom event records.
In the runtime, since we're already writing down the record preamble to
handle CPU migrations and TSC wraparound, we can use the same TSC delta
encoding in the custom event and typed event records that we use in
function event records. We do the same change to typed events (which
were unsupported before this change in the trace processing) which now
show up in the trace.
Future changes should increase our testing coverage to make custom and
typed events as first class entities in the FDR mode log processing
tools.
This change is also a good example of how we end up supporting new
record types in the FDR mode implementation. This shows the places where
new record types are added and supported.
Depends on D54139.
Reviewers: mboerger
Subscribers: hiraditya, arphaman, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D54140
llvm-svn: 346293
Diffstat (limited to 'llvm/lib/XRay/Trace.cpp')
-rw-r--r-- | llvm/lib/XRay/Trace.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/XRay/Trace.cpp b/llvm/lib/XRay/Trace.cpp index 37cd147078e..4f28f3f754c 100644 --- a/llvm/lib/XRay/Trace.cpp +++ b/llvm/lib/XRay/Trace.cpp @@ -247,6 +247,17 @@ Error loadNaiveFormatLog(StringRef Data, bool IsLittleEndian, /// ThreadBuffer: BufferExtents NewBuffer WallClockTime Pid NewCPUId /// FunctionSequence /// EOB: *deprecated* +/// +/// In Version 4, we make the following changes: +/// +/// CustomEventRecord now includes the CPU data. +/// +/// In Version 5, we make the following changes: +/// +/// CustomEventRecord and TypedEventRecord now use TSC delta encoding similar to +/// what FunctionRecord instances use, and we no longer need to include the CPU +/// id in the CustomEventRecord. +/// Error loadFDRLog(StringRef Data, bool IsLittleEndian, XRayFileHeader &FileHeader, std::vector<XRayRecord> &Records) { @@ -435,7 +446,7 @@ Expected<Trace> llvm::xray::loadTrace(const DataExtractor &DE, bool Sort) { } break; case FLIGHT_DATA_RECORDER_FORMAT: - if (Version >= 1 && Version <= 4) { + if (Version >= 1 && Version <= 5) { if (auto E = loadFDRLog(DE.getData(), DE.isLittleEndian(), T.FileHeader, T.Records)) return std::move(E); |