diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-29 13:23:42 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-29 14:36:51 +0100 |
| commit | 34f2c2332bedc41c5d22eaa35a555720cae3a1c7 (patch) | |
| tree | beb6f2d3d1399fef2c4f9d511e9d5d0804609261 /pkg/report | |
| parent | 19d272a98fd5c705b0345798da1a3e3d5b37f91f (diff) | |
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.
Diffstat (limited to 'pkg/report')
| -rw-r--r-- | pkg/report/freebsd.go | 4 | ||||
| -rw-r--r-- | pkg/report/linux.go | 4 | ||||
| -rw-r--r-- | pkg/report/report.go | 2 |
3 files changed, 8 insertions, 2 deletions
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 |
