Commit Graph

4522 Commits

Author SHA1 Message Date
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
Eugene Syromyatnikov
a3e1ad344b futex: fix formatting of val3 hexadecimal argument
* futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET,
print hexadecimal val3 argument in alternate form to avoid confusion.
2016-08-30 15:53:51 +00:00
Eugene Syromyatnikov
bfa22a596f futex: fix FUTEX_WAKE_OP compare function mask
According to the initial and current (v4.7) kernel implementations,
in FUTEX_WAKE_OP case the compare function does not have
FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24.

* futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT
for 27th bit of val3 in FUTEX_WAKE_OP case.
2016-08-30 15:53:51 +00:00
b80894cf07 tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c
* bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS.
* tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC.
[USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC.
[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC.
[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC.

Based on patch by James Clarke <jrtc27@jrtc27.com>.
2016-08-30 15:50:36 +00:00
ae914db459 Remove redundant check for PTRACE_LISTEN availability
As ptrace.h already ensures that PTRACE_LISTEN is defined,
there is no need to check this fact in other places.

* strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined.
2016-08-30 09:12:06 +00:00
e2ea606a60 Remove unused autoconf macro AC_TYPE_GETGROUPS
strace code does not use GETGROUPS_T.

* configure.ac (AC_TYPE_GETGROUPS): Remove.
2016-08-30 00:56:13 +00:00
730c49fb2a Remove unused autoconf macro AC_TYPE_MODE_T
strace code already redefines mode_t.

* configure.ac (AC_TYPE_MODE_T): Remove.
2016-08-30 00:56:04 +00:00
James Clarke
b4a32f9e57 Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64
SPARC has a different PTRACE_DETACH value correctly defined in
sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one.
PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h,
so use that instead.

* strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH
to PTRACE_SUNDETACH ...
* ptrace.h [SPARC || SPARC64]: ... here.
2016-08-30 00:48:36 +00:00
fcfdf89b8e Remove obsolescent autoconf macro AC_HEADER_STDC
All systems supported by strace are expected to have C89 conforming
header files.

* configure.ac (AC_HEADER_STDC): Remove.
2016-08-29 16:18:11 +00:00
79396167dd Remove unneeded autoconf macro AC_HEADER_DIRENT
strace code already includes <dirent.h> unconditionally.

* configure.ac (AC_HEADER_DIRENT): Remove.
2016-08-29 16:09:57 +00:00
39888f9358 Remove unneeded autoconf macro AC_HEADER_STDBOOL
strace code assumes C99.

* configure.ac (AC_HEADER_STDBOOL): Remove.
* defs.h: Include <stdbool.h> unconditionally.
2016-08-28 00:03:14 +00:00