From c35c26ec6312219507c518bae2e56c1ea46a5f36 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 16 Feb 2024 22:47:59 +0100 Subject: pkg/fuzzer: factor out the fuzzing engine This is the first step for #1541. Move the fuzzing engine that used to be interleaved with other syz-fuzzer code into a separate package. For now, the algorithm is more or less the same as it was, the only difference is that a pkg/fuzzer instance scales to the available computing power. Add an executor-based test that performs real fuzzing. --- pkg/fuzzer/stats.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pkg/fuzzer/stats.go (limited to 'pkg/fuzzer/stats.go') diff --git a/pkg/fuzzer/stats.go b/pkg/fuzzer/stats.go new file mode 100644 index 000000000..17bc6131c --- /dev/null +++ b/pkg/fuzzer/stats.go @@ -0,0 +1,26 @@ +// Copyright 2024 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package fuzzer + +const ( + statGenerate = "exec gen" + statFuzz = "exec fuzz" + statCandidate = "exec candidate" + statTriage = "exec triage" + statMinimize = "exec minimize" + statSmash = "exec smash" + statHint = "exec hints" + statSeed = "exec seeds" + statCollide = "exec collide" + statExecTotal = "exec total" + statBufferTooSmall = "buffer too small" +) + +func (fuzzer *Fuzzer) GrabStats() map[string]uint64 { + fuzzer.mu.Lock() + defer fuzzer.mu.Unlock() + ret := fuzzer.stats + fuzzer.stats = map[string]uint64{} + return ret +} -- cgit mrf-deployment