aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/bisect.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-06-15 15:38:51 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-07-05 11:29:44 +0000
commite8b147c6e77e4568d3e7df74121a28e95ee8440a (patch)
tree45e8e43e65a1ccb29d9eba5b68cd45965565afde /pkg/bisect/bisect.go
parent9a3d2957802872770199d00684132907508a6915 (diff)
pkg/bisect: try to drop instrumentation
Refactor Minimize(). As a part of Minimize(), attempt to drop all unnecessary instrumentation and test whether the kernel is still crashing. This should reduce the number of irrelevant crashes during bisection and thus increase bisection result quality.
Diffstat (limited to 'pkg/bisect/bisect.go')
-rw-r--r--pkg/bisect/bisect.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go
index 815d6ba72..3d3de92b6 100644
--- a/pkg/bisect/bisect.go
+++ b/pkg/bisect/bisect.go
@@ -260,14 +260,14 @@ func (env *env) bisect() (*Result, error) {
}
env.reportTypes = testRes.types
- if len(cfg.Kernel.BaselineConfig) != 0 {
- testRes1, err := env.minimizeConfig()
- if err != nil {
- return nil, err
- }
- if testRes1 != nil {
- testRes = testRes1
- }
+ testRes1, err := env.minimizeConfig()
+ if err != nil {
+ return nil, fmt.Errorf("config minimization failed: %w", err)
+ }
+ if testRes1 != nil {
+ // If config minimization even partially succeeds, minimizeConfig()
+ // would return a non-nil value of a new report.
+ testRes = testRes1
}
bad, good, results1, fatalResult, err := env.commitRange()
@@ -372,11 +372,14 @@ func (env *env) minimizeConfig() (*testResult, error) {
if err != nil {
return 0, err
}
- testResults[hash.Hash(test)] = testRes
+ if testRes.verdict == vcs.BisectBad {
+ // Only remember crashes.
+ testResults[hash.Hash(test)] = testRes
+ }
return testRes.verdict, err
}
minConfig, err := env.minimizer.Minimize(env.cfg.Manager.SysTarget, env.cfg.Kernel.Config,
- env.cfg.Kernel.BaselineConfig, env.cfg.Trace, predMinimize)
+ env.cfg.Kernel.BaselineConfig, env.reportTypes, env.cfg.Trace, predMinimize)
if err != nil {
return nil, err
}