]>
granicus.if.org Git - strace/log
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.
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: add support for new twelve fields in struct bpf_prog_info
* bpf_attr.h (struct bpf_prog_info_struct): Add btf_id,
func_info_rec_size, func_info, nr_func_info, nr_line_info, line_info,
jited_line_info, nr_jited_line_info, line_info_rec_size,
jited_line_info_rec_size, nr_prog_tags, and prog_tags fields.
* bpf.c (struct obj_get_info_saved): Add func_info_rec_size,
nr_func_info, nr_line_info, jited_line_info, nr_jited_line_info,
line_info_rec_size, jited_line_info_rec_size, and nr_prog_tags fields.
(print_bpf_prog_info): Decode the twelve fields introduced by Linux
commits v5.0-rc1~129^2~209^2~16^2~8, v5.0-rc1~129^2~114^2~5^2~6,
v5.0-rc1~129^2~114^2^2~2, and v5.0-rc1~129^2~15^2~22.
* NEWS: Mention the latest bpf decoding enhancements.
* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
Resolves: https://github.com/strace/strace/issues/94
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: add support for *jited_ksyms and *jited_func_lens fields in struct bpf_prog_info
* bpf_attr.h (struct bpf_prog_info_struct): Add nr_jited_ksyms,
nr_jited_func_lens, jited_ksyms, and jited_func_lens fields.
* bpf.c (struct obj_get_info_saved): Likewise.
(print_bpf_prog_info): Decode these fields introduced by Linux commits
v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2.
* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: add support for btf_* fields in struct bpf_map_info
* bpf_attr.h (struct bpf_map_info_struct): Add btf_fd, btf_key_type_id,
and btf_value_type_id fields.
* bpf.c (print_bpf_map_info): Decode btf_fd, btf_key_type_id,
and btf_value_type_id fields introduced by Linux commits
v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2.
* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: add support for btf_* fields in BPF_MAP_CREATE
* bpf_attr.h (struct BPF_MAP_CREATE_struct): Add btf_fd,
btf_key_type_id, and btf_value_type_id fields.
* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode btf_fd,
btf_key_type_id, and btf_value_type_id fields introduced by Linux
commits v4.18-rc1~114^2~417^2~1^2~3 and v4.18-rc1~114^2~148^2~7^2~2.
* tests/bpf.c (BPF_MAP_CREATE_checks): Check it.
* tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
output.
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: print struct bpf_prog_info.gpl_compatible
This bit field was added by Linux commit v4.18-rc1~114^2~376^2~6.
* bpf_attr.h (struct bpf_prog_info_struct): Add gpl_compatible field.
* bpf.c (print_bpf_prog_info): Print gpl_compatible field.
* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
Dmitry V. Levin [Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)]
bpf: exclude bit fields from the check
Currently we have no instruments to check the size and offsets
of bit fields.
* gen_bpf_attr_check.sh: Do not print bit fields.
* m4/gen_bpf_attr_m4.awk: Likewise.
Eugene Syromyatnikov [Wed, 8 Aug 2018 19:41:39 +0000 (21:41 +0200)]
Implement queueing of threads before dispatching them
It is possible that some tracees call a lot of cheap syscalls too fast,
and that can stress the tracer to the point some tracees are not served
for indefinite amount of time. In order to avoid that unfairness, try
to collect all the pending tracees first along with the relevant
information and only then dispatch the events.
* defs.h: Include "list.h".
(struct tcb): Add wait_data_idx, delayed_wait_data, and wait_list
fields.
* strace.c (struct tcb_wait_data): Add "msg" field.
(tcb_wait_tab, tcb_wait_tab_size): New static variables.
(alloctcb): Initialize wait_list.
(droptcb): Remove tcp from wait_list.
(maybe_switch_tcbs): Get old pid from
tcb_wait_tab[tcp->wait_data_idx].msg instead of calling
ptrace(PTRACE_GETEVENTMSG).
(trace_wait_data_size, init_trace_wait_data, copy_trace_wait_data,
free_trace_wait_data, tcb_wait_tab_check_size): New functions, in order
to allow the code outside next_event to operate with wait_data as with
an opaque object (needed for dispatch_event and restart_delayed_tcb).
(next_event): Add pending_tcps, extra_tcp, wait_nohang, elem, and
wait_tab_pos variables; check for elements in pending_tcps and skip
waiting if the list is not empty; check for extra_tcp and skip waiting
along with swapping wait_data_idx with wait_extra_data_idx;
after the initial wait4(), call wait4() in loop with WNOHANG flag set;
fetch siginfo on signal and eventmsg on PTRACE_EVENT_EXEC;
return the first tcp in pending_tcps list.
(dispatch_event): Store a pointer to a copy of tcb_wait_data in
tcp->delayed_wait_data if tcp's restart has to be delayed.
(restart_delayed_tcb): Use tcp->delayed_wait_data, create a stub
tcb_wait_data if it is NULL, free temporary trace_wait_data.
* tests/Makefile.am (XFAIL_TEST): Remove looping_threads.test.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=478419
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=526740
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=851457
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=
1609318
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=
1610774
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Co-Authored-by: Denys Vlasenko <dvlasenk@redhat.com>
Co-Authored-by: Andreas Schwab <aschwab@redhat.com>
Co-Authored-by: Jeff Law <law@redhat.com>
Co-Authored-by: DJ Delorie <dj@redhat.com>
Eugene Syromyatnikov [Sun, 11 Sep 2016 09:11:45 +0000 (12:11 +0300)]
Add a generic list implementation
Similar to the one used in the Linux kernel.
* macros.h (cast_ptr, containerof): New macros.
* list.h: New file.
* Makefile.am (strace_SOURCES): Add it.
Dmitry V. Levin [Wed, 4 Jul 2018 02:11:27 +0000 (02:11 +0000)]
tests: check tracing of looping threads
* test/many_looping_threads.c: Remove.
* test/.gitignore: Remove many_looping_threads.
* test/Makefile (PROGS): Likewise.
(many_looping_threads): Remove.
* tests/looping_threads.c: New file.
* tests/looping_threads.test: New test.
* tests/.gitignore: Add looping_threads.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(looping_threads_LDADD): New variable.
(MISC_TESTS, XFAIL_TESTS): Add looping_threads.test.
Dmitry V. Levin [Wed, 6 Mar 2019 23:20:39 +0000 (23:20 +0000)]
Bump SYS_socket_subcall from 400 to 500
Make room for syscalls that are going to be introduced in Linux 5.1.
* linux/i386/syscallent.h (SYS_socket_subcall): Raise from 400 to 500.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h (SYS_socket_subcall): Raise from 4400
to 4500.
* linux/mips/syscallent-n64.h (SYS_socket_subcall): Raise from 5400
to 5500.
* linux/mips/syscallent-n32.h (SYS_socket_subcall): Raise from 6400
to 6500.
Dmitry V. Levin [Wed, 6 Mar 2019 16:02:38 +0000 (16:02 +0000)]
tests: check tracing of orphaned process group
* tests/orphaned_process_group.c: New file.
* tests/.gitignore: Add orphaned_process_group.
* tests/Makefile.am (check_PROGRAMS): Likewise.
* tests/gen_tests.in (orphaned_process_group): New test.
Dmitry V. Levin [Wed, 6 Mar 2019 16:02:38 +0000 (16:02 +0000)]
tests: move PTRACE_SEIZE check to a separate file
The check is going to be used by another test soon.
* tests/PTRACE_SEIZE.sh: New file.
* tests/detach-stopped.test: Use it.
* tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh.
Eugene Syromyatnikov [Thu, 21 Feb 2019 15:55:51 +0000 (16:55 +0100)]
strace.c: fix up formatting after commit v4.24~48
The commit v4.24~48 "Implement -e kvm= option on all architectures",
while removing #ifdef, left formatting of the help message string a bit
inconsistent.
* strace.c (usage): Move "\n\" bit after "kvm", remove double quotes.
Complements: v4.24~48 "Implement -e kvm= option on all architectures"
Eugene Syromyatnikov [Thu, 21 Feb 2019 15:52:46 +0000 (16:52 +0100)]
tests: fix xgetrlimit output when syscall returns an error
* tests/xgetrlimit.c (main): Expect pointer to rlimit as the second
argument when syscall returns an error. Use sprintrc().
Eugene Syromyatnikov [Thu, 21 Feb 2019 11:56:29 +0000 (12:56 +0100)]
strace.c: pass signal number to cleanup()
* strace.c (die): Pass 0 as an argument to cleanup().
(cleanup): Add fatal_sig parameter, remove the local variable
of the same name, do not use interrupted.
(terminate): Initialise a new local variable "sig" with "interrupted",
pass it to cleanup() and use it instead of "interrupted" for exit_code
initialisation.
Gleb Fotengauer-Malinovskiy [Mon, 25 Feb 2019 14:47:20 +0000 (17:47 +0300)]
Update ioctl entries from linux v5.0
* linux/32/ioctls_inc_align16.h: Update from linux v5.0-rc8
using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* linux/64/ioctls_inc.h: Likewise.
* linux/x32/ioctls_inc0.h: Likewise.
* linux/aarch64/ioctls_arch0.h: Likewise.
* linux/arm/ioctls_arch0.h: Likewise.
* linux/mips/ioctls_arch0.h: Likewise.
* linux/powerpc/ioctls_arch0.h: Likewise.
* linux/s390/ioctls_arch0.h: Likewise.
* linux/s390x/ioctls_arch0.h: Likewise.
* NEWS: Mention this.
Gleb Fotengauer-Malinovskiy [Mon, 25 Feb 2019 14:36:16 +0000 (17:36 +0300)]
maint: update for linux 5.0-rc8
* maint/ioctls_sym.sh (x86_list): Add KVM_GET_SUPPORTED_HV_CPUID.
Dmitry V. Levin [Sun, 24 Feb 2019 23:37:00 +0000 (23:37 +0000)]
xlat/gen.sh: disable file name globbing by default
As the script uses file name globbing only in one place,
disable it by default and enable it when necessary.
* xlat/gen.sh: Add -f to shebang.
(main): Enable file name globbing to generate the list of input files.
Eugene Syromyatnikov [Tue, 5 Feb 2019 23:49:47 +0000 (00:49 +0100)]
xlat/gen.sh: speedup, part 5
* xlat/gen.sh (gen_header): Process xlat line with sed only when "/*"
substring is present in it.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Eugene Syromyatnikov [Tue, 5 Feb 2019 23:49:47 +0000 (00:49 +0100)]
xlat/gen.sh: speedup, part 4
* xlat/gen.sh (cond_xlat): Use read instead of sed for xlat entry
parsing.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Eugene Syromyatnikov [Tue, 5 Feb 2019 23:49:47 +0000 (00:49 +0100)]
xlat/gen.sh: speedup, part 3
* xlat/gen.sh (cond_def): Use parameter substitution instead of sed
for xlat line parsing.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>