diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-fillreports/fillreports.go | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/syz-fillreports/fillreports.go b/tools/syz-fillreports/fillreports.go index 2c297eb6d..501a9bcfa 100644 --- a/tools/syz-fillreports/fillreports.go +++ b/tools/syz-fillreports/fillreports.go @@ -37,11 +37,11 @@ func main() { } workItems := loadBugReports(dash, resp.List) for item := range workItems { - processReport(dash, item) + processReport(dash, item.report, item.bugID) } } -func processReport(dash *dashapi.Dashboard, bugReport *dashapi.BugReport) { +func processReport(dash *dashapi.Dashboard, bugReport *dashapi.BugReport, bugID string) { if bugReport.ReportElements != nil && len(bugReport.ReportElements.GuiltyFiles) > 0 { log.Printf("%v: already has guilty files", bugReport.ID) return @@ -85,7 +85,7 @@ func processReport(dash *dashapi.Dashboard, bugReport *dashapi.BugReport) { return } err = dash.UpdateReport(&dashapi.UpdateReportReq{ - BugID: bugReport.ID, + BugID: bugID, CrashID: bugReport.CrashID, GuiltyFiles: &[]string{rep.GuiltyFile}, }) @@ -95,13 +95,18 @@ func processReport(dash *dashapi.Dashboard, bugReport *dashapi.BugReport) { log.Printf("%v: updated", bugReport.ID) } -func loadBugReports(dash *dashapi.Dashboard, IDs []string) <-chan *dashapi.BugReport { +type workItem struct { + report *dashapi.BugReport + bugID string +} + +func loadBugReports(dash *dashapi.Dashboard, IDs []string) <-chan *workItem { const ( threads = 8 logStep = 100 ) ids := make(chan string) - ret := make(chan *dashapi.BugReport) + ret := make(chan *workItem) var wg sync.WaitGroup for i := 0; i < threads; i++ { wg.Add(1) @@ -116,7 +121,10 @@ func loadBugReports(dash *dashapi.Dashboard, IDs []string) <-chan *dashapi.BugRe if resp.ID == "" { continue } - ret <- resp + ret <- &workItem{ + report: resp, + bugID: id, + } } }() } |
