Commit Graph

4606 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
11f7093560 fadvise: change printing of len argument to unsigned in fadvise64 syscall
The kernel declares fadvise64 as
long sys_fadvise64(int fd, loff_t offset, size_t len, int advice);

* fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from
"%ld" to "%lu" for printing len argument since kernel expects argument
of type size_t.
2016-09-28 03:00:10 +00:00
cfa1b17619 sh64, sparc64: use proper decoder for fadvise64_64 syscall
This change is no-op yet, but things will change when decoder
of fadvise64 syscall get fixed.

* linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64)
with SEN(fadvise64_64).
* linux/sparc64/syscallent.h (fadvise64_64): Likewise.
2016-09-28 03:00:10 +00:00
Eugene Syromyatnikov
dbb76606dc tests: check decoding of fallocate syscall
* configure.ac (AC_CHECK_FUNCS): Add fallocate.
* tests/fallocate.c: New file.
* tests/fallocate.test: New test.
* tests/.gitignore: Add fallocate.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fallocate.test.
2016-09-28 03:00:07 +00:00
Eugene Syromyatnikov
5af0e0dab8 fallocate: change print format of offset and len arguments to signed
Since types of these arguments are off_t and kernel actually expects
signed values in order to fail when negative values are provided,
lets display these values as signed.

* fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for
printing "offset" and "len" syscall arguments from %llu to %lld.
2016-09-27 18:02:07 +00:00
Eugene Syromyatnikov
e32f7eeefc xlat: add default values for falloc_flags constants
In order to avoid dependence of declared constants to headers available
on build system.

* xlat/falloc_flags.in: Add default values for constants.
2016-09-27 18:01:36 +00:00
Eugene Syromyatnikov
ec3761429e tests: check decoding of getcpu syscall
* tests/getcpu.c: New file.
* tests/getcpu.test: New test.
* tests/.gitignore: Add getcpu.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getcpu.test.
2016-09-27 18:01:09 +00:00
Eugene Syromyatnikov
aefb09b9cc tests: make magic values in ioctl_block test distinctive
* tests/ioctl.block (init_magic): Add iterator value to magic value
in order to enable detection of potential 4-byte aligned shifts.
2016-09-27 17:55:35 +00:00
Eugene Syromyatnikov
db27247d84 tests: additional getcwd decoding checks
* tests/getcwd.c (main): Add more checks for getcwd arguments decoding.
2016-09-27 17:53:50 +00:00
Eugene Syromyatnikov
81b63834dd tests: check decoding of quotactl syscall
* configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h,
and sys/quota.h.
* tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs,
and quotactl-xfs-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add quotactl.test, quotactl-v.test,
quotactl-xfs.test, and quotactl-xfs-v.test.
(EXTRA_DIST): Add quotactl.h
* quotactl.h: New file.
* quotactl.c: Likewise.
* quotactl-v.c: Likewise.
* quotactl-xfs.c: Likewise.
* quotactl-xfs-v.c: Likewise.
* quotactl.test: New test.
* quotactl-v.test: Likewise.
* quotactl-xfs.test: Likewise.
* quotactl-xfs-v.test: Likewise.
2016-09-27 08:11:06 +00:00
ee9e7a7e5b quota: ensure that names of structure fields are printed properly
* quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros.
(decode_cmd_data): Use them to print structure fields.
2016-09-27 01:08:38 +00:00
906dc4aaa1 Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros
* defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
Add support of char types.
* tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
Likewise.
2016-09-27 00:57:28 +00:00
340909fd00 quota: move Q_QUOTAON handling to subcommand switch statement
* quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ...
(decode_cmd_data): ... here.
2016-09-27 00:57:28 +00:00
Eugene Syromyatnikov
fd5195dccd quota: remove legacy subcommand decoding support code
Support for these quota subcommands by linux kernels has been dropped
long time ago (between 2.5.16 and 2.5.17), so lets drop it in order
to minimize amount of code which should be subjected to testing and
structured conversion.

* quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo,
struct v1_dqstats, struct v2_dqstats): Remove.
(decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA,
Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS,
and Q_V2_GETSTATS subcommands.
(SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand.
2016-09-27 00:57:28 +00:00
Eugene Syromyatnikov
abde34546d quota: add realtime block limits fields to XFS disk quota printing code
* quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit
and d_rtb_softlimit fields to struct xfs_dqblk printing code.
2016-09-27 00:57:27 +00:00
Eugene Syromyatnikov
46b89571f5 quota: add packed attribute to struct if_dqblk definition
Since the only difference between 32-bit and 64-bit environments
regarding this structure is its padding, lets just add packed attribute
to its definition instead of going full mpers.

* quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED.
2016-09-27 00:57:27 +00:00
Eugene Syromyatnikov
4cb1124902 quota: Add decoding for Q_XQUOTARM subcommand
* quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand
  switch.
2016-09-27 00:57:27 +00:00
Eugene Syromyatnikov
01bb1d206a quota: add dispatch of SYNC subcommands
Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway.

* quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand
dispatch switch since id/addr arguments for these subcommands are known
to be ignored.
2016-09-27 00:57:27 +00:00
Eugene Syromyatnikov
3b3fd71546 quota: add missing prefixes to struct field names
* quota.c (decode_cmd_data): Print field names in accordance with
their definition.
2016-09-27 00:57:27 +00:00
Eugene Syromyatnikov
f8b50ef4ea quota: fix indentation inside subcommand dispatching switch statement 2016-09-27 00:57:20 +00:00
Eugene Syromyatnikov
51330fd434 quota: avoid printing id argument for those commands that ignore it
As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO,
Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF,
Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and
Q_V2_GETSTATS subcommands, do not print it for these subcommands.

* quota.c (decode_cmd_data): Add id argument parameter, add printing
of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA,
Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA,
Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands.
(SYS_FUNC(quotactl)): Remove printing of id argument, pass it
to decode_cmd_data.
2016-09-27 00:57:20 +00:00
Eugene Syromyatnikov
e87379b820 quota: use printuid for id parameter printing
* quota.c (SYS_FUNC(quotactl)): Since id call argument is used for
user/group/project ID which all have special semantics for -1,
print it the same way as UIDs are printed.
2016-09-27 00:57:20 +00:00
Eugene Syromyatnikov
0cda3e0823 quota: display quota subcommand as a macro
* quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values
(which also lacks shift of the left part) with QCMD macro call.
2016-09-27 00:57:14 +00:00
632cc8a697 tests: use VERBOSE macro in waitid and waitid-v tests
* tests/waitid-v.c (VERBOSE_RUSAGE): Remove.
(VERBOSE): Define to 1.
* tests/waitid.c (sprint_rusage): Check VERBOSE instead
of VERBOSE_RUSAGE.
2016-09-26 15:24:27 +00:00
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