This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] FDR Mode Controller
ClosedPublic

Authored by dberris on Sep 27 2018, 12:03 AM.

Details

Summary

This change implements a controller for abstracting away the details of
what happens when tracing with FDR mode. This controller type allows us
to test in isolation the various cases where we're encountering function
entry, exit, and other kinds of events we are handling when FDR mode is
enabled.

This change introduces a number of testing facilities we've needed to
better support expressing the conditions we need for the unit tests. We
leave some TODOs for moving those utilities into the LLVM project,
sitting in the Testing library, to make matching conditions on XRay
Trace instances through googlemock more manageable and declarative.

We don't wire in the controller right away, to allow us to incrementally
update the implementation(s) as we increase testing coverage of the
controller type. There's a need to re-think the way we're managing
buffers in a multi-threaded environment, which is more invasive than
this implementation.

This step in the process allows us to encode our assumptions in the
implementation of the controller, and then evolve the buffer queue
implementation to support generational buffer management to ensure we
can continue to support the cases we're already supporting with the
controller.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Sep 27 2018, 12:03 AM
mboerger added inline comments.Oct 8 2018, 4:52 AM
compiler-rt/lib/xray/tests/unit/test_helpers.h
26 ↗(On Diff #167241)

But we are in llvm::xray

dberris updated this revision to Diff 169156.Oct 10 2018, 11:38 PM
dberris marked an inline comment as done.
  • fixup: remove unnecessary namespace qualifiers
This revision is now accepted and ready to land.Oct 10 2018, 11:47 PM
This revision was automatically updated to reflect the committed changes.