aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/instance/instance.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-09-03 16:20:07 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-09-22 15:40:02 +0200
commit1c202847db0380015a8920bfd21375c2d9f28ddb (patch)
tree6693da3a936398a9ac6678842ac181c5f0e3e429 /pkg/instance/instance.go
parenta7ce77be27d8e3728b97122a005bc5b23298cfc3 (diff)
all: refactor fault injection into call props
Now that call properties mechanism is implemented, we can refactor fault injection. Unfortunately, it is impossible to remove all traces of the previous apprach. In reprolist and while performing syz-ci jobs, syzkaller still needs to parse the old format. Remove the old prog options-based approach whenever possible and replace it with the use of call properties.
Diffstat (limited to 'pkg/instance/instance.go')
-rw-r--r--pkg/instance/instance.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index 92c6d1353..68920577b 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -480,17 +480,23 @@ func ExecprogCmd(execprog, executor, OS, arch, sandbox string, repeat, threaded,
osArg = " -os=" + OS
}
optionalArg := ""
+
+ if faultCall >= 0 {
+ optionalArg = fmt.Sprintf(" -fault_call=%v -fault_nth=%v",
+ faultCall, faultNth)
+ }
+
if optionalFlags {
- optionalArg = " " + tool.OptionalFlags([]tool.Flag{
+ optionalArg += " " + tool.OptionalFlags([]tool.Flag{
{Name: "slowdown", Value: fmt.Sprint(slowdown)},
})
}
+
return fmt.Sprintf("%v -executor=%v -arch=%v%v -sandbox=%v"+
- " -procs=%v -repeat=%v -threaded=%v -collide=%v -cover=0"+
- " -fault_call=%v -fault_nth=%v%v %v",
+ " -procs=%v -repeat=%v -threaded=%v -collide=%v -cover=0%v %v",
execprog, executor, arch, osArg, sandbox,
procs, repeatCount, threaded, collide,
- faultCall, faultNth, optionalArg, progFile)
+ optionalArg, progFile)
}
var MakeBin = func() string {