diff options
author | Michael Pratt <mpratt@google.com> | 2018-10-01 14:15:52 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-01 14:16:53 -0700 |
commit | 0400e5459288592768af12ab71609c6df6afe3d7 (patch) | |
tree | b8c522749a19aa467b62d097a6b58042d0f971d2 /pkg/sentry/strace/strace.go | |
parent | d185552e79e19bd25cdcf64c123712086c48ae58 (diff) |
Add itimer types to linux package, strace
PiperOrigin-RevId: 215278262
Change-Id: Icd10384c99802be6097be938196044386441e282
Diffstat (limited to 'pkg/sentry/strace/strace.go')
-rw-r--r-- | pkg/sentry/strace/strace.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/sentry/strace/strace.go b/pkg/sentry/strace/strace.go index 539e665d2..c99c33c33 100644 --- a/pkg/sentry/strace/strace.go +++ b/pkg/sentry/strace/strace.go @@ -24,6 +24,7 @@ import ( "syscall" "time" + "gvisor.googlesource.com/gvisor/pkg/abi" "gvisor.googlesource.com/gvisor/pkg/abi/linux" "gvisor.googlesource.com/gvisor/pkg/bits" "gvisor.googlesource.com/gvisor/pkg/eventchannel" @@ -46,6 +47,22 @@ var LogMaximumSize uint = DefaultLogMaximumSize // do anything useful with binary text dump of byte array arguments. var EventMaximumSize uint +// ItimerTypes are the possible itimer types. +var ItimerTypes = abi.ValueSet{ + { + Value: linux.ITIMER_REAL, + Name: "ITIMER_REAL", + }, + { + Value: linux.ITIMER_VIRTUAL, + Name: "ITIMER_VIRTUAL", + }, + { + Value: linux.ITIMER_PROF, + Name: "ITIMER_PROF", + }, +} + func iovecs(t *kernel.Task, addr usermem.Addr, iovcnt int, printContent bool, maxBytes uint64) string { if iovcnt < 0 || iovcnt > linux.UIO_MAXIOV { return fmt.Sprintf("%#x (error decoding iovecs: invalid iovcnt)", addr) @@ -322,6 +339,8 @@ func (i *SyscallInfo) pre(t *kernel.Task, args arch.SyscallArguments, maximumBlo output = append(output, futex(uint64(args[arg].Uint()))) case PtraceRequest: output = append(output, PtraceRequestSet.Parse(args[arg].Uint64())) + case ItimerType: + output = append(output, ItimerTypes.Parse(uint64(args[arg].Int()))) case Oct: output = append(output, "0o"+strconv.FormatUint(args[arg].Uint64(), 8)) case Hex: |