Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libfuzzer: Track the rate of fuzzing in cycles/s. #21025

Closed
wants to merge 2 commits into from

Conversation

gcoakes
Copy link
Contributor

@gcoakes gcoakes commented Aug 11, 2024

As libfuzzer develops or as users design their own fuzz tests which use libfuzzer, it will be essential to understand the performance impact of changes. This change tracks the rate of execution in terms of cycles per second and updates the UI at most every second.

@ProkopRandacek
Copy link
Contributor

This statistic can be entierly calculated on the webui instead of calculating it in the fuzz process if you make the webserver send periodic updates instead of only on new unique input like it is now.

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it should be calculated client side.

As libfuzzer develops or as users design their own fuzz tests which use
libfuzzer, it will be essential to understand the performance impact of
changes. This change tracks the rate of execution in terms of cycles per
second and updates the UI at most every second.

This is implemented with a periodic update to the web UI which occurs at
least every 1 second. The period is not guaranteed to be regular.
@gcoakes
Copy link
Contributor Author

gcoakes commented Sep 7, 2024

@andrewrk, I think I've resolved the requested changes. I found a small bug while working on that and fixed it with 75ce2c3. That bug caused changes in std/build/Fuzz/abi.zig to be ignored regardless of --zig-lib-dir option.

last_cycle_timed.* = n_runs;

try web_socket.writeMessage(std.mem.asBytes(&abi.PeriodicUpdateHeader{
.cycles_per_second = cycles_per_second,
Copy link
Member

@andrewrk andrewrk Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be calculated client side.

the only additional thing that needs to be sent by the server is two pieces of static data that are already known when the connection is made:

  • what time the server thinks it currently is
  • what time according to the server fuzzing started

then the client can do the calculation based on what time it is currently and the number of runs.

@andrewrk andrewrk closed this in e3f58bd Sep 12, 2024
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.

3 participants