aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-02-07 05:33:02 +0100
committervanhauser-thc <vh@thc.org>2021-02-07 05:33:02 +0100
commit209c5ba4657b641bf261da7ac9ce7d3f809109c2 (patch)
tree9aa88f72ad623b0b7bc3829a5fb94d19d2cde2ac /src
parent01327ad301afbcc71b3ac597bc6e093839c5f469 (diff)
downloadafl++-209c5ba4657b641bf261da7ac9ce7d3f809109c2.tar.gz
larger map, stats reload fix, code format
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-bitmap.c3
-rw-r--r--src/afl-fuzz-statsd.c63
2 files changed, 37 insertions, 29 deletions
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c
index 0c4a114e..4ed59364 100644
--- a/src/afl-fuzz-bitmap.c
+++ b/src/afl-fuzz-bitmap.c
@@ -325,7 +325,8 @@ u8 *describe_op(afl_state_t *afl, u8 new_bits, size_t max_description_len) {
}
- sprintf(ret + strlen(ret), ",time:%llu", get_cur_time() - afl->start_time);
+ sprintf(ret + strlen(ret), ",time:%llu",
+ get_cur_time() + afl->prev_run_time - afl->start_time);
if (afl->current_custom_fuzz &&
afl->current_custom_fuzz->afl_custom_describe) {
diff --git a/src/afl-fuzz-statsd.c b/src/afl-fuzz-statsd.c
index 69cafd90..461bbbf6 100644
--- a/src/afl-fuzz-statsd.c
+++ b/src/afl-fuzz-statsd.c
@@ -1,3 +1,8 @@
+/*
+ * This implements rpc.statsd support, see docs/rpc_statsd.md
+ *
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
@@ -226,37 +231,39 @@ int statsd_format_metric(afl_state_t *afl, char *buff, size_t bufflen) {
*/
if (afl->statsd_metric_format_type == STATSD_TAGS_TYPE_SUFFIX) {
- snprintf(buff, bufflen, afl->statsd_metric_format,
- afl->queue_cycle ? (afl->queue_cycle - 1) : 0, tags,
- afl->cycles_wo_finds, tags, afl->fsrv.total_execs, tags,
- afl->fsrv.total_execs /
- ((double)(get_cur_time() - afl->start_time) / 1000),
- tags, afl->queued_paths, tags, afl->queued_favored, tags,
- afl->queued_discovered, tags, afl->queued_imported, tags,
- afl->max_depth, tags, afl->current_entry, tags,
- afl->pending_favored, tags, afl->pending_not_fuzzed, tags,
- afl->queued_variable, tags, afl->unique_crashes, tags,
- afl->unique_hangs, tags, afl->total_crashes, tags,
- afl->slowest_exec_ms, tags,
- count_non_255_bytes(afl, afl->virgin_bits), tags,
- afl->var_byte_count, tags, afl->expand_havoc, tags);
+ snprintf(
+ buff, bufflen, afl->statsd_metric_format,
+ afl->queue_cycle ? (afl->queue_cycle - 1) : 0, tags,
+ afl->cycles_wo_finds, tags, afl->fsrv.total_execs, tags,
+ afl->fsrv.total_execs /
+ ((double)(get_cur_time() + afl->prev_run_time - afl->start_time) /
+ 1000),
+ tags, afl->queued_paths, tags, afl->queued_favored, tags,
+ afl->queued_discovered, tags, afl->queued_imported, tags,
+ afl->max_depth, tags, afl->current_entry, tags, afl->pending_favored,
+ tags, afl->pending_not_fuzzed, tags, afl->queued_variable, tags,
+ afl->unique_crashes, tags, afl->unique_hangs, tags, afl->total_crashes,
+ tags, afl->slowest_exec_ms, tags,
+ count_non_255_bytes(afl, afl->virgin_bits), tags, afl->var_byte_count,
+ tags, afl->expand_havoc, tags);
} else if (afl->statsd_metric_format_type == STATSD_TAGS_TYPE_MID) {
- snprintf(buff, bufflen, afl->statsd_metric_format, tags,
- afl->queue_cycle ? (afl->queue_cycle - 1) : 0, tags,
- afl->cycles_wo_finds, tags, afl->fsrv.total_execs, tags,
- afl->fsrv.total_execs /
- ((double)(get_cur_time() - afl->start_time) / 1000),
- tags, afl->queued_paths, tags, afl->queued_favored, tags,
- afl->queued_discovered, tags, afl->queued_imported, tags,
- afl->max_depth, tags, afl->current_entry, tags,
- afl->pending_favored, tags, afl->pending_not_fuzzed, tags,
- afl->queued_variable, tags, afl->unique_crashes, tags,
- afl->unique_hangs, tags, afl->total_crashes, tags,
- afl->slowest_exec_ms, tags,
- count_non_255_bytes(afl, afl->virgin_bits), tags,
- afl->var_byte_count, tags, afl->expand_havoc);
+ snprintf(
+ buff, bufflen, afl->statsd_metric_format, tags,
+ afl->queue_cycle ? (afl->queue_cycle - 1) : 0, tags,
+ afl->cycles_wo_finds, tags, afl->fsrv.total_execs, tags,
+ afl->fsrv.total_execs /
+ ((double)(get_cur_time() + afl->prev_run_time - afl->start_time) /
+ 1000),
+ tags, afl->queued_paths, tags, afl->queued_favored, tags,
+ afl->queued_discovered, tags, afl->queued_imported, tags,
+ afl->max_depth, tags, afl->current_entry, tags, afl->pending_favored,
+ tags, afl->pending_not_fuzzed, tags, afl->queued_variable, tags,
+ afl->unique_crashes, tags, afl->unique_hangs, tags, afl->total_crashes,
+ tags, afl->slowest_exec_ms, tags,
+ count_non_255_bytes(afl, afl->virgin_bits), tags, afl->var_byte_count,
+ tags, afl->expand_havoc);
}