diff options
| author | Jouni Hogander <jouni.hogander@unikie.com> | 2020-11-10 15:01:26 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-12-10 12:57:35 +0100 |
| commit | cbdf514ebdff5b19bc93cdfcc81598587627330e (patch) | |
| tree | cec672b32afba297ff06bc3cd4d39205596cc78a /pkg/vcs/linux.go | |
| parent | f86bec81e1bafa82d30486258de616fff295b5f7 (diff) | |
pkg/kconfig: store minimization results
Store config options identified using DebugTracer. Also change bisection
and configuration minimization code to use new DebugTracer.
Diffstat (limited to 'pkg/vcs/linux.go')
| -rw-r--r-- | pkg/vcs/linux.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go index a99215528..93c9ca045 100644 --- a/pkg/vcs/linux.go +++ b/pkg/vcs/linux.go @@ -6,7 +6,6 @@ package vcs import ( "bytes" "fmt" - "io" "net/mail" "path/filepath" "regexp" @@ -15,6 +14,7 @@ import ( "strings" "time" + "github.com/google/syzkaller/pkg/debugtracer" "github.com/google/syzkaller/pkg/kconfig" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/prog" @@ -237,8 +237,9 @@ func linuxAlterConfigs(cf *kconfig.ConfigFile, tags map[string]bool) { } } -func (ctx *linux) Bisect(bad, good string, trace io.Writer, pred func() (BisectResult, error)) ([]*Commit, error) { - commits, err := ctx.git.Bisect(bad, good, trace, pred) +func (ctx *linux) Bisect(bad, good string, dt debugtracer.DebugTracer, pred func() (BisectResult, + error)) ([]*Commit, error) { + commits, err := ctx.git.Bisect(bad, good, dt, pred) if len(commits) == 1 { ctx.addMaintainers(commits[0]) } @@ -309,10 +310,10 @@ func ParseMaintainersLinux(text []byte) Recipients { const configBisectTag = "# Minimized by syzkaller" -func (ctx *linux) Minimize(target *targets.Target, original, baseline []byte, trace io.Writer, - pred func(test []byte) (BisectResult, error)) ([]byte, error) { +func (ctx *linux) Minimize(target *targets.Target, original, baseline []byte, + dt debugtracer.DebugTracer, pred func(test []byte) (BisectResult, error)) ([]byte, error) { if bytes.HasPrefix(original, []byte(configBisectTag)) { - fmt.Fprintf(trace, "# configuration already minimized\n") + dt.Log("# configuration already minimized\n") return original, nil } kconf, err := kconfig.Parse(target, filepath.Join(ctx.git.dir, "Kconfig")) @@ -333,7 +334,7 @@ func (ctx *linux) Minimize(target *targets.Target, original, baseline []byte, tr res, err := pred(serialize(candidate)) return res == BisectBad, err } - minConfig, err := kconf.Minimize(baselineConfig, originalConfig, kconfPred, trace) + minConfig, err := kconf.Minimize(baselineConfig, originalConfig, kconfPred, dt) if err != nil { return nil, err } |
