rr icon indicating copy to clipboard operation
rr copied to clipboard

Support for TSX

Open khuey opened this issue 2 years ago • 0 comments

@ddcc opened #2332 and then got got kind of hijacked for other purposes so lets save the conclusion of that issue here.

From @rocallahan:

Kyle and I talked about this some more and there may be a way to make rr work with RTM, and it might possibly even enable rr on ARM. However it's probably very difficult.

The basic idea is to program PEBS to interrupt after a transaction abort. This won't synchronously stop, but you can gather values of general-purpose registers after the abort. You can't sample RCB, but you have the RCB value when the CPU eventually did stop, which should be "close to" the value at the transaction abort. An approximate RCB value and values of general-purpose registers (including RIP) are probably enough to identify the stop.

It may be possible to improve this using PT to collect control-flow data so that when you stop after a transaction abort, you can reconstruct the control flow between the abort and the stopping point and compute the exact value of RCB at the time of the abort.

Replay, however, is difficult because if a transaction aborts during replay that did not abort during recording, we need to fix up the state to emulate the transaction succeeding. But since we can't stop immediately after such a spurious abort, the state of the replayed process will have already diverged and we won't be able to fix it up in general. One solution to this is that Kyle and I have a private rr branch, remix, which can replay traces with binary instrumentation, and it's pretty efficient too. That would let us do whatever we need here. Unfortunately we can't open-source that for business reasons. Without that, or something equivalent, I don't see how to make replay work.

Originally posted by @rocallahan in https://github.com/rr-debugger/rr/issues/2332#issuecomment-473497205

khuey avatar Nov 21 '21 21:11 khuey