aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/bisect.go
diff options
context:
space:
mode:
authorJouni Hogander <jouni.hogander@unikie.com>2020-11-10 15:01:26 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-12-10 12:57:35 +0100
commitcbdf514ebdff5b19bc93cdfcc81598587627330e (patch)
treecec672b32afba297ff06bc3cd4d39205596cc78a /pkg/bisect/bisect.go
parentf86bec81e1bafa82d30486258de616fff295b5f7 (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/bisect/bisect.go')
-rw-r--r--pkg/bisect/bisect.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go
index 76c518e6c..07f47ccde 100644
--- a/pkg/bisect/bisect.go
+++ b/pkg/bisect/bisect.go
@@ -5,11 +5,10 @@ package bisect
import (
"fmt"
- "io"
- "path/filepath"
"time"
"github.com/google/syzkaller/pkg/build"
+ "github.com/google/syzkaller/pkg/debugtracer"
"github.com/google/syzkaller/pkg/hash"
"github.com/google/syzkaller/pkg/instance"
"github.com/google/syzkaller/pkg/mgrconfig"
@@ -19,11 +18,10 @@ import (
)
type Config struct {
- Trace io.Writer
+ Trace debugtracer.DebugTracer
Fix bool
BinDir string
Ccache string
- DebugDir string
Timeout time.Duration
Kernel KernelConfig
Syzkaller SyzkallerConfig
@@ -540,11 +538,7 @@ func (env *env) processResults(current *vcs.Commit, results []error) (bad, good
}
func (env *env) saveDebugFile(hash string, idx int, data []byte) {
- if env.cfg.DebugDir == "" || len(data) == 0 {
- return
- }
- osutil.MkdirAll(env.cfg.DebugDir)
- osutil.WriteFile(filepath.Join(env.cfg.DebugDir, fmt.Sprintf("%v.%v", hash, idx)), data)
+ env.cfg.Trace.SaveFile(fmt.Sprintf("%v.%v", hash, idx), data)
}
func checkConfig(cfg *Config) error {
@@ -564,5 +558,5 @@ func checkConfig(cfg *Config) error {
}
func (env *env) log(msg string, args ...interface{}) {
- fmt.Fprintf(env.cfg.Trace, msg+"\n", args...)
+ env.cfg.Trace.Log(msg, args...)
}