diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-11-25 09:17:50 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-12-28 14:22:41 +0100 |
| commit | cbd0445ec3b0b184db66966d8a47e6b37d13692e (patch) | |
| tree | 14ed47723c325ef1b388e4e732a70c0fed4fa101 /pkg/ipc/ipcconfig | |
| parent | 2242f77fdc5a6c50bd8fa1021d2abc8b83e09e8d (diff) | |
all: make timeouts configurable
Add sys/targets.Timeouts struct that parametrizes timeouts throughout the system.
The struct allows to control syscall/program/no output timeouts for OS/arch/VM/etc.
See comment on the struct for more details.
Diffstat (limited to 'pkg/ipc/ipcconfig')
| -rw-r--r-- | pkg/ipc/ipcconfig/ipcconfig.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/ipc/ipcconfig/ipcconfig.go b/pkg/ipc/ipcconfig/ipcconfig.go index a99cbdadc..3791322f2 100644 --- a/pkg/ipc/ipcconfig/ipcconfig.go +++ b/pkg/ipc/ipcconfig/ipcconfig.go @@ -18,11 +18,14 @@ var ( flagSignal = flag.Bool("cover", false, "collect feedback signals (coverage)") flagSandbox = flag.String("sandbox", "none", "sandbox for fuzzing (none/setuid/namespace/android)") flagDebug = flag.Bool("debug", false, "debug output from executor") + flagSlowdown = flag.Int("slowdown", 1, "execution slowdown caused by emulation/instrumentation") ) func Default(target *prog.Target) (*ipc.Config, *ipc.ExecOpts, error) { + sysTarget := targets.Get(target.OS, target.Arch) c := &ipc.Config{ Executor: *flagExecutor, + Timeouts: sysTarget.Timeouts(*flagSlowdown), } if *flagSignal { c.Flags |= ipc.FlagSignal @@ -35,7 +38,6 @@ func Default(target *prog.Target) (*ipc.Config, *ipc.ExecOpts, error) { return nil, nil, err } c.Flags |= sandboxFlags - sysTarget := targets.Get(target.OS, target.Arch) c.UseShmem = sysTarget.ExecutorUsesShmem c.UseForkServer = sysTarget.ExecutorUsesForkServer opts := &ipc.ExecOpts{ |
