diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-16 16:48:05 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-16 16:48:05 +0100 |
| commit | 1749e412ca50caa145ba53de69c0daf95f1b6d6f (patch) | |
| tree | 850142fcd2119a0a7196973a77560b92eeecd3b0 /pkg/report | |
| parent | ce6744512e81ac2e291fea247d55fb0bf8e703e2 (diff) | |
pkg/instance: make kernel reboot detection portable
The current code is linux specific, generalize it to other OSes.
Diffstat (limited to 'pkg/report')
| -rw-r--r-- | pkg/report/fuchsia.go | 2 | ||||
| -rw-r--r-- | pkg/report/linux.go | 2 | ||||
| -rw-r--r-- | pkg/report/report.go | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/pkg/report/fuchsia.go b/pkg/report/fuchsia.go index 725c0b302..5e80501ab 100644 --- a/pkg/report/fuchsia.go +++ b/pkg/report/fuchsia.go @@ -287,7 +287,7 @@ var zirconOopses = []*oops{ []oopsFormat{ { title: compile("welcome to Zircon"), - fmt: "unexpected kernel reboot", + fmt: UnexpectedKernelReboot, noStackTrace: true, }, }, diff --git a/pkg/report/linux.go b/pkg/report/linux.go index b1b4dda8a..19a312f9b 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -1328,7 +1328,7 @@ var linuxOopses = []*oops{ []oopsFormat{ { title: compile("Booting the kernel."), - fmt: "unexpected kernel reboot", + fmt: UnexpectedKernelReboot, noStackTrace: true, }, }, diff --git a/pkg/report/report.go b/pkg/report/report.go index be6e31216..00dd74856 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -81,6 +81,8 @@ func NewReporter(cfg *mgrconfig.Config) (Reporter, error) { return &reporterWrapper{rep, supps, typ}, nil } +const UnexpectedKernelReboot = "unexpected kernel reboot" + var ctors = map[string]fn{ "akaros": ctorAkaros, "linux": ctorLinux, |
