aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/options.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-26 19:38:24 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-27 10:22:23 +0200
commitb25fc7b83119e8dca728a199fd92e24dd4c33fa4 (patch)
tree15e95c4062be3f23ab8f66c05e33465d40c1d870 /pkg/csource/options.go
parent9d92841b4e4d0ac0f97f983cd90087323f27c26c (diff)
pkg/csource: add option to trace syscall results
This will be needed for testing of generated programs.
Diffstat (limited to 'pkg/csource/options.go')
-rw-r--r--pkg/csource/options.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/pkg/csource/options.go b/pkg/csource/options.go
index e60554120..a312c5db7 100644
--- a/pkg/csource/options.go
+++ b/pkg/csource/options.go
@@ -15,11 +15,12 @@ import (
// Options control various aspects of source generation.
// Dashboard also provides serialized Options along with syzkaller reproducers.
type Options struct {
- Threaded bool `json:"threaded,omitempty"`
- Collide bool `json:"collide,omitempty"`
- Repeat bool `json:"repeat,omitempty"`
- Procs int `json:"procs"`
- Sandbox string `json:"sandbox"`
+ Threaded bool `json:"threaded,omitempty"`
+ Collide bool `json:"collide,omitempty"`
+ Repeat bool `json:"repeat,omitempty"`
+ RepeatTimes int `json:"repeat_times,omitempty"` // if non-0, repeat that many times
+ Procs int `json:"procs"`
+ Sandbox string `json:"sandbox"`
Fault bool `json:"fault,omitempty"` // inject fault into FaultCall/FaultNth
FaultCall int `json:"fault_call,omitempty"`
@@ -34,8 +35,9 @@ type Options struct {
HandleSegv bool `json:"segv,omitempty"`
// Generate code for use with repro package to prints log messages,
- // which allows to distinguish between a hang and an absent crash.
+ // which allows to detect hangs.
Repro bool `json:"repro,omitempty"`
+ Trace bool `json:"trace,omitempty"`
}
// Check checks if the opts combination is valid or not.
@@ -101,6 +103,9 @@ func (opts Options) Check(OS string) error {
if opts.ResetNet && !opts.Repeat {
return errors.New("ResetNet without Repeat")
}
+ if !opts.Repeat && opts.RepeatTimes != 0 && opts.RepeatTimes != 1 {
+ return errors.New("RepeatTimes without Repeat")
+ }
return nil
}