This is an archive of the discontinued LLVM Phabricator instance.

[XRay] Support generational buffers in FDR controller
ClosedPublic

Authored by dberris on Oct 22 2018, 8:24 PM.

Details

Summary

This is an intermediary step in the full support for generational buffer
management in the FDR runtime. This change makes the FDR controller
aware of the new generation number in the buffers handed out by the
BufferQueue type.

In the process of making this change, we've realised that the cleanest
way of ensuring that the backing store per generation is live while all
the threads that need access to it will need reference counting to tie
the backing store to the lifetime of all threads that have a handle on
buffers associated with the memory.

We also learn that we're missing the edge-case in the function exit
handler's implementation where the first record being written into the
buffer is a function exit, which is caught/fixed by the test for
generational buffer management.

We still haven't wired the controller into the FDR mode runtime, which
will need the reference counting on the backing store implemented to
ensure that we're being conservatively thread-safe with this approach.

Depends on D52974.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Oct 22 2018, 8:24 PM
dberris updated this revision to Diff 170564.Oct 22 2018, 8:26 PM
dberris retitled this revision from [XRay] Account for virtual memory re-use to [XRay] Support generational buffers in FDR controller.
dberris edited the summary of this revision. (Show Details)
dberris added reviewers: mboerger, eizan.
dberris added a subscriber: llvm-commits.

Re-title, adding subscribers and reviewers.

mboerger added inline comments.Oct 22 2018, 8:44 PM
compiler-rt/lib/xray/tests/unit/fdr_controller_test.cc
253 ↗(On Diff #170564)

s/we'll/we will/

dberris updated this revision to Diff 170567.Oct 22 2018, 9:28 PM
dberris marked an inline comment as done.

Update comment in test.

dberris updated this revision to Diff 170586.Oct 23 2018, 1:46 AM
dberris edited the summary of this revision. (Show Details)
dberris added a subscriber: jfb.

Add dependency on D53551 in description.

dberris updated this revision to Diff 170589.Oct 23 2018, 1:51 AM
dberris edited the summary of this revision. (Show Details)
dberris removed a subscriber: jfb.

Revert inadvertent inclusion of dependenent change.

This revision is now accepted and ready to land.Oct 26 2018, 7:42 PM
This revision was automatically updated to reflect the committed changes.