DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

i#6712: Add record_scheduler_t support for replay-as-traced #6714

Closed derekbruening closed 6 months ago

derekbruening commented 6 months ago

Adds record_scheduler_t (for the record_filter tool) support for replaying as-traced. The key change here is having record_reader_t's instruction ordinal, record_scheduler_t's output stream instruction ordinal, and record_scheduler_t's switch boundaries all consider the first in any sequence of encoding records or TRACE_MARKER_TYPE_BRANCH_TARGET markers to start an instruction instead of waiting for the instruction record. (Previously the scheduler switch point did consider encodings, but not branch targets, and the ordinals only considered instructions.)

Moving the boundary back avoids splitting encodings from instructions when operating at instrution boundaries in the scheduler (encountered during replay, but this would also affect skipping for scheduler regions of interest).

Adds tests of all 3 boundary types to the record_scheduler_t unit test.

Adds a test of record_filter on the checked-in threadsig trace in as-traced replay mode.

Fixes #6712

derekbruening commented 6 months ago

A bunch of changes for the target marker so re-requested review: PTAL