From 34f2c2332bedc41c5d22eaa35a555720cae3a1c7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 29 Nov 2017 13:23:42 +0100 Subject: pkg/report: add Output to Report Whole raw output is indivisble part of Report, currently we always pass Output separately along with Report. Make Output a Report field. Then, put whole Report into manager Crash and repro context and Result. There is little point in passing Report as aa bunch of separate fields. --- pkg/report/freebsd.go | 4 +++- pkg/report/linux.go | 4 +++- pkg/report/report.go | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'pkg/report') diff --git a/pkg/report/freebsd.go b/pkg/report/freebsd.go index 46efea5d9..dd9c8178d 100644 --- a/pkg/report/freebsd.go +++ b/pkg/report/freebsd.go @@ -34,7 +34,9 @@ func (ctx *freebsd) ContainsCrash(output []byte) bool { } func (ctx *freebsd) Parse(output []byte) *Report { - rep := new(Report) + rep := &Report{ + Output: output, + } var oops *oops for pos := 0; pos < len(output); { next := bytes.IndexByte(output[pos:], '\n') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 3804a134e..0efab7c16 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -78,7 +78,9 @@ func (ctx *linux) ContainsCrash(output []byte) bool { func (ctx *linux) Parse(output []byte) *Report { output = ctx.ExtractConsoleOutput(output) - rep := new(Report) + rep := &Report{ + Output: output, + } var oops *oops var textPrefix [][]byte textLines := 0 diff --git a/pkg/report/report.go b/pkg/report/report.go index 272c359ab..813e8ef3c 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -34,6 +34,8 @@ type Report struct { Title string // Report contains whole oops text. Report []byte + // Output contains whole raw kernel output. + Output []byte // StartPos/EndPos denote region of output with oops message(s). StartPos int EndPos int -- cgit mrf-deployment