aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJoey Jiao <quic_jiangenj@quicinc.com>2024-07-11 08:19:38 +0800
committerAlexander Potapenko <glider@google.com>2024-07-23 12:07:55 +0000
commite50e8da5c493b37bff754d816c11218eba03d715 (patch)
treecc27b74f029f84dbbc6d67ad5ab49246af9db941 /pkg
parent0c7d1522f3a40057c0c57e8915efc8368dfdcebb (diff)
pkg/report: remove args which already in ctx
Diffstat (limited to 'pkg')
-rw-r--r--pkg/report/linux.go11
-rw-r--r--pkg/report/linux_test.go2
2 files changed, 5 insertions, 8 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index dcdfda4b8..959089d70 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -17,7 +17,6 @@ import (
"github.com/google/syzkaller/pkg/report/crash"
"github.com/google/syzkaller/pkg/symbolizer"
"github.com/google/syzkaller/pkg/vcs"
- "github.com/google/syzkaller/pkg/vminfo"
"github.com/google/syzkaller/sys/targets"
)
@@ -417,7 +416,7 @@ func (ctx *linux) symbolize(rep *Report) error {
prefix := rep.reportPrefixLen
for _, line := range bytes.SplitAfter(rep.Report, []byte("\n")) {
line := bytes.Clone(line)
- newLine := symbolizeLine(symbFunc, ctx.symbols, ctx.config.kernelModules, ctx.kernelBuildSrc, ctx, line)
+ newLine := symbolizeLine(symbFunc, ctx, line)
if prefix > len(symbolized) {
prefix += len(newLine) - len(line)
}
@@ -437,9 +436,7 @@ func (ctx *linux) symbolize(rep *Report) error {
return nil
}
-func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, error),
- symbols map[string]map[string][]symbolizer.Symbol, modules []*vminfo.KernelModule, strip string,
- ctx *linux, line []byte) []byte {
+func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, error), ctx *linux, line []byte) []byte {
match := linuxSymbolizeRe.FindSubmatchIndex(line)
if match == nil {
return line
@@ -457,7 +454,7 @@ func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, err
if match[10] != -1 && match[11] != -1 {
modName = string(line[match[10]:match[11]])
}
- symb := symbols[modName][string(fn)]
+ symb := ctx.symbols[modName][string(fn)]
if len(symb) == 0 {
return line
}
@@ -474,7 +471,7 @@ func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, err
pc--
}
var bin string
- for _, mod := range modules {
+ for _, mod := range ctx.config.kernelModules {
if mod.Name == modName {
bin = mod.Path
break
diff --git a/pkg/report/linux_test.go b/pkg/report/linux_test.go
index 756576e98..f24b72d59 100644
--- a/pkg/report/linux_test.go
+++ b/pkg/report/linux_test.go
@@ -291,7 +291,7 @@ func TestLinuxSymbolizeLine(t *testing.T) {
}
for i, test := range tests {
t.Run(fmt.Sprint(i), func(t *testing.T) {
- result := symbolizeLine(symb, symbols, modules, "/linux", ctx, []byte(test.line))
+ result := symbolizeLine(symb, ctx, []byte(test.line))
if test.result != string(result) {
t.Errorf("want %q\n\t get %q", test.result, string(result))
}