diff options
author | Max Moroz <mmoroz@chromium.org> | 2019-08-09 18:20:53 +0000 |
---|---|---|
committer | Max Moroz <mmoroz@chromium.org> | 2019-08-09 18:20:53 +0000 |
commit | 6268708e53727a106cda959a3d7b0b8fafdb2b5c (patch) | |
tree | b26fb787aca6d972299964e09cd1e5dbc84f7adc /lib/fuzzer/FuzzerMerge.cpp | |
parent | 0eddb6e36215780b44799adefc4cd09e550555d1 (diff) | |
download | compiler-rt-6268708e53727a106cda959a3d7b0b8fafdb2b5c.tar.gz |
[libFuzzer] Merge: print stats after reading the output corpus dir.
Summary:
The purpose is to be able to extract the number of new edges added to
the original (i.e. output) corpus directory after doing the merge. Use case
example: in ClusterFuzz, we do merge after every fuzzing session, to avoid
uploading too many corpus files, and we also record coverage stats at that
point. Having a separate line indicating stats after reading the initial output
corpus directory would make the stats extraction easier for both humans and
parsing scripts.
Context: https://github.com/google/clusterfuzz/issues/802.
Reviewers: morehouse, hctim
Reviewed By: hctim
Subscribers: delcypher, #sanitizers, llvm-commits, kcc
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D66020
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerMerge.cpp')
-rw-r--r-- | lib/fuzzer/FuzzerMerge.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fuzzer/FuzzerMerge.cpp b/lib/fuzzer/FuzzerMerge.cpp index 75b2b5d59..bd99128ef 100644 --- a/lib/fuzzer/FuzzerMerge.cpp +++ b/lib/fuzzer/FuzzerMerge.cpp @@ -239,6 +239,8 @@ void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) { // Show stats. if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1))) PrintStats("pulse "); + if (TotalNumberOfRuns == M.NumFilesInFirstCorpus) + PrintStats("LOADED"); // Write the post-run marker and the coverage. OF << "FT " << i; for (size_t F : UniqFeatures) @@ -252,7 +254,7 @@ void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) { OF << "\n"; OF.flush(); } - PrintStats("DONE "); + PrintStats("DONE "); } static void WriteNewControlFile(const std::string &CFPath, |