about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-stats.c103
-rw-r--r--src/afl-showmap.c9
2 files changed, 57 insertions, 55 deletions
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index d09b4fe6..344e0abf 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -65,59 +65,62 @@ void write_stats_file(double bitmap_cvg, double stability, double eps) {
 
   if (getrusage(RUSAGE_CHILDREN, &rus)) rus.ru_maxrss = 0;
 
-  fprintf(f,
-          "start_time        : %llu\n"
-          "last_update       : %llu\n"
-          "fuzzer_pid        : %d\n"
-          "cycles_done       : %llu\n"
-          "execs_done        : %llu\n"
-          "execs_per_sec     : %0.02f\n"
-          "paths_total       : %u\n"
-          "paths_favored     : %u\n"
-          "paths_found       : %u\n"
-          "paths_imported    : %u\n"
-          "max_depth         : %u\n"
-          "cur_path          : %u\n"    /* Must match find_start_position() */
-          "pending_favs      : %u\n"
-          "pending_total     : %u\n"
-          "variable_paths    : %u\n"
-          "stability         : %0.02f%%\n"
-          "bitmap_cvg        : %0.02f%%\n"
-          "unique_crashes    : %llu\n"
-          "unique_hangs      : %llu\n"
-          "last_path         : %llu\n"
-          "last_crash        : %llu\n"
-          "last_hang         : %llu\n"
-          "execs_since_crash : %llu\n"
-          "exec_timeout      : %u\n"
-          "slowest_exec_ms   : %llu\n"
-          "peak_rss_mb       : %lu\n"
-          "afl_banner        : %s\n"
-          "afl_version       : " VERSION
-          "\n"
-          "target_mode       : %s%s%s%s%s%s%s%s\n"
-          "command_line      : %s\n",
-          start_time / 1000, get_cur_time() / 1000, getpid(),
-          queue_cycle ? (queue_cycle - 1) : 0, total_execs, eps, queued_paths,
-          queued_favored, queued_discovered, queued_imported, max_depth,
-          current_entry, pending_favored, pending_not_fuzzed, queued_variable,
-          stability, bitmap_cvg, unique_crashes, unique_hangs,
-          last_path_time / 1000, last_crash_time / 1000, last_hang_time / 1000,
-          total_execs - last_crash_execs, exec_tmout, slowest_exec_ms,
+  fprintf(
+      f,
+      "start_time        : %llu\n"
+      "last_update       : %llu\n"
+      "fuzzer_pid        : %d\n"
+      "cycles_done       : %llu\n"
+      "execs_done        : %llu\n"
+      "execs_per_sec     : %0.02f\n"
+      //          "real_execs_per_sec: %0.02f\n"  // damn the name is too long
+      "paths_total       : %u\n"
+      "paths_favored     : %u\n"
+      "paths_found       : %u\n"
+      "paths_imported    : %u\n"
+      "max_depth         : %u\n"
+      "cur_path          : %u\n"        /* Must match find_start_position() */
+      "pending_favs      : %u\n"
+      "pending_total     : %u\n"
+      "variable_paths    : %u\n"
+      "stability         : %0.02f%%\n"
+      "bitmap_cvg        : %0.02f%%\n"
+      "unique_crashes    : %llu\n"
+      "unique_hangs      : %llu\n"
+      "last_path         : %llu\n"
+      "last_crash        : %llu\n"
+      "last_hang         : %llu\n"
+      "execs_since_crash : %llu\n"
+      "exec_timeout      : %u\n"
+      "slowest_exec_ms   : %llu\n"
+      "peak_rss_mb       : %lu\n"
+      "afl_banner        : %s\n"
+      "afl_version       : " VERSION
+      "\n"
+      "target_mode       : %s%s%s%s%s%s%s%s\n"
+      "command_line      : %s\n",
+      start_time / 1000, get_cur_time() / 1000, getpid(),
+      queue_cycle ? (queue_cycle - 1) : 0, total_execs,
+      /*eps,*/ total_execs / ((double)(get_cur_time() - start_time) / 1000),
+      queued_paths, queued_favored, queued_discovered, queued_imported,
+      max_depth, current_entry, pending_favored, pending_not_fuzzed,
+      queued_variable, stability, bitmap_cvg, unique_crashes, unique_hangs,
+      last_path_time / 1000, last_crash_time / 1000, last_hang_time / 1000,
+      total_execs - last_crash_execs, exec_tmout, slowest_exec_ms,
 #ifdef __APPLE__
-          (unsigned long int)(rus.ru_maxrss >> 20),
+      (unsigned long int)(rus.ru_maxrss >> 20),
 #else
-          (unsigned long int)(rus.ru_maxrss >> 10),
+      (unsigned long int)(rus.ru_maxrss >> 10),
 #endif
-          use_banner, unicorn_mode ? "unicorn" : "", qemu_mode ? "qemu " : "",
-          dumb_mode ? " dumb " : "", no_forkserver ? "no_forksrv " : "",
-          crash_mode ? "crash " : "", persistent_mode ? "persistent " : "",
-          deferred_mode ? "deferred " : "",
-          (unicorn_mode || qemu_mode || dumb_mode || no_forkserver ||
-           crash_mode || persistent_mode || deferred_mode)
-              ? ""
-              : "default",
-          orig_cmdline);
+      use_banner, unicorn_mode ? "unicorn" : "", qemu_mode ? "qemu " : "",
+      dumb_mode ? " dumb " : "", no_forkserver ? "no_forksrv " : "",
+      crash_mode ? "crash " : "", persistent_mode ? "persistent " : "",
+      deferred_mode ? "deferred " : "",
+      (unicorn_mode || qemu_mode || dumb_mode || no_forkserver || crash_mode ||
+       persistent_mode || deferred_mode)
+          ? ""
+          : "default",
+      orig_cmdline);
   /* ignore errors */
 
   fclose(f);
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 1686a750..1fd425a2 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -926,7 +926,7 @@ int main(int argc, char** argv) {
     int            done = 0;
     u8             infile[4096], outfile[4096];
 #if !defined(DT_REG)
-    struct stat    statbuf;
+    struct stat statbuf;
 #endif
 
     dev_null_fd = open("/dev/null", O_RDWR);
@@ -974,15 +974,14 @@ int main(int argc, char** argv) {
       if (dir_ent->d_name[0] == '.')
         continue;  // skip anything that starts with '.'
 
-#if defined(DT_REG) /* Posix and Solaris do not know d_type and DT_REG */
+#if defined(DT_REG)      /* Posix and Solaris do not know d_type and DT_REG */
       if (dir_ent->d_type != DT_REG) continue;  // only regular files
 #endif
 
       snprintf(infile, sizeof(infile), "%s/%s", in_dir, dir_ent->d_name);
 
-#if !defined(DT_REG) /* use stat() */
-      if (-1 == stat(infile, &statbuf)
-          || !S_ISREG(statbuf.st_mode)) continue;
+#if !defined(DT_REG)                                          /* use stat() */
+      if (-1 == stat(infile, &statbuf) || !S_ISREG(statbuf.st_mode)) continue;
 #endif
 
       snprintf(outfile, sizeof(outfile), "%s/%s", out_file, dir_ent->d_name);