From d7bc58204ea84ccb2ed541dd26a6b6d8bc326f5d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 17 Jan 2018 19:43:04 +0100 Subject: dashboard/app: collect more info for better reports Collect kernel build commit title/date. Add support for kernel repo aliases (to be able to say linux-next instead of full git repo address). Collect on what managers a bug happened. Reuse Crash.ReportLen as generic crash reporting priority. Make it possible to prioritize reporting of particular kernel repos and arches. Fixes #473 --- dashboard/app/api.go | 54 +++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'dashboard/app/api.go') diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 5a0d3823d..c12fd62b0 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -269,20 +269,22 @@ func uploadBuild(c context.Context, ns string, req *dashapi.Build, typ BuildType return false, err } build := &Build{ - Namespace: ns, - Manager: req.Manager, - ID: req.ID, - Type: typ, - Time: timeNow(c), - OS: req.OS, - Arch: req.Arch, - VMArch: req.VMArch, - SyzkallerCommit: req.SyzkallerCommit, - CompilerID: req.CompilerID, - KernelRepo: req.KernelRepo, - KernelBranch: req.KernelBranch, - KernelCommit: req.KernelCommit, - KernelConfig: configID, + Namespace: ns, + Manager: req.Manager, + ID: req.ID, + Type: typ, + Time: timeNow(c), + OS: req.OS, + Arch: req.Arch, + VMArch: req.VMArch, + SyzkallerCommit: req.SyzkallerCommit, + CompilerID: req.CompilerID, + KernelRepo: req.KernelRepo, + KernelBranch: req.KernelBranch, + KernelCommit: req.KernelCommit, + KernelCommitTitle: req.KernelCommitTitle, + KernelCommitDate: req.KernelCommitDate, + KernelConfig: configID, } if _, err := datastore.Put(c, buildKey(c, ns, req.ID), build); err != nil { return false, err @@ -470,6 +472,10 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error) return nil, err } } + build, err := loadBuild(c, ns, req.BuildID) + if err != nil { + return nil, err + } now := timeNow(c) reproLevel := ReproLevelNone @@ -482,24 +488,21 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error) now.Sub(bug.LastTime) > time.Hour || reproLevel != ReproLevelNone if saveCrash { - build, err := loadBuild(c, ns, req.BuildID) - if err != nil { - return nil, err + // Reporting priority of this crash. + // Currently it is computed only from repository ReportingPriority and Arch, + // but can be extended to account for other factors as well. + prio := kernelRepoInfo(build).ReportingPriority * 1e6 + if build.Arch == "amd64" { + prio += 1e3 } - crash := &Crash{ Manager: build.Manager, BuildID: req.BuildID, Time: now, Maintainers: req.Maintainers, ReproOpts: req.ReproOpts, - // We used to report crash with the longest report len to work around - // corrupted reports. Now that we explicitly detect corrupted reports, - // disable this sorting. When all old bugs are closed, we need to remove - // sorting by ReportLen from queryCrashesForBug. - ReportLen: 1e9, + ReportLen: prio, } - if crash.Log, err = putText(c, ns, "CrashLog", req.Log, false); err != nil { return nil, err } @@ -537,6 +540,9 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error) if len(req.Report) != 0 { bug.HasReport = true } + if !stringInList(bug.HappenedOn, build.Manager) { + bug.HappenedOn = append(bug.HappenedOn, build.Manager) + } if _, err = datastore.Put(c, bugKey, bug); err != nil { return fmt.Errorf("failed to put bug: %v", err) } -- cgit mrf-deployment