diff options
Diffstat (limited to 'pkg/manager')
| -rw-r--r-- | pkg/manager/crash.go | 12 | ||||
| -rw-r--r-- | pkg/manager/html/main.html | 9 | ||||
| -rw-r--r-- | pkg/manager/http.go | 41 |
3 files changed, 53 insertions, 9 deletions
diff --git a/pkg/manager/crash.go b/pkg/manager/crash.go index f0fa58959..a62ec8280 100644 --- a/pkg/manager/crash.go +++ b/pkg/manager/crash.go @@ -216,6 +216,7 @@ type CrashInfo struct { type BugInfo struct { ID string Title string + TailTitles []*report.TitleFreqRank FirstTime time.Time LastTime time.Time HasRepro bool @@ -223,6 +224,7 @@ type BugInfo struct { StraceFile string // relative to the workdir ReproAttempts int Crashes []*CrashInfo + Rank int } func (cs *CrashStore) BugInfo(id string, full bool) (*BugInfo, error) { @@ -238,6 +240,16 @@ func (cs *CrashStore) BugInfo(id string, full bool) (*BugInfo, error) { return nil, err } ret.Title = strings.TrimSpace(string(desc)) + + // Bug rank may go up over time if we observe higher ranked bugs as a consequence of the first failure. + ret.Rank = report.TitlesToImpact(ret.Title) + if titleStat, err := report.ReadStatFile(filepath.Join(dir, "title-stat")); err == nil { + ret.TailTitles = report.ExplainTitleStat(titleStat) + for _, ti := range ret.TailTitles { + ret.Rank = max(ret.Rank, ti.Rank) + } + } + ret.FirstTime = osutil.CreationTime(stat) ret.LastTime = stat.ModTime() files, err := osutil.ListDir(dir) diff --git a/pkg/manager/html/main.html b/pkg/manager/html/main.html index 42e92ac2b..43652cbf6 100644 --- a/pkg/manager/html/main.html +++ b/pkg/manager/html/main.html @@ -26,6 +26,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the <thead> <tr> <th><a onclick="return sortTable(this, 'Description', textSort)" href="#">Description</a></th> + <th><a onclick="return sortTable(this, 'Rank', numSort)" href="#">Rank</a></th> <th><a onclick="return sortTable(this, 'Count', numSort)" href="#">Count</a></th> <th><a onclick="return sortTable(this, 'First Time', textSort, true)" href="#">First Time</a></th> <th><a onclick="return sortTable(this, 'Last Time', textSort, true)" href="#">Last Time</a></th> @@ -37,6 +38,14 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{range $c := $.Crashes}} <tr> <td class="title"><a href="/crash?id={{$c.ID}}">{{$c.Title}}</a></td> + <td class="rank {{if not $c.Active}}inactive{{end}}"> + {{if $c.RankTooltip}} + <b>{{$c.Rank}}</b> + <pre class="tooltiptext">{{$c.RankTooltip}}</pre> + {{else}} + {{$c.Rank}} + {{end}} + </td> <td class="stat {{if not $c.Active}}inactive{{end}}">{{len $c.Crashes}}</td> <td class="time {{if not $c.New}}inactive{{end}}">{{formatTime $c.FirstTime}}</td> <td class="time {{if not $c.Active}}inactive{{end}}">{{formatTime $c.LastTime}}</td> diff --git a/pkg/manager/http.go b/pkg/manager/http.go index e6a7d6b46..61d208f41 100644 --- a/pkg/manager/http.go +++ b/pkg/manager/http.go @@ -29,6 +29,7 @@ import ( "github.com/google/syzkaller/pkg/html/pages" "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/mgrconfig" + "github.com/google/syzkaller/pkg/report" "github.com/google/syzkaller/pkg/stat" "github.com/google/syzkaller/pkg/vcs" "github.com/google/syzkaller/pkg/vminfo" @@ -355,12 +356,33 @@ func makeUICrashType(info *BugInfo, startTime time.Time, repros map[string]bool) triaged := reproStatus(info.HasRepro, info.HasCRepro, repros[info.Title], info.ReproAttempts >= MaxReproAttempts) return UICrashType{ - BugInfo: *info, - New: info.FirstTime.After(startTime), - Active: info.LastTime.After(startTime), - Triaged: triaged, - Crashes: crashes, + BugInfo: *info, + RankTooltip: higherRankTooltip(info.Title, info.TailTitles), + New: info.FirstTime.After(startTime), + Active: info.LastTime.After(startTime), + Triaged: triaged, + Crashes: crashes, + } +} + +// higherRankTooltip generates the prioritized list of the titles with higher Rank +// than the firstTitle has. +func higherRankTooltip(firstTitle string, titlesInfo []*report.TitleFreqRank) string { + baseRank := report.TitlesToImpact(firstTitle) + res := "" + for _, ti := range titlesInfo { + if ti.Rank <= baseRank { + continue + } + res += fmt.Sprintf("[rank %2v, freq %5.1f%%] %s\n", + ti.Rank, + 100*float32(ti.Count)/float32(ti.Total), + ti.Title) + } + if res != "" { + return fmt.Sprintf("[rank %2v, originally] %s\n%s", baseRank, firstTitle, res) } + return res } var crashIDRe = regexp.MustCompile(`^\w+$`) @@ -1024,10 +1046,11 @@ type UICrashPage struct { type UICrashType struct { BugInfo - New bool // was first found in the current run - Active bool // was found in the current run - Triaged string - Crashes []UICrash + RankTooltip string + New bool // was first found in the current run + Active bool // was found in the current run + Triaged string + Crashes []UICrash } type UICrash struct { |
