From f56b4dcc82d7af38bf94d643c5750cf49a91a297 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 19 Nov 2024 16:42:32 +0100 Subject: pkg/manager: show number of times coverage for each call has overflowed If the overflows happen often, it's bad. Add visibility into this. --- pkg/fuzzer/stats.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'pkg/fuzzer/stats.go') diff --git a/pkg/fuzzer/stats.go b/pkg/fuzzer/stats.go index 7990f8b13..40c71d309 100644 --- a/pkg/fuzzer/stats.go +++ b/pkg/fuzzer/stats.go @@ -3,9 +3,17 @@ package fuzzer -import "github.com/google/syzkaller/pkg/stat" +import ( + "sync/atomic" + + "github.com/google/syzkaller/pkg/stat" + "github.com/google/syzkaller/prog" +) type Stats struct { + // Indexed by prog.Syscall.ID + the last element for extra/remote. + Syscalls []SyscallStats + statCandidates *stat.Val statNewInputs *stat.Val statJobs *stat.Val @@ -27,8 +35,16 @@ type Stats struct { statExecCollide *stat.Val } -func newStats() Stats { +type SyscallStats struct { + // Number of times coverage buffer for this syscall has overflowed. + CoverOverflows atomic.Uint64 + // Number of times comparisons buffer for this syscall has overflowed. + CompsOverflows atomic.Uint64 +} + +func newStats(target *prog.Target) Stats { return Stats{ + Syscalls: make([]SyscallStats, len(target.Syscalls)+1), statCandidates: stat.New("candidates", "Number of candidate programs in triage queue", stat.Console, stat.Graph("corpus")), statNewInputs: stat.New("new inputs", "Potential untriaged corpus candidates", -- cgit mrf-deployment