"\"<sync_command> <test_corpus>\" "
"to synchronize the test corpus.")
FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.")
+FUZZER_FLAG_INT(report_slow_units, 10,
+ "Report slowest units if they run for more than this number of seconds.")
int PreferSmallDuringInitialShuffle = -1;
size_t MaxNumberOfRuns = ULONG_MAX;
int SyncTimeout = 600;
+ int ReportSlowUnits = 10;
std::string OutputCorpus;
std::string SyncCommand;
std::vector<std::string> Tokens;
auto UnitStopTime = system_clock::now();
auto TimeOfUnit =
duration_cast<seconds>(UnitStopTime - UnitStartTime).count();
- if (TimeOfUnit > TimeOfLongestUnitInSeconds) {
+ if (TimeOfUnit > TimeOfLongestUnitInSeconds &&
+ TimeOfUnit >= Options.ReportSlowUnits) {
TimeOfLongestUnitInSeconds = TimeOfUnit;
- Printf("Longest unit: %zd s:\n", TimeOfLongestUnitInSeconds);
+ Printf("Slowest unit: %zd s:\n", TimeOfLongestUnitInSeconds);
if (U.size() <= kMaxUnitSizeToPrint)
Print(U, "\n");
- WriteUnitToFileWithPrefix(U, "long-running-unit-");
+ WriteUnitToFileWithPrefix(U, "slow-unit-");
}
return Res;
}