diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-19 16:42:32 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-20 11:33:58 +0000 |
| commit | f56b4dcc82d7af38bf94d643c5750cf49a91a297 (patch) | |
| tree | 19b2ea6bfcbf61ab7287d420f39c45432bd9b4cc /pkg/manager | |
| parent | 7d02db5adbb376babbbd3199f8c530e468292727 (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')
| -rw-r--r-- | pkg/manager/html/syscalls.html | 6 | ||||
| -rw-r--r-- | pkg/manager/http.go | 36 |
2 files changed, 30 insertions, 12 deletions
diff --git a/pkg/manager/html/syscalls.html b/pkg/manager/html/syscalls.html index e3edfcabf..d16337978 100644 --- a/pkg/manager/html/syscalls.html +++ b/pkg/manager/html/syscalls.html @@ -9,7 +9,9 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the <th><a onclick="return sortTable(this, 'Syscall', textSort)" href="#">Syscall</a></th> <th><a onclick="return sortTable(this, 'Inputs', numSort)" href="#" title="Number of inputs in the corpus added because of this syscall">Inputs</a></th> <th><a onclick="return sortTable(this, 'Total', numSort)" href="#" title="Total number of inputs in the corpus that contain this syscall">Total</a></th> - <th><a onclick="return sortTable(this, 'Coverage', numSort)" href="#">Coverage</a></th> + <th><a onclick="return sortTable(this, 'Coverage', numSort)" href="#" title="Coverage achieved by this syscall">Coverage</a></th> + <th><a onclick="return sortTable(this, 'Cover overflows', numSort)" href="#" title="Number of times coverage buffer has overflowed on this syscall">Cover overflows</a></th> + <th><a onclick="return sortTable(this, 'Comps overflows', numSort)" href="#" title="Number of times comparisons buffer has overflowed on this syscall">Comps overflows</a></th> <th>Prio</th> </tr> {{range $c := $.Calls}} @@ -18,6 +20,8 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the <td><a href='/corpus?call={{$c.Name}}'>{{$c.Inputs}}</a></td> <td>{{$c.Total}}</td> <td><a href='/cover?call={{$c.Name}}'>{{$c.Cover}}</a></td> + <td>{{$c.CoverOverflows}}</td> + <td>{{$c.CompsOverflows}}</td> <td><a href='/prio?call={{$c.Name}}'>prio</a></td> </tr> {{end}} 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 { |
