aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdznux <edznux@gmail.com>2020-10-04 03:24:09 +0200
committerEdznux <edznux@gmail.com>2020-10-04 03:24:09 +0200
commit6006cce0cf012884d1509c00ef0f088aeac66bb7 (patch)
tree608d164855c0d8669af1f70900e8449e0545c99c
parentff8c6d24156811333c855755fea8fafc43e133bc (diff)
downloadafl++-6006cce0cf012884d1509c00ef0f088aeac66bb7.tar.gz
Define config, change parent func to show_stats
-rw-r--r--include/config.h1
-rw-r--r--src/afl-fuzz-run.c6
-rw-r--r--src/afl-fuzz-stats.c8
3 files changed, 9 insertions, 6 deletions
diff --git a/include/config.h b/include/config.h
index 104276e3..c55dda2b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -46,6 +46,7 @@ Server config can be adjusted with AFL_STATSD_HOST and AFL_STATSD_PORT env var.
*/
#define USE_STATSD
+#define STATSD_UPDATE_SEC 1
/* If you want to have the original afl internal memory corruption checks.
Disabled by default for speed. it is better to use "make ASAN_BUILD=1". */
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index b7c4ae05..6fa142d2 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -901,12 +901,6 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
afl->stage_cur + 1 == afl->stage_max) {
show_stats(afl);
- #ifdef USE_STATSD
- if(send_statsd_metric(afl)){
- //Change me to something realistic; don't fail on connection / lookup fail for metrics...
- exit(1);
- }
- #endif
}
return 0;
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index 51eed14b..bbbe6ba6 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -422,6 +422,14 @@ void show_stats(afl_state_t *afl) {
}
+ #ifdef USE_STATSD
+ if (cur_ms - afl->stats_last_stats_ms > STATSD_UPDATE_SEC * 1000) {
+ if(send_statsd_metric(afl)){
+ WARNF("coundln't send statsd metric.");
+ }
+ }
+ #endif
+
/* Every now and then, write plot data. */
if (cur_ms - afl->stats_last_plot_ms > PLOT_UPDATE_SEC * 1000) {