[PATCH] D50441: [XRay] FDR Trace Dump Tool (FDR Trace Loading Refactor)
Dean Michael Berris via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 8 05:52:02 PDT 2018
dberris created this revision.
dberris added reviewers: kpw, eizan.
Herald added subscribers: hiraditya, mgorny.
This change implements a FDR trace dumping tool which allows us to
inspect the contents of an FDR mode trace in isolation. This is the
beginning of a larger refactoring of the FDR mode trace loading
implementation.
This change breaks up the FDR trace loading implementation into a number
of parts, allowing for better composition, testing, and extension.
The first part of this change is defining an abstract base type "Record"
which branches off into either a set of "MetadataRecord" types or
"FunctionRecord" instances. This allows us to then to isolate the logic
of reading data from a DataExtractor from interpreting the structure of
the log.
Doing this allows us to then more faithfully represent the data from a
trace as we see it from a log, independent of the semantic structure of
the trace.
The other part of this change involves defining a visitor abstraction,
which we use to process the log at a higher level of abstraction. It
allows us to process blocks of the trace more correctly, by grouping
individual records as blocks and arranging them by process+thread, and
interpreting the execution traces on a per-thread basis. To this end, we
implement a number of visitors which isolate the various higher-level
functions that operate on FDR traces. Some of these are:
- `BlockIndexer`: A visitor that generates an index grouping of blocks.
- `RecordPrinter`: A visitor that can print an individual `Record` instance.
- `BlockPrinter`: A visitor which defines a block-specific
pretty-printer.
- `BlockValidator`: A visitor that validates whether the log's structure is consistent with the expectations of the FDR mode log format.
We're starting the refactoring on the FDR mode implementation, then
performing a similar refactoring on the basic mode trace loading
implementation.
In this change we also take a chance to define a builder for each of the
record types, to allow us to generate valid and invalid sequences of
records in unit-testing. The builder interface is solely for testing
purposes.
NOTE: This change is rather large, suggestions for potential partitions
are most welcome.
https://reviews.llvm.org/D50441
Files:
llvm/include/llvm/XRay/BlockIndexer.h
llvm/include/llvm/XRay/BlockPrinter.h
llvm/include/llvm/XRay/BlockVerifier.h
llvm/include/llvm/XRay/FDRRecords.h
llvm/include/llvm/XRay/RecordPrinter.h
llvm/lib/XRay/BlockIndexer.cpp
llvm/lib/XRay/BlockPrinter.cpp
llvm/lib/XRay/BlockVerifier.cpp
llvm/lib/XRay/CMakeLists.txt
llvm/lib/XRay/Common.cpp
llvm/lib/XRay/Common.h
llvm/lib/XRay/FDRRecords.cpp
llvm/lib/XRay/RecordPrinter.cpp
llvm/lib/XRay/Trace.cpp
llvm/tools/llvm-xray/CMakeLists.txt
llvm/tools/llvm-xray/xray-fdr-dump.cpp
llvm/unittests/XRay/CMakeLists.txt
llvm/unittests/XRay/FDRRecordsTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50441.159695.patch
Type: text/x-patch
Size: 65716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180808/10cda398/attachment-0001.bin>
More information about the llvm-commits
mailing list