aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/manager/http.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-11-19 16:42:32 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-11-20 11:33:58 +0000
commitf56b4dcc82d7af38bf94d643c5750cf49a91a297 (patch)
tree19b2ea6bfcbf61ab7287d420f39c45432bd9b4cc /pkg/manager/http.go
parent7d02db5adbb376babbbd3199f8c530e468292727 (diff)
pkg/manager: show number of times coverage for each call has overflowed
If the overflows happen often, it's bad. Add visibility into this.
Diffstat (limited to 'pkg/manager/http.go')
-rw-r--r--pkg/manager/http.go36
1 files changed, 25 insertions, 11 deletions
diff --git a/pkg/manager/http.go b/pkg/manager/http.go
index 81affcf7e..cbde6d151 100644
--- a/pkg/manager/http.go
+++ b/pkg/manager/http.go
@@ -187,6 +187,7 @@ func (serv *HTTPServer) textPage(w http.ResponseWriter, r *http.Request, title s
func (serv *HTTPServer) httpSyscalls(w http.ResponseWriter, r *http.Request) {
var calls map[string]*corpus.CallCov
total := make(map[string]int)
+ fuzzerObj := serv.Fuzzer.Load()
syscallsObj := serv.EnabledSyscalls.Load()
corpusObj := serv.Corpus.Load()
if corpusObj != nil && syscallsObj != nil {
@@ -217,12 +218,23 @@ func (serv *HTTPServer) httpSyscalls(w http.ResponseWriter, r *http.Request) {
if syscall, ok := serv.Cfg.Target.SyscallMap[c]; ok {
syscallID = &syscall.ID
}
+ coverOverflows, compsOverflows := 0, 0
+ if fuzzerObj != nil {
+ idx := len(serv.Cfg.Target.Syscalls)
+ if c != prog.ExtraCallName {
+ idx = serv.Cfg.Target.SyscallMap[c].ID
+ }
+ coverOverflows = int(fuzzerObj.Syscalls[idx].CoverOverflows.Load())
+ compsOverflows = int(fuzzerObj.Syscalls[idx].CompsOverflows.Load())
+ }
data.Calls = append(data.Calls, UICallType{
- Name: c,
- ID: syscallID,
- Inputs: cc.Count,
- Total: total[c],
- Cover: len(cc.Cover),
+ Name: c,
+ ID: syscallID,
+ Inputs: cc.Count,
+ Total: total[c],
+ Cover: len(cc.Cover),
+ CoverOverflows: coverOverflows,
+ CompsOverflows: compsOverflows,
})
}
sort.Slice(data.Calls, func(i, j int) bool {
@@ -702,7 +714,7 @@ func (serv *HTTPServer) httpDebugInput(w http.ResponseWriter, r *http.Request) {
if len(extraIDs) > 0 {
calls = append(calls, UIRawCallCover{
Sig: r.FormValue("sig"),
- Call: ".extra",
+ Call: prog.ExtraCallName,
UpdateIDs: extraIDs,
})
}
@@ -963,11 +975,13 @@ type UIStat struct {
}
type UICallType struct {
- Name string
- ID *int
- Inputs int
- Total int
- Cover int
+ Name string
+ ID *int
+ Inputs int
+ Total int
+ Cover int
+ CoverOverflows int
+ CompsOverflows int
}
type UICorpusPage struct {