4583 Commits

Author SHA1 Message Date
5cc7036061 tests: use VERBOSE macro in wait4 and wait4-v tests
* tests/wait4-v.c (VERBOSE_RUSAGE): Remove.
(VERBOSE): Define to 1.
* tests/wait4.c (sprint_rusage): Check VERBOSE instead
of VERBOSE_RUSAGE.
2016-09-26 15:24:26 +00:00
074c630705 tests: use VERBOSE macro in msg_control and msg_control-v tests
* tests/msg_control-v.c (VERBOSE_MSGHDR): Remove.
(VERBOSE): Define to 1.
* tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead
of VERBOSE_MSGHDR.
2016-09-26 15:24:25 +00:00
0c5b09c658 tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests
* tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove.
(VERBOSE): Define to 1.
* tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead
of VERBOSE_MMSGHDR.
2016-09-26 15:24:23 +00:00
a392aaa796 tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests
* tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove.
(VERBOSE): Define to 1.
* tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead
of VERBOSE_IOCTL.
2016-09-26 15:24:22 +00:00
aa95ec7648 tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests
* tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove.
(VERBOSE): Define to 1.
* tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL.
2016-09-26 15:24:01 +00:00
0400e2ca7d tests: use VERBOSE macro in execveat and execveat-v tests
* tests/execveat-v.c (VERBOSE_EXECVEAT): Remove.
(VERBOSE): Define to 1.
* tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT.
2016-09-26 15:23:48 +00:00
68beed808a tests: use VERBOSE macro in execve and execve-v tests
* tests/execve-v.c (VERBOSE_EXECVE): Remove.
(VERBOSE): Define to 1.
* tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE.
2016-09-26 15:23:25 +00:00
91eb1eddb0 tests: add VERBOSE macro
Introduce VERBOSE macro (defaults to 0) that is expected to be defined
to 1 by code testing "strace -v" output.

* tests/tests.h [!VERBOSE] (VERBOSE): New macro.
2016-09-26 15:23:18 +00:00
212a444bdc decode_open: print the mode argument when O_TMPFILE flag is set
O_TMPFILE reqires the mode argument (just like O_CREAT), so print it.

* open.c (STRACE_O_TMPFILE): New macro.
(decode_open): Print the mode argument when O_TMPFILE flag is set.
* tests/open.c (main): Check it.
Fixes RH#1377846.
2016-09-20 20:55:56 +00:00
0918a4c3a2 tests: use sprintrc in tests/ptrace.c
* tests/ptrace.c (errstr): New static variable.
(do_ptrace): Initialize it using sprintrc.
(test_peeksiginfo, main): Use errstr.
2016-09-20 15:17:37 +00:00
b9bac78553 tests: use sprintrc in tests/netlink_protocol.c
* tests/netlink_protocol.c (main): Use sprintrc.
2016-09-20 12:29:35 +00:00
99f41c592d tests: use sprintrc in tests/fchownat.c
* tests/fchownat.c (main): Use sprintrc.
2016-09-20 00:48:57 +00:00
48ba1de869 tests: use sprintrc in tests/fchmodat.c
* tests/fchmodat.c (main): Use sprintrc.  Add more fchmodat decoding tests.
2016-09-20 00:23:10 +00:00
e9bfa4e406 tests: use sprintrc in tests/fchmod.c
* tests/fchmod.c (main): Use sprintrc.  Add more fchmod decoding tests.
* tests/fchmod.test: Update the value specified for strace -a parameter.
2016-09-20 00:23:10 +00:00
ac563cff02 tests: use sprintrc in tests/getgroups.c
* tests/getgroups.c (main): Use sprintrc.
2016-09-20 00:23:10 +00:00
fe1a225459 tests: use sprintrc in tests/setgroups.c
* tests/setgroups.c (main): Use sprintrc.
2016-09-20 00:23:05 +00:00
24f6345505 tests/utime.c: rewrite without assert
* tests/utime.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-19 19:51:37 +00:00
c7cd262a06 tests/xattr.c: rewrite without assert
* tests/xattr.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-19 19:51:37 +00:00
1caf9f296b tests: use sprintrc in tests/xchownx.c
* tests/xchownx.c (main): Do not include <errno.h>.  Use sprintrc.
2016-09-19 19:51:37 +00:00
8870b9e831 tests/xstatfsx.c: fix potential errno clobbering
* tests/xstatfsx.c (main): Use sprintrc.
2016-09-19 19:51:37 +00:00
38ce2658cd Add more fs magic constants
Add *_MAGIC constants defined for some relatively widespread
non-mainline filesystems.

* xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC,
VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants.
2016-09-19 19:51:30 +00:00
Eugene Syromyatnikov
43e85a6648 tests: fix whitespace for explicit type casts in futex test 2016-09-15 20:05:44 +00:00
eb5b530be3 Add more fs magic constants
Add *_MAGIC constants defined inside linux fs but not explicitly
exported via linux uapi.

* xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC,
EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC,
BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC,
FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC,
VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER
constants.
2016-09-14 23:52:36 +00:00
6cb1ced84f Update fs *_MAGIC constants
Add fs *_MAGIC constants exported by linux uapi.

* xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants
defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h,
respectively.
2016-09-14 23:41:19 +00:00
1ae660572f tests: workaround limited semctl implementation in musl
musl libc forwards semctl command argument for 8 known commands only,
for all the rest it passes 0 instead.

* tests/ipc_sem.c (main): Update semctl expected output.
2016-09-13 21:18:17 +00:00
Eugene Syromyatnikov
1bc727fc2f tests: add more IPC decoding checks
* tests/ipc_msg.c: Additional msgget (parameter format) and msgctl
(parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT
commands) checks.
* tests/ipc_sem.c: Additional semget and semctl checks.
* tests/ipc_shm.c: Additional shmget and shmctl checks.
* tests/semop.c: Additional semop checks.  Add checks for semtimedop.
* tests/semop.test: Add explicit -e parameter in order to trace both
semop and semtimedop.
* tests/shmxt.c: Additional shmat and shmdt checks.
2016-09-13 17:21:20 +00:00
ecc9fc1e49 .mailmap: add addresses of Dr. David Alan Gilbert
* .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid
duplications in CREDITS file.
2016-09-12 23:38:20 +00:00
Eugene Syromyatnikov
61bf3050f3 .mailmap: add canonical name for Eugene Syromyatnikov
This is needed due to apparent deviation in spelling of commit author
name in several commits.

* .mailmap: Add canonical name for Eugene Syromyatnikov.
2016-09-12 23:33:46 +00:00
7f6f692916 Update generic ioctl entries from linux 4.8
* linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
2016-09-12 15:34:27 +00:00
Gleb Fotengauer-Malinovskiy
07eb711ec6 x32: update ioctl entries from linux 4.8
* linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh.
2016-09-12 13:55:59 +00:00
Gleb Fotengauer-Malinovskiy
7e8314eb34 maint: update for linux 4.8
* maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and
xen/evtchn.h files.
2016-09-12 13:55:59 +00:00
378a47e80a tests: use sprintrc_grep in tests/ipc_shm.c
* tests/ipc_shm.c (main): Use sprintrc_grep.
2016-09-12 10:30:22 +00:00
3138893026 tests: use sprintrc_grep in tests/ipc_sem.c
* tests/ipc_sem.c (main): Use sprintrc_grep.
2016-09-12 09:27:58 +00:00
adffd04424 tests: use sprintrc_grep in tests/ipc_msg.c
* tests/ipc_msg.c (main): Use sprintrc_grep.
2016-09-11 00:04:16 +00:00
961a541ab4 tests: use sprintrc in tests/chmod.c
* tests/chmod.c (main): Use sprintrc.  Add more chmod decoding tests.
2016-09-10 22:58:40 +00:00
06847fe282 ipc: fix printing of nsops argument of semop and semtimedop syscalls
According to POSIX, nsops argument of semop syscall has type size_t,
but the kernel treats nsops argument of semop and semtimedop syscalls
as unsigned int.

* ipc_sem.c (tprint_sembuf_array): Change type of "count" argument
from unsigned long to unsigned int, print it using %u format.
2016-09-09 22:18:11 +00:00
Eugene Syromyatnikov
84de545d73 tests/aio.c: bring indentation in conformance with the rest of the file 2016-09-09 22:18:11 +00:00
Eugene Syromyatnikov
083123860b tests: use predefined constant in aio_context_t checks in aio test
Also fix io_cancel and io_destroy checks which did not check correct
printing of context argument properly.

* tests/aio.c (main): Update syscall checks in order to use newly
defined bogus_ctx constant.
2016-09-09 22:18:11 +00:00
a92ba46c55 Mark io_setup and io_destroy as memory mapping related syscalls
As io_setup syscall allocates some memory using do_mmap_pgoff, and
io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY
flag for all sysentries of io_setup and io_destroy using the following
oneliner:
sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h

* linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM.
2016-09-09 02:38:32 +00:00
f6c70f9f19 travis: add x86 musl
* .travis.yml (matric): Add musl-gcc/x86.
* travis-build.sh [TARGET == x86]: Specify --target along with --build
to configure.
* travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC.
[CC == musl-gcc && TARGET == x86]: Add -m32 to $CC.  Specify --build
and --target to musl configure invocation.
2016-09-08 22:56:25 +00:00
Eugene Syromyatnikov
3351924396 tests: use PRI__*64 macros in aio test
It was incorrectly assumed that __*64 types are long long on all
platforms, despite strace having specially crafted macros in order
to handle precisely this architecture discrepancy.
The commit fixes this oversight.

* tests/aio.c (main): Use PRI__*64 macros for correct format conversion
specifiers for __*64-typed values.
2016-09-08 20:04:20 +00:00
Eugene Syromyatnikov
047c42e7c8 ipc: fix printing of integer arguments
* ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int
by the kernel, cast it to int and print it using %d format.
* ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise,
for semid argument.
(SYS_FUNC(semget)): Likewise, for nsems argument.
(SYS_FUNC(semctl)): Likewise, for semid and semnum arguments.
* ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument.
* ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise.
2016-09-08 16:40:50 +00:00
7b93574bc7 ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls
* ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel
is __kernel_key_t (i.e. int), cast key_t argument to int
and print it using %#x format.
* ipc_sem.c (SYS_FUNC(semget)): Likewise.
* ipc_shm.c (SYS_FUNC(shmget)): Likewise.
* tests/ipc_msg.c (main): Test it.
* tests/ipc_sem.c (main): Likewise.
* tests/ipc_shm.c (main): Likewise.
2016-09-08 16:26:48 +00:00
Eugene Syromyatnikov
f4b7ac23b9 tests: add more sched_getattr and sched_setattr decoding checks
* tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr
decoding checks.
2016-09-08 12:33:44 +00:00
Eugene Syromyatnikov
0797de9efe tests: change type of sched_nice field to signed in sched_xetattr test
Kernel headers declare this field as s32, and strace prints it with %d
specifier.

* tests/sched_xetattr.c (main): Change type of sched_nice field of struct
sched_attr to int32_t, update format specifiers accordingly.
2016-09-08 12:33:44 +00:00
Eugene Syromyatnikov
6d995ae68b tests: add sprintrc_grep function to libtests
New sprintrc_grep function is sprintrc function equivalent suitable for
tests where grep-base pattern matching is employed.

* tests/tests.h (sprintrc_grep): New prototype.
* tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration.
(sprintrc_ex): New function, renamed from sprintrc and updated to
support different formats.
(sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW.
(sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP.
2016-09-08 01:37:18 +00:00
Eugene Syromyatnikov
ee7d47f4d6 tests: perform more strict structure allocation in sched_xetattr test
Use tail_alloc with precise size of the structure.

* tests/sched_xetattr.c (main): Eliminate usage of anonymous union type.
Rename sched to sched_attr.  Change type of sched_attr to struct
pointer.  Use tail_alloc for sched_attr allocation, update printf
statements accrodingly.
2016-09-08 01:37:14 +00:00
Eugene Syromyatnikov
e3ed9f557c tests: split long lines in sched_xetattr test
* tests/sched_xetattr.c (main): Split long lines.
2016-09-08 01:34:12 +00:00
9b95549a25 tests/aio.c: fix for x32 personality
* tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit
and io_getevents until strace learns how to print 64-bit pointers on x32
and on x86_64 for x32 personality.
2016-09-07 13:17:59 +00:00
ed292f62d6 aio: print aio_context_t as a pointer type
As aio_context_t is treated by the kernel as a pointer,
print it using printaddr.

* aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t
argument using printnum_ptr.
(SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel),
SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr.
* tests/aio.c (sprint_aio_context_t): Remove.
(main): Update expected output.
2016-09-07 13:01:29 +00:00