print final stats
@@ -152,6 +152,16 @@ static void setupSignalsMainThread(void) {
}
}
+static void printSummary(honggfuzz_t* hfuzz) {
+ uint64_t exec_per_sec = 0;
+ uint64_t elapsed_sec = time(NULL) - hfuzz->timing.timeStart;
+ if (elapsed_sec) {
+ exec_per_sec = hfuzz->cnts.mutationsCnt / elapsed_sec;
+ }
+ LOG_I("Summary iterations:%zu time:%" PRIu64 " speed:%" PRIu64, hfuzz->cnts.mutationsCnt,
+ elapsed_sec, exec_per_sec);
+}
+
int main(int argc, char** argv) {
/*
* Work around CygWin/MinGW
@@ -260,13 +270,7 @@ int main(int argc, char** argv) {
cleanupSocketFuzzer();
}
- uint64_t exec_per_sec = 0;
- uint64_t elapsed_sec = time(NULL) - hfuzz.timing.timeStart;
- if (elapsed_sec) {
- exec_per_sec = hfuzz.cnts.mutationsCnt / elapsed_sec;
- }
- LOG_I("Summary: iters:%zu time:%" PRIu64 " execs/s:%" PRIu64, hfuzz.cnts.mutationsCnt,
- elapsed_sec, exec_per_sec);
+ printSummary(&hfuzz);
return EXIT_SUCCESS;
}
