Skip to content

fix(afl_stats): report execs_per_sec as a rate instead of total execs - #3939

Open
Aditya30ag wants to merge 1 commit into
AFLplusplus:mainfrom
Aditya30ag:fix/afl-stats-execs-per-sec
Open

Aditya30ag wants to merge 1 commit into
AFLplusplus:mainfrom
Aditya30ag:fix/afl-stats-execs-per-sec

Conversation

@Aditya30ag

Copy link
Copy Markdown
Contributor

Problem

AflStatsStage wrote the total execution count into execs_per_sec, so fuzzer_stats and every plot_data row showed a number that only grows instead of throughput.

Fix

Keep the previous (time, executions) sample and report the rate between stats reports. The first report has no baseline and yields 0. Zero elapsed time and a counter that goes backwards also yield 0.

Testing

  • Added a unit test for the rate calculation.
  • Ran baby_fuzzer_unicode for 20s with stats_file/plot_file set:
    • before: execs_per_sec == execs_done (323253)
    • after: execs_per_sec ≈ 25k, matching 501813 execs / 20s

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

@Aditya30ag

Copy link
Copy Markdown
Contributor Author

@raaller sir and @domenukk sir please have alook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant