minor enhancement

This commit is contained in:
vanhauser-thc 2024-05-23 21:42:17 +02:00
parent 35156eb917
commit 59d546f39a
3 changed files with 42 additions and 39 deletions

View File

@ -200,6 +200,7 @@ struct queue_entry {
u8 *fname; /* File name for the test case */
u32 len; /* Input length */
u32 id; /* entry number in queue_buf */
u32 found;
u8 colorized, /* Do not run redqueen stage again */
cal_failed; /* Calibration failed? */

View File

@ -75,8 +75,8 @@ double compute_weight(afl_state_t *afl, struct queue_entry *q,
}
#ifdef DEBUG_QUEUE
fprintf(stderr, "WEIGHT id=%u fname=%s start_weight=1.0\n", q->id, q->fname);
fprintf(stderr, " after step 1: %.2f (log10(hits))\n", weight);
fprintf(stderr, "WEIGHT id=%u fname=%s start_weight=1.0\n", q->id,
q->fname); fprintf(stderr, " after step 1: %.2f (log10(hits))\n", weight);
#endif
if (likely(afl->schedule < RARE)) { weight *= (avg_exec_us / q->exec_us); }
#ifdef DEBUG_QUEUE
@ -635,6 +635,7 @@ void add_to_queue(afl_state_t *afl, u8 *fname, u32 len, u8 passed_det) {
q->trace_mini = NULL;
q->testcase_buf = NULL;
q->mother = afl->queue_cur;
afl->queue_cur->found++;
q->score = afl->current_score;
if (unlikely(!q->score)) { q->score = 1; }

View File

@ -3081,15 +3081,16 @@ stop_fuzzing:
struct queue_entry *q = afl->queue_buf[k];
fprintf(stderr,
"item=%u fname=%s len=%u exec_us=%llu total_execs=%llu has_new_cov=%u "
"item=%u fname=%s len=%u exec_us=%llu total_execs=%llu "
"has_new_cov=%u "
"var_behavior=%u favored=%u fs_redundant=%u disabled=%u "
"bitmap_size=%u tc_ref=%u fuzz_level=%u was_fuzzed=%u "
"mother=%d perf_score=%.2f weight=%.2f score=%u\n",
"mother=%d found=%u perf_score=%.2f weight=%.2f score=%u\n",
k, q->fname, q->len, q->exec_us, q->total_execs, q->has_new_cov,
q->var_behavior, q->favored, q->fs_redundant, q->disabled,
q->bitmap_size, q->tc_ref, q->fuzz_level, q->was_fuzzed,
q->mother == NULL ? -1 : (int)q->mother->id, q->perf_score,
q->weight, q->score);
q->mother == NULL ? -1 : (int)q->mother->id, q->found,
q->perf_score, q->weight, q->score);
}