aboutsummaryrefslogtreecommitdiffstats
path: root/syz-verifier/stats.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@gmail.com>2021-11-09 17:32:18 +0100
committerGitHub <noreply@github.com>2021-11-09 17:32:18 +0100
commitf549c8707e71276f8ce5396b0d64b4f2ec536ff4 (patch)
tree3320aec8972b3806f2f79ac17d36b3f7620dbfc0 /syz-verifier/stats.go
parent59bcaf9a32d049b180bfc3e2ff2b80fb0ac2d5b1 (diff)
syz-verifier: add monitoring api (#2869)
Diffstat (limited to 'syz-verifier/stats.go')
-rw-r--r--syz-verifier/stats.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/syz-verifier/stats.go b/syz-verifier/stats.go
index a6d00a0d2..e06ead8c0 100644
--- a/syz-verifier/stats.go
+++ b/syz-verifier/stats.go
@@ -39,20 +39,22 @@ type CallStats struct {
States map[ReturnState]bool
}
-// InitStats creates a stats object.
-func InitStats(calls map[*prog.Syscall]bool) *Stats {
- stats := &Stats{
- Calls: make(map[string]*CallStats),
- StartTime: time.Now(),
+// MakeStats creates a stats object.
+func MakeStats() *Stats {
+ return &Stats{
+ Calls: make(map[string]*CallStats),
}
+}
+
+// SetSyscallMask initializes the allowed syscall list.
+func (stats *Stats) SetSyscallMask(calls map[*prog.Syscall]bool) {
+ stats.StartTime = time.Now()
for syscall := range calls {
stats.Calls[syscall.Name] = &CallStats{
Name: syscall.Name,
States: make(map[ReturnState]bool)}
}
-
- return stats
}
// ReportGlobalStats creates a report with statistics about all the