ede0c48554
Mark eventfd return code with RVAL_FD flag
...
* eventfd.c (do_eventfd): Set RVAL_FD flag in the return code.
2015-08-01 20:46:43 +00:00
28471d17f9
desc.c: move eventfd parsers to a separate file
...
* eventfd.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c.
2015-08-01 20:46:43 +00:00
73a4fa43f5
Update PERF_FLAG_* constants
...
* xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC,
provide fallback definitions.
2015-08-01 20:46:43 +00:00
0d60cf753e
desc.c: move perf_event_open parser to a separate file
...
* perf.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* desc.c (sys_perf_event_open): Move to perf.c.
2015-08-01 20:46:37 +00:00
Elvira Khabirova
2c217fd8e2
time.c: remove obsolete code from adjtimex parser
...
Linux versions 1.3.28 and below are not supported.
* time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove.
2015-08-01 16:52:43 +00:00
Elvira Khabirova
f9ce39d1e4
ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/
...
* ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in.
Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in.
Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in.
2015-08-01 16:52:43 +00:00
0c0453a1cb
tests/ppoll: replace SIGABRT with SIGHUP
...
Use SIGHUP instead of SIGABRT, the number of the former
is more portable across architectures.
* tests/ppoll.c (test2): Replace SIGABRT with SIGHUP.
* tests/ppoll.expected: Update regexp.
* tests/ppoll-v.expected: Likewise.
2015-08-01 16:52:13 +00:00
3b9d315e8c
decode_poll_exiting: reserve more space in output buffer
...
* poll.c (decode_poll_exiting): Reserve more space in output buffer.
2015-08-01 08:37:46 +00:00
d9fb450748
Cleanup poll/ppoll decoders
...
* poll.c (decode_poll): Split into print_pollfd, decode_poll_entering,
and decode_poll_exiting.
(sys_poll, sys_ppoll): Update callers.
* tests/ppoll.c: New file.
* tests/ppoll.expected: Likewise.
* tests/ppoll-v.expected: Likewise.
* tests/ppoll.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add ppoll.
(TESTS): Add ppoll.test.
(EXTRA_DIST): Add ppoll.expected and ppoll-v.expected.
* tests/.gitignore: Add ppoll.
2015-07-30 22:03:07 +00:00
c18b002fe9
poll: print timeout argument as int
...
* poll.c (sys_poll): Explicitly cast timeout argument to int.
2015-07-30 22:03:07 +00:00
811bda6225
stream.c: move poll and ppoll parsers to a separate file
...
* poll.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c.
2015-07-30 22:03:07 +00:00
80d5e012a1
Assume that <poll.h> is available
...
* configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h.
* pathtrace.c: Include <poll.h> unconditionally.
* stream.c: Likewise.
[HAVE_SYS_POLL_H]: Compile unconditionally.
[!HAVE_SYS_POLL_H]: Remove.
2015-07-30 22:03:07 +00:00
ea7ef9365f
tests: add oldselect.test
...
* tests/oldselect.c: New file.
* tests/oldselect.expected: Likewise.
* tests/oldselect.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add oldselect.
(TESTS): Add oldselect.test.
(EXTRA_DIST): Add oldselect.expected.
* tests/.gitignore: Add oldselect.
2015-07-30 22:03:07 +00:00
Elvira Khabirova
c44df3e3ca
Fix oldselect decoding on 64-bit architectures
...
As struct sel_arg_struct is an array of 32-bit values,
fetch it using an intermediate array on 64-bit architectures.
* desc.c (sys_oldselect): Rename args to long_args.
[SIZEOF_LONG == 4] Alias oldselect_args to long_args.
[SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args.
* linux/sh64/syscallent.h (oldselect): Remove.
2015-07-30 22:02:56 +00:00
52dc1506ab
net.c: use printaddr
...
* net.c (printsock, sys_recvfrom): Use printaddr.
2015-07-30 13:53:42 +00:00
Denys Vlasenko
383386de73
net.c: recvfrom fixes
...
This change fixes these three problems (before/after is shown):
On interrupted syscall, flags are not decoded:
-recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS
+recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS
If peer address is unavalable (example: anon sockets from socketpair()),
kernel returns socklen of 0, but we ignore that and show bogus sockaddr data:
-recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10
+recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10
SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock():
- printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
+ printsock(tcp, tcp->u_arg[4], fromlen);
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2015-07-30 13:38:32 +02:00
Elliott Hughes
1d246ce3d4
prctl: decode Android-specific PR_SET_VMA
...
Android kernels have a prctl to name VMAs.
* prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA.
2015-07-29 22:54:11 +00:00
0e4b1f2eb3
mips: fix stub files
...
This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.
* linux/mips/genstub.sh: Output SEN(printargs) instead of printargs.
Reported-by: Elliott Hughes <enh@google.com>
2015-07-29 22:54:11 +00:00
4e3ded36ef
tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc
...
* configure.ac: Check how union bpf_attr.log_buf initialization works.
* tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF.
2015-07-29 22:53:07 +00:00
3456bcca67
Implement sched_getattr and sched_setattr syscalls decoding
...
* xlat/sched_flags.in: New file.
* sched.c: Include "xlat/sched_flags.h".
(print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions.
* linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove.
* tests/sched_xetattr.c: New file.
* tests/sched_xetattr.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add sched_xetattr.
(TESTS): Add sched_xetattr.test.
* tests/.gitignore: Add sched_xetattr.
2015-07-29 09:18:26 +00:00
95b84ea641
Implement memfd_create syscall decoding
...
* memfd_create.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h (sys_memfd_create): Remove.
* pathtrace.c (pathtrace_match): Add SEN_memfd_create.
* xlat/memfd_create_flags.in: New file.
* tests/memfd_create.c: New file.
* tests/memfd_create.expected: Likewise.
* tests/memfd_create.test: New test.
* tests/Makefile.am: (check_PROGRAMS): Add memfd_create.
(TESTS): Add memfd_create.test.
(EXTRA_DIST): Add memfd_create.expected.
* tests/.gitignore: Add memfd_create.
2015-07-29 09:18:26 +00:00
Elliott Hughes
e46534351d
Fix builds where HAVE_MQUEUE_H isn't defined
...
Android doesn't have <mqueue.h>.
* ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation.
2015-07-28 22:40:01 +00:00
afa10d877c
tests/restart_syscall: skip if nanosleep looks uninterrupted
...
* tests/restart_syscall.test: Skip if restart_syscall is not detected
and nanosleep syscall looks uninterrupted.
2015-07-27 15:27:43 +00:00
7c2210190a
Implement execveat syscall decoding
...
* execve.c (decode_execve): New function.
(sys_execve): Use it.
(sys_execveat): New function.
* linux/dummy.h (sys_execveat): Remove.
* tests/execveat.c: New file.
* tests/execveat.expected: Likewise.
* tests/execveat-v.expected: Likewise.
* tests/execveat.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execveat.
(TESTS): Add execveat.test.
(EXTRA_DIST): Add execveat.expected and execveat-v.expected.
* tests/.gitignore: Add execveat.
2015-07-27 15:27:43 +00:00
4ff687bb31
execve: fix support of personalities with different word size
...
* execve.c (printargc): Do not assume that host and target pointers have
the same size.
* tests/execve.c: New file.
* tests/execve.expected: Likewise.
* tests/execve-v.expected: Likewise.
* tests/execve.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execve.
(TESTS): Add execve.test.
(EXTRA_DIST): Add execve.expected and execve-v.expected.
* tests/.gitignore: Add execve.
2015-07-27 15:27:43 +00:00
ddb53dd142
Implement bpf syscall decoding
...
* bpf.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h.
* linux/dummy.h (sys_bpf): Remove.
* pathtrace.c (pathtrace_match): Add SEN_bpf.
* xlat/bpf_commands.in: New file.
* xlat/bpf_map_types.in: New file.
* xlat/bpf_map_update_elem_flags.in: New file.
* xlat/bpf_prog_types.in: New file.
* tests/bpf.c: New file.
* tests/bpf.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add bpf.
(TESTS): Add bpf.test.
* tests/.gitignore: Add bpf.
2015-07-27 15:27:43 +00:00
3691562e7d
prctl: fix decoding of unrecognized commands
...
The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong:
when the first argument is already printed, printargs cannot be called.
* prctl.c (print_prctl_args): New function.
(sys_prctl): Use it.
2015-07-25 09:55:02 +00:00
f8b49133b7
Macroize -m32/-mx32 configure checks
...
Prepare for additional configure checks that would be needed
for new multiple personalities support.
* m4/mpers.m4: New file.
* configure.ac: Use it.
2015-07-23 11:39:32 +00:00
04fcb99972
tests/uid: import uid overflow check from tests/uid16
...
* tests/uid.c (main): Skip if the uid returned by getuid matches
/proc/sys/kernel/overflowuid.
2015-07-22 19:47:39 +00:00
ae61067ce6
sh64: fix inotify_{add,rm}_watch syscall entries
...
* linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch):
Set sys_func.
2015-07-21 19:09:35 +00:00
1e0efbb18d
microblaze: fix several syscall entries
...
* linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1,
dup3, pipe2, inotify_init1, recvmmsg): Set sys_func.
2015-07-21 19:09:35 +00:00
be547c19da
hppa: fix several syscall entries
...
* linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink,
mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr,
clock_nanosleep, signalfd, timerfd): Set sys_func.
2015-07-21 19:09:35 +00:00
d00eb1f58d
ia64: fix getpagesize syscall entry
...
* linux/ia64/syscallent.h (getpagesize): Fux nargs.
2015-07-21 19:09:35 +00:00
76c9f0ecb7
avr32: fix fstatat64 syscall entry
...
* linux/avr32/syscallent.h (fstatat64): Set sys_func.
2015-07-21 19:09:35 +00:00
ecabdcf959
alpha: fix 2 dummy osf syscall entries
...
* linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs.
(osf_sigstack): Fix nargs and sys_name.
2015-07-21 19:09:35 +00:00
82841f7e7e
alpha, arm, ia64, mips, sh64: fix semop syscall entries
...
* linux/alpha/syscallent.h (semop): Fix nargs, set sys_func.
* linux/ia64/syscallent.h (semop): Set sys_func.
* linux/mips/syscallent-n32.h (semop): Likewise.
* linux/mips/syscallent-n64.h (semop): Likewise.
* linux/arm/syscallent.h (semop): Fix nargs.
* linux/sh64/syscallent.h (semop): Likewise.
2015-07-21 19:09:35 +00:00
ece9ce6fea
m68k: fix getpagesize decoding
...
* linux/m68k/syscallent.h (getpagesize): Set sys_func.
* mem.c [M68K] (sys_getpagesize): Define.
2015-07-21 19:09:35 +00:00
f1548d93f1
tests/ip_mreq: skip if basic setsockopt operations fail
...
* tests/ip_mreq.c (main): Return 77 if basic
IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set.
2015-07-21 19:09:35 +00:00
95eaf19644
tests: use -lpthread instead of -pthread
...
On some obscure systems, -lpthread is more likely to work than -pthread.
* tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to
filter_unavailable_LDADD and change to -lpthread.
2015-07-21 19:09:35 +00:00
ce93bbdef1
mips o32: fix utimensat syscall entry
...
* linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func.
2015-07-21 19:09:35 +00:00
ba8b9556bb
linux/mips/syscallent-compat.h: use designated initializers
...
Change linux/mips/syscallent-compat.h to use designated initializers
like normal syscallent.h files.
* linux/mips/syscallent-compat.h: Use designated initializers.
2015-07-21 19:09:35 +00:00
a3eb3b410d
linux/mips/syscallent-compat.h: fix initalization of empty entries
...
This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.
* linux/mips/syscallent-compat.h: Fix initalization of empty entries.
2015-07-21 19:09:35 +00:00
716fb20263
Remove unused parsers of getmsg and putmsg
...
* stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove.
Stop including "xlat/msgflags.h".
* xlat/msgflags.in: Remove.
2015-07-20 22:41:56 +00:00
fa6c0879c7
sigreturn: make use of RVAL_DECODED
...
* sigreturn.c (arch_sigreturn): New function.
(sys_sigreturn): Use it. Return RVAL_DECODED.
* linux/alpha/arch_sigreturn.c: Update.
* linux/crisv10/arch_sigreturn.c: Likewise.
* linux/m68k/arch_sigreturn.c: Likewise.
* linux/microblaze/arch_sigreturn.c: Likewise.
* linux/x86_64/arch_sigreturn.c: Likewise.
2015-07-20 22:03:07 +00:00
eebb5616bf
or1k_atomic.c: make use of RVAL_DECODED
...
* or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
57ae04e402
Update openat parser for the RVAL_DECODED change
...
* open.c (sys_openat): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
d9e87921de
bjm.c: make use of RVAL_DECODED
...
* bjm.c (sys_create_module, sys_delete_module, sys_init_module,
sys_finit_module): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
0b2eabeed4
access.c: make use of RVAL_DECODED
...
* access.c (decode_access, sys_faccessat): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
8aa2a81233
affinity.c: make use of RVAL_DECODED
...
* affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
a52375f748
affinity.c: use printaddr and umove_or_printaddr
...
* affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr.
(sys_sched_getaffinity): Remove redundant u_rval check.
2015-07-20 22:03:07 +00:00