]>
granicus.if.org Git - strace/log
Dmitry V. Levin [Thu, 19 Nov 2015 16:39:32 +0000 (16:39 +0000)]
tests: rewrite getdents test in C for better coverage
* tests/getdents.awk: Remove.
* tests/getdents.out: Remove.
* tests/getdents.c: New file.
* tests/getdents.test: Rewrite.
* tests/getdents64.c: New file.
* tests/getdents64.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64.
(TESTS): Add getdents64.test.
(EXTRA_DIST): Remove getdents.awk and getdents.out.
* tests/.gitignore: Add getdents and getdents64.
Dmitry V. Levin [Thu, 19 Nov 2015 19:04:32 +0000 (19:04 +0000)]
tests: add readdir.test
* tests/readdir.c: New file.
* tests/readdir.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add readdir.
(TESTS): Add readdir.test.
* tests/.gitignore: Add readdir.
Dmitry V. Levin [Thu, 19 Nov 2015 18:13:53 +0000 (18:13 +0000)]
Mpersify parsers of readdir and getdents syscalls
* defs.h (dirent_types): New xlat prototype.
* dirent.c: Stop including "xlat/direnttypes.h".
(kernel_dirent): New typedef. Mpersify it.
(print_old_dirent): Use it instead of old_dirent_t.
(SYS_FUNC(getdents)): Use it instead of struct kernel_dirent.
Rename direnttypes to dirent_types.
(SYS_FUNC(getdents64)): Move ...
* dirent64.c: ... here. Rename direnttypes to dirent_types.
Include "xlat/dirent_types.h".
* Makefile.am (strace_SOURCES): Add dirent64.c.
* xlat/direnttypes.in: Rename to xlat/dirent_types.in.
Gabriel Laskar [Thu, 19 Nov 2015 10:44:30 +0000 (11:44 +0100)]
getdents: fix typos in array output
Array should be enclosed by square brakets, and elements should be
separated by commas.
* dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos
in array output.
* tests/getdents.awk: Update regexps to match fixed output.
* tests/getdents.out: Update output.
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Dmitry V. Levin [Thu, 19 Nov 2015 00:29:19 +0000 (00:29 +0000)]
printcmsghdr: move type and data decoders to a separate function
* net.c (print_scm_rights, print_scm_creds, print_scm_security): Change
to return void. Move printing of struct cmsghdr closing '}' ...
(printcmsghdr): ... here. Move type and data decoders to ...
(print_cmsg_type_data): ... new function.
Dmitry V. Levin [Wed, 18 Nov 2015 23:18:17 +0000 (23:18 +0000)]
Assume that libc provides sendmsg
Starting with commit
v4.6-281-g7af9f35 , we implicitly assume that
HAVE_SENDMSG is always defined. Therefore, the check for sendmsg
availability is redundant and could be safely removed.
* configure.ac (AC_CHECK_FUNCS): Remove sendmsg.
* linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove
stub aliases.
* net.c [HAVE_SENDMSG]: Define unconditionally.
* syscall.c (dumpio) [HAVE_SENDMSG]: Likewise.
Dmitry V. Levin [Wed, 18 Nov 2015 23:11:34 +0000 (23:11 +0000)]
net.c: move fallback definition of SCM_SECURITY to xlat/
* net.c: Move fallback definition of SCM_SECURITY ...
* xlat/scmvals.in: ... here.
Dmitry V. Levin [Sun, 15 Nov 2015 02:35:57 +0000 (02:35 +0000)]
Implement mlock2 syscall decoding
* mem.c: Include "xlat/mlock_flags.h".
(SYS_FUNC(mlock2)): New function.
* xlat/mlock_flags.in: New file.
* xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values.
* linux/dummy.h (mlock2): Remove.
* tests/mlock2.c: New file.
* tests/mlock2.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add mlock2.
(TESTS): Add mlock2.test.
* tests/.gitignore Add mlock2.
Dmitry V. Levin [Sun, 15 Nov 2015 02:29:29 +0000 (02:29 +0000)]
Implement membarrier syscall decoding
* membarrier.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/membarrier_cmds.in: New file.
* linux/dummy.h (membarrier): Remove.
* tests/membarrier.c: New file.
* tests/membarrier.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add membarrier.
(TESTS): Add membarrier.test.
* tests/.gitignore: Add membarrier.
Dmitry V. Levin [Sun, 15 Nov 2015 02:22:44 +0000 (02:22 +0000)]
Implement userfaultfd syscall decoding
* userfaultfd.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/uffd_flags.in: New file.
* linux/dummy.h (userfaultfd): Remove.
* tests/userfaultfd.c: New file.
* tests/userfaultfd.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add userfaultfd.
(TESTS): Add userfaultfd.test.
* tests/.gitignore: Add userfaultfd.
Dmitry V. Levin [Sun, 15 Nov 2015 16:57:15 +0000 (16:57 +0000)]
ia64: wire up kcmp syscall
ia64 has kcmp syscall starting with linux kernel commit
v4.3-rc7-1-gd305c47 .
* linux/ia64/syscallent.h (kcmp): New entry.
Dmitry V. Levin [Sun, 15 Nov 2015 02:49:03 +0000 (02:49 +0000)]
powerpc: wire up direct sysv ipc syscalls
Starting with linux commit
v4.3-rc3-33-ga342361 , powerpc has
direct sysv ipc syscalls in addition to traditional ipc syscall.
* linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd,
msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries.
Dmitry V. Levin [Sun, 15 Nov 2015 02:37:51 +0000 (02:37 +0000)]
Wire up userfaultfd, membarrier, and mlock2 syscalls
* linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases.
* linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries.
* linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise.
* linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise.
* linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise.
* linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
* linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
Dmitry V. Levin [Sun, 15 Nov 2015 20:44:13 +0000 (20:44 +0000)]
sprintflags: skip zero flags
Tweak sprintflags behaviour to match printflags.
* util.c (sprintflags): Skip zero flags unless the value passed
to sprintflags is also zero.
Mike Frysinger [Sat, 31 Oct 2015 04:47:59 +0000 (00:47 -0400)]
printflags: handle empty xlats
If the set of headers are unable to produce a valid list, printflags
will try to pass NULL to tprints which crashes. Add a sanity check
for this edge case.
* util.c (printflags): Check xlat->str is not NULL.
Dmitry V. Levin [Mon, 16 Nov 2015 01:12:18 +0000 (01:12 +0000)]
mpers: forward mpers_DEFS to mpers.sh
mpers_DEFS has to be forwarded to mpers.sh so that config.h would be
properly included by defs.h at preprocessor stage.
* Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of
options to mpers.sh's CPPFLAGS.
Dmitry V. Levin [Mon, 16 Nov 2015 01:53:43 +0000 (01:53 +0000)]
tests/ioctl: workaround glibc ioctl wrapper on powerpc
* tests/ioctl.c (main) [POWERPC] Disable TCGETS test.
Dmitry V. Levin [Sun, 15 Nov 2015 16:51:55 +0000 (16:51 +0000)]
powerpc: wire up switch_endian syscall
powerpc has switch_endian syscall starting with linux commit
v4.0-rc4-67-g529d235 .
* linux/powerpc/syscallent.h (switch_endian): New entry.
Dmitry V. Levin [Sun, 15 Nov 2015 16:48:50 +0000 (16:48 +0000)]
sparc: reserve more space for new syscalls
Move socket subcalls further down the table to make room
for new syscalls.
* linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400.
Dmitry V. Levin [Sun, 15 Nov 2015 01:46:51 +0000 (01:46 +0000)]
m68k: wire up direct socket syscalls
Starting with linux commit
v4.3-rc3-1-g5b3f33e , m68k has direct
socket syscalls in addition to traditional socketcall syscall.
* linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen,
accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries.
Dmitry V. Levin [Sun, 15 Nov 2015 01:40:26 +0000 (01:40 +0000)]
i386: wire up direct socket syscalls
Starting with linux commit
v4.2-rc1-64-g9dea5dc , x86 has direct
socket syscalls in addition to traditional socketcall syscall.
* linux/i386/syscallent.h (socket, socketpair, bind, connect, listen,
accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
sendmsg, recvfrom, recvmsg, shutdown): New entries.
Heiko Carstens [Tue, 10 Nov 2015 11:39:41 +0000 (12:39 +0100)]
s390, s390x: update syscall tables
* linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0.
* linux/s390x/syscallent.h: Likewise.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Dmitry V. Levin [Sat, 7 Nov 2015 23:22:24 +0000 (23:22 +0000)]
Fix *_printer_defs.h rules ambiguousness
There is an ambiguousness in *_printer_defs.h rules definition:
$ grep '^[^ ]*_defs\.h: ' Makefile.am
m%_defs.h: $(srcdir_mpers_source_files)
%_printer_defs.h: $(srcdir_mpers_source_files)
While it appears to work with GNU make, it has to be fixed nevertheless.
* Makefile.am (m%_defs.h): Rename to m%_type_defs.h.
(mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h.
(mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h.
* mpers_type.h: Rename m32_defs.h to m32_type_defs.h,
mx32_defs.h to mx32_type_defs.h.
* .gitignore: Likewise.
Reported-by: Elliott Hughes <enh@google.com>
Dmitry V. Levin [Fri, 9 Oct 2015 01:55:46 +0000 (01:55 +0000)]
fcntl.c: make use of RVAL_DECODED
* fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations.
Dmitry V. Levin [Thu, 1 Oct 2015 12:24:01 +0000 (12:24 +0000)]
desc.c: move parser of fcntl syscall to a separate file
* fcntl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c.
Dmitry V. Levin [Thu, 1 Oct 2015 12:20:11 +0000 (12:20 +0000)]
desc.c: move parser of flock syscall to a separate file
* flock.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* desc.c (SYS_FUNC(flock)): Move to flock.c.
Dmitry V. Levin [Thu, 8 Oct 2015 14:44:15 +0000 (14:44 +0000)]
tests: fix false uio.test failures
* tests/uio.c (main): Use descriptor number 0 in pread/pwrite
and preadv/pwritev syscalls.
* tests/uio.expected: Update regexps.
Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Gabriel Laskar [Thu, 1 Oct 2015 12:49:25 +0000 (14:49 +0200)]
Fix make -j builds
In files generated by mpers scripts, includes directives are taken from
original files where the type definition was done. This causes to
include defs.h in multiple files. defs.h includes printers.h header,
which is a generated header.
This patch add an explicit dependency to printers.h for the mpers
scripts.
* Makefile.am (mpers-m%.stamp): Add printers.h to order-only
prerequisites.
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Mike Frysinger [Tue, 29 Sep 2015 19:02:35 +0000 (15:02 -0400)]
mpers: fix shell code to conform better to POSIX
The `echo -n` behavior is non-portable, so use printf instead.
* generate_mpers_am.sh: Change `echo -n` to `printf`.
Gabriel Laskar [Wed, 23 Sep 2015 08:11:55 +0000 (10:11 +0200)]
ioctl: fix ioctl command number decoding in case of conflicts
When a command number was decoded through ioctl_decode_command_number(),
there was no check for conflicts with other potential ioctls numbers.
For example:
ioctl(fd, MCE_GET_RECORD_LEN, &i);
output:
ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0
instead of:
ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0
* ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding
in case of conflicts.
* tests/ioctl.c (main): Add a case for command number conflicts.
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Tue, 22 Sep 2015 21:22:37 +0000 (21:22 +0000)]
tests: convert ioctl.test from match_grep to match_diff
* tests/ioctl.c (main): Print expected output.
* tests/ioctl.test: Use match_diff instead of match_grep.
* tests/ioctl.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected.
Dmitry V. Levin [Sat, 19 Sep 2015 21:28:23 +0000 (21:28 +0000)]
Convert parser of seccomp filter program to new mpers infrastructure
* seccomp_fprog.h: New file.
* fetch_seccomp_fprog.c: New file.
* Makefile.am (strace_SOURCES): Add them.
* seccomp.c: Include "seccomp_fprog.h".
(print_seccomp_filter): Use fetch_seccomp_fprog.
Dmitry V. Levin [Sat, 19 Sep 2015 00:11:07 +0000 (00:11 +0000)]
tests/init.sh: enhance match_grep error diagnostics
* tests/init.sh (match_grep): Check patterns one by one,
output only those patterns that didn't match.
Dmitry V. Levin [Sat, 19 Sep 2015 00:01:35 +0000 (00:01 +0000)]
tests/init.sh: fix comment
* tests/init.sh (match_awk): Fix usage description.
Dmitry V. Levin [Fri, 18 Sep 2015 21:54:52 +0000 (21:54 +0000)]
tests: add one more case to select.test
* tests/select.c (main): Check how timeout is printed
on exiting syscall.
Dmitry V. Levin [Fri, 18 Sep 2015 21:45:36 +0000 (21:45 +0000)]
tests: uncouple pselect6 from select.test
* tests/select.c Do not include <string.h>.
Include <sys/syscall.h>.
[!__NR_select]: Skip the test.
(main): Remove pselect6 support, test just select syscall.
* tests/select.test: Remove all pselect6 checks, test just
select syscall.
Dmitry V. Levin [Fri, 18 Sep 2015 21:37:09 +0000 (21:37 +0000)]
tests: robustify select test
* tests/select.c: Do not include <assert.h>.
(main): Skip the test instead of assertions.
Add some padding to the timeval structure.
Dmitry V. Levin [Fri, 18 Sep 2015 21:20:56 +0000 (21:20 +0000)]
tests: add one more case to pselect6.test
* tests/pselect6.c (main): Check how timeout is printed
on exiting syscall.
Dmitry V. Levin [Fri, 18 Sep 2015 21:20:56 +0000 (21:20 +0000)]
tests: robustify pselect6 test
* tests/pselect6.c: Do not include <assert.h> and <string.h>.
Include <sys/syscall.h>.
[!__NR_pselect6]: Skip the test.
(main): Skip the test instead of assertions.
Add some padding to the timespec structure.
Dmitry V. Levin [Fri, 18 Sep 2015 18:02:50 +0000 (18:02 +0000)]
Convert another parser of struct timeval to new mpers infrastructure
* print_time.c (sprint_timeval): New mpers printer.
[ALPHA] (sprint_timeval32): New function.
* defs.h [ALPHA] (sprint_timeval32): New prototype.
(bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove.
* desc.c (decode_select): Replace bitness parameter with two printers.
Use them instead of printtv_bitness and sprinttv.
(sys_oldselect, sys_select): Pass print_timeval and sprint_timeval
to decode_select.
[ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32
to decode_select.
(pselect6): Pass print_timespec and sprint_timespec to decode_select.
* time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat,
struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove.
Dmitry V. Levin [Fri, 18 Sep 2015 17:44:16 +0000 (17:44 +0000)]
Convert another parser of struct timespec to new mpers infrastructure
* print_time.c (sprint_timespec): New mpers printer.
* defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
(sprint_timespec): Remove.
* time.c (sprint_timespec): Remove.
* net.c (sys_recvmmsg): Update callers.
* poll.c (decode_poll_exiting): Likewise.
Dmitry V. Levin [Fri, 18 Sep 2015 17:05:35 +0000 (17:05 +0000)]
tests: add another case to pselect6 test
* tests/pselect6.c: Include <sys/time.h>.
(handler): New function.
(main): Install an interval timer.
Use it to check how ERESTARTNOHAND is printed.
Dmitry V. Levin [Fri, 18 Sep 2015 16:15:49 +0000 (16:15 +0000)]
Fix decoding of gettimeofday and settimeofday
* time.c (print_timezone): new function.
(sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval
to print struct timezone.
[ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it
instead of print_timeval32 to print struct timezone.
* tests/xettimeofday.c: New file.
* tests/xettimeofday.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add xettimeofday.
(TESTS): Add xettimeofday.
* tests/.gitignore: Add xettimeofday.
Dmitry V. Levin [Fri, 18 Sep 2015 15:16:11 +0000 (15:16 +0000)]
Convert parser of struct timeval to new mpers infrastructure
* defs.h (printtv, printtv_special): Remove.
[ALPHA] (print_timeval32, print_timeval32_pair): New prototypes.
* print_time.c (print_timeval): New mpers printer.
[ALPHA] (print_timeval32, print_timeval32_pair): New functions.
* time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval
instead of printtv.
[ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday):
Use print_timeval32 instead of printtv_bitness.
* utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair
instead of printtv_bitness.
Dmitry V. Levin [Fri, 18 Sep 2015 15:16:11 +0000 (15:16 +0000)]
Convert parser of struct timespec to new mpers infrastructure
* defs.h (print_timespec): Remove.
* print_time.c (print_timespec): New mpers printer.
* futex.c (sys_futex): Use print_timespec instead of printtv.
* ipc_sem.c (sys_semtimedop): Likewise.
* mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise.
* time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise.
(print_timespec): Remove.
Dmitry V. Levin [Fri, 18 Sep 2015 15:47:29 +0000 (15:47 +0000)]
Remove unused parser of adjtime syscall
* time.c (sys_adjtime): Remove.
Dmitry V. Levin [Fri, 18 Sep 2015 14:24:51 +0000 (14:24 +0000)]
Fix decoding of clock_nanosleep
* time.c (sys_clock_nanosleep): Use is_erestart,
temporarily_clear_syserror, and restore_cleared_syserror.
* tests/clock_nanosleep.c: New file.
* tests/clock_nanosleep.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep.
(TESTS): Add clock_nanosleep.test.
* tests/.gitignore: Add clock_nanosleep.
Dmitry V. Levin [Fri, 18 Sep 2015 01:54:59 +0000 (01:54 +0000)]
Add is_erestart helper function
* defs.h (is_erestart): New prototype.
* syscall.c (is_erestart): New function.
* time.c (sys_nanosleep): Use is_erestart,
temporarily_clear_syserror, and restore_cleared_syserror.
Dmitry V. Levin [Fri, 18 Sep 2015 01:54:59 +0000 (01:54 +0000)]
Add helper functions to clear/restore syserror
* defs.h (temporarily_clear_syserror, restore_cleared_syserror):
New prototypes.
* syscall.c (saved_u_error): New variable.
(temporarily_clear_syserror, restore_cleared_syserror): New functions.
* aio.c (sys_io_getevents): Use temporarily_clear_syserror
and restore_cleared_syserror.
* mq.c (sys_mq_timedreceive): Likewise.
* signal.c (sys_rt_sigtimedwait): Likewise.
Dmitry V. Levin [Fri, 18 Sep 2015 02:18:03 +0000 (02:18 +0000)]
tests: add nanosleep.test
* tests/nanosleep.c: New file.
* tests/nanosleep.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add nanosleep.
(TESTS): Add nanosleep.test.
* tests/.gitignore: Add nanosleep.
Dmitry V. Levin [Fri, 18 Sep 2015 11:27:11 +0000 (11:27 +0000)]
tests: rewrite restart_syscall in C
* tests/restart_syscall.c: New file.
* tests/restart_syscall.expected: Remove.
* tests/restart_syscall_unknown.expected: Remove.
* tests/restart_syscall.test: Update to use restart_syscall.
* tests/Makefile.am (check_PROGRAMS): Add restart_syscall.
(EXTRA_DIST): Remove restart_syscall.expected
and restart_syscall_unknown.expected.
* tests/.gitignore: Add restart_syscall.
Dmitry V. Levin [Fri, 18 Sep 2015 13:04:02 +0000 (13:04 +0000)]
Properly initialize siginfo_t object passed to print_stopped function
* strace.c (trace): Clear the whole siginfo_t variable before passing it
to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a
part of the structure.
Dmitry V. Levin [Thu, 17 Sep 2015 21:57:22 +0000 (21:57 +0000)]
tests: add clock_xettime.test
* tests/clock_xettime.c: New file.
* tests/clock_xettime.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add clock_xettime.
(TESTS): Add clock_xettime.test.
* tests/.gitignore: Add clock_xettime.
Dmitry V. Levin [Thu, 17 Sep 2015 20:23:31 +0000 (20:23 +0000)]
Convert parser of struct itimerval to new mpers infrastructure
* defs.h [ALPHA] (print_itimerval32): New prototype.
* print_time.c (print_itimerval): New mpers printer.
[ALPHA] (timeval32_t): New typedef.
[ALPHA] (print_timeval32_t, print_itimerval32): New functions.
* time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead
of printitv.
[ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32
instead of printitv_bitness.
(tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove.
Dmitry V. Levin [Thu, 17 Sep 2015 20:44:22 +0000 (20:44 +0000)]
tests: add xetitimer.test
* tests/xetitimer.c: New file.
* tests/xetitimer.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add xetitimer.
(TESTS): Add xetitimer.test.
* tests/.gitignore: Add xetitimer.
Dmitry V. Levin [Thu, 17 Sep 2015 16:47:03 +0000 (16:47 +0000)]
Convert parser of struct itimerspec to new mpers infrastructure
* print_time.c (print_itimerspec): New mpers printer.
* time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd,
sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv.
Dmitry V. Levin [Thu, 17 Sep 2015 16:47:03 +0000 (16:47 +0000)]
print_time.c: introduce print_timespec_t helper
* print_time.c (time_fmt): New constant string.
(print_timeval_t): Use it.
(print_timespec_t): New function.
(print_timespec_t_utime): Use it.
Dmitry V. Levin [Thu, 17 Sep 2015 20:05:20 +0000 (20:05 +0000)]
tests: add timerfd_xettime.test
* tests/timerfd_xettime.c: New file.
* tests/timerfd_xettime.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime.
(TESTS): Add timerfd_xettime.test.
* tests/.gitignore: Add timerfd_xettime.
Dmitry V. Levin [Thu, 17 Sep 2015 18:25:12 +0000 (18:25 +0000)]
tests: add timer_xettime.test
* tests/timer_xettime.c: New file.
* tests/timer_xettime.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add timer_xettime.
(TESTS): Add timer_xettime.test.
* tests/.gitignore: Add timer_xettime.
Dmitry V. Levin [Thu, 17 Sep 2015 16:10:53 +0000 (16:10 +0000)]
time.c: move parser of time syscall to print_time.c
* time.c (current_time_t_is_int32): Remove.
(sys_time): Move ...
* print_time.c: ... here. Mpersify time_t.
Dmitry V. Levin [Thu, 17 Sep 2015 15:12:42 +0000 (15:12 +0000)]
print_time.c: remove unused function parameters
* print_time.c (print_timespec_t_utime, print_timeval_t): Remove
"struct tcb *" parameter.
(print_timespec_utime_pair, print_timeval_pair): Update callers.
Dmitry V. Levin [Wed, 16 Sep 2015 23:15:55 +0000 (23:15 +0000)]
Add struct timex.tai support
* configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai.
* print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field.
* tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise.
Dmitry V. Levin [Wed, 16 Sep 2015 21:58:36 +0000 (21:58 +0000)]
Convert parser of struct timex to new mpers infrastructure
* defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes.
* print_timex.c (struct_timex): New typedef. Mpersify it.
[IN_MPERS]: Do not include "xlat/adjtimex_modes.h"
and "xlat/adjtimex_status.h".
[SUPPORTED_PERSONALITIES > 1]: Remove.
(tprint_timeval): Remove.
(tprint_timex): Rename to print_timex. Mpersify it.
* time.c (do_adjtimex): Rename tprint_timex to print_timex.
* tests/adjtimex.c: New file.
* tests/adjtimex.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add adjtimex.
(TESTS): Add adjtimex.test.
* tests/.gitignore: Add adjtimex.
Dmitry V. Levin [Wed, 16 Sep 2015 21:47:48 +0000 (21:47 +0000)]
Move parser of struct timex to a separate file
* print_timex.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* time.c (tprint_timex32, tprint_timex): Move to print_timex.c.
Dmitry V. Levin [Wed, 16 Sep 2015 16:31:43 +0000 (16:31 +0000)]
Enhance parser of struct sigevent
* print_sigevent.c (print_sigevent): Always print names
of struct_sigevent fields along with their values.
Print signal name of sigev_signo for those sigev_notify values
that require valid signal numbers.
* tests/timer_create.c: New file.
* tests/timer_create.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add timer_create.
(TESTS): Add timer_create.test.
* tests/.gitignore: Add timer_create.
Dmitry V. Levin [Wed, 16 Sep 2015 16:31:43 +0000 (16:31 +0000)]
Convert parser of struct sigevent to new mpers infrastructure
* defs.h (sigev_value): New prototype.
(printsigevent): Remove.
* print_sigevent.c (struct_sigevent): New typedef. Mpersify it.
[IN_MPERS]: Do not include "xlat/sigev_value.h".
(printsigevent32): Remove.
(printsigevent): Rename to print_sigevent. Mpersify it.
* mq.c (sys_mq_notify): Rename printsigevent to print_sigevent.
* time.c (sys_timer_create): Likewise.
Dmitry V. Levin [Wed, 16 Sep 2015 18:05:43 +0000 (18:05 +0000)]
Move parser of struct sigevent to a separate file
* print_sigevent.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* time.c (printsigevent32, printsigevent): Move to print_sigevent.c.
Dmitry V. Levin [Wed, 16 Sep 2015 12:09:52 +0000 (12:09 +0000)]
time.c: move fallback definitions of SIGEV_* values to xlat/
* time.c: Move fallback definitions of SIGEV_* values ...
* xlat/sigev_value.in: ... here.
Dmitry V. Levin [Tue, 15 Sep 2015 21:51:15 +0000 (21:51 +0000)]
Simplify use of mpers printers
* native_defs.h: New file.
* syscall.c: Include it.
* mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h".
* defs.h (MPERS_PRINTER_NAME): Remove.
[SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ...
* Makefile.am (printers.h): ... here.
Add macro definitions for mpers printers.
(m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion
of "$(mpers_PREFIX)printer_decls.h".
(strace_SOURCES): Add native_defs.h.
* README-mpers: Update instructions for using mpers printers.
* ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly.
* mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly.
* process.c (sys_ptrace): Call printsiginfo_at directly.
* signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise.
* resource.c (sys_getrusage): Call printrusage directly.
* utimes.c (sys_utimensat): Call print_timespec_utime_pair directly.
(sys_utimes, sys_futimesat): Call print_timeval_pair directly.
* wait.c (printwaitn): Call printrusage directly.
(sys_waitid): Call printrusage and printsiginfo_at directly.
Dmitry V. Levin [Tue, 15 Sep 2015 02:17:32 +0000 (02:17 +0000)]
Add a new helper function umove_ulong_array_or_printaddr
* defs.h (umove_ulong_array_or_printaddr): New prototype.
* util.c (umove_ulong_array_or_printaddr): New function.
* desc.c (sys_pselect6): Use it instead of open-coding
a proxy struct parser for different personalities.
* io.c (tprint_iov_upto): Use it instead of open-coding
a struct iovec parser for different personalities.
* kexec.c (print_kexec_segments): Use it instead of open-coding
a struct kexec_segment parser for different personalities.
(print_seg): Pass arguments using an array.
Dmitry V. Levin [Tue, 15 Sep 2015 02:14:38 +0000 (02:14 +0000)]
tests: add pselect6.test
* tests/pselect6.c: New file.
* tests/pselect6.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add pselect6.
(TESTS): Add pselect6.test.
* tests/.gitignore: Add pselect6.
Dmitry V. Levin [Mon, 14 Sep 2015 23:02:29 +0000 (23:02 +0000)]
Rename umove_long_or_printaddr to umove_ulong_or_printaddr
Rename the recently added function to reflect what kind of data type
it actually deals with: unsigned long int, without sign extension.
* defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr,
chage 3rd argument to unsigned long *.
* util.c (umove_long_or_printaddr): Likewise.
* aio.c (sys_io_submit): Update callers.
Dmitry V. Levin [Mon, 14 Sep 2015 22:33:23 +0000 (22:33 +0000)]
aarch64, ppc64, sparc64, tile: hook up mpers printers
* defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS,
PERSONALITY0_INCLUDE_PRINTERS_DECLS,
and PERSONALITY0_INCLUDE_PRINTERS_DEFS.
[POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS,
PERSONALITY1_INCLUDE_PRINTERS_DECLS,
and PERSONALITY1_INCLUDE_PRINTERS_DEFS.
[SPARC64 && HAVE_M32_MPERS]: Likewise.
[TILE && HAVE_M32_MPERS]: Likewise.
Anton Blanchard [Tue, 1 Sep 2015 21:55:37 +0000 (07:55 +1000)]
Add PowerPC specific ptrace constants
* xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants.
Dmitry V. Levin [Mon, 14 Sep 2015 17:24:09 +0000 (17:24 +0000)]
Update SCTP_* constants
* xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF,
SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO,
SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3,
and SCTP_GET_ASSOC_STATS.
Dmitry V. Levin [Mon, 14 Sep 2015 17:21:10 +0000 (17:21 +0000)]
Update F_* constants
* xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS,
and F_GET_SEALS.
Dmitry V. Levin [Mon, 14 Sep 2015 17:16:32 +0000 (17:16 +0000)]
Update RENAME_* constants
* xlat/rename_flags.in: Add RENAME_WHITEOUT.
Dmitry V. Levin [Mon, 14 Sep 2015 17:04:22 +0000 (17:04 +0000)]
Update SO_* constants
* xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS,
SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU,
SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL,
SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS.
Dmitry V. Levin [Mon, 14 Sep 2015 16:20:25 +0000 (16:20 +0000)]
Update INPUT_PROP_* constants
* xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER.
Dmitry V. Levin [Mon, 14 Sep 2015 16:19:25 +0000 (16:19 +0000)]
Update KEY_* constants
* xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A,
KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D.
Dmitry V. Levin [Mon, 14 Sep 2015 16:04:17 +0000 (16:04 +0000)]
Update FALLOC_FL_* constants
* xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE.
Dmitry V. Levin [Mon, 14 Sep 2015 16:00:39 +0000 (16:00 +0000)]
Update AF_* and PF_* constants
* xlat/addrfams.in: Add AF_IB and AF_MPLS.
* xlat/domains.in: Add PF_IB and PF_MPLS.
Dmitry V. Levin [Mon, 14 Sep 2015 15:50:44 +0000 (15:50 +0000)]
Update TCP_* constants
* xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO,
TCP_SAVE_SYN, and TCP_SAVED_SYN.
Dmitry V. Levin [Mon, 14 Sep 2015 15:46:47 +0000 (15:46 +0000)]
Update PACKET_* constants
* xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP,
PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS,
PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA.
Dmitry V. Levin [Mon, 14 Sep 2015 15:40:17 +0000 (15:40 +0000)]
Update BPF_MAP_TYPE_* constants
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY.
Dmitry V. Levin [Mon, 14 Sep 2015 15:29:41 +0000 (15:29 +0000)]
Update IPPROTO_* constants
* xlat/inet_protocols.in: Add IPPROTO_MPLS.
Dmitry V. Levin [Mon, 14 Sep 2015 15:01:02 +0000 (15:01 +0000)]
Update IP_* constants
* xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT.
Dmitry V. Levin [Mon, 14 Sep 2015 14:42:28 +0000 (14:42 +0000)]
Update PTRACE_O_* constants
* ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP.
* xlat/ptrace_setoptions_flags.in: Add it.
Dmitry V. Levin [Mon, 14 Sep 2015 13:25:24 +0000 (13:25 +0000)]
Update PR_* constants
* xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE,
and PR_CAP_AMBIENT.
Dmitry V. Levin [Mon, 14 Sep 2015 13:21:01 +0000 (13:21 +0000)]
Update SECBIT_* constants
* xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE
and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED.
Dmitry V. Levin [Thu, 27 Aug 2015 19:51:05 +0000 (19:51 +0000)]
mpers.m4: workaround missing gnu/stubs-*.h files
On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation
checks fail. As we want to support multiple personalities despite of
this limitation, workaround the check by creating empty gnu stub files
if necessary.
* m4/mpers.m4 (st_MPERS): Check for the gnu stub file. Create an empty
gnu stub file if the system one is missing.
* Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h.
Elvira Khabirova [Thu, 20 Aug 2015 21:09:32 +0000 (00:09 +0300)]
tests: add times-fail.test
* tests/times-fail.c: New file.
* tests/times-fail.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add times-fail.
(TESTS): Add times-fail.test.
* tests/.gitignore: Add times-fail.
Eugene Syromyatnikov [Tue, 4 Aug 2015 12:52:55 +0000 (15:52 +0300)]
tests: add times.test
* tests/times.c: New file.
* tests/times.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add times.
(TESTS): Add times.test.
(times_LDADD): Define.
* tests/.gitignore: Add times.
Elvira Khabirova [Mon, 3 Aug 2015 04:26:53 +0000 (07:26 +0300)]
Mpersify parser of times syscall
Fix multiple personalities support in parser of times syscall by
mpersifying struct tms.
* times.c (tms_t): New typedef. Mpersify it.
(sys_times): Use it instead of struct tms.
Elvira Khabirova [Mon, 3 Aug 2015 03:30:49 +0000 (06:30 +0300)]
tests: add sysinfo.test
* tests/sysinfo.c: New file.
* tests/sysinfo.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add sysinfo.
(TESTS): Add sysinfo.test.
* tests/.gitignore: Add sysinfo.
Elvira Khabirova [Mon, 3 Aug 2015 03:27:48 +0000 (06:27 +0300)]
Mpersify parser of sysinfo syscall
Fix multiple personalities support in parser of sysinfo syscall by
mpersifying struct sysinfo.
* sysinfo.c (sysinfo_t): New typedef. Mpersify it.
(sys_sysinfo): Use it instead of struct sysinfo.
Elvira Khabirova [Mon, 17 Aug 2015 23:01:26 +0000 (02:01 +0300)]
Enhance msgctl syscall decoding
Make parser of msgctl syscall print struct msqid_ds.
* ipc_msgctl.c (msqid_ds_t): New typedef. Mpersify it.
(print_msqid_ds): New function. Use msqid_ds_t.
(sys_msgctl): Use print_msqid_ds.
* tests/ipc_msg.c: Update for struct msqid_ds support.
Elvira Khabirova [Fri, 31 Jul 2015 15:43:21 +0000 (18:43 +0300)]
Enhance shmctl syscall decoding
Make parser of shmctl syscall print struct shmid_ds.
* ipc_shmctl.c (shmid_ds_t): New typedef. Mpersify it.
(print_shmid_ds): New function. Use shmid_ds_t.
(sys_shmctl): Use print_shmid_ds.
* tests/ipc_shm.c: Update for struct shmid_ds support.
Elvira Khabirova [Mon, 3 Aug 2015 09:40:46 +0000 (12:40 +0300)]
tests: add ipc_msgbuf.test
* tests/ipc_msgbuf.c: New file.
* tests/ipc_msgbuf.expected: Likewise.
* tests/ipc_msgbuf.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf.
(TESTS): Add ipc_msgbuf.test.
(EXTRA_DIST): Add ipc_msgbuf.expected.
* tests/.gitignore: Add ipc_msgbuf.
Elvira Khabirova [Wed, 19 Aug 2015 02:33:34 +0000 (05:33 +0300)]
Mpersify tprint_msgsnd and tprint_msgrcv
Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv
by converting tprint_msgbuf into a mpersified printer.
* print_msgbuf.c (msgbuf_t): New typedef. Mpersify it.
(tprint_msgbuf): Use it instead of long.
Wrap function name into MPERS_PRINTER_DECL.
* ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified
tprint_msgbuf.