scripts/oss-fuzz: Add script to reorder a generic-fuzzer trace
commit7c9b64ade9d1d3c69250ef1684db9c080a7b7092
authorAlexander Bulekov <alxndr@bu.edu>
Fri, 23 Oct 2020 15:07:39 +0000 (23 11:07 -0400)
committerThomas Huth <thuth@redhat.com>
Mon, 26 Oct 2020 08:53:53 +0000 (26 09:53 +0100)
tree0a62b48b6a5d8ca07c5ddd48e2f6b77feae4234f
parenta25393222764c26658a98dbfc20f78c80765bca4
scripts/oss-fuzz: Add script to reorder a generic-fuzzer trace

The generic-fuzzer uses hooks to fulfill DMA requests just-in-time.
This means that if we try to use QTEST_LOG=1 to build a reproducer, the
DMA writes will be logged _after_ the in/out/read/write that triggered
the DMA read. To work work around this, the generic-fuzzer annotates
these just-in time DMA fulfilments with a tag that we can use to
discern them. This script simply iterates over a raw qtest
trace (including log messages, errors, timestamps etc), filters it and
re-orders it so that DMA fulfillments are placed directly _before_ the
qtest command that will cause the DMA access.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-Id: <20201023150746.107063-11-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
scripts/oss-fuzz/reorder_fuzzer_qtest_trace.py [new file with mode: 0755]