[PATCH] D51912: [XRay] Use FDR Records+Visitors for Trace Loading

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 22:56:56 PDT 2018


dberris created this revision.
dberris added reviewers: mboerger, eizan.
Herald added subscribers: mgrang, hiraditya, mgorny.

In this change, we overhaul the implementation for loading
`llvm::xray::Trace` objects from files by using the combination of
specific FDR Record types and visitors breaking up the logic to
reconstitute an execution trace from flight-data recorder mode traces.

This change allows us to handle out-of-temporal order blocks as written
in files, and more consistently recreate an execution trace spanning
multiple blocks and threads. To do this, we use the `WallclockRecord`
associated with each block to maintain temporal order of blocks, before
attempting to recreate an execution trace.

The new addition in this change is the `TraceExpander` type which can be
thought of as a decompression/decoding routine. This allows us to
maintain the state of an execution environment (thread+process) and
create `XRayRecord` instances that fit nicely into the `Trace`
container. We don't have a specific unit test for the TraceExpander
type, since the end-to-end tests for the `llvm-xray convert` tools
already cover precisely this codepath.

This change completes the refactoring started with https://reviews.llvm.org/D50441.

Depends on https://reviews.llvm.org/D51911.


https://reviews.llvm.org/D51912

Files:
  llvm/include/llvm/XRay/BlockIndexer.h
  llvm/include/llvm/XRay/FDRTraceExpander.h
  llvm/lib/XRay/BlockIndexer.cpp
  llvm/lib/XRay/CMakeLists.txt
  llvm/lib/XRay/FDRTraceExpander.cpp
  llvm/lib/XRay/Trace.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51912.164808.patch
Type: text/x-patch
Size: 35036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180911/c7255e1a/attachment-0001.bin>


More information about the llvm-commits mailing list