[PATCH] D48054: [libFuzzer] Mutation tracking and logging implemented
Jonathan Metzman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 25 10:15:37 PDT 2018
metzman added inline comments.
================
Comment at: lib/fuzzer/FuzzerMutationStats.cpp:24
+ // +1 is not significant, but prevents us from dividing by zero.
+ double Ratio = static_cast<double>(100 * UsefulMutations.at(i)) /
+ (1 + TotalMutations.at(i));
----------------
Please rename Ratio since it is a percent not a ratio.
Also, what if you do `100. * UsefulMutations.at(i)`, do you still need to `static_cast` this?
================
Comment at: test/fuzzer/fuzzer-mutationstats.test:3
+RUN: not %run %t-MutationStatsTest -max_total_time=360 -print_final_stats=1 -print_mutation_stats=1 -print_mutation_usefulness=1 2>&1 | FileCheck %s
+CHECK: stat::mutation_usefulness: {{.*[0-9]+\.[0-9]+[1-9]+.*}}
----------------
Dor1s wrote:
> add a comment before that line, something like "# Make sure there are some non-zero values in the usefulness percentages printed."
Sorry, I think comments in this format begin with `;` not `#`.
See `afl-driver-stderr.test` as an example.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D48054
More information about the llvm-commits
mailing list