aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Maragno <carlo@Carlos-MacBook-Pro.local>2022-04-01 14:56:27 +0200
committerCarlo Maragno <carlo@Carlos-MacBook-Pro.local>2022-04-01 14:56:27 +0200
commit657e4cc81234967495792174856605e4c29fcf35 (patch)
tree78d1ca7601f3139b43e2b6ab6ee137f31413bc21
parent29f0bb1c6a6e689f41bd3c92b1d4a607983cce80 (diff)
downloadafl++-657e4cc81234967495792174856605e4c29fcf35.tar.gz
Fix layout
-rw-r--r--include/afl-fuzz.h2
-rw-r--r--include/envs.h1
-rw-r--r--src/afl-fuzz-stats.c100
3 files changed, 53 insertions, 50 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 9eac502f..9fddac32 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -1082,6 +1082,8 @@ void write_setup_file(afl_state_t *, u32, char **);
void write_stats_file(afl_state_t *, u32, double, double, double);
void maybe_update_plot_file(afl_state_t *, u32, double, double);
void show_stats(afl_state_t *);
+void show_stats_normal(afl_state_t *);
+void show_stats_pizza(afl_state_t *);
void show_init_stats(afl_state_t *);
/* StatsD */
diff --git a/include/envs.h b/include/envs.h
index f4327d8c..2c9305f6 100644
--- a/include/envs.h
+++ b/include/envs.h
@@ -221,6 +221,7 @@ static char *afl_environment_variables[] = {
"AFL_USE_FASAN",
"AFL_USE_QASAN",
"AFL_PRINT_FILENAMES",
+ "AFL_PIZZA_MODE",
NULL
};
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index c5561414..88ca53eb 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -1374,7 +1374,7 @@ void show_stats_pizza(afl_state_t *afl) {
/* reset counter, even if send failed. */
afl->statsd_last_send_ms = cur_ms;
- if (statsd_send_metric(afl)) { WARNF("could not order tomato sauce from statsd."); }
+ if (statsd_send_metric(afl)) { WARNF("Could not order tomato sauce from statsd."); }
}
@@ -1520,8 +1520,8 @@ void show_stats_pizza(afl_state_t *afl) {
/* Lord, forgive me this. */
SAYF(SET_G1 bSTG bLT bH bSTOP cCYA
- " Mozzarbella has been proudly serving pizzas since " bSTG bH30 bH5 bH bHB bH bSTOP cCYA
- " In this time, we served " bSTG bH2 bH2 bRT "\n");
+ " Mozzarbella has been proudly serving pizzas since " bSTG bH20 bH bH bH bHB bH bSTOP cCYA
+ " In this time, we served " bSTG bH30 bRT "\n");
if (afl->non_instrumented_mode) {
@@ -1562,8 +1562,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
u_stringify_time_diff(time_tmp, afl->prev_run_time + cur_ms, afl->start_time);
- SAYF(bV bSTOP " open time : " cRST "%-33s " bSTG bV bSTOP
- " seasons done : %s%-5s " bSTG bV "\n",
+ SAYF(bV bSTOP " open time : " cRST "%-37s " bSTG bV bSTOP
+ " seasons done : %s%-5s " bSTG bV "\n",
time_tmp, tmp, u_stringify_int(IB(0), afl->queue_cycle - 1));
/* We want to warn people about not seeing new paths after a full cycle,
@@ -1574,25 +1574,25 @@ void show_stats_pizza(afl_state_t *afl) {
afl->in_bitmap || afl->crash_mode)) {
u_stringify_time_diff(time_tmp, cur_ms, afl->last_find_time);
- SAYF(bV bSTOP " last pizza baked : " cRST "%-33s ", time_tmp);
+ SAYF(bV bSTOP " last pizza baked : " cRST "%-33s ", time_tmp);
} else {
if (afl->non_instrumented_mode) {
- SAYF(bV bSTOP " last pizza baked : " cPIN "n/a" cRST
- " (non-instrumented mode) ");
+ SAYF(bV bSTOP " last pizza baked : " cPIN "n/a" cRST
+ " (non-instrumented mode) ");
} else {
- SAYF(bV bSTOP " last pizza baked : " cRST "none yet " cLRD
+ SAYF(bV bSTOP " last pizza baked : " cRST "none yet " cLRD
"(odd, check Gennarino, he might be slacking!) ");
}
}
- SAYF(bSTG bV bSTOP " pizzas on the menu : " cRST "%-5s " bSTG bV "\n",
+ SAYF(bSTG bV bSTOP " pizzas on the menu : " cRST "%-5s " bSTG bV "\n",
u_stringify_int(IB(0), afl->queued_items));
/* Highlight crashes in red if found, denote going over the KEEP_UNIQUE_CRASH
@@ -1602,21 +1602,21 @@ void show_stats_pizza(afl_state_t *afl) {
(afl->saved_crashes >= KEEP_UNIQUE_CRASH) ? "+" : "");
u_stringify_time_diff(time_tmp, cur_ms, afl->last_crash_time);
- SAYF(bV bSTOP "last ordered pizza : " cRST "%-33s " bSTG bV bSTOP
- "at table : %s%-6s" bSTG bV "\n",
+ SAYF(bV bSTOP " last ordered pizza : " cRST "%-33s " bSTG bV bSTOP
+ " at table : %s%-6s " bSTG bV "\n",
time_tmp, crash_color, tmp);
sprintf(tmp, "%s%s", u_stringify_int(IB(0), afl->saved_hangs),
(afl->saved_hangs >= KEEP_UNIQUE_HANG) ? "+" : "");
u_stringify_time_diff(time_tmp, cur_ms, afl->last_hang_time);
- SAYF(bV bSTOP " last conversation with customers : " cRST "%-33s " bSTG bV bSTOP
- " at table : " cRST "%-6s" bSTG bV "\n",
+ SAYF(bV bSTOP " last conversation with customers : " cRST "%-33s " bSTG bV bSTOP
+ " at table : " cRST "%-6s " bSTG bV "\n",
time_tmp, tmp);
SAYF(bVR bH bSTOP cCYA
- " baked progress " bSTG bH10 bH5 bH2 bH2 bH2 bHB bH bSTOP cCYA
- " pizzeria busyness" bSTG bHT bH20 bH2 bVL "\n");
+ " Backing progress " bSTG bH30 bH20 bH5 bX bH bSTOP cCYA
+ " Pizzeria busyness" bSTG bH30 bH5 bH bH bVL "\n");
/* This gets funny because we want to print several variable-length variables
together, but then cram them into a fixed-width field - so we need to
@@ -1626,13 +1626,13 @@ void show_stats_pizza(afl_state_t *afl) {
afl->queue_cur->favored ? "." : "*", afl->queue_cur->fuzz_level,
((double)afl->current_entry * 100) / afl->queued_items);
- SAYF(bV bSTOP " now baking : " cRST "%-18s " bSTG bV bSTOP, tmp);
+ SAYF(bV bSTOP " now baking : " cRST "%-18s " bSTG bV bSTOP, tmp);
sprintf(tmp, "%0.02f%% / %0.02f%%",
((double)afl->queue_cur->bitmap_size) * 100 / afl->fsrv.real_map_size,
t_byte_ratio);
- SAYF(" table full : %s%-19s" bSTG bV "\n",
+ SAYF(" table full : %s%-19s " bSTG bV "\n",
t_byte_ratio > 70
? cLRD
: ((t_bytes < 200 && !afl->non_instrumented_mode) ? cPIN : cRST),
@@ -1641,23 +1641,23 @@ void show_stats_pizza(afl_state_t *afl) {
sprintf(tmp, "%s (%0.02f%%)", u_stringify_int(IB(0), afl->cur_skipped_items),
((double)afl->cur_skipped_items * 100) / afl->queued_items);
- SAYF(bV bSTOP " burned pizzas : " cRST "%-18s " bSTG bV, tmp);
+ SAYF(bV bSTOP " burned pizzas : " cRST "%-18s " bSTG bV, tmp);
sprintf(tmp, "%0.02f bits/tuple", t_bytes ? (((double)t_bits) / t_bytes) : 0);
- SAYF(bSTOP " count coverage : " cRST "%-19s" bSTG bV "\n", tmp);
+ SAYF(bSTOP " count coverage : " cRST "%-19s " bSTG bV "\n", tmp);
SAYF(bVR bH bSTOP cCYA
- " pizzas almost ready " bSTG bH10 bH5 bH2 bH2 bH2 bX bH bSTOP cCYA
- " types of pizzas cooking " bSTG bH10 bH5 bH2 bVL "\n");
+ " Pizzas almost ready " bSTG bH30 bH20 bH2 bH bX bH bSTOP cCYA
+ " Types of pizzas cooking " bSTG bH10 bH5 bH2 bH10 bH2 bH bVL "\n");
sprintf(tmp, "%s (%0.02f%%)", u_stringify_int(IB(0), afl->queued_favored),
((double)afl->queued_favored) * 100 / afl->queued_items);
/* Yeah... it's still going on... halp? */
- SAYF(bV bSTOP " now preparing : " cRST "%-22s " bSTG bV bSTOP
- " favourite topping : " cRST "%-20s" bSTG bV "\n",
+ SAYF(bV bSTOP " now preparing : " cRST "%-22s " bSTG bV bSTOP
+ " favourite topping : " cRST "%-20s" bSTG bV "\n",
afl->stage_name, tmp);
if (!afl->stage_max) {
@@ -1672,12 +1672,12 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " number of pizzas : " cRST "%-23s" bSTG bV bSTOP, tmp);
+ SAYF(bV bSTOP " number of pizzas : " cRST "%-23s " bSTG bV bSTOP, tmp);
sprintf(tmp, "%s (%0.02f%%)", u_stringify_int(IB(0), afl->queued_with_cov),
((double)afl->queued_with_cov) * 100 / afl->queued_items);
- SAYF(" new pizza type seen on Instagram : " cRST "%-20s" bSTG bV "\n", tmp);
+ SAYF(" new pizza type seen on Instagram : " cRST "%-20s" bSTG bV "\n", tmp);
sprintf(tmp, "%s (%s%s saved)", u_stringify_int(IB(0), afl->total_crashes),
u_stringify_int(IB(1), afl->saved_crashes),
@@ -1685,14 +1685,14 @@ void show_stats_pizza(afl_state_t *afl) {
if (afl->crash_mode) {
- SAYF(bV bSTOP " total pizzas : " cRST "%-22s " bSTG bV bSTOP
- " pizzas with pineapple : %s%-20s" bSTG bV "\n",
+ SAYF(bV bSTOP " total pizzas : " cRST "%-22s " bSTG bV bSTOP
+ " pizzas with pineapple : %s%-20s" bSTG bV "\n",
u_stringify_int(IB(0), afl->fsrv.total_execs), crash_color, tmp);
} else {
- SAYF(bV bSTOP " total pizzas : " cRST "%-22s " bSTG bV bSTOP
- " total pizzas with pineapple : %s%-20s" bSTG bV "\n",
+ SAYF(bV bSTOP " total pizzas : " cRST "%-22s " bSTG bV bSTOP
+ " total pizzas with pineapple : %s%-20s" bSTG bV "\n",
u_stringify_int(IB(0), afl->fsrv.total_execs), crash_color, tmp);
}
@@ -1704,12 +1704,12 @@ void show_stats_pizza(afl_state_t *afl) {
sprintf(tmp, "%s/sec (%s)", u_stringify_float(IB(0), afl->stats_avg_exec),
afl->stats_avg_exec < 20 ? "zzzz..." : "Gennarino is at it again!");
- SAYF(bV bSTOP " pizza making speed : " cLRD "%-22s ", tmp);
+ SAYF(bV bSTOP " pizza making speed : " cLRD "%-22s ", tmp);
} else {
sprintf(tmp, "%s/sec", u_stringify_float(IB(0), afl->stats_avg_exec));
- SAYF(bV bSTOP " pizza making speed : " cRST "%-22s ", tmp);
+ SAYF(bV bSTOP " pizza making speed : " cRST "%-22s ", tmp);
}
@@ -1717,12 +1717,12 @@ void show_stats_pizza(afl_state_t *afl) {
u_stringify_int(IB(1), afl->saved_tmouts),
(afl->saved_hangs >= KEEP_UNIQUE_HANG) ? "+" : "");
- SAYF(bSTG bV bSTOP " burned pizzas : " cRST "%-20s" bSTG bV "\n", tmp);
+ SAYF(bSTG bV bSTOP " burned pizzas : " cRST "%-20s" bSTG bV "\n", tmp);
/* Aaaalmost there... hold on! */
- SAYF(bVR bH cCYA bSTOP " promotional campaign on Facebook yields " bSTG bH10 bH2 bHT bH10 bH2
- bH bHB bH bSTOP cCYA " customer type " bSTG bH5 bH2 bVL "\n");
+ SAYF(bVR bH cCYA bSTOP " Promotional campaign on Facebook yields " bSTG bH30 bH2
+ bH bX bH bSTOP cCYA " Customer type " bSTG bH5 bH2 bH30 bH2 bH bVL "\n");
if (unlikely(afl->custom_only)) {
@@ -1744,8 +1744,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " pizzas for celiac : " cRST "%-36s " bSTG bV bSTOP
- " levels : " cRST "%-10s" bSTG bV "\n",
+ SAYF(bV bSTOP " pizzas for celiac : " cRST "%-36s " bSTG bV bSTOP
+ " levels : " cRST "%-10s " bSTG bV "\n",
tmp, u_stringify_int(IB(0), afl->max_depth));
if (unlikely(!afl->skip_deterministic)) {
@@ -1760,8 +1760,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " pizzas for kids : " cRST "%-36s " bSTG bV bSTOP
- " pizzas to make : " cRST "%-10s" bSTG bV "\n",
+ SAYF(bV bSTOP " pizzas for kids : " cRST "%-36s " bSTG bV bSTOP
+ " pizzas to make : " cRST "%-10s " bSTG bV "\n",
tmp, u_stringify_int(IB(0), afl->pending_not_fuzzed));
if (unlikely(!afl->skip_deterministic)) {
@@ -1776,8 +1776,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " pizza bianca : " cRST "%-36s " bSTG bV bSTOP
- " nice table : " cRST "%-10s" bSTG bV "\n",
+ SAYF(bV bSTOP " pizza bianca : " cRST "%-36s " bSTG bV bSTOP
+ " nice table : " cRST "%-10s " bSTG bV "\n",
tmp, u_stringify_int(IB(0), afl->pending_favored));
if (unlikely(!afl->skip_deterministic)) {
@@ -1792,8 +1792,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " recurring customers : " cRST "%-36s " bSTG bV bSTOP
- " new customers : " cRST "%-10s" bSTG bV "\n",
+ SAYF(bV bSTOP " recurring customers : " cRST "%-36s " bSTG bV bSTOP
+ " new customers : " cRST "%-10s " bSTG bV "\n",
tmp, u_stringify_int(IB(0), afl->queued_discovered));
if (unlikely(!afl->skip_deterministic)) {
@@ -1816,8 +1816,8 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP " dictionary : " cRST "%-36s " bSTG bV bSTOP
- " patrons from old resturant : " cRST "%-10s" bSTG bV "\n",
+ SAYF(bV bSTOP " dictionary : " cRST "%-36s " bSTG bV bSTOP
+ " patrons from old resturant : " cRST "%-10s " bSTG bV "\n",
tmp,
afl->sync_id ? u_stringify_int(IB(0), afl->queued_imported)
: (u8 *)"n/a");
@@ -1828,7 +1828,7 @@ void show_stats_pizza(afl_state_t *afl) {
u_stringify_int(IB(3), afl->stage_finds[STAGE_SPLICE]),
u_stringify_int(IB(4), afl->stage_cycles[STAGE_SPLICE]));
- SAYF(bV bSTOP "18 year aniversary mode/cleaning : " cRST "%-36s " bSTG bV bSTOP, tmp);
+ SAYF(bV bSTOP " 18 year aniversary mode/cleaning : " cRST "%-36s " bSTG bV bSTOP, tmp);
if (t_bytes) {
@@ -1840,7 +1840,7 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(" oven flameout : %s%-10s" bSTG bV "\n",
+ SAYF(" oven flameout : %s%-10s " bSTG bV "\n",
(stab_ratio < 85 && afl->var_byte_count > 40)
? cLRD
: ((afl->queued_variable &&
@@ -1893,7 +1893,7 @@ void show_stats_pizza(afl_state_t *afl) {
}
- SAYF(bV bSTOP "py/custom/rq : " cRST "%-36s " bSTG bVR bH20 bH2 bH bRB "\n",
+ SAYF(bV bSTOP " py/custom/rq : " cRST "%-36s " bSTG bVR bH20 bH2 bH30 bH2 bH bH bRB "\n",
tmp);
if (likely(afl->disable_trim)) {
@@ -1943,7 +1943,7 @@ void show_stats_pizza(afl_state_t *afl) {
//
//} else {
- SAYF(bV bSTOP " toilets clogged : " cRST "%-36s " bSTG bV RESET_G1, tmp);
+ SAYF(bV bSTOP " toilets clogged : " cRST "%-36s " bSTG bV RESET_G1, tmp);
//}
@@ -2000,7 +2000,7 @@ void show_stats_pizza(afl_state_t *afl) {
}
/* Last line */
- SAYF(SET_G1 "\n" bSTG bLB bH30 bH20 bH2 bRB bSTOP cRST RESET_G1);
+ SAYF(SET_G1 "\n" bSTG bLB bH30 bH20 bH2 bH20 bH2 bH bRB bSTOP cRST RESET_G1);
#undef IB