From 4d4a4420e72dba0231c8ce5921eb75dddab88747 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 20 May 2019 18:30:54 +0200 Subject: pkg/report: add Type/Frame to Report In several places we do special handling for some crash types. Currently we compare report title with magic strings, which is error-prone. Add explicit Type to reports. --- pkg/report/linux.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index d414395cb..3b1e96581 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -791,8 +791,6 @@ var linuxStackParams = &stackParams{ }, } -const MemoryLeakPrefix = "memory leak in " - func warningStackFmt(skip ...string) *stackFmt { return &stackFmt{ // In newer kernels WARNING traps and actual stack starts after invalid_op frame, @@ -996,7 +994,7 @@ var linuxOopses = []*oops{ }, { title: compile("BUG: memory leak"), - fmt: MemoryLeakPrefix + "%[1]v", + fmt: memoryLeakPrefix + "%[1]v", stack: &stackFmt{ parts: []*regexp.Regexp{ compile("backtrace:"), @@ -1484,7 +1482,7 @@ var linuxOopses = []*oops{ []oopsFormat{ { title: compile("Booting the kernel."), - fmt: UnexpectedKernelReboot, + fmt: unexpectedKernelReboot, noStackTrace: true, }, }, -- cgit mrf-deployment