[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.
authorMax Moroz <mmoroz@chromium.org>
Mon, 16 Jul 2018 14:54:23 +0000 (14:54 +0000)
committerMax Moroz <mmoroz@chromium.org>
Mon, 16 Jul 2018 14:54:23 +0000 (14:54 +0000)
commit2156d885e0cffd767ec955c607b94ad774c6474c
treeb18c79a0698798f3c797d10634b67d6112ca4693
parent1f0b194b4a51623aec90594e92df635ab5444251
[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.

Summary:
Created a -print_unstable_stats flag.
When -print_unstable_stats=1, we run it 2 more times on interesting inputs poisoning unstable edges in an array.
On program termination, we run PrintUnstableStats() which will print a line with a stability percentage like AFL does.

Patch by Kyungtak Woo (@kevinwkt).

Reviewers: metzman, Dor1s, kcc, morehouse

Reviewed By: metzman, Dor1s, morehouse

Subscribers: delcypher, llvm-commits, #sanitizers, kcc, morehouse, Dor1s

Differential Revision: https://reviews.llvm.org/D49212

llvm-svn: 337175
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
compiler-rt/lib/fuzzer/FuzzerFlags.def
compiler-rt/lib/fuzzer/FuzzerInternal.h
compiler-rt/lib/fuzzer/FuzzerLoop.cpp
compiler-rt/lib/fuzzer/FuzzerOptions.h
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
compiler-rt/lib/fuzzer/FuzzerTracePC.h
compiler-rt/test/fuzzer/PrintUnstableStatsTest.cpp [new file with mode: 0644]
compiler-rt/test/fuzzer/print_unstable_stats.test [new file with mode: 0644]