about summary refs log tree commit diff
path: root/frida_mode/src
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-07-07 21:11:03 +0100
committerGitHub <noreply@github.com>2021-07-07 22:11:03 +0200
commit161d763334a27c6b031d8c5b9a7b49280cb05796 (patch)
tree63528b033b850b489644ea3231d81f7adf1ca6c3 /frida_mode/src
parent49df0af628c556a1d462644a04a2df560c9aab82 (diff)
downloadafl++-161d763334a27c6b031d8c5b9a7b49280cb05796.tar.gz
Changes to print stats more periodically rather than relying on a new block being instrumented (#1011)
Co-authored-by: Your Name <you@example.com>
Diffstat (limited to 'frida_mode/src')
-rw-r--r--frida_mode/src/entry.c2
-rw-r--r--frida_mode/src/stats/stats.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/frida_mode/src/entry.c b/frida_mode/src/entry.c
index 1d3b3e43..f70e21fc 100644
--- a/frida_mode/src/entry.c
+++ b/frida_mode/src/entry.c
@@ -7,6 +7,7 @@
 #include "persistent.h"
 #include "ranges.h"
 #include "stalker.h"
+#include "stats.h"
 #include "util.h"
 
 extern void __afl_manual_init();
@@ -21,6 +22,7 @@ static void entry_launch(void) {
 
   /* Child here */
   instrument_previous_pc = 0;
+  stats_on_fork();
 
 }
 
diff --git a/frida_mode/src/stats/stats.c b/frida_mode/src/stats/stats.c
index 0dd8be70..91a58741 100644
--- a/frida_mode/src/stats/stats.c
+++ b/frida_mode/src/stats/stats.c
@@ -178,10 +178,12 @@ void stats_write(void) {
 
 }
 
-static void stats_maybe_write(void) {
+void stats_on_fork(void) {
 
   guint64 current_time;
 
+  if (stats_filename == NULL) { return; }
+
   if (stats_interval == 0) { return; }
 
   current_time = g_get_monotonic_time();
@@ -208,7 +210,5 @@ void stats_collect(const cs_insn *instr, gboolean begin) {
 
   stats_collect_arch(instr);
 
-  stats_maybe_write();
-
 }