]> xenbits.xensource.com Git - people/iwj/xen.git/commit
fuzz/x86_emulate: Take multiple test files for inputs
authorGeorge Dunlap <george.dunlap@citrix.com>
Wed, 11 Oct 2017 17:49:42 +0000 (18:49 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 11 Oct 2017 22:35:27 +0000 (23:35 +0100)
commit2b1cde778318564d4fc040773d45d0adc07da73a
treeac98439862897361e2ecf22277b30cca33cd10f9
parent02a7745410bfd40246c72fb693e9c2f3bcf2e3ad
fuzz/x86_emulate: Take multiple test files for inputs

Finding aggregate coverage for a set of test files means running each
afl-generated test case through the harness.  At the moment, this is
done by re-executing afl-harness-cov with each input file.  When a
large number of test cases have been generated, this can take a
significant amonut of time; a recent test with 30k total files
generated by 4 parallel fuzzers took over 7 minutes.

The vast majority of this time is taken up with 'exec', however.
Since the harness is already designed to loop over multiple inputs for
llvm "persistent mode", just allow it to take a large number of inputs
on the same when *not* running in llvm "persistent mode"..  Then the
command can be efficiently executed like this:

  ls */queue/id* | xargs $path/afl-harness-cov

For the above-mentioned test on 30k files, the time to generate
coverage data was reduced from 7 minutes to under 30 seconds.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/fuzz/README.afl
tools/fuzz/x86_instruction_emulator/afl-harness.c