DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.59k stars 552 forks source link

i#6662 public traces, part 2: encoding_filter #6663

Closed edeiana closed 2 months ago

edeiana commented 5 months ago

New record_filter_t::record_filter_func_t filter, which we call "encodings2regdeps", that modifies the encoding of trace_entry_t records from a real ISA to the synthetic regdeps ISA.

"encodings2regdeps" can add or remove trace_entry_t records that contain encodings depending on the regdeps encoding size. Note that "encodings2regdeps" only changes the encoding of instructions, but it does not adjust their length (or changes the instruction PC), hence the output trace will have encoding sizes that do not match the instruction length. For this reason we disable the encoding size vs instruction length check in reader_t when the trace has DR_ISA_REGDEPS encodings.

This filter is part of the "record_filter" tool and can be invoked with:

drrun -t drcachesim -simulator_type record_filter -filter_encodings2regdeps -indir path/to/input/trace -outdir path/to/output/trace

Issue: #6662