diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-05-21 09:36:19 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-05-21 09:46:36 +0000 |
| commit | 5546e69adad6744befb5bc74a32763d20c7db4a6 (patch) | |
| tree | e5609b2cf1cf2007eeef215dafc2baac91483384 | |
| parent | 780a5444026e461c8be27b8615a81360310582e7 (diff) | |
syz-manager: make num fuzzing stat more precise
Make num fuzzing VMs stat more precise:
increment when the VM is actually ready to execute test programs,
decrement as soon as we see oops in console output.
Also show it on graphs.
| -rw-r--r-- | syz-manager/manager.go | 4 | ||||
| -rw-r--r-- | syz-manager/rpc.go | 5 | ||||
| -rw-r--r-- | syz-manager/stats.go | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 4c0565a76..0758930c8 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -236,7 +236,7 @@ func (mgr *Manager) heartbeatLoop() { if mgr.firstConnect.Load() == 0 { continue } - mgr.statFuzzingTime.Add(diff * mgr.statNumFuzzing.Val()) + mgr.statFuzzingTime.Add(diff * mgr.serv.statNumFuzzing.Val()) buf := new(bytes.Buffer) for _, stat := range stats.Collect(stats.Console) { fmt.Fprintf(buf, "%v=%v ", stat.Name, stat.Value) @@ -790,8 +790,6 @@ func (mgr *Manager) runInstanceInner(index int, instanceName string, injectLog < // Run the fuzzer binary. mgr.bootTime.Save(time.Since(start)) start = time.Now() - mgr.statNumFuzzing.Add(1) - defer mgr.statNumFuzzing.Add(-1) args := &instance.FuzzerCmdArgs{ Fuzzer: fuzzerBin, diff --git a/syz-manager/rpc.go b/syz-manager/rpc.go index ea6427092..4a6311d4c 100644 --- a/syz-manager/rpc.go +++ b/syz-manager/rpc.go @@ -48,6 +48,7 @@ type RPCServer struct { runners map[string]*Runner execSource queue.Source + statNumFuzzing *stats.Val statExecs *stats.Val statExecRetries *stats.Val statExecutorRestarts *stats.Val @@ -97,6 +98,8 @@ func startRPCServer(mgr *Manager) (*RPCServer, error) { baseSource: baseSource, execSource: queue.Retry(baseSource), statExecs: mgr.statExecs, + statNumFuzzing: stats.Create("fuzzing VMs", "Number of VMs that are currently fuzzing", + stats.Console), statExecRetries: stats.Create("exec retries", "Number of times a test program was restarted because the first run failed", stats.Rate{}, stats.Graph("executor")), @@ -255,6 +258,8 @@ func (serv *RPCServer) connectionLoop(runner *Runner) error { } } + serv.statNumFuzzing.Add(1) + defer serv.statNumFuzzing.Add(-1) for { for len(runner.requests)-len(runner.executing) < 2*serv.cfg.Procs { req := serv.execSource.Next() diff --git a/syz-manager/stats.go b/syz-manager/stats.go index 77982434f..322782c30 100644 --- a/syz-manager/stats.go +++ b/syz-manager/stats.go @@ -12,7 +12,6 @@ import ( ) type Stats struct { - statNumFuzzing *stats.Val statNumReproducing *stats.Val statExecs *stats.Val statCrashes *stats.Val @@ -24,8 +23,6 @@ type Stats struct { } func (mgr *Manager) initStats() { - mgr.statNumFuzzing = stats.Create("VMs", "Number of VMs that are currently fuzzing", - stats.Console, stats.NoGraph) mgr.statNumReproducing = stats.Create("reproducing", "Number of crashes being reproduced", stats.Console, stats.NoGraph) mgr.statExecs = stats.Create("exec total", "Total test program executions", |
