Commit Graph

4532 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
851ac444f4 tests: add more aio decoding checks
* tests/aio.c (sprint_aio_context_t): New function.
(main): Use it; add more checks.
2016-09-06 16:07:14 +00:00
Eugene Syromyatnikov
ea7adc3c4f tests: add suffix and cast to 64-bit constants in aio test
This helps to avoid warnings like
"integer constant is too large for ‘long’ type"
reported by some versions of gcc on 32-bit platforms.

* tests/aio.c (main): Add ULL suffix to 64-bit constants
and cast them to unsigned long.
2016-09-06 09:06:24 +00:00
Eugene Syromyatnikov
06d0a0eaa3 tests: check decoding of perf_event_open syscall
* tests/perf_event_open.c: New file.
* tests/perf_event_open.test: New test.
* tests/.gitignore: Add perf_event_open.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add perf_event_open.test.
2016-09-05 19:58:00 +00:00
Eugene Syromyatnikov
af0d956078 Makefile.am: use pwd instead of realpath
* Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1)
instead of less widespread realpath(1) utility from GNU coreutils.
2016-09-05 19:52:57 +00:00
b5d7a0b7cf tests: use sprintrc in tests/xetpriority.c
* tests/xetpriority.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
b177783770 tests: use sprintrc in vhangup.test
* tests/vhangup.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
60d5765b5a tests: use sprintrc in tests/sockname.c
* tests/sockname.c (test_sockname_syscall): Use sprintrc.
2016-09-05 15:58:35 +00:00
e0a886d378 tests: use sprintrc in signalfd4.test
* tests/signalfd4.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
a46700d697 tests: use sprintrc in setrlimit.test
* tests/setrlimit.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
746d6eb2e2 tests: use sprintrc in set_mempolicy.test
* tests/set_mempolicy.c (main, print_nodes): Use sprintrc.
2016-09-05 15:58:35 +00:00
416896888d tests: use sprintrc in openat.test
* tests/openat.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
f7352b73a2 tests: use sprintrc in open.test
* tests/open.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
1b03fa4ab8 tests: use sprintrc in move_pages.test
* tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc.
2016-09-05 15:58:35 +00:00
79582ae9af tests: use sprintrc in mlockall.test
* tests/mlockall.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
ef62ce49a1 tests: use sprintrc in mlock.test
* tests/mlock.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
1b36107cc2 tests: use sprintrc in epoll_create1.test
* tests/epoll_create1.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
df00cad32e tests: fix printing of min_nr and nr arguments of io_getevents syscall
* tests/aio.c (main): Change output format for min_nr and nr arguments
in io_getevents check to %ld, cast these arguments to long.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
afcbaaf050 tests: use sprintrc for return code output in aio test
* tests/aio.c (main): Use sprintrc for return code output.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
25463ec93e tests: add more tests for ched_rr_get_interval decoding
* tests/sched_rr_get_interval.c (main): Check decoding of invalid
timespec pointer and successful syscall invocation.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
2fdb64efd6 tests: use sprintrc for return code output in sched_rr_get_interval test
* tests/sched_rr_get_interval.c (main): Use sprintrc for return code
output.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
7890a1e208 tests: add more tests for sched_getscheduler and sched_xetscheduler
* tests/sched_xetscheduler.c (main): Check for decoding of invalid PID
in sched_getscheduler and sched_setscheduler, invalid address
of sched_param structure, and invalid policy value.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
88d0a427ed tests: use sprintrc for return code output in sched_xetscheduler test
* tests/sched_xetscheduler.c (main): Use sprintrc for return code output.
2016-09-05 15:58:35 +00:00
Eugene Syromyatnikov
2b962b26a0 aio: use printfd for fd printing
struct iocb contains two fields with fd semantics: aio_fildes and
aio_resfd.  It is quite reasonable to use the appropriate function for
printing them (apart from just "%d").

* aio.c (print_common_flags): Add struct tcb pointer to parameter list;
use printfd for printing aio_resfd field.
(print_iocb_header): Add struct tcb pointer to parameter list;
use printfd for printing aio_fildes field.
(print_iocb): Provide tcp argument to print_iocb_header
and print_common_flags.
(SYS_FUNC(io_cancel)): Likewise.
2016-09-05 15:08:40 +00:00
724c623596 sh64: wire up new syscalls
* linux/sh64/syscallent.h [380..393]: New entries.
2016-09-05 13:05:38 +00:00
596c63dead sh: wire up new syscalls
* linux/sh/syscallent.h [369..382]: New entries.
2016-09-02 21:04:49 +00:00
5ff4be2bd2 avr32: wire up preadv2 and pwritev2 syscalls
* linux/avr32/syscallent.h [326]: Add preadv2 entry.
[327]: Add pwritev2 entry.
2016-09-05 13:04:29 +00:00
Eugene Syromyatnikov
0c766339fe tests: check decoding of readahead syscall
* configure.ac (AC_CHECK_FUNCS): Add readahead.
* tests/readahead.c: New file.
* tests/readahead.test: New test.
* tests/.gitignore: Add readahead.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add readahead.test.
2016-09-05 01:31:14 +00:00
Eugene Syromyatnikov
6f9aefde21 tests: move sprintrc function to libtests
* tests/tests.h (sprintrc): New prototype.
* tests/futex.c (sprintrc): Move to ...
* tests/sprintrc.c: ... new file.
* tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c.
2016-09-02 17:42:42 +00:00
Eugene Syromyatnikov
8bb9f473e4 tests/futex: add support to sprintrc for return codes other than 0 and -1
* tests/futex.c (sprintrc): Print the actual return code provided,
not just "0".  Check snprintf return code.
2016-09-02 17:21:14 +00:00
Eugene Syromyatnikov
243e1a909c tests/futex: increase sprintrc static buffer size
* tests/futex.c (sprintrc): Increase buffer size from 256 to 4096.
2016-09-02 17:20:04 +00:00
Eugene Syromyatnikov
100a7f2f8d tests/futex: rename retstr to sprintrc
* tests/futex.c (retstr): Rename to sprintrc.
(main): Convert all retstr calls to sprintrc.
2016-09-02 17:19:17 +00:00
Eugene Syromyatnikov
680d0e960c readahead: fix print format for the "count" argument
According to documentation and kernel's syscalls.h, its type is size_t,
so "%lu" format should be used instead of "%ld".

* readahead.c (SYS_FUNC(readahead)): Fix conversion specifier
for the "count" argument.
2016-09-01 15:18:11 +00:00
db4ef238bd tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll
Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros
instead of explicit casts with unpredictable sign extension semantics.

* tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull
instead of explicit cast.
(print_stat): Use zero_extend_signed_to_ull and
sign_extend_unsigned_to_ll instead of explicit casts.
2016-08-31 16:31:53 +00:00
ca7c8952ea tests: add sign_extend_unsigned_to_ll macro
* tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h.
2016-08-31 16:09:24 +00:00
Eugene Syromiatnikov
2909c7c1d8 Refactor common sa_handler printing code
* xlat/sa_handler_values.in: New file.
* signal.c: Include "xlat/sa_handler_values.h".
(get_sa_handler_str, print_sa_handler): New functions.
(SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them.
2016-08-31 15:41:41 +00:00
e31e2c0e57 Update TCP* constants
* xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux
kernel commit v4.8-rc1~140^2~226.
2016-08-31 08:49:31 +00:00
80b49fb4dc Update SCTP_* constants
* xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO,
and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits
v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and
v4.8-rc1~140^2~148^2~3, respectively.
2016-08-30 18:22:41 +00:00
9c3f5daa16 Update fs *_MAGIC constants
* xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced
by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74,
respectively.
2016-08-30 18:19:16 +00:00
6d68e0d4dd Update KEXEC_ARCH_* constants
* xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux
kernel commit v4.8-rc1~16^2~41.
2016-08-30 18:13:38 +00:00
788e5f37d3 Update ETH_P_* constants
* xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel
commit v4.8-rc1~140^2~65^2~8.
2016-08-30 18:11:13 +00:00
3b9e6a34b8 Update BPF_* constants
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced
by linux kernel commit v4.8-rc1~140^2~212^2~2.
* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced
by linux kernel commit v4.8-rc1~140^2~64^2~10.
2016-08-30 18:01:50 +00:00
78b0755828 Remove HAVE_SIGACTION checks
The syscall parsers guarded by HAVE_SIGACTION check have to be compiled
regardless of libc sigaction function availability.

* configure.ac (AC_CHECK_FUNCS): Remove sigaction.
* signal.c: Remove HAVE_SIGACTION checks.
2016-08-30 17:44:33 +00:00
c47beb7091 Remove obsolescent autoconf macro AC_TYPE_SIGNAL
All supported systems are expected to have C89 conforming sematics.

* configure.ac (AC_TYPE_SIGNAL): Remove.
2016-08-30 17:38:37 +00:00
a7857e50e4 Remove obsolescent autoconf macro AC_C_CONST
All supported systems are expected to have the 'const' keyword.

* configure.ac (AC_C_CONST): Remove.
2016-08-30 17:38:37 +00:00
Eugene Syromiatnikov
c965bec3a1 tests: check decoding of futex syscall
* tests/futex.c: New file.
* tests/futex.test: New test.
* tests/.gitignore: Add futex.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add futex.test.
2016-08-30 17:38:26 +00:00
Eugene Syromyatnikov
d02a91dd2c futex: do not pretend <linux/futex.h> is included
As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is
never defined and therefore the inclusion of <linux/futex.h> guarded by
HAVE_LINUX_FUTEX_H makes no sense.

Moreover, <linux/futex.h> used to have an incorrect definition
of FUTEX_WAIT_BITSET_PRIVATE and FUTEX_WAKE_BITSET_PRIVATE:
since kernel commit v2.6.24-6320-gcd68998 where these definitions
were initially introduced and up to v2.6.31-7082-gf8d1e54 where they
were finally fixed these macros had been incorrectly defined via
FUTEX_WAIT_BITS and FUTEX_WAKE_BITS instead of FUTEX_WAIT_BITSET
and FUTEX_WAKE_BITSET, and these incorrect definitions made their way
into some distributions still in use.

* futex.c [HAVE_LINUX_FUTEX_H]: Remove.
2016-08-30 17:29:28 +00:00
Eugene Syromyatnikov
110da33aff futex: avoid printing val when it is not used by the futex command
This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET
command.

* futex.c (SYS_FUNC(futex)): Remove common printing of val argument.
Add printing of val argument for all futex commands except
FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2016-08-30 17:29:28 +00:00
Eugene Syromyatnikov
606d4b2d54 xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set
* xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and
FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel
since commit v4.5-rc1~172^2.
2016-08-30 17:26:58 +00:00
Eugene Syromyatnikov
ebeae24de4 futex: fix formatting of unknown command argument
Use alternate form for printing hexadecimal numbers to avoid confusion.
Use printaddr to print uaddr as the latter is interpreted as a pointer
in all currently supported futex operations.

* futex.c (SYS_FUNC(futex)): Fix formatting of unknown command
argument.
2016-08-30 15:53:51 +00:00
Eugene Syromyatnikov
3e0e10532d futex: add handling of FUTEX_FD command
Since obsolete FUTEX_FD command is known and used to have some expected
argument format, print FUTEX_FD using that format.

* futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command.
2016-08-30 15:53:51 +00:00