aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/repro
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-02-22 14:14:39 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-02-22 15:29:10 +0000
commit2b876d1039e8c18ba9a1cdbaa7c9c5b6e1bc975d (patch)
tree73cb1a29c67204ab69e1c9c0696771c1fd8d0c53 /pkg/repro
parentbbb79582c485df7295f46f2345f6614a6342c279 (diff)
pkg/repro: check reproducibility before bisecting
In many cases bisection does not seem to bring any results, but it takes quite a while to run. Let's save some time by running the whole log before the proces.
Diffstat (limited to 'pkg/repro')
-rw-r--r--pkg/repro/repro.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go
index 6a2eff44c..21c15fc66 100644
--- a/pkg/repro/repro.go
+++ b/pkg/repro/repro.go
@@ -357,8 +357,18 @@ func (ctx *context) extractProgBisect(entries []*prog.LogEntry, baseDuration tim
return baseDuration + time.Duration(entries/4)*time.Second
}
+ // First check if replaying the log may crash the kernel at all.
+ ret, err := ctx.testProgs(entries, duration(len(entries)), opts)
+ if !ret {
+ ctx.reproLogf(3, "replaying the whole log did not cause a kernel crash")
+ return nil, nil
+ }
+ if err != nil {
+ return nil, err
+ }
+
// Bisect the log to find multiple guilty programs.
- entries, err := ctx.bisectProgs(entries, func(progs []*prog.LogEntry) (bool, error) {
+ entries, err = ctx.bisectProgs(entries, func(progs []*prog.LogEntry) (bool, error) {
return ctx.testProgs(progs, duration(len(progs)), opts)
})
if err != nil {