aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-02-08 12:48:49 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-02-08 20:25:02 +0100
commit0df8b231c3d20ee5d0663883503270a9495c337f (patch)
tree4afb44faa171cce7cc37ca38df5ede8b093f4d72 /pkg/report/linux.go
parent6a3c415d02bf3c2d68fa964efa6affba3e24f3d8 (diff)
pkg/report: add a ReportToGuiltyFile method
We cannot unfortunately just substitute Report and invoke Symbolize(), because in this case a non-emtpy reportPrefixLen may lead to `panic: runtime error: slice bounds out`. Create a special external method in the pkg/report package.
Diffstat (limited to 'pkg/report/linux.go')
-rw-r--r--pkg/report/linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index b0650339e..0e2d8e1a4 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -691,8 +691,11 @@ func (ctx *linux) decompileOpcodes(text []byte, report *Report) []byte {
}
func (ctx *linux) extractGuiltyFile(rep *Report) string {
- report := rep.Report[rep.reportPrefixLen:]
- if strings.HasPrefix(rep.Title, "INFO: rcu detected stall") {
+ return ctx.extractGuiltyFileRaw(rep.Title, rep.Report[rep.reportPrefixLen:])
+}
+
+func (ctx *linux) extractGuiltyFileRaw(title string, report []byte) string {
+ if strings.HasPrefix(title, "INFO: rcu detected stall") {
// Special case for rcu stalls.
// There are too many frames that we want to skip before actual guilty frames,
// we would need to ignore too many files and that would be fragile.