]>
granicus.if.org Git - strace/log
Dmitry V. Levin [Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)]
Implement decoding of SO_TIMESTAMP*_NEW control messages
* print_timeval64.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (print_timeval64_data_size): New prototype.
* msghdr.c (print_scm_timestamp_new, print_scm_timestampns_new,
print_scm_timestamping_new): New functions.
(cmsg_socket_printers): Add SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW,
and SO_TIMESTAMPING_NEW.
* NEWS: Mention this change.
Dmitry V. Levin [Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)]
print_timespec.h: parametrize TIMESPEC_T.tv_nsec
This is going to be used to implement a parser of SO_TIMESTAMP_NEW
control message.
* print_timespec.h [!TIMESPEC_NSEC] (TIMESPEC_NSEC): Define to tv_sec.
(TIMESPEC_TO_SEC_NSEC, timespec_fmt, print_timespec_t_utime): Use
TIMESPEC_NSEC instead of tv_sec.
Dmitry V. Levin [Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)]
print_timespec.h: conditionalize printers
This allows to implement a parser of SO_TIMESTAMP_NEW control message
without implementing extra unused printers.
* print_timespec.h (PRINT_TIMESPEC_DATA_SIZE,
PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC,
PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Conditionalize.
Dmitry V. Levin [Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)]
xlat: add SO_TIMESTAMP*_NEW constants
* xlat/sock_options.in (SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW,
SO_TIMESTAMPING_NEW): New constants introduced by Linux commits
v5.1-rc1~178^2~363^2~4 and v5.1-rc1~178^2~363^2~3.
* xlat/scmvals.in: Likewise.
Dmitry V. Levin [Thu, 16 May 2019 22:46:26 +0000 (22:46 +0000)]
Use kernel_timeval64_t in definition of kernel_timex64_t
* kernel_timex.h: Include "kernel_timeval.h".
(kernel_timex64_t): Change the type of "time" field from a locally
defined structure to its equivalent kernel_timeval64_t.
Dmitry V. Levin [Thu, 16 May 2019 22:46:26 +0000 (22:46 +0000)]
Introduce kernel_timeval64_t type
This type is going to be used to implement parsers of SO_TIMESTAMP*_NEW
control messages.
* kernel_timeval.h: New file.
* Makefile.am (strace_SOURCES): Add it.
Dmitry V. Levin [Wed, 15 May 2019 16:52:37 +0000 (16:52 +0000)]
xlat: add _OLD suffixes to SO_RCVTIMEO and SO_SNDTIMEO
Follow the Linux kernel commit v5.1-rc1~178^2~363^2~1 and rename
these constants.
* xlat/sock_options.in (SO_RCVTIMEO): Rename to SO_RCVTIMEO_OLD.
(SO_SNDTIMEO): Rename to SO_SNDTIMEO_OLD.
Dmitry V. Levin [Wed, 15 May 2019 16:52:37 +0000 (16:52 +0000)]
Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
Follow the Linux kernel commit v5.1-rc1~178^2~363^2~8 and rename
these constants everywhere.
* xlat/scmvals.in (SO_TIMESTAMP): Rename to SO_TIMESTAMP_OLD.
(SO_TIMESTAMPNS): Rename to SO_TIMESTAMPNS_OLD.
(SO_TIMESTAMPING): Rename to SO_TIMESTAMPING_OLD.
* xlat/sock_options.in: Likewise.
* xlat/sock_rds_options.in: Likewise.
* msghdr.c (cmsg_socket_printers): Likewise.
(print_scm_timestamp): Rename to print_scm_timestamp_old.
(print_scm_timestampns): Rename to print_scm_timestampns_old.
(print_scm_timestamping): Rename to print_scm_timestamping_old.
* tests/msg_control.c (test_scm_timestamp): Rename SO_TIMESTAMP
to SO_TIMESTAMP_OLD.
(test_scm_timestampns): Rename SO_TIMESTAMPNS to SO_TIMESTAMPNS_OLD.
(test_scm_timestamping): Rename SO_TIMESTAMPING to SO_TIMESTAMPING_OLD.
* tests/sockopt-timestamp.c (main): Rename SO_TIMESTAMP and
SO_TIMESTAMPNS to SO_TIMESTAMP_OLD and SO_TIMESTAMPNS_OLD, respectively.
Dmitry V. Levin [Wed, 15 May 2019 16:52:37 +0000 (16:52 +0000)]
Replace SCM_TIMESTAMP* constants with SO_TIMESTAMP*
Besides the fact that SO_TIMESTAMP* constants appear to be more
standardized than SCM_TIMESTAMP*, new SO_TIMESTAMP*_OLD and
SO_TIMESTAMP*_NEW constants introduced in Linux 5.1 have no
SCM_TIMESTAMP*_OLD and SCM_TIMESTAMP*_NEW analogues.
* xlat/scmvals.in: Replace SCM_WIFI_STATUS, SCM_TXTIME, SCM_TIMESTAMP,
SCM_TIMESTAMPNS, and SCM_TIMESTAMPING with SO_WIFI_STATUS, SO_TXTIME,
SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING, respectively.
* msghdr.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode.
(cmsg_socket_printers): Replace SCM_TIMESTAMP, SCM_TIMESTAMPNS, and
SCM_TIMESTAMPING with SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING,
respectively.
* tests/msg_control.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY
mode.
(test_scm_timestamp): Replace SCM_TIMESTAMP with SO_TIMESTAMP.
(test_scm_timestampns): Replace SCM_TIMESTAMPNS with SO_TIMESTAMPNS.
(test_scm_timestamping): Replace SCM_TIMESTAMPING with SO_TIMESTAMPING.
* tests/sockopt-timestamp.c (main): Replace SCM_TIMESTAMP and
SCM_TIMESTAMPNS with SO_TIMESTAMP and SO_TIMESTAMPNS, respectively.
Dmitry V. Levin [Wed, 15 May 2019 16:52:37 +0000 (16:52 +0000)]
tests: add another test of SO_TIMESTAMP and SO_TIMESTAMPNS decoding
Unlike msg_control test, this new test makes the kernel generate
SO_TIMESTAMP and SO_TIMESTAMPNS messages.
* tests/sockopt-timestamp.c: New file.
* tests/gen_tests.in (sockopt-timestamp): New entry.
* tests/pure_executables.list: Add sockopt-timestamp.
* tests/.gitignore: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
print_timespec.c: remove unused printers
* print_timespec.c (PRINT_TIMESPEC, SPRINT_TIMESPEC,
PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Remove.
(print_timespec, sprint_timespec, print_timespec_utime_pair,
print_itimerspec): Remove.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of utimensat syscall
* utimes.c (SYS_FUNC(utimensat)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(utimensat_time32)): New function.
* pathtrace.c (pathtrace_match_set): Replace SEN_utimensat with
SEN_utimensat_time32.
* linux/64/syscallent.h: Replace SEN(utimensat) with
SEN(utimensat_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(utimensat) with
SEN(utimensat_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of timerfd_gettime and timerfd_settime syscalls
* time.c (SYS_FUNC(timerfd_gettime), SYS_FUNC(timerfd_settime)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timerfd_gettime32),
SYS_FUNC(timerfd_settime32)): New functions.
* pathtrace.c (pathtrace_match_set): Replace SEN_timerfd_gettime and
SEN_timerfd_settime with SEN_timerfd_gettime32 and
SEN_timerfd_settime32, respectively.
* linux/64/syscallent.h: Replace SEN(timerfd_gettime) and
SEN(timerfd_settime) with SEN(timerfd_gettime64) and
SEN(timerfd_settime64), respectively.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(timerfd_gettime) and
SEN(timerfd_settime) with SEN(timerfd_gettime32) and
SEN(timerfd_settime32), respectively.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of timer_gettime and timer_settime syscalls
* time.c (SYS_FUNC(timer_gettime), SYS_FUNC(timer_settime)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timer_gettime32),
SYS_FUNC(timer_settime32)): New functions.
* linux/64/syscallent.h: Replace SEN(timer_gettime) and
SEN(timer_settime) with SEN(timer_gettime64) and SEN(timer_settime64),
respectively.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(timer_gettime) and
SEN(timer_settime) with SEN(timer_gettime32) and SEN(timer_settime32),
respectively.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of nanosleep syscall
* time.c (SYS_FUNC(nanosleep)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS]
(do_nanosleep): New function.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(nanosleep_time32)): Likewise.
[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(nanosleep_time64)): Likewise.
* linux/64/syscallent.h: Replace SEN(nanosleep) with
SEN(nanosleep_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(nanosleep) with
SEN(nanosleep_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of clock_nanosleep syscall
* time.c (SYS_FUNC(clock_nanosleep)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_nanosleep_time32)): New
function.
* linux/64/syscallent.h: Replace SEN(clock_nanosleep) with
SEN(clock_nanosleep_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(clock_nanosleep) with
SEN(clock_nanosleep_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of clock_gettime and clock_settime syscalls
* time.c (SYS_FUNC(clock_gettime), SYS_FUNC(clock_settime)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_gettime32),
SYS_FUNC(clock_settime32)): New functions.
* linux/dummy.h (sys_clock_getres): Remove.
(sys_clock_getres_time32): Redirect to sys_clock_gettime32.
* linux/64/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime),
and SEN(clock_getres) with SEN(clock_gettime64), SEN(clock_settime64),
and SEN(clock_getres_time64), respectively.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime),
and SEN(clock_getres) with SEN(clock_gettime32), SEN(clock_settime32),
and SEN(clock_getres_time32), respectively.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of mq_timedsend and mq_timedreceive syscalls
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(mq_timedsend_time32),
SYS_FUNC(mq_timedreceive_time32)): New functions.
* pathtrace.c (pathtrace_match_set): Replace SEN_mq_timedsend and
SEN_mq_timedreceive with SEN_mq_timedsend_time32 and
SEN_mq_timedreceive_time32, respectively.
* syscall.c (dumpio): Likewise.
* linux/64/syscallent.h: Replace SEN(mq_timedsend) and
SEN(mq_timedreceive) with SEN(mq_timedsend_time64) and
SEN(mq_timedreceive_time64), respectively.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(mq_timedsend) and
SEN(mq_timedreceive) with SEN(mq_timedsend_time32) and
SEN(mq_timedreceive_time32), respectively.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of rt_sigtimedwait syscall
* signal.c (SYS_FUNC(rt_sigtimedwait)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(rt_sigtimedwait_time32)): New
function.
* linux/64/syscallent.h: Replace SEN(rt_sigtimedwait) with
SEN(ppoll_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(rt_sigtimedwait) with
SEN(ppoll_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of sched_rr_get_interval syscall
* sched.c (SYS_FUNC(sched_rr_get_interval)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(sched_rr_get_interval_time32)):
New function.
* linux/64/syscallent.h: Replace SEN(sched_rr_get_interval) with
SEN(sched_rr_get_interval_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(sched_rr_get_interval) with
SEN(sched_rr_get_interval_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of poll syscall
* poll.c (SYS_FUNC(poll)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] (do_poll):
New function.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(poll_time32)): Likewise.
[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(poll_time64)): Likewise.
* pathtrace.c (pathtrace_match_set): Replace SEN_poll with
SEN_poll_time32 and SEN_poll_time64.
* linux/aarch64/syscallent.h: Replace SEN(poll) with SEN(poll_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/arm/syscallent.h: Replace SEN(poll) with SEN(poll_time32).
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of ppoll syscall
* poll.c (SYS_FUNC(ppoll)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(ppoll_time32)): New function.
* pathtrace.c (pathtrace_match_set): Replace SEN_ppoll with
SEN_ppoll_time32.
* linux/64/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of recvmmsg syscall
* mmsghdr.c (SYS_FUNC(recvmmsg)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(recvmmsg_time32)): New function.
* syscall.c (dumpio): Handle SEN_recvmmsg_time32.
* linux/subcall32.h (sys_recvmmsg): Redirect to sys_recvmmsg_time32.
* linux/subcall64.h (sys_recvmmsg): Redirect to sys_recvmmsg_time64.
* linux/64/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of semtimedop syscall
* ipc_sem.c (SYS_FUNC(semtimedop)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(semtimedop_time32)): New function.
* linux/subcall32.h (sys_semtimedop): Redirect to sys_semtimedop_time32.
* linux/subcall64.h (sys_semtimedop): Redirect to sys_semtimedop_time64.
* linux/64/syscallent.h: Replace SEN(semtimedop) with
SEN(semtimedop_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(semtimedop) with
SEN(semtimedop_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Introduce subcall32.h and subcall64.h wrappers
They are going to be used to implement new parsers for indirect
time-related syscalls.
* linux/subcall32.h: New file.
* linux/subcall64.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* linux/arm/syscallent.h: Replace "subcall.h" with "subcall32.h".
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Replace "subcall.h" with "subcall64.h".
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of futex syscall
* futex.c (SYS_FUNC(futex)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(futex_time32)): New function.
* linux/64/syscallent.h: Replace SEN(futex) with SEN(futex_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(futex) with SEN(futex_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of pselect6 syscall
* desc.c (SYS_FUNC(pselect6)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(pselect6_time32)): New function.
* pathtrace.c (pathtrace_match_set): Replace SEN_pselect6 with
SEN_pselect6_time32.
* linux/64/syscallent.h: Replace SEN(pselect6) with
SEN(pselect6_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(pselect6) with
SEN(pselect6_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of io_pgetevents syscall
* aio.c (SYS_FUNC(io_pgetevents)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_pgetevents_time32)): New
function.
* linux/64/syscallent.h: Replace SEN(io_pgetevents) with
SEN(io_pgetevents_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(io_pgetevents) with
SEN(io_pgetevents_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sun, 12 May 2019 22:45:45 +0000 (22:45 +0000)]
Implement and use new parsers of io_getevents syscall
* aio.c (SYS_FUNC(io_getevents)): Remove.
[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_getevents_time32)): New
function.
[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(io_getevents_time64)):
Likewise.
* linux/64/syscallent.h: Replace SEN(io_getevents) with
SEN(io_getevents_time64).
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/32/syscallent.h: Replace SEN(io_getevents) with
SEN(io_getevents_time32).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Dmitry V. Levin [Sat, 11 May 2019 22:35:56 +0000 (22:35 +0000)]
Wire up *time64 system calls
* linux/32/syscallent.h [403...423]: Wire up clock_gettime64,
clock_settime64, clock_adjtime64, clock_getres_time64,
clock_nanosleep_time64, timer_gettime64, timer_settime64,
timerfd_gettime64, timerfd_settime64, utimensat_time64, pselect6_time64,
ppoll_time64, io_pgetevents_time64, recvmmsg_time64,
mq_timedsend_time64, mq_timedreceive_time64, semtimedop_time64,
rt_sigtimedwait_time64, futex_time64, and sched_rr_get_interval_time64
introduced by linux commit v5.1-rc1~160^2~2^2.
* linux/arm/syscallent.h [403...423]: Likewise.
* linux/hppa/syscallent.h [403...423]: Likewise.
* linux/i386/syscallent.h [403...423]: Likewise.
* linux/m68k/syscallent.h [403...423]: Likewise.
* linux/microblaze/syscallent.h [403...423]: Likewise.
* linux/mips/syscallent-n32.h [6403...6423]: Likewise.
* linux/mips/syscallent-o32.h [4403...4423]: Likewise.
* linux/powerpc/syscallent.h [403...423]: Likewise.
* linux/s390/syscallent.h [403...423]: Likewise.
* linux/sh/syscallent.h [403...423]: Likewise.
* linux/sparc/syscallent.h [403...423]: Likewise.
* linux/xtensa/syscallent.h [403...423]: Likewise.
* linux/64/syscallent.h: Add a comment about syscall numbers
reserved to sync up with other architectures.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* pathtrace.c (pathtrace_match_set): Handle SEN_utimensat_time64,
SEN_pselect6_time64, SEN_ppoll_time64, SEN_mq_timedreceive_time64,
SEN_mq_timedsend_time64, SEN_timerfd_gettime64, and
SEN_timerfd_settime64.
* syscall.c (dumpio): Handle SEN_mq_timedsend_time64,
SEN_mq_timedreceive_time64, and SEN_recvmmsg_time64.
* NEWS: Mention this.
Dmitry V. Levin [Sat, 11 May 2019 22:35:56 +0000 (22:35 +0000)]
Implement parsers of new *time64 system calls
* aio.c (SYS_FUNC(io_pgetevents_time64)): New function.
* desc.c (SYS_FUNC(pselect6_time64)): Likewise.
* futex.c (SYS_FUNC(futex_time64)): Likewise.
* ipc_sem.c (SYS_FUNC(semtimedop_time64)): Likewise.
* mmsghdr.c (SYS_FUNC(recvmmsg_time64)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend_time64),
SYS_FUNC(mq_timedreceive_time64)): Likewise.
* poll.c (SYS_FUNC(ppoll_time64)): Likewise.
* sched.c (SYS_FUNC(sched_rr_get_interval_time64)): Likewise.
* signal.c (SYS_FUNC(rt_sigtimedwait_time64)): Likewise.
* time.c (SYS_FUNC(clock_settime64), SYS_FUNC(clock_gettime64),
SYS_FUNC(clock_nanosleep_time64), SYS_FUNC(timer_settime64),
SYS_FUNC(timer_gettime64), SYS_FUNC(timerfd_settime64),
SYS_FUNC(timerfd_gettime64)): Likewise.
* utimes.c (SYS_FUNC(utimensat_time64)): Likewise.
* linux/dummy.h (sys_clock_getres_time64): Redirect
to sys_clock_gettime64.
Dmitry V. Levin [Sat, 11 May 2019 22:35:56 +0000 (22:35 +0000)]
Use new parsers of adjtimex and clock_adjtime syscalls
* print_timex.c (struct_timex, print_timex): Remove.
* time.c (SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Remove.
* linux/alpha/syscallent.h [303]: Replace SEN(adjtimex)
with SEN(adjtimex32).
[366]: Replace SEN(adjtimex) with SEN(adjtimex64).
[499]: Replace SEN(clock_adjtime) with SEN(clock_adjtime64).
* linux/32/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime)
with SEN(adjtimex32) and SEN(clock_adjtime32), respectively.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* linux/64/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime)
with SEN(adjtimex64) and SEN(clock_adjtime64), respectively.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* tests/adjtimex.c: Include <stddef.h>.
(main): Print struct timex.tai unconditionally.
Dmitry V. Levin [Sat, 11 May 2019 22:35:56 +0000 (22:35 +0000)]
Implement parsers of 64-bit adjtimex and clock_adjtime syscalls
* time.c (SYS_FUNC(clock_adjtime64)): New function.
[SPARC64] (SYS_FUNC(clock_sparc64_adjtime)): Likewise.
[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(adjtimex64)): Likewise.
Dmitry V. Levin [Sat, 11 May 2019 22:35:56 +0000 (22:35 +0000)]
Implement parsers of 32-bit adjtimex and clock_adjtime syscalls
* time.c [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(adjtimex32),
SYS_FUNC(clock_adjtime32)): New functions.
Dmitry V. Levin [Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)]
sparc64: implement printer for sparc64-specific struct timex
According to Linux kernel commit v5.1-rc1~160^2~2^2~8, sparc64 is the
only architecture on Linux that has a 'timeval' definition with a 32-bit
tv_usec but a 64-bit tv_sec.
* defs.h [SPARC64] (print_sparc64_timex): New prototype.
* kernel_timex.h [SPARC64] (kernel_sparc64_timex_t): New type.
* print_timex.c [SPARC64] (print_sparc64_timex): New function.
Dmitry V. Levin [Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)]
Implement printer for kernel_timex64_t
This is going to be used to implement clock_adjtime64 parser.
* defs.h (kernel_timex64_t): New prototype.
* print_timex.c (print_timex64): New function.
Dmitry V. Levin [Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)]
Implement printer for kernel_timex32_t
This is going to be used to re-implement parsers of syscalls that deal
with 32-bit struct timex.
* print_timex.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (print_timex32): New prototype.
* print_timex.c: Include "kernel_timex.h".
[HAVE_ARCH_TIME32_SYSCALLS] (print_timex32): New function.
Dmitry V. Levin [Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)]
Introduce kernel_timex64_t
This is going to be used to implement clock_adjtime64 parser.
* kernel_timex.h (kernel_timex64_t): New type.
Dmitry V. Levin [Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)]
Introduce kernel_timex32_t
Currently existing parsers of syscalls that deal with 32-bit timex
rely upon struct timex being defined in libc and match the definition
used by the kernel. Given the upcoming y2038 changes in glibc,
this new type is going to be used instead.
* kernel_timex.h: New file.
* Makefile.am (strace_SOURCES): Add it.
Dmitry V. Levin [Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)]
Re-implement mpersified timespec printers using timespec32/timespec64 printers
* print_timespec.c (UTIME_NOW, UTIME_OMIT, TIMESPEC_TO_SEC_NSEC,
timespec_fmt, print_sec_nsec, print_timespec_t, print_timespec_t_utime):
Remove.
(TIMESPEC_IS_32BIT, PRINT_TIMESPEC_DATA_SIZE,
PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC,
PRINT_TIMESPEC_UTIME_PAIR,PRINT_ITIMERSPEC): New macros.
(print_struct_timespec_data_size): Invoke PRINT_TIMESPEC_DATA_SIZE.
(print_struct_timespec_array_data_size): Invoke
PRINT_TIMESPEC_ARRAY_DATA_SIZE.
(print_timespec): Invoke PRINT_TIMESPEC.
(sprint_timespec): Invoke SPRINT_TIMESPEC.
(print_timespec_utime_pair): Invoke PRINT_TIMESPEC_UTIME_PAIR.
(print_itimerspec): Invoke PRINT_ITIMERSPEC.
Dmitry V. Levin [Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)]
Implement printers for kernel_timespec64_t
They are going to be used to re-implement parsers of syscalls that deal
with 64-bit timespec, and to implement parsers of new *time64 syscalls.
* defs.h (print_timespec64_data_size, print_timespec64_array_data_size,
print_timespec64, sprint_timespec64, print_timespec64_utime_pair,
print_itimerspec64): New prototypes.
* print_timespec64.c: New file.
* Makefile.am (strace_SOURCES): Add it.
Dmitry V. Levin [Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)]
Implement printers for kernel_timespec32_t
They are going to be used to re-implement parsers of syscalls that deal
with 32-bit timespec.
* defs.h (print_timespec32_data_size, print_timespec32_array_data_size,
print_timespec32, sprint_timespec32, print_timespec32_utime_pair,
print_itimerspec32): New prototypes.
* print_timespec.h: New file based on print_timespec.c.
* print_timespec32.c: New file.
* Makefile.am (strace_SOURCES): Add them.
Dmitry V. Levin [Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)]
print_timespec.c: introduce helper macros and functions
They are going to be used to implement printers of other timespec
flavours, e.g. kernel_timespec32_t and kernel_timespec64_t.
* print_timespec.c (TIMESPEC_TO_SEC_NSEC): New macro.
(print_timespec_t_utime, sprint_timespec): Use it.
(print_sec_nsec): New function.
(print_timespec_t): Use it.
Dmitry V. Levin [Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)]
Introduce kernel_timespec64_t type
This type ais going to be used to implement parsers of syscalls
that deal with 64-bit timespec.
* kernel_timespec.h (kernel_timespec64_t): New type.
Dmitry V. Levin [Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)]
Introduce kernel_timespec32_t type
Currently existing parsers of syscalls that deal with 32-bit timespec
rely upon struct timespec being defined in libc and match the definition
used by the kernel. Given the upcoming y2038 changes in glibc,
this new type is going to be used instead.
* kernel_timespec.h: New file.
* Makefile.am (strace_SOURCES): Add it.
Dmitry V. Levin [Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)]
Introduce ARCH_TIMESIZE
This is going to be used to implement new timespec parsers.
* linux/arch_defs_.h [!ARCH_TIMESIZE] (ARCH_TIMESIZE): Define
to SIZEOF_LONG.
* linux/x32/arch_defs_.h (ARCH_TIMESIZE): Define to 8.
Dmitry V. Levin [Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)]
Introduce HAVE_ARCH_TIME32_SYSCALLS and HAVE_ARCH_OLD_TIME64_SYSCALLS
These are going to control whether to compile parsers of 32-bit and
old 64-bit time syscalls.
* linux/arch_defs_.h [!MIN_WORDSIZE] (MIN_WORDSIZE): Define.
[!HAVE_ARCH_TIME32_SYSCALLS] (HAVE_ARCH_TIME32_SYSCALLS): Define.
[!HAVE_ARCH_OLD_TIME64_SYSCALLS] (HAVE_ARCH_OLD_TIME64_SYSCALLS):
Define.
* linux/alpha/arch_defs_.h (HAVE_ARCH_TIME32_SYSCALLS): Define.
* linux/x32/arch_defs_.h (HAVE_ARCH_OLD_TIME64_SYSCALLS): Define.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
time.c: introduce do_timerfd_gettime and do_timerfd_settime
These are going to be used to implement parsers of timerfd_gettime64
and timerfd_settime64 syscalls.
* time.c (do_timerfd_settime, do_timerfd_gettime): New functions.
((SYS_FUNC(timerfd_settime)): Turn into a thin wrapper around
do_timerfd_settime.
((SYS_FUNC(timerfd_gettime)): Turn into a thin wrapper around
do_timerfd_gettime.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
time.c: introduce do_timer_gettime and do_timer_settime
These are going to be used to implement parsers of timer_gettime64 and
timer_settime64 syscalls.
* time.c (do_timer_settime, do_timer_gettime): New functions.
((SYS_FUNC(timer_settime)): Turn into a thin wrapper around
do_timer_settime.
((SYS_FUNC(timer_gettime)): Turn into a thin wrapper around
do_timer_gettime.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
time.c: introduce do_clock_gettime, do_clock_settime, and do_clock_nanosleep
These are going to be used to implement parsers of clock_gettime64,
clock_settime64, and clock_nanosleep_time64 syscalls.
* time.c (do_clock_settime, do_clock_gettime, do_clock_nanosleep): New
functions.
((SYS_FUNC(clock_settime)): Turn into a thin wrapper around
do_clock_settime.
((SYS_FUNC(clock_gettime)): Turn into a thin wrapper around
do_clock_gettime.
((SYS_FUNC(clock_nanosleep)): Turn into a thin wrapper around
do_clock_nanosleep.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
time.c: introduce do_clock_adjtime
This is going to be used to implement a parser of clock_adjtime64
syscall.
* time.c (do_clock_adjtime): New function.
((SYS_FUNC(clock_adjtime)): Turn into a thin wrapper around
do_clock_adjtime.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
do_adjtimex: parametrize print_timex
This is going to be used to implement a parser of clock_adjtime64
syscall.
* time.c (do_adjtimex): Add print_tx argument, invoke it
instead of print_timex.
(SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Pass print_timex
to do_adjtimex.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
utimes.c: introduce do_utimensat
This is going to be used to implement a parser of utimensat_time64
syscall.
* utimes.c (do_utimensat): New function.
(SYS_FUNC(utimensat)): Turn into a thin wrapper around do_utimensat.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
signal.c: introduce do_rt_sigtimedwait
This is going to be used to implement a parser of rt_sigtimedwait_time64
syscall.
* signal.c (do_rt_sigtimedwait): New function.
(SYS_FUNC(rt_sigtimedwait)): Turn into a thin wrapper around
do_rt_sigtimedwait.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
sched.c: introduce do_sched_rr_get_interval
This is going to be used to implement a parser of
sched_rr_get_interval_time64 syscall.
* sched.c (do_sched_rr_get_interval): New function.
(SYS_FUNC(sched_rr_get_interval)): Turn into a thin wrapper around
do_sched_rr_get_interval.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
poll.c: introduce do_ppoll
This is going to be used to implement a parser of ppoll_time64 syscall.
* poll.c (decode_poll_exiting): Add sprint_ts argument.
(SYS_FUNC(poll)): Pass sprint_timespec to decode_poll_exiting.
(do_ppoll): New function.
(SYS_FUNC(ppoll)): Turn into a thin wrapper around do_ppoll.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
mq.c: introduce do_mq_timedsend and do_mq_timedreceive
These are going to be used to implement parsers of mq_timedsend_time64
and mq_timedreceive_time64 syscalls.
* mq.c (do_mq_timedsend, do_mq_timedreceive): New functions.
(SYS_FUNC(mq_timedsend)): Turn into a thin wrapper around
do_mq_timedsend.
(SYS_FUNC(mq_timedreceive)): Turn into a thin wrapper around
do_mq_timedreceive.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
mmsghdr.c: introduce do_recvmmsg
This is going to be used to implement a parser of recvmmsg_time64
syscall.
* mmsghdr.c (do_recvmmsg): New function.
(SYS_FUNC(recvmmsg)): Turn into a thin wrapper around do_recvmmsg.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
ipc_sem.c: introduce do_semtimedop
This is going to be used to implement a parser of semtimedop_time64
syscall.
* ipc_sem.c (do_semtimedop): New function.
(SYS_FUNC(semtimedop)): Turn into a thin wrapper around do_semtimedop.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
futex.c: introduce do_futex
This is going to be used to implement a parser of futex_time64 syscall.
* futex.c (do_futex): New function.
(SYS_FUNC(futex)): Turn into a thin wrapper around do_futex.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
desc.c: introduce do_pselect6
This is going to be used to implement a parser of pselect6_time64
syscall.
* dec.c (do_pselect6): New function.
(SYS_FUNC(pselect6)): Turn into a thin wrapper around do_pselect6.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
print_io_getevents: parametrize print_timespec
This is going to be used to implement a parser of io_pgetevents_time64
syscall.
* aio.c (print_io_getevents): Add print_ts argument, invoke it
instead of print_timespec.
(SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): Pass print_timespec
to print_io_getevents.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn
These types are going to be used in signatures of functions that take
print_*time* functions as parameters.
* defs.h (print_obj_by_addr_fn, sprint_obj_by_addr_fn): New types.
* desc.c (decode_select): Use them.
Dmitry V. Levin [Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)]
Change signatures of print_*time* functions to match print_timex
Make all these functions that print time by address return -1 when
umove_or_printaddr() returns non-zero.
This helps to use these functions as parameters to other functions.
* defs.h [ALPHA] (print_timeval32, print_timeval32_utimes,
print_itimerval32): Change return type to int.
* desc.c (decode_select): Change return type of print_tv_ts to int.
* print_timespec.c (print_timespec, print_timespec_utime_pair,
print_itimerspec): Change return type to int, return -1 when
umove_or_printaddr() returns non-zero.
* print_timeval.c (print_timeval, print_timeval_utimes,
print_itimerval): Likewise.
[ALPHA] (print_timeval32, print_timeval32_utimes, print_itimerval32):
Likewise.
Dmitry V. Levin [Tue, 16 Apr 2019 00:27:42 +0000 (00:27 +0000)]
tests: robustify umount and umount2 tests against future kernel changes
Prepare for the rename of umount syscall to umount2 introduced by linux
kernel commits v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~16 on alpha
and ia64 architectures, respectively.
* tests/umount.c: Check for __NR_umount == __NR_umount2.
* tests/umount2.c: Likewise.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
alpha: wire up getegid, geteuid, and getppid syscalls
* linux/alpha/syscallent.h [530..532]: Wire up getegid, geteuid,
and getppid syscalls introduced on this architecture by linux commit
v5.1-rc1~160^2~3^2~1.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
alpha: wire up statfs64 and fstatfs64 syscalls
* linux/alpha/syscallent.h [528..529]: Wire up statfs64 and fstatfs64
syscalls introduced on this architecture by linux commit
v5.1-rc1~160^2~3^2~2.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
Wire up pkey_* and rseq syscalls on remaining architectures
* linux/alpha/syscallent.h [524..527]: Wire up pkey_mprotect,
pkey_alloc, pkey_free, and rseq syscalls introduced on this architecture
by linux commit v5.1-rc1~160^2~3^2~3.
* linux/hppa/syscallent.h [351..354]: Likewise.
* linux/ia64/syscallent.h [1024 + 330..333]: Likewise.
* linux/m68k/syscallent.h [381..384]: Likewise.
* linux/sh/syscallent.h [384..387]: Likewise.
* linux/sparc/syscallent.h [362..365]: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/s390/syscallent.h [384..386]: Wire up pkey_mprotect,
pkey_alloc, and pkey_free syscalls introduced on this architecture
by linux commit v5.1-rc1~160^2~3^2~3.
* linux/s390x/syscallent.h: Likewise.
* linux/xtensa/syscallent.h [352]: Wire up rseq syscall introduced
on this architecture by linux commit v5.1-rc1~160^2~3^2~3.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
Wire up direct ipc syscalls on m68k, mips, powerpc*, s390*, sh, sparc*, x86
* linux/i386/syscallent.h [393..402]: Wire up semget, semctl, shmget,
shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls
introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h [4393..4402]: Wire up semget, semctl,
shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls
introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4.
* linux/powerpc64/syscallent.h [392..402]: Wire up semtimedop, semget,
semctl, shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl
syscalls introduced on this architecture by linux commit
v5.1-rc1~160^2~3^2~4.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
powerpc, powerpc64: remove direct ipc syscall entries
* linux/powerpc/syscallent.h [366..377]: Remove entries reserved for
direct ipc syscalls, they were added by linux kernel commit
v4.4-rc1~98^2~32 and removed by linux kernel commit v4.4-rc6~5^2~2.
* linux/powerpc64/syscallent.h: Likewise.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
sh: wire up statx syscall
* linux/sh/syscallent.h [380]: Wire up statx syscall
introduced on sh by linux commit v5.1-rc1~160^2~3^2~7.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
m68k: wire up seccomp syscall
* linux/m68k/syscallent.h [380]: Wire up seccomp syscall
introduced on m68k by linux commit v5.1-rc1~160^2~3^2~9.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
arm: wire up kexec_file_load syscall
* linux/arm/syscallent.h [401]: Wire up kexec_file_load syscall
introduced on arm by linux commit v5.1-rc1~160^2~3^2~10.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
arm: wire up migrate_pages syscall
* linux/arm/syscallent.h [400]: Wire up migrate_pages syscall
introduced on arm by linux commit v5.1-rc1~160^2~3^2~11.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
alpha: wire up io_pgetevents syscall
* linux/alpha/syscallent.h [523]: Wire up io_pgetevents syscall
introduced on alpha by linux commit v5.1-rc1~160^2~3^2~13.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
ia64: wire up perf_event_open and seccomp syscalls
* linux/ia64/syscallent.h [1024 + 327..328]: Wire up perf_event_open
and seccomp syscalls introduced on ia64 by linux commit
v5.1-rc1~160^2~3^2~14.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
ia64: wire up statx and io_pgetevents syscalls
* linux/ia64/syscallent.h [1024 + 326..327]: Wire up statx and
io_pgetevents syscalls introduced on ia64 by linux commit
v5.1-rc1~160^2~3^2~15.
* NEWS: Mention this.
Dmitry V. Levin [Mon, 15 Apr 2019 00:39:53 +0000 (00:39 +0000)]
ia64: make syscall entry table numbers more readable
* linux/ia64/syscallent.h: Format syscall numbers using base+offset form.
* scno.am (SCNO_SED): Update to handle this format.
Guo Ren [Sat, 23 Mar 2019 00:56:14 +0000 (08:56 +0800)]
Add C-SKY architecture support
This is port of C-SKY architecture for strace. There is a little
difference between abiv1 and abiv2, we use __CSKYABIV2__ from GCC-csky
to distinguish.
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Reviewed-By: Dmitry V. Levin <ldv@altlinux.org>
* cacheflush.c [CSKY] (cacheflush_flags, SYS_FUNC(cacheflush)): Define.
* clone.c [CSKY] (ARG_*): Define.
* configure.ac [$host_cpu == csky*]: Define CSKY.
* linux/csky/arch_regs.c: New file.
* linux/csky/get_error.c: Likewise.
* linux/csky/get_scno.c: Likewise.
* linux/csky/get_syscall_args.c: Likewise.
* linux/csky/ioctls_arch0.h: Likewise.
* linux/csky/ioctls_inc0.h: Likewise.
* linux/csky/raw_syscall.h: Likewise.
* linux/csky/set_error.c: Likewise.
* linux/csky/set_scno.c: Likewise.
* linux/csky/syscallent.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* NEWS: Mention this change.
Guo Ren [Fri, 22 Mar 2019 08:58:17 +0000 (16:58 +0800)]
riscv: Fixup wrong clone's arguments define
In linux kernel riscv select CLONE_BACKWARDS in
linux/arch/riscv/Kconfig, and in linux/kernel/fork.c:
ifdef CONFIG_CLONE_BACKWARDS
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
int __user *, parent_tidptr,
unsigned long, tls,
int __user *, child_tidptr)
elif ...
So we must make the riscv clone-arguments' sequence to be:
define ARG_FLAGS 0
define ARG_STACK 1
define ARG_PTID 2
define ARG_TLS 3
define ARG_CTID 4
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Reviewed-By: Dmitry V. Levin <ldv@altlinux.org>
* clone.c [RISCV]: Use default definitions for ARG_* macros.
* NEWS: Mention this fix.
Dmitry V. Levin [Wed, 20 Mar 2019 23:31:27 +0000 (23:31 +0000)]
Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 5.0-1.
* strace.spec.in: Likewise.
Dmitry V. Levin [Tue, 19 Mar 2019 03:04:05 +0000 (03:04 +0000)]
Prepare for 5.0 release
* NEWS: Update for 5.0 release.
Dmitry V. Levin [Tue, 19 Mar 2019 03:04:05 +0000 (03:04 +0000)]
.mailmap: add more entries to avoid duplication in CREDITS
Dmitry V. Levin [Mon, 18 Mar 2019 19:06:47 +0000 (19:06 +0000)]
strace.spec.in: do not define Group tag for modern distros
* strace.spec.in (Group): Conditionalize on distro version.
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
Dmitry V. Levin [Mon, 18 Mar 2019 19:06:47 +0000 (19:06 +0000)]
strace-log-merge: enhance pid formatting
* strace-log-merge (max_suffix_length): New variable.
(iterate_logfiles, process_suffix, process_logfile): New functions.
Use them to choose the optimum width for pid column.
* NEWS: Mention this enhancement.
* tests/strace-log-merge-suffix.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
Dmitry V. Levin [Mon, 18 Mar 2019 19:06:47 +0000 (19:06 +0000)]
strace-log-merge: fix error diagnostics
* strace-log-merge: Print error diagnostics and exit with a non-zero
status in case of no strace output.
* NEWS: Mention this fix.
* tests/strace-log-merge-error.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
Fixes: v4.21~287 "strace-log-merge: work around corner cases of strace -ttt parsing"
Eugene Syromyatnikov [Mon, 18 Mar 2019 17:48:37 +0000 (18:48 +0100)]
Update NEWS
Dmitry V. Levin [Mon, 18 Mar 2019 02:40:16 +0000 (02:40 +0000)]
Update copyright year number range
* COPYING: Update copyright year number range.
* tests/COPYING: Likewise.
* debian/copyright: Likewise.
Dmitry V. Levin [Mon, 18 Mar 2019 02:40:16 +0000 (02:40 +0000)]
Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
Dmitry V. Levin [Mon, 18 Mar 2019 02:40:16 +0000 (02:40 +0000)]
Fix preprocessor indentation
Indent the C preprocessor directives to reflect their nesting
using the following script:
$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
done
Shankara Pailoor [Sun, 13 Jan 2019 23:34:04 +0000 (15:34 -0800)]
Honor xlat styles when decoding mac addresses
* defs.h (print_mac_addr): Add xlat_style support, move ...
* print_mac.c: ... here.
* tests/sockaddr_xlat.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Include
<bluetooth/bluetooth.h>, <bluetooth/hci.h>, <bluetooth/l2cap.h>
<bluetooth/rfcomm.h>, and <bluetooth/sco.h>.
[HAVE_BLUETOOTH_BLUETOOTH_H] (check_sco, check_rc): New functions.
(main) [HAVE_BLUETOOTH_BLUETOOTH_H]: Call them to verify
new xlat_style support in print_mac_addr().
* tests/net-packet_mreq.c: Handle XLAT_RAW, XLAT_ABBREV,
and XLAT_VERBOSE macros.
* tests/net-packet_mreq-Xabbrev.c: New test.
* tests/net-packet_mreq-Xraw.c: Likewise.
* tests/net-packet_mreq-Xverbose.c: Likewise.
* tests/gen_tests.in (net-packet_mreq-Xabbrev, net-packet_mreq-Xraw,
net-packet_mreq-Xverbose): New tests.
* tests/pure_executables.list: Add net-packet_mreq-Xabbrev,
net-packet_mreq-Xraw, and et-packet_mreq-Xverbose.
* tests/.gitignore: Likewise.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Shankara Pailoor [Sun, 13 Jan 2019 23:34:04 +0000 (15:34 -0800)]
net: print mac address consistently
* net.c (print_packet_mreq): Call PRINT_FIELD_MAC_SZ instead of custom
print.
* tests/net-packet_mreq.c (test_packet_mreq): Update expected output.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Sun, 17 Mar 2019 14:36:56 +0000 (14:36 +0000)]
Change -D option to imply -I4
* strace.c (init) [daemonized_tracer && !opt_intr]: Set opt_intr
to INTR_BLOCK_TSTP_TOO.
* strace.1.in: Document this.
* NEWS: Mention this change.
Resolves: https://github.com/strace/strace/issues/96
Tuan Hoang [Thu, 14 Mar 2019 09:18:22 +0000 (10:18 +0100)]
s390: fix SIGNAL_FRAMESIZE macro
Since __SIGNAL_FRAMESIZE is in private name space, it is better not to
use it directly. This macro has been stable on s390/s390x so it is safe
to use the integer value.
* linux/s390/arch_sigreturn.c [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE):
Define to 96.
* linux/s390x/arch_sigreturn.c (arch_sigreturn == s390_arch_sigreturn):
Remove S390_SIGNAL_FRAMESIZE and SIGNAL_FRAMESIZE.
(arch_sigreturn == s390x_arch_sigreturn): Define SIGNAL_FRAMESIZE.
* linux/s390/rt_sigframe.h (SIGNAL_FRAMESIZE): Define.
(struct_rt_sigframe): Replace __SIGNAL_FRAMESIZE with SIGNAL_FRAMESIZE.
Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com>
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Thu, 14 Mar 2019 01:57:38 +0000 (01:57 +0000)]
bpf: add support for new seven fields in BPF_PROG_LOAD
* bpf_attr.h (struct BPF_PROG_LOAD_struct): Add prog_btf_fd,
func_info_rec_size, func_info, func_info_cnt, line_info_rec_size,
line_info, and line_info_cnt fields.
* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode these fields
introduced by Linux commits v5.0-rc1~129^2~209^2~16^2~8 and
v5.0-rc1~129^2~114^2~5^2~6.
* tests/bpf.c (BPF_PROG_LOAD_checks): Check it.
* tests/kernel_version.c (print_bpf_attr): Update expected output.
* tests/bpf-obj_get_info_by_fd.c (print_prog_load): Likewise.
Dmitry V. Levin [Wed, 13 Mar 2019 18:38:51 +0000 (18:38 +0000)]
bpf: implement decoding of BPF_TASK_FD_QUERY command
BPF_TASK_FD_QUERY command was introduced by Linux commit
v4.18-rc1~114^2~148^2~1^2~5.
* bpf_attr.h (struct BPF_TASK_FD_QUERY_struct): New type.
(BPF_TASK_FD_QUERY_struct_size,
expected_BPF_TASK_FD_QUERY_struct_size): New macros.
* bpf.c: Include "xlat/bpf_task_fd_type.h".
(BEGIN_BPF_CMD_DECODER(BPF_TASK_FD_QUERY)): New bpf command decoder.
(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
BPF_CMD_ENTRY(BPF_TASK_FD_QUERY).
* xlat/bpf_task_fd_type.in: New file.
* tests/bpf.c (union bpf_attr_data): Add
BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY).
(BPF_TASK_FD_QUERY_checks): New checks array.
(main) <checks>: Add CHK(BPF_TASK_FD_QUERY).
Dmitry V. Levin [Wed, 13 Mar 2019 18:38:51 +0000 (18:38 +0000)]
bpf: implement decoding of BPF_MAP_LOOKUP_AND_DELETE_ELEM command
BPF_MAP_LOOKUP_AND_DELETE_ELEM command was introduced by Linux commit
v4.20-rc1~151^2~32^2~11^2~2.
* bpf.c (decode_BPF_MAP_LOOKUP_AND_DELETE_ELEM): Alias
to decode_BPF_MAP_LOOKUP_ELEM.
(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_ELEM).
* tests/bpf.c (BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks): Alias
to BPF_MAP_LOOKUP_ELEM_checks.
(main) <checks>: Add CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM).
Dmitry V. Levin [Wed, 13 Mar 2019 18:38:51 +0000 (18:38 +0000)]
bpf: implement decoding of BPF_BTF_GET_FD_BY_ID command
BPF_BTF_GET_FD_BY_ID command was introduced by Linux commit
v4.18-rc1~114^2~223^2~21^2~4.
* bpf_attr.h (struct BPF_BTF_GET_FD_BY_ID_struct): New type.
(BPF_BTF_GET_FD_BY_ID_struct_size,
expected_BPF_BTF_GET_FD_BY_ID_struct_size): New macros.
* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_GET_FD_BY_ID)): New bpf command
decoder.
(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
BPF_CMD_ENTRY(BPF_BTF_GET_FD_BY_ID).
* tests/bpf.c (union bpf_attr_data): Add
BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID).
(BPF_BTF_GET_FD_BY_ID_checks): New checks array.
(main) <checks>: Add CHK(BPF_BTF_GET_FD_BY_ID).
Dmitry V. Levin [Wed, 13 Mar 2019 18:38:51 +0000 (18:38 +0000)]
bpf: implement decoding of BPF_BTF_LOAD command
BPF_BTF_LOAD command was introduced by Linux commit
v4.18-rc1~114^2~417^2~1^2~5.
* bpf_attr.h (struct BPF_BTF_LOAD_struct): New type.
(BPF_BTF_LOAD_struct_size, expected_BPF_BTF_LOAD_struct_size): New
macros.
* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_LOAD)): New bpf command decoder.
(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add BPF_CMD_ENTRY(BPF_BTF_LOAD).
* tests/bpf.c (union bpf_attr_data): Add
BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD).
(init_BPF_BTF_LOAD_attr): New function.
(BPF_BTF_LOAD_checks): New checks array.
(main) <checks>: Add CHK(BPF_BTF_LOAD).
Dmitry V. Levin [Wed, 13 Mar 2019 18:38:51 +0000 (18:38 +0000)]
bpf: make decoders of BPF_*_GET_FD_BY_ID commands return RVAL_FD
These bpf commands return file descriptors.
* bpf.c (BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID): Add RVAL_FD
to END_BPF_CMD_DECODER.