Commit Graph

4606 Commits

Author SHA1 Message Date
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
460c6253c4 tests/aio.c: rewrite without assert
* tests/aio.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-07 01:44:50 +00:00
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