diff options
Diffstat (limited to 'benchmark')
-rwxr-xr-x[-rw-r--r--] | benchmark/benchmark.py | 2 | ||||
-rwxr-xr-x | benchmark/benchmark.sh | 42 |
2 files changed, 1 insertions, 43 deletions
diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 85dc7fd3..b3d55f21 100644..100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -64,7 +64,7 @@ env_vars = { parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("-b", "--basedir", help="directory to use for temp files", type=str, default="/tmp/aflpp-benchmark") parser.add_argument("-d", "--debug", help="show verbose debugging output", action="store_true") -parser.add_argument("-r", "--runs", help="how many runs to average results over", type=int, default=2) +parser.add_argument("-r", "--runs", help="how many runs to average results over", type=int, default=3) parser.add_argument("-f", "--fuzzers", help="how many afl-fuzz workers to use", type=int, default=cpu_count) parser.add_argument("-m", "--mode", help="pick modes", action="append", default=modes, choices=modes) parser.add_argument("-c", "--comment", help="add a comment about your setup", type=str, default="") diff --git a/benchmark/benchmark.sh b/benchmark/benchmark.sh deleted file mode 100755 index 3318adce..00000000 --- a/benchmark/benchmark.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -test -x ../afl-fuzz -a -x ../afl-cc -a -e ../SanitizerCoveragePCGUARD.so || { - echo Error: you need to compile AFL++ first, we need afl-fuzz, afl-clang-fast and SanitizerCoveragePCGUARD.so built. - exit 1 -} - -echo Preparing environment - -env | grep AFL_ | sed 's/=.*//' | while read e; do - unset $e -done - -AFL_PATH=`pwd`/.. -export PATH=$AFL_PATH:$PATH - -AFL_LLVM_INSTRUMENT=PCGUARD afl-cc -o test-instr ../test-instr.c > afl.log 2>&1 || { - echo Error: afl-cc is unable to compile - exit 1 -} - -{ -mkdir in -dd if=/dev/zero of=in/in.txt bs=10K count=1 -} > /dev/null 2>&1 - -echo Ready, starting benchmark - this will take approx 20-30 seconds ... - -AFL_DISABLE_TRIM=1 AFL_NO_UI=1 AFL_TRY_AFFINITY=1 AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 AFL_BENCH_JUST_ONE=1 time afl-fuzz -i in -o out -s 123 -D ./test-instr >> afl.log 2>&1 - -echo Analysis: - -CPUID=$(grep 'try binding to' afl.log | tail -n 1 | sed 's/.*#//' | sed 's/\..*//') -grep 'model name' /proc/cpuinfo | head -n 1 | sed 's/.*:/ CPU:/' -test -n "$CPUID" && grep -E '^processor|^cpu MHz' /proc/cpuinfo | grep -A1 -w "$CPUID" | grep 'cpu MHz' | head -n 1 | sed 's/.*:/ Mhz:/' -test -z "$CPUID" && grep 'cpu MHz' /proc/cpuinfo | head -n 1 | sed 's/.*:/ Mhz:/' -grep execs_per_sec out/default/fuzzer_stats | sed 's/.*:/ execs\/s:/' - -echo -echo "Comparison: (note that values can change by 10-15% per run)" -cat COMPARISON - -rm -rf in out test-instr afl.log |