[compiler-rt] r368461 - [libFuzzer] Merge: print stats after reading the output corpus dir.
Max Moroz via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 11:20:53 PDT 2019
Author: dor1s
Date: Fri Aug 9 11:20:53 2019
New Revision: 368461
URL: http://llvm.org/viewvc/llvm-project?rev=368461&view=rev
Log:
[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
Modified:
compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp?rev=368461&r1=368460&r2=368461&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp Fri Aug 9 11:20:53 2019
@@ -239,6 +239,8 @@ void Fuzzer::CrashResistantMergeInternal
// 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::CrashResistantMergeInternal
OF << "\n";
OF.flush();
}
- PrintStats("DONE ");
+ PrintStats("DONE ");
}
static void WriteNewControlFile(const std::string &CFPath,
More information about the llvm-commits
mailing list