dwww Home | Show directory contents | Find package

2022-12-12  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 6.1 release.
        * NEWS: Update for 6.1 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2022-12-11  Dmitry V. Levin  <ldv@strace.io>

        statx: decode new fields added to struct statx.
        * src/statx.h (struct_statx): Add stx_mnt_id, stx_dio_mem_align,
        and stx_dio_offset_align fields, update reserved2 field.
        * src/statx.c (SYS_FUNC(statx)): Print the new fields when
        the appropriate bits of struct statx.stx_mask are set.
        * tests/xstatx.c (print_stat) [IS_STATX]: Update expected output.
        * NEWS: Mention this change.

        statx: honor struct statx.stx_mask.
        * src/statx.c (SYS_FUNC(statx)): Make printing of optional struct statx
        fields dependent on the value of struct statx.stx_mask.
        * tests/xstatx.c (print_stat): Update expected output.

        xlat: update TLS_* constants.
        * src/xlat/tls_info_ciphers.in (TLS_CIPHER_ARIA_GCM_128,
        TLS_CIPHER_ARIA_GCM_256): New constants introduced by Linux kernel
        commit v6.1-rc1~170^2~85.
        * tests/nlattr_inet_diag_msg.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update STATX_* constants.
        * src/xlat/statx_masks.in (STATX_DIOALIGN): New constant introduced
        by Linux kernel commit v6.1-rc1~187^2~7.
        * tests/xstatx.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update PERF_* constants.
        * src/xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_PRIV_SAVE):
        New constant introduced by Linux kernel commit v6.1-rc1~97^2~60.
        * tests/perf_event_open.c (BRANCH_TYPE_ALL, main): Update expected
        output.
        * NEWS: Mention this change.

        xlat: update NLMSGERR_* constants.
        * src/xlat/nlmsgerr_attrs.in (NLMSGERR_ATTR_MISS_TYPE,
        NLMSGERR_ATTR_MISS_NEST): New constants introduced by Linux kernel
        commit v6.1-rc1~170^2~313^2~4.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_DIRTY_LOG_RING_ACQ_REL): New constant
        introduced by Linux kernel commit v6.1-rc1~49^2~1^2~1^2~4.
        * NEWS: Mention this change.

        xlat: update ABS_* constants.
        * src/xlat/evdev_abs.in (ABS_PROFILE): New constant introduced
        by Linux kernel commit v6.1-rc1~54^2^2~9.
        * NEWS: Mention this change.

        xlat: update IFLA_* constants.
        * src/xlat/rtnl_link_attrs.in (IFLA_ALLMULTI): New constant introduced
        by Linux kernel commit v6.1-rc1~170^2~218.
        * src/rtnl_link.c (ifinfomsg_nla_decoders) <IFLA_ALLMULTI>: New entry.
        * NEWS: Mention this change.

        xlat: update ETH_P_* constants.
        * src/xlat/ethernet_protocols.in (ETH_P_CANXL): New constant introduced
        by Linux kernel commit v6.1-rc1~170^2~209^2^2~2.
        * tests/nlattr_ifla_vfinfo.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update COUNTER_* constants.
        * src/xlat/counter_ioctl_event_types.in (COUNTER_EVENT_CAPTURE): New
        constant introduced by Linux kernel commit v6.1-rc1~113^2~16.
        * tests/ioctl_counter.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update BTRFS_* constants.
        * src/xlat/btrfs_features_compat_ro.in
        (BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE): New constant introduced
        by Linux kernel commit v6.1-rc1~142^2~102.
        * NEWS: Mention this change.

        xlat: update BPF_* constants.
        * src/xlat/bpf_map_types.in (BPF_MAP_TYPE_USER_RINGBUF): New constant
        introduced by Linux kernel commit v6.1-rc1~170^2~10^2~39^2~3.
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Update.

        xlat: update MADV_* constants.
        * src/xlat/madvise_cmds.in (MADV_COLLAPSE): New constant
        introduced by Linux kernel commit v6.1-rc1~21^2~577.
        * NEWS: Mention this.

2022-12-11  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v6.1.
        In addition to linux/io_uring.h that was excluded from updates because
        of non-trivial implications caused by use of linux/time_types.h in that
        header file starting with v6.0, linux/in.h is also excluded from updates
        due to its use of linux/stddef.h starting with v6.1.

        * bundled/linux/include/uapi/asm-generic/hugetlb_encode.h: Update to
        headers_install'ed Linux kernel v6.1.
        * bundled/linux/include/uapi/linux/btrfs.h: Likewise.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/counter.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/input-event-codes.h: Likewise.
        * bundled/linux/include/uapi/linux/landlock.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/ipset/ip_set.h: Likewise.
        * bundled/linux/include/uapi/linux/netlink.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
        * bundled/linux/include/uapi/linux/stat.h: Likewise.
        * bundled/linux/include/uapi/linux/tls.h: Likewise.
        * bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/linux/include/uapi/mtd/mtd-abi.h: Likewise.
        * bundled/linux/include/uapi/mtd/ubi-user.h: Likewise.

2022-12-10  Dmitry V. Levin  <ldv@strace.io>

        Reduce sysctl decoder to the bare minimum.
        Given that sysctl syscall was removed by Linux kernel commit
        v5.5-rc1~102^2, do not spend limited resources on the incomplete decoder
        of sysctl syscall and reduce it to the bare minimum.  At the same time,
        add mpers support and a test for the new decoder to make sure it works
        properly.

        * src/sysctl.c: Rewrite.
        * src/xlat/sysctl_*.in: Remove.
        * tests/sysctl.c: New file.
        * tests/gen_tests.in (sysctl): New test.
        * tests/pure_executables.list: Add sysctl.
        * tests/.gitignore: Likewise.

2022-12-09  Dmitry V. Levin  <ldv@strace.io>

        ia64: use sysctl decoder.
        Apparently, sysctl syscall has never been decoded on ia64.  Although the
        syscall is now removed from the Linux kernel, it's never late to fix the
        decoder on ia64.

        * src/linux/ia64/syscallent.h (sysctl): Use the sysctl decoder
        instead of printargs.

2022-12-02  Dmitry V. Levin  <ldv@strace.io>

        .github: switch from actions/checkout@v2 to actions/checkout@v3.
        This fixes the following diagnostic warning:

          Node.js 12 actions are deprecated. For more information see:
          https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

        * .github/workflows/ci.yml: Replace actions/checkout@v2 with
        actions/checkout@v3.

2022-11-28  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v6.1.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v6.1-rc7 using
        ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2022-11-28  Dmitry V. Levin  <ldv@strace.io>

        print_icmp_filter: fix icmp_filter decoding on 64-bit bigendian architectures
        * src/net.c (print_icmp_filter): Fix next_set_bit usage.

        Fixes: v6.0-27-g238f5799f "print_icmp_filter: print icmp_filter as a bitset"
        Resolves: https://github.com/strace/strace/issues/229

2022-11-27  Dmitry V. Levin  <ldv@strace.io>

        src: introduce tprint_attribute_{begin,end} helpers.
        * src/print_fields.h (tprint_attribute_begin, tprint_attribute_end):
        New inline functions.
        * src/print_instruction_pointer.c (print_instruction_pointer): Use them.
        * src/print_syscall_number.c (print_syscall_number): Likewise.
        * src/secontext.c (selinux_printfdcon, selinux_printfilecon,
          selinux_printpidcon): Likewise.
        * src/strace.c (printleader): Likewise.
        * src/syscall.c (stub_sysent): Update sys_name.
        * tests/kill_child.c: Update comment.
        * tests/kill_child.test: Update expected output.

        src: introduce tprint_associated_info_{begin,end} helpers.
        * src/print_fields.h (tprint_associated_info_begin,
        tprint_associated_info_end): New inline functions.
        * src/open.c (print_dirfd): Use them.
        * src/strace.c (print_comm_str): Likewise.
        * src/syscall.c (syscall_exiting_trace): Likewise.
        * src/util.c (print_string_in_angle_brackets, printdev, printpidfd,
        print_quoted_string_in_angle_brackets): Likewise.

2022-11-27  Dmitry V. Levin  <ldv@strace.io>

        dm: decode dm_ioctl as a pseudoarray.
        Somewhat similar to netlink messages, dm_ioctl data is a struct dm_ioctl
        header followed by payload.

        * src/dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
        dm_decode_dm_name_list, dm_decode_dm_target_versions,
        dm_decode_dm_target_msg, dm_decode_string): Use tprint_array_next
        to print separator between payload records.
        (dm_decode_header, dm_decode_payload): New functions.
        (dm_known_ioctl): Use them.
        * tests/ioctl_dm.c (main): Update expected output.

2022-11-27  Dmitry V. Levin  <ldv@strace.io>

        src: introduce tprint_newline() helper.
        * src/print_fields.h (tprint_newline): New inline function.
        * src/strace.c (ptrace_restart, printleader, maybe_switch_tcbs,
        print_signalled, print_exited, print_stopped, print_event_exit): Use it.
        * src/syscall.c (syscall_exiting_trace): Likewise.

        src: introduce tprint_null() helper.
        * src/print_fields.h (tprint_null): New inline function.
        * src/util.c (printaddr64, printpathn, printstr_ex, print_array_ex):
        Use it.

2022-11-26  Dmitry V. Levin  <ldv@strace.io>

        print_icmp_filter: print icmp_filter as a bitset.
        * src/xlat/icmp_filter_flags.in: New file.
        * src/xlat/icmpfilterflags.in: Remove.
        * src/net.c: Include "xlat/icmp_filter_flags.h" instead of
        "xlat/icmpfilterflags.h".
        (print_icmp_filter): Print struct icmp_filter.data as a bitset.
        * tests/net-icmp_filter.c (main): Update expected output.

        print_affinitylist: use tprint_bitset_* helpers to print bitsets.
        * src/affinity.c (print_affinitylist): Replace tprint_array_* helpers
        with the corresponding tprint_bitset_* helpers.
        * tests/io_uring_register.c (main): Update expected output.
        * tests/sched_xetaffinity.c (main): Likewise.

2022-11-25  Dmitry V. Levin  <ldv@strace.io>

        mips: fix decoding of ioctl 't' commands.
        Similar to alpha, powerpc, and sparc architectures, some of tty ioctl
        commands on mips also have type 't'.

        * src/ioctl.c (ioctl_decode) [MIPS]: Handle type 't'.

2022-11-25  Dmitry V. Levin  <ldv@strace.io>

        xlat/modem_flags: fix fallback definitions for mips.
        * src/xlat/modem_flags.in [__mips__] (TIOCM_ST, TIOCM_SR, TIOCM_CTS,
        TIOCM_CAR, TIOCM_RNG, TIOCM_DSR): Provide correct fallback
        definitions.
        * tests/ioctl_tiocm.c [__mips__] (VALID_FLAGS, INVALID_FLAGS):
        Provide correct definitions.

        Fixes: v6.0-10-gebc5d9e24 "xlat: update TIOCM_* constants"

2022-11-25  Dmitry V. Levin  <ldv@strace.io>

        s390: use more print_fields.h helpers.
        * src/s390.c (decode_ebcdic, print_sthyi_machine, print_sthyi_guest,
        guard_storage_print_gscb): Use tprint_struct_next.
        (guard_storage_print_gsepl): Use tprint_struct_next,
        tprint_indirect_begin, and tprint_indirect_end.
        (SYS_FUNC(s390_guarded_storage), SYS_FUNC(s390_runtime_instr)):
        Use tprint_arg_next.
        (SYS_FUNC(s390_sthyi)): Use tprint_arg_next and PRINT_VAL_X.
        (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
        Use tprint_arg_next, PRINT_VAL_X, and PRINT_VAL_U.

2022-11-24  Dmitry V. Levin  <ldv@strace.io>

        strace.spec.in: skip tests for all 32-bit architectures on fedora and rhel
        gcc on the latest versions of fedora and rhel fails to compile
        strace tests not just for x86 architecture but for armv7 as well.

        * strace.spec.in (%check) [fedora >= 35 || rhel > 9]: Skip on all
        32-bit architectures.

2022-11-24  Yaakov Selkowitz  <yselkowitz@fedoraproject.org>

        strace.spec.in: skip tests for x86 architecture on ELN.
        * strace.spec.in (%check): Skip on %ix86 and rhel > 9.

2022-11-24  Dmitry V. Levin  <ldv@strace.io>

        swapon: use more print_fields.h helpers.
        * src/swapon.c (SYS_FUNC(swapon)): Use PRINT_VAL_U.

2022-11-23  Dmitry V. Levin  <ldv@strace.io>

        sockaddr: use more print_fields.h helpers.
        * src/sockaddr.c (print_sockaddr_data_ll): Use PRINT_VAL_0X.

2022-11-22  Dmitry V. Levin  <ldv@strace.io>

        netlink_netlink_diag: use more print_fields.h helpers.
        * src/netlink_netlink_diag.c (print_group): Use PRINT_VAL_0X.

2022-11-21  Dmitry V. Levin  <ldv@strace.io>

        numa: use more print_fields.h helpers.
        * src/numa.c (print_node): Use PRINT_VAL_0X.
        * tests/get_mempolicy.c (print_nodes): Update expected output.
        * tests/set_mempolicy.c (print_nodes): Likewise.

2022-11-20  Dmitry V. Levin  <ldv@strace.io>

        personality: use more print_fields.h helpers.
        * src/personality.c (SYS_FUNC(personality)): Use PRINT_VAL_X.

2022-11-19  Dmitry V. Levin  <ldv@strace.io>

        tests: fix injection tests on ia64 architecture.
        * tests/filtering_syscall-syntax.test: Use 1025 instead of 1 as a valid
        syscall on ia64 architecture.
        * tests/qual_fault.test: Use 1068 instead of 51 as a valid syscall
        on ia64 architecture.
        * tests/qual_inject-syntax.test: Use 1068 instead of 42 as a valid
        syscall on ia64 architecture.
        * tests/qual_syscall.test: Likewise.
        * NEWS: Mention this change.

        Fixes: v5.17~48 "Enhance rejection of invalid syscall numbers in syscall specification expressions"

2022-11-13  Dmitry V. Levin  <ldv@strace.io>

        term: modernize.
        * src/term.c: Do not include xlat/termio_cc.h unless _VMIN is defined.
        Use macros from print_fields.h.
        (decode_termios2, decode_termios): Do not print c_cc[VMIN]
        and c_cc[VTIME] twice.
        (decode_termio): Do not print c_cc[_VMIN] and c_cc[_VTIME] twice.
        * tests/ioctl_termios.c: Update expected output.
        * NEWS: Mention this change.

2022-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add struct termios-related ioctl command test.

        term: improve decoding of termios and termio structures.
        Closes: https://github.com/strace/strace/issues/130

2022-11-12  Dmitry V. Levin  <ldv@strace.io>

        tprint_array_index_end: remove extra whitespace from the output.
        * src/print_fields.h (tprint_array_index_end): Remove extra whitespace
        from the output around '='.
        * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected
        output.
        * tests/io_uring_register.c (main): Likewise.
        * tests/nlattr_ifla_af_inet6.h (print_arr_val, print_arr_uval): Likewise.
        * tests/nlattr_ifstats.c (PR_FIELD_, FIELD_STR_): Likewise.
        * tests/nlattr_inet_diag_msg.c (print_uint): Likewise.

2022-11-06  Dmitry V. Levin  <ldv@strace.io>

        xlat: update TIOCM_* constants.
        * src/xlat/modem_flags.in: Provide fallback definitions.
        (TIOCM_OUT1, TIOCM_OUT2, TIOCM_LOOP): New constants introduced
        before Linux kernel commit v2.6.12-rc2.
        * tests/ioctl_tiocm.c (main): Update expected output.

        tests: check decoding of ioctl TIOCM* commands.
        * tests/ioctl_tiocm.c: New file.
        * tests/gen_tests.in (ioctl_tiocm): New test.
        * tests/pure_executables.list: Add ioctl_tiocm.
        * tests/.gitignore: Likewise.

2022-11-05  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of ioctl TIOC[GS]WINSZ commands.
        * tests/ioctl_winsize.c: New file.
        * tests/gen_tests.in (ioctl_winsize): New test.
        * tests/pure_executables.list: Add ioctl_winsize.
        * tests/.gitignore: Likewise.

2022-11-05  Dmitry V. Levin  <ldv@strace.io>

        sparc: fix decoding of ioctl 't' commands.
        Similar to alpha and powerpc architectures, some of tty ioctl commands
        on sparc are also have type 't'.

        * src/ioctl.c (ioctl_decode) [SPARC || SPARC64]: Handle type 't'.

2022-11-04  Dmitry V. Levin  <ldv@strace.io>

        src: introduce tprint_space() helper.
        * src/print_fields.h (tprint_space): New inline function.
        * src/print_instruction_pointer.c (print_instruction_pointer): Use it.
        * src/print_syscall_number.c (print_syscall_number): Likewise.
        * src/secontext.c (selinux_printfdcon, selinux_printfilecon,
        selinux_printpidcon): Likewise.
        * src/strace.c (printleader): Likewise.
        * src/syscall.c (syscall_exiting_trace): Likewise.

2022-11-03  Dmitry V. Levin  <ldv@strace.io>

        v4l2: use tprint_value_changed() helper from print_fields.h.
        * src/v4l2.c (print_v4l2_streamparm, print_v4l2_tuner,
        print_v4l2_ext_controls): Use tprint_struct_next, tprint_struct_begin,
        tprint_struct_end, and tprint_value_changed.

2022-11-02  Dmitry V. Levin  <ldv@strace.io>

        src: introduce tprint_plus() helper.
        * src/print_fields.h (tprint_plus): New inline function.
        * src/bpf_sock_filter.c (print_sock_filter_k): Use it.
        * src/ptrace.c (print_user_offset_addr): Likewise.
        * src/sockaddr.c (print_bluetooth_l2_psm, print_bluetooth_l2_cid):
        Likewise.
        * tests/net-sockaddr.c (check_l2): Update expected output.

2022-11-01  Dmitry V. Levin  <ldv@strace.io>

        src: use tprint_shift() helper from print_fields.h.

2022-10-31  Dmitry V. Levin  <ldv@strace.io>

        src: use tprint_or() helper from print_fields.h.

2022-10-30  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 6.0-1.
        * strace.spec.in: Likewise.

2022-10-29  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 6.0 release.
        * NEWS: Update for 6.0 release.

2022-10-23  Dmitry V. Levin  <ldv@strace.io>

        strace.spec.in: skip tests for x86 architecture on the latest fedora versions
        gcc on the latest versions of fedora fails to compile strace tests for
        x86 architecture, and given that fedora is phasing out that
        architecture, there is no hope that issue is ever going to be fixed.

        * strace.spec.in (%check): Skip on %ix86 and fedora >= 35.

2022-10-17  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2022-10-16  Dmitry V. Levin  <ldv@strace.io>

        strace.1: fix typos.
        * doc/strace.1.in (.SH HISTORY): Fix two typos.

        Reported-by: Roland Illig <roland.illig@gmx.de>

2022-10-10  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v6.0.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v6.0 using
        ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2022-10-09  Dmitry V. Levin  <ldv@strace.io>

        xlat: update TLS_INFO_* constants.
        * src/xlat/inet_diag_ulp_info_tls_attrs.in (TLS_INFO_RX_NO_PAD):
        New constant introduced by Linux kernel commit v6.0-rc1~141^2~193^2~2.
        * src/netlink_inet_diag.c (diag_ulp_info_tls_nla_decoders): Add
        TLS_INFO_RX_NO_PAD.
        * tests/nlattr_inet_diag_msg.c (tls_unk_attrs): Update expected output.
        * NEWS: Mention this change.

        xlat: update PERF_* constants.
        * src/xlat/perf_event_read_format.in (PERF_FORMAT_LOST): New constant
        introduced by Linux kernel commit v6.0-rc1~199^2~3.
        * tests/ioctl_perf.c (main): Update expected output.
        * tests/perf_event_open.c (read_formats): Likewise.
        * NEWS: Mention this change.

        xlat: update NDTPA_* constants.
        * src/xlat/rtnl_neightbl_parms_attrs.in (NDTPA_INTERVAL_PROBE_TIME_MS):
        New constant introduced by Linux kernel commit v6.0-rc1~141^2~249^2.
        * src/rtnl_neightbl.c (ndt_parms_nla_decoders): Decode
        NDTPA_INTERVAL_PROBE_TIME_MS.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_VM_TSC_CONTROL): New constant
        introduced by Linux kernel commit v5.19-rc1~137^2~83^2~14.
        (KVM_CAP_SYSTEM_EVENT_DATA): New constant introduced
        by Linux kernel commit v5.18-rc5~1^2~2^2~1.
        (KVM_CAP_ARM_SYSTEM_SUSPEND): New constant introduced
        by Linux kernel commit v5.19-rc1~137^2~12^2~4^2~6.
        (KVM_CAP_S390_PROTECTED_DUMP): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~389^2~70^2~7.
        (KVM_CAP_X86_TRIPLE_FAULT_EVENT): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~389^2~12.
        (KVM_CAP_X86_NOTIFY_VMEXIT): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~389^2~9.
        (KVM_CAP_VM_DISABLE_NX_HUGE_PAGES): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~169.
        (KVM_CAP_S390_ZPCI_OP): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~34^2~21^2~1.
        (KVM_CAP_S390_CPU_TOPOLOGY): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6^2~34^2.
        * src/xlat/kvm_exit_reason.in (KVM_EXIT_RISCV_CSR): New constant
        introduced by Linux kernel commit v6.0-rc1~129^2~7^2~4.
        (KVM_EXIT_NOTIFY): New constant introduced
        by Linux kernel commit v6.0-rc1~129^2~6.
        * NEWS: Mention this change.

        xlat: update ETH_P_* constants.
        * src/xlat/ethernet_protocols.in (ETH_P_DSA_A5PSW): New constant
        introduced by Linux kernel commit v6.0-rc1~141^2~283^2~13.
        * NEWS: Mention this change.

        xlat: update FAN_MARK_* constants.
        * src/xlat/fan_mark_flags.in (FAN_MARK_IGNORE): New constant
        introduced by Linux kernel commit v6.0-rc1~219^2~1.
        * tests/fanotify_mark.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update NT_S390_* constants.
        * src/xlat/nt_descriptor_types.in (NT_S390_PV_CPU_DATA): New constant
        introduced by Linux kernel commit v6.0-rc1~81^2~5.
        * NEWS: Mention this change.

        xlat: update BTRFS_* constants.
        * src/xlat/btrfs_send_flags.in (BTRFS_SEND_FLAG_COMPRESSED): New
        constant introduced by Linux kernel commit v6.0-rc1~146^2~125.
        * NEWS: Mention this change.

        xlat: update BPF_* constants.
        * src/xlat/bpf_attach_type.in (BPF_LSM_CGROUP): New constant
        introduced by Linux kernel commit v6.0-rc1~141^2~163^2~30^2~8.
        * tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output.
        * NEWS: Mention this change.

2022-10-07  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v6.0.
        linux/io_uring.h is excluded from this update because of non-trivial
        implications caused by changes made to this header file in v6.0.

        * bundled/linux/include/uapi/linux/blkzoned.h: Update to
        headers_install'ed Linux kernel v6.0-rc7.
        * bundled/linux/include/uapi/linux/btrfs.h: Likewise.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/dm-ioctl.h: Likewise.
        * bundled/linux/include/uapi/linux/fiemap.h: Likewise.
        * bundled/linux/include/uapi/linux/fs.h: Likewise.
        * bundled/linux/include/uapi/linux/fscrypt.h: Likewise.
        * bundled/linux/include/uapi/linux/if_alg.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/inet_diag.h: Likewise.
        * bundled/linux/include/uapi/linux/ip_vs.h: Likewise.
        * bundled/linux/include/uapi/linux/neighbour.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/rtnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/tls.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/linux/include/uapi/mtd/mtd-abi.h: Likewise.
        * bundled/linux/include/uapi/rdma/ib_user_verbs.h: Likewise.

2022-10-07  Marvin Schmidt  <marv@exherbo.org>

        sysent: Provide proper function prototype to fix -Wdeprecated-non-prototype
        clang-15 emits an error because the `sys_func` function pointer of the sysent struct doesn't declare
        an argument list:

        > make[3]: Entering directory '/home/marv/devel/strace/src'
        > clang -DHAVE_CONFIG_H   -I./linux/x86_64 -I./linux/x86_64 -I./linux/generic -I./linux/generic -I. -I. -I../bundled/linux/arch/x86/include/uapi -I../bundled/linux/include/uapi -DIN_STRACE=1      -I./bundled/linux/arch/x86/include/uapi -I./bundled/linux/include/uapi -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wdate-time -Wformat-security -Winit-self -Winitializer-overrides -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wundef -Wwrite-strings -Werror   -Wall -g -ggdb3 -O0 -c -o libstrace_a-syscall.o `test -f 'syscall.c' || echo './'`syscall.c
        > syscall.c:670:65: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
        >         int res = raw(tcp) ? printargs(tcp) : tcp_sysent(tcp)->sys_func(tcp);
        >                                                                        ^
        > syscall.c:815:39: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
        >                         sys_res = tcp_sysent(tcp)->sys_func(tcp);
        >                                                            ^
        > 2 errors generated.

        * src/sysent.h (struct tcb): Add forward declaration.
        (struct sysent): Use it to provide a proper prototype of sys_func field.

        Resolves: https://github.com/strace/strace/pull/225

2022-10-03  Dmitry V. Levin  <ldv@strace.io>

        tests: fix build on aarch64.
        This fixes the following compilation errors on aarch64

          In file included from ptrace-Xraw.c:2:
          ptrace.c: In function 'check_compat_ptrace_req':
          ptrace.c:1662:28: error: expected expression before ',' token
           1662 |                req, NRAW(s), pid, errstr);
                |                            ^
          ptrace.c:1667:28: error: expected expression before ',' token
           1667 |                req, NRAW(s), pid, errstr);
                |                            ^

        * tests/ptrace.c [__arm64__ || __aarch64__] (check_compat_ptrace_req):
        Update to new NRAW semantics by switching to use XLAT_RAW instead.

        Fixes: v5.19-4-g10eba44ca "tests: make {,N}{ABBR,RAW,VERB} macros more versatile"

2022-10-02  Dmitry V. Levin  <ldv@strace.io>

        xstring.h: fix typo in comment.

2022-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printsiginfo: consider all POLL_* si_codes as a valid reason to print si_band/si_fd
        * src/printsiginfo.c (print_si_info) <case SIGIO>: Add POLL_ERR,
        POLL_PRI, and POLL_HUP to the POLL_* case.

        printsiginfo: decode SIGEMT the same way as SIG{ILL,FPE,SEGV,BUS}
        * src/printsiginfo.c (print_si_info) [SIGEMT] <case SIGEMT>: Add
        to the SIGILL/SIGFPE/SIGSEGV/SIGBUS case.

        printsiginfo: dispatch signal code names using an array.
        * src/printsiginfo.c (print_si_code): Consolidate xlat pointers
        into an array, dispatch over it using si_code.

        xlat: update sysctl_kern.
        * xlat/sysctl_kern.in (KERN_PANIC_PRINT): New constant, introduced
        by Linux commit v5.0-rc1~38^2~16.

        rtnl_neigh: enhance NDA_PROTOCOL decoding.
        * src/rtnl_neigh.c (ndmsg_nla_decoders) <[NDA_PROTOCOL]>: Decode as
        an IP protocol.

2022-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: rename XFS_SB_MAGIC to XFS_SUPER_MAGIC.
        Per Linux commit v4.20-rc1~139^2~13.

        * src/xlat/fsmagic.in (XFS_SUPER_MAGIC): Rename from XFS_SB_MAGIC.

2022-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        powerpc, powerpc64: replace empty syscall entries with comments.
        * src/linux/powerpc/syscallent.h ([224]): Remove, add a comment about
        unused slot for security syscall.
        * src/linux/powerpc64/syscallent.h ([192]): Remove, add a comment about
        powerpc32-only mmap2.
        ([193]): Remove, add a comment about powerpc32-only truncate64.
        ([194]): Remove, add a comment about powerpc32-only ftruncate64.
        ([195]): Remove, add a comment about powerpc32-only stat64.
        ([196]): Remove, add a comment about powerpc32-only lstat64.
        ([197]): Remove, add a comment about powerpc32-only fstat64.
        ([204]): Remove, add a comment about powerpc32-only fcntl64.
        ([224]): Remove, add a comment about unused slot for security syscall.
        ([226]): Remove, add a comment about powerpc32-only sendfile64.
        ([254]): Remove, add a comment about powerpc32-only fadvise64_64.

        sparc, sparc64: replace empty syscall entries with comments.
        * src/linux/sparc/syscallent.h ([52]): Remove, add a comment that
        it is memory_ordering on sparc64.
        ([164]): Remove, add a comment that it is utrap_install on sparc64.
        * src/linux/sparc64/syscallent.h ([31]): Remove, add a comment that
        it is lchown32 on sparc32.
        ([32]): Remove, add a comment that it is fchown32 on sparc32.
        ([35]): Remove, add a comment that it is chown32 on sparc32.
        ([44]): Remove, add a comment that it is getuid32 on sparc32.
        ([53]): Remove, add a comment that it is getgid32 on sparc32.
        ([56]): Remove, add a comment that it is mmap2 on sparc32.
        ([69]): Remove, add a comment that it is geteuid32 on sparc32.
        ([70]): Remove, add a comment that it is getegid32 on sparc32.
        ([72]): Remove, add a comment that it is setreuid32 on sparc32.
        ([77]): Remove, add a comment that it is truncate64 on sparc32.
        ([82]): Remove, add a comment that it is setgroups32 on sparc32.
        ([84]): Remove, add a comment that it is ftruncate64 on sparc32.
        ([87]): Remove, add a comment that it is setuid32 on sparc32.
        ([89]): Remove, add a comment that it is setgid32 on sparc32.
        ([91]): Remove, add a comment that it is setfsuid32 on sparc32.
        ([94]): Remove, add a comment that it is setfsgid32 on sparc32.
        ([112]): Remove, add a comment that it is setregid32 on sparc32.
        ([115]): Remove, add a comment that it is getgroups32 on sparc32.
        ([155]): Remove, add a comment that it is fcntl64 on sparc32.
        ([231]): Remove, add a comment that it is time on sparc32.

2022-10-02  Dmitry V. Levin  <ldv@strace.io>

        tests: fix build on some platforms.
        This fixes the following compilation issues on platforms
        where __s64 is not defined to "long long":

          ioctl_ptp.c:268:11: error: format '%lld' expects argument of type 'long long int', but argument 4 has type '__s64' {aka 'long int'} [-Werror=format=]
          ioctl_ptp.c:268:11: error: format '%lld' expects argument of type 'long long int', but argument 5 has type '__s64' {aka 'long int'} [-Werror=format=]
          ioctl_ptp.c:355:24: error: format '%lld' expects argument of type 'long long int', but argument 3 has type '__s64' {aka 'long int'} [-Werror=format=]
          ioctl_ptp.c:490:29: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
          ioctl_ptp.c:498:36: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
          ioctl_ptp.c:509:35: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
          ioctl_ptp.c:581:25: error: format '%lld' expects argument of type 'long long int', but argument 3 has type '__s64' {aka 'long int'} [-Werror=format=]

        * tests/ioctl_ptp.c (test_no_device): Explicitly cast
        struct ptp_clock_time.sec to "long long".

        Fixes: v5.19-5-g03eb34004 "ptp: update decoder"

2022-09-25  Dmitry V. Levin  <ldv@strace.io>

        Print the second argument of setns syscall as flags.
        Starting with Linux kernel commit v5.8-rc1~175^2~1, when the first
        argument of setns syscall is a descriptor obtained from pidfd_open
        syscall, the second argument of setns syscall is treated as a bit mask
        rather than a single CLONE_NEW* constant.

        * src/clone.c (SYS_FUNC(setns)): Print tcp->u_arg[1] using printflags
        instead of printxval.
        * src/xlat/setns_types.in (0): Remove.
        * tests/setns.c: Check it.
        * NEWS: Mention this change.

2022-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ptp: update decoder.
        CHECK_*_SIZE checks are added as minimum safe-guards against implicit
        decoding breakages, since the types infrastructure, that would allow proper
        checking, has been removed in v5.11~8.

        * src/xlat/ptp_pin_funcs.in: New file.
        * src/ptp.c: Include "xlat/ptp_pin_funcs.h".
        (print_ptp_clock_time): Add rtc argument that signifies that the clock
        data is RTC-like, so it is worthy of pretty-printing;  print reserved
        field if it is non-zero; print time in the ISO 8601 format only if rtc
        argument is set and the xlat decoding format is not raw.
        (print_ptp_clock_time_am): Pass true in the rtc argument
        to print_ptp_clock_time.
        (print_ptp_clock_time3_am): New function.
        (PRINT_RSV): New macro.
        (ptp_ioctl): Re-order switch cases to reflect the ioctl macros
        declaration order.
        (ptp_ioctl) <case PTP_CLOCK_GETCAPS, case PTP_CLOCK_GETCAPS2>: Add size
        checks;  print n_pins, cross_timestamping, adjust_phase, and non-zero
        rsv fields.
        (ptp_ioctl) <case PTP_EXTTS_REQUEST, case PTP_EXTTS_REQUEST2>: Add size
        checks;  print index field as unsigned;  print non-zero rsv field
        for PTP_EXTTS_REQUEST2.
        (ptp_ioctl) <case PTP_PEROUT_REQUEST, case PTP_PEROUT_REQUEST2>: Add
        size checks;  print either phase (non-RTC) or start (RTC) field
        depending on the presence of PTP_PEROUT_PHASE among flags;  print period
        as non-RTC value;  print index as unsigned;  print "PTP_PEROUT_???"
        instead of "PTP_???" as flags fallback value;  print either on field or
        non-zero rsv field (only for PTP_PEROUT_REQUEST2) depending on presence
        of PTP_PEROUT_DUTY_CYCLE among flags.
        (ptp_ioctl) <case PTP_ENABLE_PPS, case PTP_ENABLE_PPS>: Print arg
        as unsigned.
        (ptp_ioctl) <case PTP_SYS_OFFSET, case PTP_SYS_OFFSET2>: Add size
        checks;  print non-zero rsv field on entering;  do not interpret the
        structure as unavailable in case of syscall error;  use MIN macro for
        n_samples calculation instead of open-coding it.
        (ptp_ioctl) <case PTP_PIN_GETFUNC, case PTP_PIN_GETFUNC2, case
        PTP_PIN_SETFUNC, case PTP_PIN_SETFUNC2, case PTP_SYS_OFFSET_PRECISE,
        case PTP_SYS_OFFSET_PRECISE2, case PTP_SYS_OFFSET_EXTENDED, case
        PTP_SYS_OFFSET_EXTENDED2>: Implement decoding.
        * tests/.gitignore: Add ioctl_ptp-Xabbrev, ioctl_ptp-Xraw,
        ioctl_ptp-Xverbose, ioctl_ptp-success, ioctl_ptp-success-Xabbrev,
        ioctl_ptp-success-Xraw, and ioctl_ptp-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_ptp-success,
        ioctl_ptp-success-Xabbrev, ioctl_ptp-success-Xraw,
        and ioctl_ptp-success-Xverbose.
        * tests/gen_tests.in (ioctl_ptp-Xabbrev, ioctl_ptp-Xraw,
        ioctl_ptp-Xverbose, ioctl_ptp-success, ioctl_ptp-success-Xabbrev,
        ioctl_ptp-success-Xraw, ioctl_ptp-success-Xverbose): New tests.
        * tests/ioctl_ptp-Xabbrev.c: New file.
        * tests/ioctl_ptp-Xraw.c: Likewise.
        * tests/ioctl_ptp-Xverbose.c: Likewise.
        * tests/ioctl_ptp-success-Xabbrev.c: Likewise.
        * tests/ioctl_ptp-success-Xraw.c: Likewise.
        * tests/ioctl_ptp-success-Xverbose.c: Likewise.
        * tests/ioctl_ptp-success.c: Likewise.
        * tests/ioctl_ptp.c: Update expected output, add checks.
        * tests/pure_executables.list: Add ioctl_ptp-Xabbrev, ioctl_ptp-Xraw,
        and ioctl_ptp-Xverbose.
        * NEWS: Mention it.

2022-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: make {,N}{ABBR,RAW,VERB} macros more versatile.
        These macros can be much more useful if they would be variadic
        and expand to nothing when they are used in the incompatible xlat
        decoding mode.

        * tests/tests.h (ABBR, RAW, VERB, NABBR, NRAW, NVERB): Change the
        argument to "...", expand into __VA_ARGS__/nothing instead of arg/"".
        * tests/io_uring_register.c: Update NRAW macro usage.
        * tests/nlattr_ifstats.c: Likewise.

2022-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: provide information about strace's native long/kernel_long_t sizes
        * tests/Makefile.am (STRACE_SIZEOF_KERNEL_LONG_T, STRACE_SIZEOF_LONG):
        New variables.
        (AM_CPPFLAGS): Add -DSTRACE_SIZEOF_KERNEL_LONG_T
        and -DSTRACE_SIZEOF_LONG.

2022-08-16  Dmitry V. Levin  <ldv@strace.io>

        .github: remove gcc7 jobs.
        This old compiler was provided by the old version of the OS that is
        currently being deprecated by github actions.

        * .github/workflows/ci.yml (gcc7-x86_64-kheaders, gcc7-x86_64-dw,
        gcc7-x86_64-unwind): Remove.

        Link: https://github.com/actions/runner-images/issues/6002

2022-08-15  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.19-1.
        * strace.spec.in: Likewise.

2022-08-12  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.19 release.
        * NEWS: Update for 5.19 release.

        Update .mailmap.
        * .mailmap: Add both email addresses of Sergei Trofimovich to avoid
        duplication in CREDITS file.

2022-08-11  Joubin Jabbari  <joubin@linux.com>

        README.md: update Fedora strace repo location.
        Resolves: https://github.com/strace/strace/pull/218

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add PR_SVE_[GS]ET_VL checks.
        Re-purpose prct-sme.c for that, since these commands identical
        to PR_SME_[GS]ET_VL so far, save for s/SME/SVE/ in identifier names.
        Retain the original prct-sve.c to retain test coverage diversity.

        * tests/.gitignore: Add prctl-sve-Xabbrev, prctl-sve-Xraw,
        prctl-sve-Xverbose, prctl-sve-success, prctl-sve-success-Xabbrev,
        prctl-sve-success-Xraw, and prctl-sve-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-sve-success,
        prctl-sve-success-Xabbrev, prctl-sve-success-Xraw,
        and prctl-sve-success-Xverbose.
        * tests/gen_tests.in (prctl-sve-Xabbrev, prctl-sve-Xraw,
        prctl-sve-Xverbose, prctl-sve-success, prctl-sve-success-Xabbrev,
        prctl-sve-success-Xraw, prctl-sve-success-Xverbose): New tests.
        * tests/prctl-sme.c [!EXT] (EXT): New macro.
        (EXT_STR, GLUE_, GLUE, _): New macros.
        (print_sme_vl_arg, main): Use _ and EXT_STR macros.
        * tests/prctl-sve-Xabbrev.c: New file.
        * tests/prctl-sve-Xraw.c: Likewise.
        * tests/prctl-sve-Xverbose.c: Likewise.
        * tests/prctl-sve-success-Xabbrev.c: Likewise.
        * tests/prctl-sve-success-Xraw.c: Likewise.
        * tests/prctl-sve-success-Xverbose.c: Likewise.
        * tests/prctl-sve-success.c: Likewise.
        * tests/pure_executables.list: Add prctl-sve-Xabbrev, prctl-sve-Xraw,
        and prctl-sve-Xverbose.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: expand so_error test checks.
        Check decoding with various optlen values.

        * tests/so_error.c: Add checks.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: print unexpectedly short integer sockopts in hex.
        Since it makes little sence to print ASCII character codes when we know
        that the bytes are part of a number.

        * src/net.c (print_get_error, print_txrehash, print_getsockopt): Use
        printstr_ex with QUOTE_FORCE_HEX parameter instead of printstrn.
        * tests/sockopt-sol_socket.c: Update expected output.

2022-08-11  Dmitry V. Levin  <ldv@strace.io>

        net: print the data returned by SO_ERROR as a string if it is too short.
        The data returned by getsockopt SO_ERROR is an integer.  If the buffer
        size specified by userspace is less than sizeof(int), the data written
        by the kernel should not be interpreted as an integer.

        * src/net.c (print_get_error): Print the buffer as a string if its
        length is less than sizeof(int).

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: implement SO_TXREHASH socket option support.
        * src/xlat/sock_options.in (SO_TXREHASH): New constant, introduced
        by Linux commit v5.18-rc1~136^2~484^2~3.
        * src/xlat/sockopt_txrehash_vals.in: New file.
        * src/net.c: Include "xlat/sockopt_txrehash_vals.h".
        (print_txrehash): New function.
        (print_getsockopt, print_setsockopt) <case SO_TXREHASH>: Call
        print_txrehash.
        * tests/sockopt-sol_socket.c: Add checks for SO_TXREHASH decoding.
        * NEWS: Mention it.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: add support for IORING_{,UN}REGISTER_PBUF_RING opcodes.
        Introduced by Linux commit v5.19-rc1~251^2~10.

        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_PBUF_RING,
        IORING_UNREGISTER_PBUF_RING): New constants.
        * src/io_uring.c (print_io_uring_buf_reg): New function.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_PBUF_RING,
        case IORING_UNREGISTER_PBUF_RING>: Call print_io_uring_buf_reg
        for decoding.
        * tests/io_uring_register.c: Update expected output, add checks.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: decode struct io_uring_rsrc_register.flags field.
        Introduced by Linux commit v5.19-rc1~251^2~20.

        * configure.ac: Remove struct io_uring_rsrc_register.resv check.
        * src/xlat/uring_register_rsrc_flags.in: New file.
        * src/io_uring.c: Include "xlat/uring_register_rsrc_flags.h".
        (print_io_uring_register_rsrc): Remove CHECK_TYPE_SIZE for arg.resv,
        decode flags field using PRINT_FIELD_FLAGS instead of optional decoding
        of no longer existing resv field.
        * tests/io_uring_register.c: Update expected output.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix ioctl_dm test with new kernel headers.
        Linux commit v5.19-rc2-1-g94dfc73e7cf4 replaced the zero-length array
        dm_target_msg.sector field declaration with a flexible-array declaration,
        which led to the following error when compiled with clang:

            ../../../tests/ioctl_dm.c:53:25: error: field 'target_msg' with variable
            sized type 'struct dm_target_msg' not at the end of a struct or class
            is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
                                    struct dm_target_msg target_msg;
                                                         ^
            1 error generated.

        Work around it by removing the following field and adjusting
        the untyped message size.

        * tests/ioctl_dm.c (struct s): Remove tm.target_string field, adjust
        string field size.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        arch_prctl: decode ARCH_GET_XCOMP_SUPP, ARCH_{GET,REQ}_XCOMP{,_GUEST}_PERM
        * src/xlat/archvals.in (ARCH_GET_XCOMP_SUPP, ARCH_GET_XCOMP_PERM,
        ARCH_REQ_XCOMP_PERM): New constants, introduced by Linux commit
        v5.16-rc1~195^2~21.
        (ARCH_GET_XCOMP_GUEST_PERM, ARCH_REQ_XCOMP_GUEST_PERM): New constants,
        introduced by Linux commit v5.17-rc1~15^2~70.
        * src/xlat/x86_xfeature_bits.in: New file.
        * src/xlat/x86_xfeatures.in: Likewise.
        * src/prctl.c [X86_64 || X32 || I386]: Include
        "xlat/x86_xfeature_bits.h", "xlat/x86_xfeatures.h".
        * tests/.gitignore: Add arch_prctl, arch_prctl-Xabbrev, arch_prctl-Xraw,
        arch_prctl-Xverbose, arch_prctl-success, arch_prctl-success-Xabbrev,
        arch_prctl-success-Xraw, and arch_prctl-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add arch_prctl-success,
        arch_prctl-success-Xabbrev, arch_prctl-success-Xraw,
        and arch_prctl-success-Xverbose.
        * tests/arch_prctl.c: New file.
        * tests/arch_prctl-Xabbrev.c: Likewise.
        * tests/arch_prctl-Xraw.c: Likewise.
        * tests/arch_prctl-Xverbose.c: Likewise.
        * tests/arch_prctl-success.c: Likewise.
        * tests/arch_prctl-success-Xabbrev.c: Likewise.
        * tests/arch_prctl-success-Xraw.c: Likewise.
        * tests/arch_prctl-success-Xverbose.c: Likewise.
        * tests/arch_prctl.sh: Likewise.
        * tests/gen_tests.in (arch_prctl, arch_prctl-Xabbrev, arch_prctl-Xraw,
        arch_prctl-Xverbose, arch_prctl-success, arch_prctl-success-Xabbrev,
        arch_prctl-success-Xraw, arch_prctl-success-Xverbose): New tests.
        * tests/prctl-success.sh (PRCTL_SYSCALL, PRCTL_MARKER_RE): New vaiables.
        Handle "ARCH_PRCTL_INJECT_RETVALS" in addition to "PRCTL_INJECT_RETVALS",
        set PRCTL_SYSCALL and PRCTL_MARKER_RE accordingly;  use $PRCTL_SYSCALL
        and $PRCTL_MARKER_RE in run_strace and sed calls.
        * tests/pure_executables.list: Add arch_prctl, arch_prctl-Xabbrev,
        arch_prctl-Xraw, and arch_prctl-Xverbose.
        * NEWS: Mention it.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: change the license from LGPL to GPL in some newly added files.
        * tests/fork--pidns-translation.c (SPDX-License-Identifier): Change
        from "LGPL-2.1-or-later" to "GPL-2.0-or-later".
        * tests/fork--pidns-translation.test: Likewise.
        * tests/gettid--pidns-translation.test: Likewise.
        * tests/ioctl_block--pidns-translation.test: Likewise.
        * tests/netlink_audit--pidns-translation.test: Likewise.
        * tests/pidns.c: Likewise.
        * tests/pidns.h: Likewise.
        * tests/prctl.sh: Likewise.

        References: v4.26~53 "tests: change the license to GPL-2.0-or-later"
        Fixes: v5.9~49 "Implement testing framework for pidns"
        Fixes: v5.9~48 "Add tests for PID namespace translation"
        Fixes: v5.13~9 "tests: unify common code in prctl decoder tests"

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_SME_[GS]ET_VL decoding.
        Introduced by Linux commit v5.19-rc1~38^2~8^2~22.

        * src/xlat/pr_sme_vl_flags.in: New file.
        * src/prctl.c: Include "xlat/pr_sme_vl_flags.h".
        (sprint_sme_val): New function.
        (SYS_FUNC(prctl)) <case PR_SME_SET_VL, case PR_SME_GET_VL>: Implement
        command decoders.
        * tests/.gitignore: Add prctl-sme, prctl-sme-Xabbrev, prctl-sme-Xraw,
        prctl-sme-Xverbose, prctl-sme-success, prctl-sme-success-Xabbrev,
        prctl-sme-success-Xraw, and prctl-sme-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-sme-success,
        prctl-sme-success-Xabbrev, prctl-sme-success-Xraw,
        and prctl-sme-success-Xverbose.
        * tests/gen_tests.in (prctl-sme, prctl-sme-Xabbrev, prctl-sme-Xraw,
        prctl-sme-Xverbose, prctl-sme-success, prctl-sme-success-Xabbrev,
        prctl-sme-success-Xraw, prctl-sme-success-Xverbose): New tests.
        * tests/prctl-sme.c: New file.
        * tests/prctl-sme-Xabbrev.c: Likewise.
        * tests/prctl-sme-Xraw.c: Likewise.
        * tests/prctl-sme-Xverbose.c: Likewise.
        * tests/prctl-sme-success.c: Likewise.
        * tests/prctl-sme-success-Xabbrev.c: Likewise.
        * tests/prctl-sme-success-Xraw.c: Likewise.
        * tests/prctl-sme-success-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add prctl-sme, prctl-sme-Xabbrev,
        prctl-sme-Xraw, and prctl-sme-Xverbose.

2022-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: improve PR_SVE_[SG]ET_VL decoding.
        * src/prctl.c (sprint_sve_val): Add aux parameter, handle printing based
        on it.
        (SYS_FUNC(prctl)): <case PR_SVE_SET_VL>: Pass false as aux
        to sprint_sve_val.
        (SYS_FUNC(prctl)): <case PR_SVE_GET_VL>: Pass true as aux
        to sprint_sve_val; return RVAL_HEX flag.
        * NEWS: Mention it.

        tests/ptrace: add comments for specific siginfo decoding checks.
        * tests/ptrace.c: Add comments with the signal names being tested.

        printsiginfo: print si_trapno for SIGFPE on alpha.
        * src/printsiginfo.c [ALPHA] (print_si_info) <case SIGFPE>: Print
        si_trapno.
        * tests/ptrace.c: Update expected output.

        printsiginfo: print si_trapno for SIGILL on sparc.
        * src/printsiginfo.c [SPARC || SPARC64] (print_si_info) <case SIGILL>:
        Print si_trapno.
        * tests/ptrace.c: Update expected output.

        printsiginfo: print si_[su]time as clock_t values.
        * src/printsiginfo.c (print_si_info): Print si_utime and si_stime using
        PRINT_FIELD_CLOCK_T macro.
        * tests/clone_ptrace.c: Update expected output.
        * tests/siginfo.c: Likewise.
        * tests/waitid.c: Likewise.

        tests: move enjoy_time in a separate header.
        * tests/times.c (NUM_USER_ITERS_SQRT, NUM_USER_ITERS, READ_BUF_SIZE,
        READ_ITER, nsecs, enjoy_time): Move it...
        * tests/time_enjoyment.h: ...in a new file.
        * tests/Makefile.am (EXTRA_DIST): Add it.

        tests: move clock_t_str from nlattr_ifla_linkinfo.c into a separate file
        * tests/nlattr_ifla_linkinfo.c (clock_t_str): Move it...
        * tests/clock_t_str.c: ...to a new file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        (LDADD): Add ${m_LIBS} after libtests.a.
        (nlattr_ifla_linkinfo_LDADD): Remove.
        * tests/tests.h (clock_t_str): New declaration.

2022-08-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printsiginfo: print relevant SI_SIGIO information.
        * src/printsiginfo.c (print_si_info) <case SI_SIGIO>: Print si_band
        and si_fd fields.
        * tests/ptrace.c: Add checks.

        printsiginfo: print si_fd for SIGIO signals.
        * src/printsiginfo.c (print_si_code, print_si_info): Use SIGIO instead
        of the SIGPOLL synonym in switch cases as that is what strace prints out.
        (print_si_info) <case SIGIO>: Print si_fd field.
        * tests/.gitignore: Add ptrace-y, ptrace-y-Xabbrev, ptrace-y-Xraw,
        and ptrace-y-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ptrace-y, ptrace-y-Xabbrev, ptrace-y-Xraw,
        ptrace-y-Xverbose): New tests.
        * tests/ptrace-y.c: New file.
        * tests/ptrace-y-Xabbrev.c: Likewise.
        * tests/ptrace-y-Xraw.c: Likewise.
        * tests/ptrace-y-Xverbose.c: Likewise.
        * tests/ptrace.c: Include <fcntl.h>.
        (NULL_FD, NULL_STR, NULL_FD_STR): New macros.
        (null_path): New constant variable.
        (main): Open null_path at NULL_FD fd, update expected SIGIO check
        output.

        printsiginfo: update SIGTRAP decoding.
        * src/xlat/alpha_trap_codes.in: New file.
        * src/xlat/sigtrap_perf_flags.in: Likewise.
        * configure.ac (AC_CHECK_MEMBERS): Add checks
        for siginfo_t.si_perf_data, siginfo_t.si_perf_type,
        and siginfo_t.si_perf_flags fields.
        * src/defs.h (perf_type_id): New extern definition.
        * src/printsiginfo.c [ALPHA]: Include "xlat/alpha_trap_codes.h".
        [HAVE_SIGINFO_T_SI_PERF_FLAGS]: Include "xlat/sigtrap_perf_flags.h".
        (print_si_info): Implement SIGTRAP case.
        * tests/ptrace.c: Add checks.

        printsiginfo: print si_lower/si_upper for SEGV_BNDERR signals.
        * configure.ac (AC_CHECK_MEMBERS): Add siginfo_t.si_lower
        and siginfo_t.si_upper checks.
        * src/printsiginfo.c (print_si_info): [!SEGV_STACKFLOW
        && HAVE_SIGINFO_T_SI_LOWER] <case SIGSEGV>: Print si_lower
        and si_upper fields if si_code is SEGV_BNDERR.
        * tests/ptrace.c: Add checks.

        printsiginfo: print si_addr_lsb for BUS_MCEERR_A[RO] signals.
        * configure.ac (AC_CHECK_MEMBERS): Add siginfo_t.si_addr_lsb check.
        * src/printsiginfo.c (print_si_info) [!BUS_OPFETCH
        && HAVE_SIGINFO_T_SI_ADDR_LSB] <case SIGBUS>: Print si_addr_lsb field
        is si_code is equal to BUS_MCEERR_AR or BUS_MCEERR_AO.
        * tests/ptrace.c: Add checks.
        * NEWS: Mention it.

        xlat: update NT_ARM_* constants in nt_descriptor_types.
        * src/xlat/nt_descriptor_types.in (NT_ARM_SSVE): New constant,
        introduced by Linux commit v5.19-rc1~38^2~8^2~13.
        (NT_ARM_ZA): New constant, introduced by Linux commit
        v5.19-rc1~38^2~8^2~12.

        xlat: switch perf xlats type from sorted to value_indexed.
        * src/xlat/hw_breakpoint_type.in: Change #sorted to #value_indexed
        * src/xlat/perf_hw_cache_id.in: Likewise.
        * src/xlat/perf_hw_cache_op_id.in: Likewise.
        * src/xlat/perf_hw_cache_op_result_id.in: Likewise.
        * src/xlat/perf_hw_id.in: Likewise.
        * src/xlat/perf_sw_ids.in: Likewise.
        * src/xlat/perf_type_id.in: Likewise.

        xlat: update v4l2_control_ids.
        * src/xlat/v4l2_control_ids.in
        (V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD,
        V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE): New constants,
        introduced by Linux commit v5.19-rc1~179^2~221.
        * NEWS: Mention it.

        xlat: update v4l2_pix_fmts.
        * src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_IPU3_Y10): New constant,
        introduced by Linux commit v5.19-rc1~179^2~35.
        (V4L2_PIX_FMT_QC08C, V4L2_PIX_FMT_QC10C): New constants, introduced
        by Linux commit v5.19-rc1~179^2~227.
        (V4L2_PIX_FMT_VP9_FRAME): New constant, introduced by Linux commit
        v5.17-rc1~114^2~207.
        (V4L2_PIX_FMT_NV12M_10BE_8L128, V4L2_PIX_FMT_NV12M_8L128): New
        constants, introduced by Linux commit v5.18-rc1~153^2~81^2~10.
        * NEWS: Mention it.

2022-08-07  Dmitry V. Levin  <ldv@strace.io>

        tests/nlattr_inet_diag_msg: fix big-endian systems support.
        * tests/nlattr_inet_diag_msg.c (print_uint): Fix md5sig_vecs
        for big-endian systems.
        (main): Fix sockopts for big-endian systems.

        Fixes: v5.18-37-gd9606c5f6 "netlink_inet_diag: implement INET_DIAG_MD5SIG attribute decoding"

2022-08-07  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

        xlat: update SECCOMP_FILTER_FLAG_* constants.
        * src/xlat/seccomp_filter_flags.in
        (SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV): New constant introduced
        by Linux kernel commit v5.19-rc1~198^2~3.
        * tests/seccomp-filter.c (main): Update expected output.
        * tests/seccomp-filter-v.c: Likewise.
        * NEWS: Mention this change.

        xlat: update PR_* constants.
        * src/xlat/prctl_options.in (PR_SME_SET_VL, PR_SME_GET_VL): New
        constants introduced by Linux kernel commit v5.19-rc1~38^2~8^2~22.
        * NEWS: Mention this change.

        xlat: update NLM_F_* constants.
        * src/xlat/netlink_delete_flags.in (NLM_F_BULK): New constant introduced
        by Linux kernel commit v5.19-rc1~159^2~322^2~8.
        * tests/netlink_route.c (test_nlmsg_flags): Check it.
        * NEWS: Mention this change.

        xlat: update LANDLOCK_ACCESS_FS_* constants.
        * src/xlat/landlock_ruleset_access_fs.in (LANDLOCK_ACCESS_FS_REFER):
        New constant introduced by Linux kernel commit v5.19-rc1~195^2~6.
        * tests/landlock_add_rule.c (main): Update expected output.
        * tests/landlock_create_ruleset.c: Likewise.
        * NEWS: Mention this change.

        xlat: update IORING_* constants.
        * src/xlat/uring_ops.in (IORING_OP_FSETXATTR, IORING_OP_SETXATTR):
        New constants introduced by Linux kernel commit v5.19-rc1~250^2~3.
        (IORING_OP_FGETXATTR, IORING_OP_GETXATTR):  New constants introduced
        by Linux kernel commit v5.19-rc1~250^2~2.
        (IORING_OP_SOCKET): New constant introduced by Linux kernel commit
        v5.19-rc1~249^2~4.
        (IORING_OP_URING_CMD): New constant introduced by Linux kernel commit
        v5.19-rc1~247^2~8.
        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_PBUF_RING,
        IORING_UNREGISTER_PBUF_RING): New constants introduced by Linux kernel
        commit v5.19-rc1~251^2~10.
        * tests/io_uring_register.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update IORING_SETUP_* constants.
        * src/xlat/uring_setup_flags.in (IORING_SETUP_COOP_TASKRUN):
        New constant introduced by Linux kernel commit v5.19-rc1~251^2~43.
        (IORING_SETUP_TASKRUN_FLAG): New constant introduced by Linux kernel
        commit v5.19-rc1~251^2~42.
        (IORING_SETUP_SQE128): New constant introduced by Linux kernel
        commit v5.19-rc1~247^2~21.
        (IORING_SETUP_CQE32): New constant introduced by Linux kernel
        commit v5.19-rc1~247^2~20.
        * tests/io_uring_setup.c (main): Update expected output.
        * NEWS: Mention this change.

2022-07-31  Dmitry V. Levin  <ldv@strace.io>

        rtnl_link: update decoding of struct rtnl_link_stats64.
        * src/rtnl_link.c (decode_nla_rtnl_link_stats64): Decode
        struct rtnl_link_stats64.rx_otherhost_dropped introduced by Linux kernel
        commit v5.19-rc1~159^2~379.
        * NEWS: Mention this.
        * tests/nlattr_ifinfomsg.c (main): Check it.
        * tests/nlattr_ifstats.c (print_stats_64): Update.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add DEVCONF_ACCEPT_UNTRACKED_NA to inet6_devconf_indices.
        * src/xlat/inet6_devconf_indices.in (DEVCONF_ACCEPT_UNTRACKED_NA): New
        constant, introduced by Linux commit v5.19-rc1~61^2~22.
        * NEWS: Mention it.

        xlat: add UFFD_FEATURE_WP_HUGETLBFS_SHMEM to uffd_api_features.
        * src/xlat/uffd_api_features.in (UFFD_FEATURE_WP_HUGETLBFS_SHMEM): New
        constant, introduced by Linux commit v5.19-rc1~138^2~148.
        * NEWS: Mention it.

        xlat: add KEXEC_ARCH_LOONGARCH to kexec_arch_values.
        * src/xlat/kexec_arch_values.in (KEXEC_ARCH_LOONGARCH): New constant,
        introduced by Linux commit v5.19-rc1~37^2~19.
        * NEWS: Mention it.

        rtnl_neigh: implement NDA_NDM_{STATE,FLAGS}_MASK decoding.
        * src/xlat/rtnl_neigh_attrs.in (NDA_NDM_STATE_MASK, NDA_NDM_FLAGS_MASK):
        New constants, introduced by Linux commit v5.19-rc1~159^2~322^2~2.
        * src/rtnl_neigh.c (decode_nda_ndm_states, decode_nda_ndm_flags): New
        functions.
        * tests/nlattr_ndmsg.c: Add checks.
        * NEWS: Mention it.

        rtnl_neigh: decode NDA_SRC_VNI as u32; similarly to NDA_VNI.
        * src/rtnl_neigh.c (ndmsg_nla_decoders) <[NDA_SRC_VNI]>: Set
        to decode_nla_u32.
        * tests/nlattr_ndmsg.c: Add checks.

        rtnl_neigh: implement NDA_FLAGS_EXT decoding.
        * src/xlat/neighbor_cache_entry_ext_flags.in: New file.
        * src/rtnl_neigh.c: Include "xlat/neighbor_cache_entry_ext_flags.h".
        (decode_nda_ext_flags): New function.
        (ndmsg_nla_decoders) <[NDA_FLAGS_EXT]>: New entry, calls
        decode_nda_ext_flags.
        * tests/nlattr_ndmsg.c: Add checks.
        * NEWS: Mention it.

        rtnl_neigh: implement NDA_FDB_EXT_ATTRS decoding.
        * src/xlat/fdb_notify_flags.in: New file.
        * src/xlat/rtnl_neigh_fdb_ext_attrs.in: Likewise.
        * src/rtnl_neigh.c: Include "xlat/fdb_notify_flags.h",
        "xlat/rtnl_neigh_fdb_ext_attrs.h".
        (decode_fdb_notify_flags, decode_nda_fdb_ext_attrs): New functions.
        (nda_fdb_ext_attrs_nla_decoders): New decoder array.
        (ndmsg_nla_decoders) <[NDA_FDB_EXT_ATTRS]>: New entry, calls
        decode_nda_fdb_ext_attrs.
        * tests/nlattr_ndmsg.c: Add checks.
        * NEWS: Mention it.

        inet: implement SO_RCVMARK socket option decoding.
        * src/xlat/sock_options.in (SO_RCVMARK): New constant, introduced
        by Linux commit v5.19-rc1~159^2~237.
        * src/xlat/sock_options.in (print_getsockopt. print_setsockopt) <case
        SO_RCVMARK>: Handle as an int-like socket option.
        * tests/sockopt-sol_socket.c: Update expected output.

        net: update handling of all int-like SOL_SOCKET options.
        * src/net.c (print_getsockopt) <case SO_DEBUG, case SO_REUSEADDR,
        case SO_DONTROUTE, case SO_BROADCAST, case SO_SNDBUF, case SO_RCVBUF,
        case SO_KEEPALIVE, case SO_OOBINLINE, case SO_NO_CHECK,
        case SO_PRIORITY, case SO_BSDCOMPAT, case SO_REUSEPORT,
        case SO_PASSCRED, case SO_RCVLOWAT, case SO_SNDLOWAT,
        case SO_DETACH_FILTER, case SO_TIMESTAMP_OLD, case SO_ACCEPTCONN,
        case SO_SNDBUFFORCE, case SO_RCVBUFFORCE, case SO_PASSSEC,
        case SO_TIMESTAMPNS_OLD, case SO_MARK, case SO_TIMESTAMPING_OLD,
        case SO_RXQ_OVFL, case SO_WIFI_STATUS, case SO_PEEK_OFF, case SO_NOFCS,
        case SO_LOCK_FILTER, case SO_SELECT_ERR_QUEUE, case SO_BUSY_POLL,
        case SO_INCOMING_CPU, case SO_CNX_ADVICE, case SO_INCOMING_NAPI_ID,
        case SO_ZEROCOPY, case SO_TIMESTAMP_NEW, case SO_TIMESTAMPNS_NEW,
        case SO_TIMESTAMPING_NEW, case SO_DETACH_REUSEPORT_BPF,
        case SO_PREFER_BUSY_POLL, case SO_BUSY_POLL_BUDGET, case
        SO_RESERVE_MEM>: Print only the integer value on any len larger than
        sizeof(int).
        (print_setsockopt) <case SO_DEBUG, case SO_REUSEADDR,
        case SO_DONTROUTE, case SO_BROADCAST, case SO_SNDBUF, case SO_RCVBUF,
        case SO_KEEPALIVE, case SO_OOBINLINE, case SO_NO_CHECK,
        case SO_PRIORITY, case SO_BSDCOMPAT, case SO_REUSEPORT,
        case SO_PASSCRED, case SO_RCVLOWAT, case SO_SNDLOWAT,
        case SO_DETACH_FILTER, case SO_TIMESTAMP_OLD, case SO_ACCEPTCONN,
        case SO_SNDBUFFORCE, case SO_RCVBUFFORCE, case SO_PASSSEC,
        case SO_TIMESTAMPNS_OLD, case SO_MARK, case SO_TIMESTAMPING_OLD,
        case SO_RXQ_OVFL, case SO_WIFI_STATUS, case SO_PEEK_OFF, case SO_NOFCS,
        case SO_LOCK_FILTER, case SO_SELECT_ERR_QUEUE, case SO_BUSY_POLL,
        case SO_INCOMING_CPU, case SO_CNX_ADVICE, case SO_INCOMING_NAPI_ID,
        case SO_ZEROCOPY, case SO_TIMESTAMP_NEW, case SO_TIMESTAMPNS_NEW,
        case SO_TIMESTAMPING_NEW, case SO_DETACH_REUSEPORT_BPF,
        case SO_PREFER_BUSY_POLL, case SO_BUSY_POLL_BUDGET, case
        SO_RESERVE_MEM>: Print address if len is less than sizeof(int),
        the integer value otherwise.
        * tests/sockopt-sol_socket.c: Update the expected output.

        tests: add [gs]etsockopt(SOL_SOCKET) tests.
        * tests/.gitignore: Add sockopt-sol_socket, sockopt-sol_socket-Xabbrev,
        sockopt-sol_socket-Xraw, sockopt-sol_socket-Xverbose,
        sockopt-sol_socket-success, sockopt-sol_socket-success-Xabbrev,
        sockopt-sol_socket-success-Xraw,
        and sockopt-sol_socket-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add sockopt-sol_socket-success,
        sockopt-sol_socket-success-Xabbrev, sockopt-sol_socket-success-Xraw,
        and sockopt-sol_socket-success-Xverbose.
        * tests/pure_executables.list: Add sockopt-sol_socket,
        sockopt-sol_socket-Xabbrev, sockopt-sol_socket-Xraw,
        and sockopt-sol_socket-Xverbose.
        * tests/gen_tests.in (sockopt-sol_socket, sockopt-sol_socket-Xabbrev,
        sockopt-sol_socket-Xraw, sockopt-sol_socket-Xverbose,
        sockopt-sol_socket-success, sockopt-sol_socket-success-Xabbrev,
        sockopt-sol_socket-success-Xraw, sockopt-sol_socket-success-Xverbose):
        New tests.
        * tests/sockopt-sol_socket.c: New file.
        * tests/sockopt-sol_socket-Xabbrev.c: Likewise.
        * tests/sockopt-sol_socket-Xraw.c: Likewise.
        * tests/sockopt-sol_socket-Xverbose.c: Likewise.
        * tests/sockopt-sol_socket-success.c: Likewise.
        * tests/sockopt-sol_socket-success-Xabbrev.c: Likewise.
        * tests/sockopt-sol_socket-success-Xraw.c: Likewise.
        * tests/sockopt-sol_socket-success-Xverbose.c: Likewise.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/errno2name: enforce ENOTSUPP handling.
        This is needed for [gs]etsockopt(SOL_SOCKET) test, as some socket
        options (namely, SO_ZEROCOPY) tend to return it.

        * tests/errno2name.c [!ENOTSUPP] (ENOTSUPP): New macro constant.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add NT_LOONGARCH_* to nt_descriptor_types.
        * src/xlat/nt_descriptor_types.in (NT_LOONGARCH_CPUCFG,
        NT_LOONGARCH_CSR, NT_LOONGARCH_LSX, NT_LOONGARCH_LASX,
        NT_LOONGARCH_LBT): New constants, introduced by Linux commit
        v5.19-rc1~37^2~19.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: decode IFLA_TSO_MAX_SIZE and IFLA_TSO_MAX_SEGS attributes.
        Introduced by Linux commit v5.19-rc1~159^2~108^2~12.

        * src/xlat/rtnl_link_attrs.in (IFLA_TSO_MAX_SIZE, IFLA_TSO_MAX_SEGS):
        New constants.
        * src/rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_TSO_MAX_SIZE],
        [IFLA_TSO_MAX_SEGS]>: New entries, call decode_nla_u32.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add FAN_MARK_EVICTABLE to fan_mark_flags.
        * src/xlat/fan_mark_flags.in (FAN_MARK_EVICTABLE): New constant,
        introduced by Linux commit v5.19-rc1~148^2~5.
        * tests/fanotify_mark.c: Update expected output.
        * NEWS: Mention it.

        xlat: add GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE to gpio_v2_line_flags.
        * src/xlat/gpio_v2_line_flags.in (GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE):
        New constant, introduced by Linux commit v5.19-rc1~16^2~9.
        * NEWS: Mention it.

        inet_diag: implement INET_DIAG_LOCALS and INET_DIAG_PEERS attributes decoding
        * src/netlink_inet_diag.c (print_sockaddr_array_member,
        decode_nla_sockaddrs): New functions.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_LOCALS], [INET_DIAG_PEERS]>:
        Set the value to decode_nla_sockaddrs.
        * tests/nlattr_inet_diag_msg.c: Include <linux/atalk.h>, <netinet/in.h>.
        (print_sa): New function.
        (main): Add checks.
        * NEWS: Mention it.

        inet_diag: implement INET_DIAG_SOCKOPT attribute decoding.
        * src/netlink_inet_diag.c (decode_diag_sockopt): New function.
        (OPT_PRINT_FIELD_U): New macro.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_SOCKOPT]>: New entry
        with the value of decode_diag_sockopt.
        * tests/nlattr_inet_diag_msg.c: Add checks.
        * NEWS: Mention it.

        inet_diag: implement INET_DIAG_CGROUP_ID attribute decoding.
        * src/netlink_inet_diag.c (inet_diag_msg_nla_decoders)
        <[INET_DIAG_CGROUP_ID]>: New entry, set to decode_nla_u64.
        * tests/nlattr_inet_diag_msg.c: Add checks for uint attributes.

        netlink_inet_diag: decode INET_DIAG_PROTOCOL using decode_nla_ip_proto.
        * src/netlink_inet_diag.c (inet_diag_msg_nla_decoders)
        <[INET_DIAG_PROTOCOL]>: Change the value from decode_nla_u8
        to decode_nla_ip_proto.
        * tests/nlattr_inet_diag_msg.c: Add checks.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update sysctl_net_ipv4_conf.
        NET_IPV4_CONF_ARP_EVICT_NOCARRIER has been introduced in Linux commit
        v5.16-rc1~159^2~3^2~2;  it ignores the previous short-lived existence
        of NET_IPV4_CONF_ACCEPT_LOCAL.

        * src/xlat/sysctl_net_ipv4_conf.in (NET_IPV4_CONF_ACCEPT_LOCAL,
        NET_IPV4_CONF_SRC_VMARK, NET_IPV4_CONF_PROXY_ARP_PVLAN): Comment out.
        (NET_IPV4_CONF_ARP_EVICT_NOCARRIER): New constant.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_inet_diag: decode INET_DIAG_REQ_PROTOCOL attribute.
        INET_DIAG_REQ_PROTOCOL has been introduced in v5.9-rc1~133^2~292^2~3.

        * src/netlink_inet_diag.c (inet_diag_req_nla_decoders)
        <[INET_DIAG_REQ_NONE], [INET_DIAG_REQ_SK_BPF_STORAGES]>: Add entries,
        provide NULL as a decoder.
        (inet_diag_req_nla_decoders) <[INET_DIAG_REQ_PROTOCOL]>: Add entry,
        decode using decode_nla_ip_proto.
        * src/nlattr.c (decode_nla_ip_proto) <opts>: Remove size enforcement
        for the xval.
        * tests/nlattr_inet_diag_req_v2.c (test_unk_attrs,
        test_inet_diag_proto): New functions.
        (main): Call them.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        inet_diag: implement INET_DIAG_SK_BPF_STORAGES attribute decoding.
        * src/xlat/inet_diag_bpf_storage_attrs.in: New file.
        * src/xlat/inet_diag_bpf_storages_attrs.in: Likewise.
        * src/netlink_inet_diag.c: Include "xlat/inet_diag_bpf_storage_attrs.h"
        and "xlat/inet_diag_bpf_storages_attrs.h".
        (decode_diag_bpf_storage, decode_diag_bpf_storages): New functions.
        (diag_bpf_storage_nla_decoders, diag_bpf_storages_nla_decoders): New
        static constants.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_SK_BPF_STORAGES]>: New decoder,
        calls decode_diag_bpf_storages.
        * tests/nlattr_inet_diag_msg.c: Add checks.
        * NEWS: Mention it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: introduce decode_nla_xint.
        A dispatcher function that calls a decode_nla_x* decoder
        of the matching size, if there's any;  suitable for the cases
        when an integer-sized object is most likely an integer.

        * src/nlattr.h (decode_nla_xint): New declaration, using DECL_NLA macro.
        * src/nlattr.c (decode_nla_xint): New function.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        inet_diag: implement INET_DIAG_ULP_INFO attribute decoding.
        * bundled/linux/include/uapi/linux/in.h: New file.
        * bundled/linux/include/uapi/linux/mptcp.h: Likewise.
        * bundled/linux/include/uapi/linux/tls.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/xlat/inet_diag_ulp_info_attrs.in: New file.
        * src/xlat/inet_diag_ulp_info_mptcp_attrs.in: Likewise.
        * src/xlat/inet_diag_ulp_info_tls_attrs.in: Likewise.
        * src/xlat/mptcp_subflow_flags.in: Likewise.
        * src/xlat/tls_info_ciphers.in: Likewise.
        * src/xlat/tls_info_configs.in: Likewise.
        * src/xlat/tls_info_versions.in: Likewise.
        * src/netlink_inet_diag.c: Include <linux/tls.h>,
        "xlat/inet_diag_ulp_info_attrs.h", "xlat/inet_diag_ulp_info_mptcp_attrs.h",
        "xlat/inet_diag_ulp_info_tls_attrs.h", "xlat/mptcp_subflow_flags.h",
        "xlat/tls_info_ciphers.h", "xlat/tls_info_configs.h",
        and "xlat/tls_info_versions.h".
        (decode_tls_version, decode_tls_cipher, decode_tls_config,
        decode_diag_ulp_info_tls, decode_mptcp_subflow_flags,
        decode_diag_ulp_info_mptcp, decode_diag_ulp_info): New functions.
        (diag_ulp_info_tls_nla_decoders, diag_ulp_info_mptcp_nla_decoders,
        diag_ulp_info_nla_decoders): New static constants.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_ULP_INFO]>: Decode using
        decode_diag_ulp_info.
        * tests/nlattr_inet_diag_msg.c: Add INET_DIAG_ULP_INFO attribute checks.
        * NEWS: Mention it.

        tests/test_nlattr: add check_x32_nlattr.
        * tests/test_nlattr.h (check_x32_nlattr): New function, defined using
        the DEF_NLATTR_INTEGER_CHECK_ macro.

        tests/test_nlattr: introduce TEST_NESTED_NLATTR_
        * tests/test_nlattr.h (tests/test_nlattr.h): New macro.
        (TEST_NESTED_NLATTR_OBJECT_EX_MINSZ_, TEST_NESTED_NLATTR_ARRAY_EX_):
        Rewrite using it.

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: put NUD_NONE first in neighbor_cache_entry_states.
        Otherwise it is never used.

        * src/xlat/neighbor_cache_entry_states.in: Move NUD_NONE first, add
        values.

        Fixes: v4.19~139 "netlink: add a basic rtnetlink parser of neigh messages"

2022-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        gpio: switch consumer and config printing order in struct gpio_v2_line_request
        Following the order they are declared in struct gpio_v2_line_request.

        * src/gpio_ioctl.c (print_gpio_v2_line_request): Decode the consumer
        field before the config field.
        * tests/ioctl_gpio.c: Update expected output.

        Fixes: v5.11~161 "Add GPIO v2 ioctl decoding"

2022-07-31  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.19.
        * bundled/linux/include/uapi/asm-generic/fcntl.h: Update to
        headers_install'ed Linux kernel v5.19.
        * bundled/linux/include/uapi/linux/version.h: Likewise.

2022-07-21  Dmitry V. Levin  <ldv@strace.io>

        .github: add gcc-12, clang-13, and clang-14 jobs.
        These new compilers are provided by the latest version of the OS
        currently available in ci, which apparently is not ubuntu-latest yet.

        * .github/workflows/ci.yml (gcc12-x86_64-kheaders, gcc12-x86_64-dw,
        gcc12-x86_64-unwind, clang14-x86_64-kheaders, clang14-x86_64-dw,
        clang14-x86_64-unwind, clang13-x86_64-kheaders, clang13-x86_64-dw,
        clang13-x86_64-unwind, gcc12-x32-kheaders, gcc12-x32-nostacktrace,
        gcc12-x86-kheaders, gcc12-x86-nostacktrace, clang14-x86-kheaders,
        clang14-x86-nostacktrace, clang13-x86-kheaders,
        clang13-x86-nostacktrace): New jobs.

2022-07-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_inet_diag: implement INET_DIAG_MD5SIG attribute decoding.
        * bundled/linux/include/uapi/linux/tcp.h: New file.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac: Check for struct tcp_diag_md5sig presence
        in <netinet/tcp.h>.
        * netlink_inet_diag.c: Include <linux/tcp.h>.
        (print_tcp_md5sig, decode_tcp_md5sig): New functions.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_MD5SIG]>: New attribute,
        decoded by decode_tcp_md5sig.
        * tests/nlattr_inet_diag_msg.c: Check INET_DIAG_MD5SIG attribute
        decoding.
        * NEWS: Mention it.

        inet_diag: enhance INET_DIAG_SHUTDOWN attribute decoding.
        * src/xlat/inet_diag_shutdown_flags.in: New file.
        * src/netlink_inet_diag.c: Include "xlat/inet_diag_shutdown_flags.h"
        (decode_diag_shutdown): New function.
        (inet_diag_msg_nla_decoders) <[INET_DIAG_SHUTDOWN]>: Call
        decode_diag_shutdown.
        * tests/nlattr_inet_diag_msg.c: Update expected output.
        * NEWS: Mention it.

        netlink_inet_diag: factor out struct tcp{vegas,_dctcp,_bbr}_info printing
        * src/defs.h (struct tcpvegas_info, struct tcp_dctcp_info,
        struct tcp_bbr_info): New type declarations.
        (print_tcpvegas_info, print_tcp_dctcp_info, print_tcp_bbr_info): New
        function declarations.
        * src/netlink_inet_diag.c (print_tcpvegas_info): Factor out the printing
        code out of decode_tcpvegas_info.
        (decode_tcpvegas_info): Call print_tcpvegas_info for printing the retrieved
        structure.
        (print_tcp_dctcp_info): Factor out the printing code out
        of decode_tcp_dctcp_info.
        (decode_tcp_dctcp_info): Call print_tcp_dctcp_info for printing the retrieved
        structure.
        (print_tcp_bbr_info): Factor out the printing code out
        of decode_tcp_bbe_info.
        (decode_tcp_bbr_info): Call print_tcp_bbr_info for printing the retrieved
        structure.

        src: move MAYBE_PRINT_FIELD_LEN macro from net.c to print_fields.h.
        * src/net.c (MAYBE_PRINT_FIELD_LEN): Move it...
        * src/print_fields.h (MAYBE_PRINT_FIELD_LEN): ...here. Add parentheses
        around "where_" usages.

        print_fields: PRINT_FIELD_HEX_ARRAY_UPTO.
        * src/print_fields.h (PRINT_FIELD_HEX_ARRAY_UPTO): New macro.

        print_fields: add tprint_union_* functions.
        * src/print_fields.h (tprint_union_begin, tprint_union_next,
        tprint_union_end): New functions.

        print_fields: add tprint_{shift,or} to make xlat-like output more structured
        * src/print_fields.h (tprint_shift, tprint_or): New functions.

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields: de-duplicate tprint_* functions definitions.
        There is an unnecessary (possibly error-prone) duplication of tprint_*
        functions definitions based on the presence of IN_STRACE macro,
        which can be handled by an appropriate definition of a string printing
        macro.

        * src/print_fields.h (STRACE_PRINTS): New macro function, define
        to an tprints call if IN_STRACE is defined, or to an fputs call
        otherwise.
        (tprint_struct_begin, tprint_struct_next, tprint_struct_end,
        tprint_array_begin, tprint_array_next, tprint_array_end,
        tprint_array_index_begin, tprint_array_index_end, tprint_arg_next,
        tprint_arg_end, tprint_bitset_begin, tprint_bitset_next,
        tprint_bitset_end, tprint_comment_begin, tprint_comment_end,
        tprint_indirect_begin, tprint_indirect_end, tprint_more_data_follows,
        tprint_value_changed, tprint_alternative_value, tprint_unavailable):
        Define once using STRACE_PRINTS, instead of two definitions that use
        either tprints or fputs.

        Complements: v5.11~157 "print_fields.h: introduce a few tprint_* helper inline functions"

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/init.sh: add --status to pidns strace call.
        The pidns test harness processes multi-process log output,
        which is inherently prone to ordering issues like this:

            -7     get_robust_list(2 /* 7 in strace's PID NS */, [0x7ff3fc9a7a20], [24]) = 0
            +7     get_robust_list(2 /* 7 in strace's PID NS */,  <unfinished ...>
            +7     <... get_robust_list resumed>[0x7ff3fc9a7a20], [24]) = 0
            FAIL xet_robust_list--pidns-translation.gen.test (exit status: 1)

        Try to avoid them by forcing the buffering of the syscall trace output
        with the --status option that excludes the "unavailable" status,
        that is not expected in the test output.

        * tests/init.sh (test_pidns_run_strace): Add "--status=!unavailable"
        option to the strace call.

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/filter_qualify: move "s" qual_options record to its synonyms.
        There is little reason to have "status" before "s", which is a synonym
        for "signal", it is just confusing.

        * src/filter_qualify.c (qual_options) <"s">: Move up after "signal"
        and "signals".

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: add all supported -e qualifier synonyms.
        It is mentioned in the general -e option description, but it is detached
        from the qualifier descriptions themselves now.

        * doc/strace.1.in (.SS Filtering) <-e trace>: Add "-e t" synonymous
        syntax.
        (.SS Filtering) <-e signal>: Add "-e signals" and "-e s" synonymous
        syntaxes.
        (.SS Output format) <-e abbrev>: Add "-e a" synonymous syntax.
        (.SS Output format) <-e verbose>: Add "-e v" synonymous syntax.
        (.SS Output format) <-e raw>: Add "-e x" synonymous syntax.
        (.SS Output format) <-e read>: Add "-e reads" and "-e r" synonymous
        syntaxes.
        (.SS Output format) <-e write>: Add "-e writes" and "-e w" synonymous
        syntaxes.
        (.SS Output format) <-e quiet>: Add "-e silent", "-e silence",
        and "-e q" synonymous syntaxes.

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ksysent: silence compiler warnings about re-init of ksyslist elements
        The purpose of the test is to catch and report possible issues
        with syscall number definitions;  compiler diagnostics of possible array
        elements re-initialisation (that may happen when there are legacy __NR_*
        definition present along with the contemporary ones) only gets in the way
        here (has happened on el6 with gcc12):

            ksysent.h:311:27: error: initialized field overwritten [-Werror=override-init]
              311 | [__NR_madvise & 0xffff] = "madvise",
                  |                           ^~~~~~~~~
            ksysent.h:311:27: note: (near initialization for 'ksyslist[219]')

        * tests/ksysent.c (ksyslist): Surround the definition
        with the DIAG_PUS_IGNORE_OVERRIDE_INIT/DIAG_POP_IGNORE_OVERRIDE_INIT
        pair.

2022-07-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add clock_LIBS to bpf-obj_get_info_by_fd* libraries.
        * tests/Makefile.am (bpf_obj_get_info_by_fd_LDADD,
        bpf_obj_get_info_by_fd_v_LDADD, bpf_obj_get_info_by_fd_prog_LDADD,
        bpf_obj_get_info_by_fd_prog_v_LDADD): New variables.

        Fixes: v5.18~21 "bpf: provide approximate local time for prog_info.load_time"

2022-07-18  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.19.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.19-rc7 using
        ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/aarch64/ioctls_arch0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/mips/ioctls_arch0.h: Likewise.
        * src/linux/powerpc/ioctls_arch0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2022-07-17  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.19-rc7.
        * bundled/linux/arch/mips/include/uapi/asm/fcntl.h: Update to
        headers_install'ed Linux kernel v5.19-rc7.
        * bundled/linux/include/uapi/asm-generic/fcntl.h: Likewise.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/gpio.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/input.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/kexec.h: Likewise.
        * bundled/linux/include/uapi/linux/landlock.h: Likewise.
        * bundled/linux/include/uapi/linux/lirc.h: Likewise.
        * bundled/linux/include/uapi/linux/loop.h: Likewise.
        * bundled/linux/include/uapi/linux/neighbour.h: Likewise.
        * bundled/linux/include/uapi/linux/netlink.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/seccomp.h: Likewise.
        * bundled/linux/include/uapi/linux/socket.h: Likewise.
        * bundled/linux/include/uapi/linux/tee.h: Likewise.
        * bundled/linux/include/uapi/linux/types.h: Likewise.
        * bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/linux/include/uapi/rdma/ib_user_verbs.h: Likewise.

2022-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pathtrace, strace: refactor path trace options parsing and storing.
        In preparation for further changes.

        * src/defs.h (struct path_set_item): New type.
        (struct path_set): Use struct path_set_item for storing paths_selected.
        * src/pathtrace.c (pathmatch, storepath): Access specific paths using
        "path" field.
        * src/strace.c (struct pathtrace): New type.
        (add_path_trace): New function.
        (init): Replace pathtrace_paths, pathtrace_size, and pathtrace_count
        variables with pathtrace variable.
        (init) <case 'P'>: Call add_path_trace instead of open-coded
        pathtrace_paths array update.
        (init): Access pathtrace "paths" and "count" fields instead
        of pathtrace_paths and pathtrace_count, respectively.

2022-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/bpf: fix sloppy low FD number usage.
        FD 42 can already be opened, so close it.  Otherwise, it may lead
        to the following test failure:

            -bpf(BPF_LINK_CREATE, {link_create={prog_fd=0</dev/full>, target_fd=0</dev/full>, attach_type=BPF_TRACE_ITER, flags=0, iter_info=[{map={map_fd=0</dev/full>}}, {map={map_fd=42}}, {map={map_fd=314159265}}, {map={map_fd=-1159983635}}, {map={map_fd=-1}}], iter_info_len=5}}, 28) = 841540765612359407 (INJECTED)
            +bpf(BPF_LINK_CREATE, {link_create={prog_fd=0</dev/full>, target_fd=0</dev/full>, attach_type=BPF_TRACE_ITER, flags=0, iter_info=[{map={map_fd=0</dev/full>}}, {map={map_fd=42</var/tmp/restraintd/logs/146893626/task.log>}}, {map={map_fd=314159265}}, {map={map_fd=-1159983635}}, {map={map_fd=-1}}], iter_info_len=5}}, 28) = 841540765612359407 (INJECTED)
             bpf(BPF_LINK_CREATE, 0x3ff95574fe5, 28) = 841540765612359407 (INJECTED)
            -bpf(BPF_LINK_CREATE, {link_create={prog_fd=0</dev/full>, target_fd=0</dev/full>, attach_type=BPF_TRACE_ITER, flags=0, iter_info=[{map={map_fd=0</dev/full>}}, {map={map_fd=42}}, {map={map_fd=314159265}}, {map={map_fd=-1159983635}}, {map={map_fd=-1}}, ... /* 0x3ff9555d000 */], iter_info_len=6}}, 28) = 841540765612359407 (INJECTED)
            +bpf(BPF_LINK_CREATE, {link_create={prog_fd=0</dev/full>, target_fd=0</dev/full>, attach_type=BPF_TRACE_ITER, flags=0, iter_info=[{map={map_fd=0</dev/full>}}, {map={map_fd=42</var/tmp/restraintd/logs/146893626/task.log>}}, {map={map_fd=314159265}}, {map={map_fd=-1159983635}}, {map={map_fd=-1}}, ... /* 0x3ff9555d000 */], iter_info_len=6}}, 28) = 841540765612359407 (INJECTED)
            [...]
            FAIL bpf-success-long-y.test (exit status: 1)

        * tests/bpf.c (init_BPF_LINK_CREATE_attr7): Close iter_info_data[1] fd.

        Fixes: v5.18~18 "bpf: improve bpf(BPF_LINK_CREATE) decoding"
        Reported-by: Lenka Špačková <lkuprova@redhat.com>
        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103137

2022-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.spec.in: cater to some distros with special SPDX identifier needs
        * strace.spec.in (License): Define to "LGPL-2.1-or-later and GPL-2.0-or-later"
        for distributions that have voluntarily decided not to recognise
        the deprecated SPDX license identifiers everyone else is fine with.

        Complements: v5.3~47 "strace.spec.in: use SPDX shortname format in License: tag"
        Reported-by: Lenka Špačková <lkuprova@redhat.com>

2022-07-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        secontext: fix expected SELinux context check for unlinked FDs.
        selinux_getfdcon open-coded a part of getfdpath_pid since it tries
        to do the same job, figure out a path associated with an FD, for slightly
        different purpose: to get the expected SELinux context for it.  As the previous
        commit shows, it's a bit more complicated in cases when the path ends
        with the " (deleted)" string, which is also used for designated unlinked paths
        in procfs.  Otherwise, it may manifest in test failures such as this:

            --- exp     2022-05-18 04:29:13.311710593 -0400
            +++ out     2022-05-18 04:29:13.311710593 -0400
            @@ -1,4 +1,4 @@
             [unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023] fchmod(4</root/rpmbuild/BUILD/strace-5.13/tests/fchmod-y--secontext_full_mismatch.dir/fchmod_subdir/fchmod_sample_file> [unconfined_u:object_r:admin_home_t:s0!!system_u:object_r:admin_home_t:s0], 0600) = 0
            -[unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023] fchmod(4</root/rpmbuild/BUILD/strace-5.13/tests/fchmod-y--secontext_full_mismatch.dir/fchmod_subdir/fchmod_sample_file (deleted)> [unconfined_u:object_r:admin_home_t:s0!!system_u:object_r:admin_home_t:s0], 051) = 0
            -[unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023] fchmod(4</root/rpmbuild/BUILD/strace-5.13/tests/fchmod-y--secontext_full_mismatch.dir/fchmod_subdir/fchmod_sample_file (deleted)> [unconfined_u:object_r:admin_home_t:s0!!system_u:object_r:admin_home_t:s0], 004) = 0
            +[unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023] fchmod(4</root/rpmbuild/BUILD/strace-5.13/tests/fchmod-y--secontext_full_mismatch.dir/fchmod_subdir/fchmod_sample_file (deleted)> [unconfined_u:object_r:admin_home_t:s0], 051) = 0
            +[unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023] fchmod(4</root/rpmbuild/BUILD/strace-5.13/tests/fchmod-y--secontext_full_mismatch.dir/fchmod_subdir/fchmod_sample_file (deleted)> [unconfined_u:object_r:admin_home_t:s0], 004) = 0
             +++ exited with 0 +++
            + fail_ '../../src/strace -a15 -y --secontext=full,mismatch -e trace=fchmod ../fchmod-y--secontext_full_mismatch output mismatch'
            + warn_ 'fchmod-y--secontext_full_mismatch.gen.test: failed test: ../../src/strace -a15 -y --secontext=full,mismatch -e trace=fchmod ../fchmod-y--secontext_full_mismatch output mismatch'
            + printf '%s\n' 'fchmod-y--secontext_full_mismatch.gen.test: failed test: ../../src/strace -a15 -y --secontext=full,mismatch -e trace=fchmod ../fchmod-y--secontext_full_mismatch output mismatch'
            fchmod-y--secontext_full_mismatch.gen.test: failed test: ../../src/strace -a15 -y --secontext=full,mismatch -e trace=fchmod ../fchmod-y--secontext_full_mismatch output mismatch
            + exit 1
            FAIL fchmod-y--secontext_full_mismatch.gen.test (exit status: 1)

        that happens due to the fact that the get_expected_filecontext() call
        is made against the path with the " (deleted)" part, which is wrong (it
        is more wrong than shown above when a file with the path that ends with
        " (deleted)" exists).  Moreover, it would be incorrect to call stat()
        on that path.

        Let's factor out the common part of the code and simply call it
        from selinux_getfdcon, then use the st_mode from the procfs link.

        * src/defs.h (get_proc_pid_fd_path): New declaration.
        * src/pathtrace.c (get)proc_pid_fd_path): New function, part
        of getfdpath_pid that performs link resolution and processing
        of the result.
        (getfdpath_pid): Call get_proc_pid_fd_path after PID resolution.
        * src/secontext.c (get_expected_filecontext): Add mode parameter, use
        it in selabel_lookup call instead of retrieveing file mode using stat()
        if it is not -1.
        (selinux_getfdcon): Call get_proc_pid_fd_path instead
        of open-coding path resolution code, call stat() on the procfs link
        and pass the retrieved st_mode to the get_expected_filecontext call.
        (selinux_getfilecon): Pass -1 as mode in the get_expected_filecontext
        call.

        Reported-by: Václav Kadlčík <vkadlcik@redhat.com>
        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2087693

2022-07-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pathtrace, util: do not print " (deleted)" as part of the path.
        In order to allow to discern the unlinked paths from the paths that
        do indeed end with " (deleted)".

        * src/defs.h (getfdpath_pid): Add deleted parameter.
        (getfdpath): Pass NULL as deleted parameter to getfdpath_pid.
        * src/largefile_wrappers.h (lstat_file): New macro.
        * src/pathtrace.c: Include <sys/stat.h>, <sys/types.h>, <unistd.h>,
        and "largefile_wrappers.h".
        (getfdpath_pid): Add deleted parameter, check if path ends with
        " (deleted)", and if it is, try to figure out if it is a part
        of the path by comparing device/inode numbers of the file procfs
        link resolves into and the file pointed by the path read;  strip
        " (deleted)";  set deleted (if it is non-NULL) to true if the fd
        is turned out to be deleted and to false otherwise.
        * src/util.c (print_quoted_string_in_angle_brackets): Add deleted
        parameter, print "(deleted)" after the closing angle bracket if it is
        non-NULL.
        (printfd_pid): Add deleted local variable, pass it to getfdpath_pid
        and print_quoted_string_in_angle_brackets calls.
        * tests/fchmod.c: Add checks for a file with " (deleted)" in the path,
        update expected output.
        * NEWS: Mention the change.

2022-07-02  Dmitry V. Levin  <ldv@strace.io>

        .github: switch gcc-11 and clang-12 jobs to ubuntu-22.04.
        Unlike ubuntu-20.04 image, in ubuntu-22.04 the versions of bundled gcc
        and clang are gcc-11 and clang-12, respectively, so it makes sense
        switching to the image where the required compiler is already installed.

        * .github/workflows/ci.yml (gcc11-x86_64-kheaders, gcc11-x86_64-dw,
        gcc11-x86_64-unwind, clang12-x86_64-kheaders, clang12-x86_64-dw,
        clang12-x86_64-unwind, gcc11-x32-kheaders, gcc11-x32-nostacktrace,
        gcc11-x86-kheaders, gcc11-x86-nostacktrace, clang12-x86-kheaders,
        clang12-x86-nostacktrace) <runs-on>: Change from ubuntu-20.04 to
        ubuntu-22.04.

2022-07-01  Dmitry V. Levin  <ldv@strace.io>

        .github: switch coverage job to ubuntu-latest.
        While ubuntu-latest in ci is not necessarily the latest version of the
        OS available in ci, it's the default version, so let's try to use it
        for the coverage.

        * .github/workflows/ci.yml (coverage) <runs-on>: Change from
        ubuntu-20.04 to ubuntu-latest.

2022-07-01  Dmitry V. Levin  <ldv@strace.io>

        .github: switch whitespace-errors job to ubuntu-latest.
        While ubuntu-latest in ci is not necessarily the latest version of the
        OS available in ci, whitespace-errors job should be agnostic to the
        version being used, so use the default one.

        * .github/workflows/ci.yml (whitespace-errors) <runs-on>: Change from
        ubuntu-20.04 to ubuntu-latest.

2022-07-01  Dmitry V. Levin  <ldv@strace.io>

        ci: try to make /dev/kvm more accessible.
        This might help to enable ioctl_kvm_run* tests in some ci environments.

        * ci/install-dependencies.sh: If /dev/kvm exists, try to make it
        more accessible by setting a permissive file access mode.

        Suggested-by: Alexey Gladkov <gladkov.alexey@gmail.com>

2022-06-30  Renaud Métrich  <rmetrich@redhat.com>

        secontext: print context of Unix socket's sun_path field.

        * src/sockaddr.c: Include "secontext.h".
        (print_sockaddr_data_un): Print the SELinux context of sun_path field
        using selinux_printfilecon.
        * NEWS: Mention this change.
        * tests/secontext.c (raw_secontext_full_fd, get_secontext_field_fd,
        raw_secontext_short_fd, secontext_full_fd, secontext_short_fd): New
        functions.
        * tests/secontext.h (secontext_full_fd, secontext_short_fd,
        get_secontext_field_fd): New prototypes.
        (SECONTEXT_FD): New macro.
        * tests/sockname.c: Include "secontext.h".
        (test_sockname_syscall): Update expected output.
        * tests/gen_tests.in (getsockname--secontext,
        getsockname--secontext_full, getsockname--secontext_full_mismatch,
        getsockname--secontext_mismatch): New tests.

        Resolves: https://github.com/strace/strace/pull/214

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        basic_filters: use find_xlat_val_case for syscall class lookup.
        There is no need to open-code it.

        * src/basic_filters.c (lookup_class): Remove.
        (lookup_class) <syscall_class>: Move to qualify_syscall_class, change
        the element type to struct xlat_data, reverse the field order
        in the declaration.
        (qualify_syscall_class): Use find_xlat_val_case to find a syscall class
        in syscall_class array.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: constify xflag_str and daemonize_str.
        They are not supposed to be modified.

        * src/strace.c (xflag_str, daemonize_str): Add const modifier.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: constify find_xlat_val_ex arguments.
        They are not supposed to be modified in the function body.

        * src/util.c (find_xlat_val_ex): Add const qualifiers to items, s,
        num_items, and flags arguments.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add offs sanity check to print_clock_t.
        While it is not strictly needed right now, the code that uses
        the calculated offs value lacks any checks for possible buf overruns,
        which is not defensive enough, so let's add them.  Reported by covscan:

            Error: OVERRUN (CWE-119):
            strace-5.18/src/util.c:248: assignment: Assigning:
            "offs" = "ilog10(val / clk_tck)". The value of "offs" is now between
            16 and 31 (inclusive).
            strace-5.18/src/util.c:249: overrun-local: Overrunning array of 30 bytes
            at byte offset 31 by dereferencing pointer "buf + offs". [Note: The source
            code implementation of the function has been overridden by a builtin model.]

            Error: OVERRUN (CWE-119):
            strace-5.18/src/util.c:248: assignment: Assigning:
            "offs" = "ilog10(val / clk_tck)". The value of "offs" is now between
            16 and 31 (inclusive).
            strace-5.18/src/util.c:253: overrun-buffer-arg: Overrunning array "buf"
            of 30 bytes by passing it to a function which accesses it at byte offset
            32 using argument "offs + 2UL" (which evaluates to 33). [Note: The source
            code implementation of the function has been overridden by a builtin model.]

            Error: OVERRUN (CWE-119):
            strace-5.18/src/util.c:248: assignment: Assigning:
            "offs" = "ilog10(val / clk_tck)". The value of "offs" is now between
            16 and 31 (inclusive).
            strace-5.18/src/util.c:254: overrun-local: Overrunning array "buf"
            of 30 bytes at byte offset 32 using index "offs + 1UL" (which evaluates
            to 32).

        * src/util.c (print_clock_t): Add check that offs is small enough
        for it and "offs + 2" not to overrun buf.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strauss: fix off-by-one error in strauss array access.
        It has to be limited with strauss_lines - 1, not strauss_lines.
        Reported by covscan:

            Error: OVERRUN (CWE-119):
            strace-5.18/src/strauss.c:380: cond_at_least: Checking "4UL + i < 37UL"
            implies that "i" is at least 33 on the false branch.
            strace-5.18/src/strauss.c:380: overrun-local: Overrunning array "strauss"
            of 37 8-byte elements at element index 37 (byte offset 303) using index
            "(4UL + i < 37UL) ? 4UL + i : 37UL" (which evaluates to 37).

        * src/strauss.c (print_totd): Limit strauss array accesses to
        strauss_lines - 1 instead of strauss_lines.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strauss: tips whitespace and phrasing cleanups.
        * src/strauss.c (tips_tricks_tweaks): Fix some whitespace and phrasing
        issues.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/strace--tips.test: fix tips randomness check.
        The initial call should contain "--tips" as well, otherwise no tips will
        be enabled if $tips_fmt_opt is empty.

        * tests/strace--tips.test: Pass "--tips" to the initial randomness check
        strace call.

2022-06-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/xlat: remove remnants of unnecessary idx usage in xlookup.
        As there is no idx saving between calls anymore, there's no need to use
        (and update) idx in the XT_SORTED case.  Reported by clang as a dead store:

            Error: CLANG_WARNING:
            strace-5.18/src/xlat.c:84:4: warning[deadcode.DeadStores]: Value stored to 'idx' is never read

        * src/xlat.c (xlookup): Remove idx declaration;  declare idx inside
        of the for loop in the XT_NORMAL case; do not offset x->data and x->size
        by offs in the XT_SORTED case and do not update idx upon successful
        lookup.

        Complements: v5.15~164 "xlat: no longer interpret NULL xlat as continuation"

2022-06-26  Sergei Trofimovich  <slyich@gmail.com>

        mpers: add missing dependency on autogenerated sys_func.h.
        Noticed missing target directory dependency as a build failure in
        `make --shuffle` mode (added in https://savannah.gnu.org/bugs/index.php?62100):

            for f in block.c ... v4l2.c; do \
                    D="" \
                    READELF="readelf" \
                    CC="gcc" \
                    CFLAGS="-DHAVE_CONFIG_H  ... -I./bundled/linux/include/uapi -DMPERS_IS_m32" \
                    CPP="gcc -E" \
                    CPPFLAGS="-DHAVE_CONFIG_H ... -DMPERS_IS_m32" \
                    ./mpers.sh m32 "-m32" $f || exit; \
            done
            In file included from ./defs.h:2041,
                             from mpers-m32/struct_blk_user_trace_setup.c:10:
            ./syscall.h:14:11: fatal error: sys_func.h: No such file or directory
               14 | # include "sys_func.h"
                  |           ^~~~~~~~~~~~

        While at it changed order-only dependency against generated headers to
        full dependency.

2022-06-20  Dmitry V. Levin  <ldv@strace.io>

        maint: fix false positives reported by gen-contributors-list.sh.
        * maint/gen-contributors-list.sh: Do not consider names from cited
        commit messages as contributors.

        maint/gen-contributors-list.sh: shorten regexps by using "sed -E"
        * maint/gen-contributors-list.sh: Use "sed -E" instead of sed.
        (SCRIPT, SCRIPT_NORM_EMAILS, MATCH_OUT): Convert to extended regular
        expressions syntax.

2022-06-19  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.18-1.
        * strace.spec.in: Likewise.

2022-06-18  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.18 release.
        * NEWS: Update for 5.18 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2022-06-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Pegasust  <pegasucksgg@gmail.com>

        tests: rename strace-T test to strace-T_upper.
        Unfortunately, there are still exist OSes and FSes that cannot
        (or pretend that cannot) discern between file names with letters
        in different cases;  there is little reason not to avoid breaking
        workflow for those who are so unfortunate to happen to use them
        (besides the general hesitance to cater for this decades-old barbarism).

        * tests/strace-T.expected: Rename to...
        * tests/strace-T_upper.expected: ...this.
        * tests/strace-T.test: Rename to...
        * tests/strace-T_upper.test: ...this.
        * tests/gen_tests.in (strace--syscall-times, strace--syscall-times-ms,
        strace--syscall-times-ns, strace--syscall-times-s,
        strace--syscall-times-us): Change the included script name
        from strace-T.test to strace-T_upper.test.
        * tests/Makefile.am (MISC_TESTS): Change strace-T.test to
        strace-T_upper.test.
        (EXTRA_DIST): Change strace-T.expected to strace-T_upper.expected.

        Closes: https://github.com/strace/strace/issues/134
        Closes: https://github.com/strace/strace/issues/213

2022-06-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: work around UAPI breakage in v5.19-rc1~143^2~9^2.
        Linux commit v5.19-rc1~143^2~9^2 breaks UAPI by removing
        TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF definitions.  Work that
        around by providing fallback definitions in the test.

        * src/xlat/tee_ioctl_shm_flags.in: Note that TEE_IOCTL_SHM_MAPPED
        and TEE_IOCTL_SHM_DMA_BUF are also not part of the UAPI.
        * tests/ioctl_tee.c [!TEE_IOCTL_SHM_MAPPED] (TEE_IOCTL_SHM_MAPPED):
        Define.
        [!TEE_IOCTL_SHM_DMA_BUF] (TEE_IOCTL_SHM_DMA_BUF): Likewise.

2022-06-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        fcntl: work around removal of F_*64 definitions in v5.19-rc1~89^2~9^2~18
        Linux commit v5.19-rc1~89^2~9^2~18 has hidden F_*64 definitions
        from the 64-bit userspace, which has broken strace build.
        Work around it by providing the definitions in case
        they are not present.

        * src/fcntl.c [!F_GETLK64] (F_GETLK64, F_SETLK64, F_SETLKW64): Define
        macro constants.
        * tests/fcntl.c: Call the F_GETLK64, F_GETLK64, and F_SETLKW64 checks
        only when the respective definitions are present.

2022-06-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: work aroung struct io_uring_rsrc_register field name change.
        resv field has been renamed to flags in Linux commit v5.19-rc1~251^2~20,
        provide a shim to support old decoding syntax.

        * configure.ac (AC_CHECK_TYPES): Add struct io_uring_rsrc_register
        and struct io_uring_rsrc_register.resv checks.
        * src/io_uring.c [HAVE_STRUCT_IO_URING_RSRC_REGISTER_RESV] (RESV):
        Define as resv.
        [!HAVE_STRUCT_IO_URING_RSRC_REGISTER_RESV] (RESV): Define as flags.
        (print_io_uring_register_rsrc): Use RESV instead of resv;  print "resv"
        field name explicitly and use PRINT_VAL_X instead of PRINT_FIELD_X.
        * tests/io_uring_register.c [HAVE_STRUCT_IO_URING_RSRC_REGISTER_RESV] (RESV):
        Define as resv.
        [!HAVE_STRUCT_IO_URING_RSRC_REGISTER_RESV] (RESV): Define as flags.
        (main): Use RESV to access struct io_uring_rsrc_register.resv field.

2022-06-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/io_uring_register: introduce ARR_ITEM macro.
        It simplifies cyclic array access.

        * tests/io_uring_register.c (ARR_ITEM): New macro.
        (main): Use it.

2022-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtc: implement RTC_PARAM_[GS]ET ioctl code decoding.
        Introduced by Linux commit v5.16-rc1~40^2~31.

        * src/xlat/rtc_backup_switch_modes.in: New file.
        * src/xlat/rtc_feature_bits.in: Likewise.
        * src/xlat/rtc_features.in: Likewise.
        * src/xlat/rtc_params.in: Likewise.
        * src/xlat/rtc_ioctl_cmds.in (RTC_PARAM_GET, RTC_PARAM_SET): New
        constants.
        * src/rtc.c (struct_rtc_param): New type definition.
        [XLAT_MACROS_ONLY]: Include "xlat/rtc_feature_bits.h".
        Include "xlat/rtc_vl_flags.h", "xlat/rtc_params.h",
        "xlat/rtc_features.h", and "xlat/rtc_backup_switch_modes.h".
        (decode_rtc_param): New function.
        (rtc_ioctl) <case RTC_PARAM_GET, case RTC_PARAM_SET>: Call
        decode_rtc_param.
        * tests/ioctl_rtc.c [!RTC_PARAM_GET] (struct rtc_param): New type.
        [!RTC_PARAM_GET] (RTC_PARAM_GET): New macro.
        [!RTC_PARAM_SET] (RTC_PARAM_SET): Likewise.
        (main): Add checks for RTC_PARAM_GET and RTC_PARAM_SET.
        * NEWS: Mention this.

2022-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_rtc: expand RTC_VL_READ check.
        Check that RTC_VL_READ argument is indeed decoded as flags and not xval.

        * tests/ioctl_rtc.c (main): Expand RTC_VL_READ check.

2022-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_rtc: make RTC_VL_READ/RTC_VL_CLR checks unconditional.
        * tests/ioctl_rtc.c [!RTC_VL_READ] (RTC_VL_READ): Define.
        [!RTC_VL_CLR] (RTC_VL_CLR): Likewise.
        [!RTC_VL_CLR, !RTC_VL_READ] (main) <noarg_cmds>: Provide records
        for RTC_VL_CLR and RTC_VL_READ.
        [!RTC_VL_READ]: Enable RTC_VL_READ check.

2022-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement COUNTER_* ioctl decoding.
        Introduced by Linux commit v5.16-rc1~119^2~29^2~10.

        * bundled/linux/include/uapi/linux/counter.h: New file.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/counter_ioctl.c: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add it.
        * src/defs.h (DECL_IOCTL(counter)): New declaration.
        * src/ioctl.c (ioctl_decode) <case '>'>: Call counter_ioctl.
        * src/xlat/counter_ioctl_component_types.in: New file.
        * src/xlat/counter_ioctl_event_types.in: Likewise.
        * src/xlat/counter_ioctl_scopes.in: Likewise.
        * tests/ioctl_counter-Xabbrev.c: Likewise.
        * tests/ioctl_counter-Xraw.c: Likewise.
        * tests/ioctl_counter-Xverbose.c: Likewise.
        * tests/ioctl_counter.c: Likewise.
        * tests/.gitignore: Add ioctl_counter, ioctl_counter-Xabbrev,
        ioctl_counter-Xraw, and ioctl_counter-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_counter, ioctl_counter-Xabbrev,
        ioctl_counter-Xraw, ioctl_counter-Xverbose): New tests.
        * NEWS: Mention it.

2022-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: make XLAT_ARGS_U generally available.
        * tests/ioctl_seccomp.c (XLAT_ARGS_U): Move it...
        * tests/tests.h (XLAT_ARGS_U): ...here.

        src: make CHECK_IOCTL_SIZE generally available.
        * src/seccomp_ioctl.c (CHECK_IOCTL_SIZE): Move it...
        * src/macros.h (CHECK_IOCTL_SIZE): ...here.

2022-05-27  Dmitry V. Levin  <ldv@strace.io>

        tests: use sprintrc in waitid tests.
        * tests/waitid.c (errstr): New variable.
        (do_waitid): Initialize it using sprintrc.
        (main): Use it instead of errno2name.

2022-05-27  SuHsueyu  <anolasc13@gmail.com>

        tests: check decoding of waitid P_PGID.
        * tests/waitid.c (main): Check P_PGID decoding.

2022-05-27  SuHsueyu  <anolasc13@gmail.com>
            Dmitry V. Levin  <ldv@strace.io>

        tests: add -Y test for waitid.
        * tests/waitid-Y.c: New file.
        * tests/waitid.c (sprint_siginfo): Add "comm" argument.
        [!MY_COMM] (MY_COMM): New macro.
        [!SKIP_IF_PROC_IS_UNAVAILABLE] (SKIP_IF_PROC_IS_UNAVAILABLE): Likewise.
        (do_waitid, main): Use them.
        * tests/gen_tests.in (waitid-Y): New test.
        * tests/Makefile.am (check_PROGRAMS): Add waitid-Y.
        * tests/.gitignore: Likewise.

2022-05-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: support both old and new landlock pseudopath.
        Since the ABI of landlock ruleset file name has been broken by Linux
        commit v5.18-rc1~88^2, the landlock_create_ruleset-y now has to account
        for both new and old possible names.  Opt for checking the link value
        in the test instead.

        * tests/landlock_create_ruleset-y.c (FD_PATH): Remove.
        (DECODE_FD): New macro.
        * tests/landlock_create_ruleset.c: Include "xmalloc.h" and <stdlib.h>.
        [!DECODE_FD] (DECODE_FD): New macro.
        (main) <fd_str>: New variable.
        [DECODE_FD] (main): Check the link path of the fd returned
        by the landlock_create_ruleset call and set it to fd_str, which
        is then printed.

2022-05-27  Bruce Ashfield  <bruce.ashfield@gmail.com>

        landlock: update expected string.
        Test failures were picked up in the yocto 5.15.36 -stable testing.

        Kernel commit:

          commit 3d4b396a616d0d67bf95d6823ad1197f6247292e
          Author: Christian Brauner <christian.brauner@ubuntu.com>
          Date:   Mon Oct 11 15:37:04 2021 +0200

              landlock: Use square brackets around "landlock-ruleset"

              commit aea0b9f2486da8497f35c7114b764bf55e17c7ea upstream.

              Make the name of the anon inode fd "[landlock-ruleset]" instead of
              "landlock-ruleset". This is minor but most anon inode fds already
              carry square brackets around their name:

                  [eventfd]
                  [eventpoll]
                  [fanotify]
                  [fscontext]
                  [io_uring]
                  [pidfd]
                  [signalfd]
                  [timerfd]
                  [userfaultfd]

              For the sake of consistency lets do the same for the landlock-ruleset anon
              inode fd that comes with landlock. We did the same in
              1cdc415f1083 ("uapi, fsopen: use square brackets around "fscontext" [ver #2]")
              for the new mount api.

              Cc: linux-security-module@vger.kernel.org
              Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
              Link: https://lore.kernel.org/r/20211011133704.1704369-1-brauner@kernel.org
              Cc: stable@vger.kernel.org
              Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
              Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

        Changed the format of the landlock ruleset. We need to update the strace
        expected string to match.

2022-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: improve bpf(BPF_LINK_CREATE) decoding.
        union bpf_attr.link_create got a couple of new fields;  this patch
        attempts to decode it based on the attach_type field value, which
        is imprecise, but the next best thing without information about
        the type of prog_fd.

        * src/xlat/bpf_link_create_kprobe_multi_flags.in: New file.
        * src/gen_bpf_attr_check.sh: Ignore anonymous union fields;
        * src/bpf_attr.h (BPF_LINK_CREATE_struct): Add target_btf_id, iter_info,
        iter_info_len, perf_event.bpf_cookie, kprobe_multi.flags,
        kprobe_multi.cnt, kprobe_multi.syms, kprobe_multi.addrs,
        kprobe_multi.cookies fields.
        (expected_BPF_LINK_CREATE_struct_size): Change to 48.
        * src/bpf.c: Include "xlat/bpf_link_create_kprobe_multi_flags.h".
        (BEGIN_BPF_CMD_DECODER): Remove const qualifier from attr_size
        definition.
        (union strace_bpf_iter_link_info): New type definition.
        (print_iter_info_array_member, print_str_array_member): New functions.
        (BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE)): Decode new fields.
        * tests/bpf.c: Add new checks.

2022-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/bpf: add ability to define multi-iterational checks.
        For checks that have only single field changed, repeating the whole
        check boilerplate seems excessive;  let's add ability to iterate
        a single check multiple times, by virtue of supplying iteration number
        to init/print handlers.

        * tests/bpf.c (struct bpf_attr_check): Add iters field; add idx
        parameter to init_fn and print_fn field types.
        (print_bpf_attr): Add idx parameter, pass it to check->print_fn.
        (test_bpf): Declare j iteration variable;  iterate each check
        MAX(check->iters, 1) times, pass j to check->init_fn and print_bpf_attr
        calls.
        (init_BPF_MAP_CREATE_attr7, init_BPF_PROG_LOAD_attr3,
        print_BPF_PROG_LOAD_attr3, init_BPF_PROG_LOAD_attr4,
        print_BPF_PROG_LOAD_attr4, init_BPF_OBJ_PIN_attr,
        init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4,
        init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5,
        init_BPF_RAW_TRACEPOINT_attr2, init_BPF_BTF_LOAD_attr): Add idx
        parameter.

2022-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: fix next_id decoding for BPF_*_GET_NEXT_ID.
        It is an R/W attribute and is supposed to be handled as such.

        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID)): Store next_id
        field value on entering, print the new value (if it has been modified)
        on exiting.
        * NEWS: Mention it.

2022-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: provide approximate local time for prog_info.load_time.
        It is stored as CLOCK_BOOTTIME value that gives little insight into the
        actual time a program has been loaded otherwise.

        * src/bpf.c [XLAT_MACROS_ONLY]: Include "xlat/clocknames.h".
        (print_boottime): New function.
        (print_bpf_prog_info): Call it.
        * tests/bpf-obj_get_info_by_fd.c: Update expected output.
        * NEWS: Mention it.

2022-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/bpf: make sizeof_attr const.
        No one is supposed to change it.

        * tests/bpf.c (sizeof_attr): Add const qualifier.

2022-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add BPF_TRACE_KPROBE_MULTI to bpf_attach_type.
        * src/xlat/bpf_attach_type.in (BPF_TRACE_KPROBE_MULTI): New constant,
        introduced by Linux commit v5.18-rc1~136^2~11^2~28^2~10.
        * tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output.
        * NEWS: Mention this.

2022-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for the batch_size field of BPF_PROG_TEST_RUN command.
        Introduced by Linux commit v5.18-rc1~136^2~11^2~58^2~4,
        along with the BPF_F_TEST_XDP_LIVE_FRAMES flag.

        * src/bpf_attr.h (BPF_PROG_TEST_RUN_struct): Add batch_size field.
        (BPF_PROG_TEST_RUN_struct_size): Use the offset of batch_size field end
        for definition.
        (expected_BPF_PROG_TEST_RUN_struct_size): Change from 72 to 76.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Fix "The following
        two fields were introduced in Linux commit v5.10-rc1~107^2~96^2~36" comment
        formatting, decode the batch_size field.
        * src/xlat/bpf_test_run_flags.in (BPF_F_TEST_XDP_LIVE_FRAMES): New
        constant.
        * tests/bpf.c (BPF_PROG_TEST_RUN_checks): Update checks.

2022-05-21  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.18.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.18-rc7 using
        ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2022-05-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_S390_MEM_OP_EXTENSION): New constant,
        introduced by Linux commit v5.18-rc1~10^2~52^2~11 and getting its
        present value in commit v5.18-rc1~10^2~131.
        (KVM_CAP_PMU_CAPABILITY): New constant, introduced by Linux commit
        v5.18-rc1~10^2~124.
        (KVM_CAP_DISABLE_QUIRKS2): New constant, introduced by Linux commit
        v5.18-rc1~10^2~43.
        * NEWS: Mention this.

        xlat: update UFFD_* constants.
        * src/xlat/uffd_api_features.in (UFFD_FEATURE_EXACT_ADDRESS): New
        constant, introduced by Linux commit v5.18-rc1~168^2~89.
        * NEWS: Mention this.

        xlat: update IORING_* constants.
        * src/xlat/uring_enter_flags.in (IORING_ENTER_REGISTERED_RING): New
        constant, introduced by Linux commit v5.18-rc1~22^2~44.
        * src/xlat/uring_ops.in (IORING_OP_MSG_RING): New constant, introduced
        by Linux commit v5.18-rc1~22^2~42.
        * src/xlat/uring_setup_features.in (IORING_FEAT_LINKED_FILE): New
        constant, introduced by Linux commit v5.18-rc3~17^2~12.
        * src/xlat/uring_setup_flags.in (IORING_SETUP_SUBMIT_ALL): New constant,
        introduced by Linux commit v5.18-rc1~22^2~36.
        * tests/io_uring_enter.c: Update expected output.
        * tests/io_uring_register.c: Likewise.
        * tests/io_uring_setup.c: Likewise.
        * NEWS: Mention this.

        io_uring: decode IORING_{,UN}REGISTER_RING_FDS io_uring_register operations
        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_RING_FDS,
        IORING_UNREGISTER_RING_FDS): New constants, introduced by Linux commit
        v5.18-rc1~22^2~44.
        * src/io_uring.c (print_ringfd_register_array_member,
        print_io_uring_ringfds_register, print_ringfd_unregister_array_member,
        print_io_uring_ringfds_unregister): New functions.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_RING_FDS>: New case,
        call print_io_uring_ringfds_register.
        (SYS_FUNC(io_uring_register)) <case IORING_UNREGISTER_RING_FDS>: New case,
        call print_io_uring_ringfds_unregister.
        * tests/io_uring_register.c: Update expected output, add checks
        for IORING_REGISTER_RING_FDS and IORING_UNREGISTER_RING_FDS ops decoding.
        * NEWS: Mention this.

        tests: introduce TAIL_ALLOC_OBJECT_{CONST,VAR}_ARR.
        * tests/tests.h (TAIL_ALLOC_OBJECT_CONST_ARR,
        TAIL_ALLOC_OBJECT_VAR_ARR): New macros.

2022-04-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update KEY_* constants.
        * src/xlat/evdev_keycode.in (KEY_NEXT_ELEMENT, KEY_PREVIOUS_ELEMENT,
        KEY_AUTOPILOT_ENGAGE_TOGGLE, KEY_MARK_WAYPOINT, KEY_SOS, KEY_NAV_CHART,
        KEY_FISHING_CHART, KEY_SINGLE_RANGE_RADAR, KEY_DUAL_RANGE_RADAR,
        KEY_RADAR_OVERLAY, KEY_TRADITIONAL_SONAR, KEY_CLEARVU_SONAR,
        KEY_SIDEVU_SONAR, KEY_NAV_INFO, KEY_BRIGHTNESS_MENU): New constants,
        introduced by Linux commit v5.18-rc4~12^2.
        * NEWS: Mention this.

2022-04-29  Dmitry V. Levin  <ldv@strace.io>

        xlat: update BR_* constants.
        * src/xlat/rtnl_ifla_br_boolopts.in (BR_BOOLOPT_MST_ENABLE): New
        constant introduced by Linux kernel commit v5.18-rc1~136^2~50^2~14.
        * src/xlat/rtnl_ifla_br_boolopt_flags.in (1<<BR_BOOLOPT_MST_ENABLE):
        Likewise.
        * tests/nlattr_ifla_linkinfo.c (main): Update expected output.
        * NEWS: Mention this.

2022-04-28  Dmitry V. Levin  <ldv@strace.io>

        xlat: update IFLA_* constants.
        * src/xlat/rtnl_ifla_af_spec_bridge_attrs.in (IFLA_BRIDGE_MST): New
        constant introduced by Linux kernel commit v5.18-rc1~136^2~50^2~12.
        * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_LOCKED): New constant
        introduced by Linux kernel commit v5.18-rc1~136^2~267^2~4.
        * src/rtnl_link.c (ifla_brport_nla_decoders): Add IFLA_BRPORT_LOCKED.
        (ifla_af_spec_bridge_nla_decoders): Add IFLA_BRIDGE_MST.
        * tests/nlattr_ifla_af_spec.c (main): Update expected output.
        * tests/nlattr_ifla_brport.c: Likewise.
        * tests/nlattr_ifla_linkinfo.c: Likewise.
        * NEWS: Mention this.

2022-04-27  Dmitry V. Levin  <ldv@strace.io>

        xlat: update IFA_* constants.
        * src/xlat/rtnl_addr_attrs.in (IFA_PROTO): New constant introduced
        by Linux kernel commit v5.18-rc1~136^2~308.
        * NEWS: Mention this.

2022-04-26  Dmitry V. Levin  <ldv@strace.io>

        xlat: update BTRFS_* constants.
        * src/xlat/btrfs_features_incompat.in
        (BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2): New constant introduced
        by Linux kernel commit v5.18-rc1~172^2~73.
        * src/xlat/btrfs_tree_objectids.in (BTRFS_BLOCK_GROUP_TREE_OBJECTID):
        New constant introduced by Linux kernel commit v5.18-rc1~172^2~64.
        * NEWS: Mention this.

2022-04-25  Dmitry V. Levin  <ldv@strace.io>

        xlat: update MADV_* constants.
        * src/xlat/madvise_cmds.in (MADV_DONTNEED_LOCKED): New constant
        introduced by Linux kernel commit v5.18-rc1~120^2~1.
        * NEWS: Mention this.

2022-04-24  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.18-rc4.
        * bundled/linux/include/uapi/linux/btrfs.h: Update to
        headers_install'ed Linux kernel v5.18-rc4.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/dm-ioctl.h: Likewise.
        * bundled/linux/include/uapi/linux/if_addr.h: Likewise.
        * bundled/linux/include/uapi/linux/if_bridge.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/input-event-codes.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/kexec.h: Likewise.
        * bundled/linux/include/uapi/linux/lirc.h: Likewise.
        * bundled/linux/include/uapi/linux/loop.h: Likewise.
        * bundled/linux/include/uapi/linux/mctp.h: Likewise.
        * bundled/linux/include/uapi/linux/mroute6.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_queue.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/rtnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/socket.h: Likewise.
        * bundled/linux/include/uapi/linux/types.h: Likewise.
        * bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.

2022-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Raise strace awareness.
        After des Strausses awareness has been raised sufficiently,
        it is time for den Strauss to raise the awareness about strace,
        and to do so, the most modern and contemporary method has been elected:
        displaying tips, tricks and tweaks on each run.

        * src/strace.c (parse_tips_args): New function.
        (init) <enum>: Add GETOPT_TIPS.
        <longopts>: Add  "tips" option.
        (init) <case GETOPT_TIPS>: Call parse_tips_args.
        (terminate): Call print_totd before exit.
        (usage): Document --tips.
        * doc/strace.1.in (.SS Miscellaneous): Ditto.
        * src/strauss.c (MAX_TIP_LINES): New enum.
        (tips_tricks_tweaks, tip_top, tip_bottom, tip_left, tip_right): New
        static constants.
        (show_tips, tip_id): New variable.
        (print_totd): New function.
        * src/strauss.h (tips_fmt, tip_ids): New enumerations.
        (show_tips, tip_id, print_totd): New declarations.
        * tests/Makefile.am (MISC_TESTS): Add strace--tips.test,
        strace--tips-full.test.
        (EXTRA_DIST): Add strace--tips.exp.
        * tests/strace--tips-full.test: New test.
        * tests/strace--tips.test: Ditto.
        * tests/strace--tips.exp: New file.
        * tests/options-syntax.test: Add --tips syntax checks.
        * NEWS: Mention it.

        Suggested-by: Elvira Khabirova <lineprinter@altlinux.org>
        References: https://github.com/strace/strace/issues/14

2022-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add an option for raising Strauss awareness.
        As der Strauss is the strace's mascot and also an endangered species,
        it is a strace's responsibility now to raise awareness about it.

        * src/strauss.c: New file.
        * src/strauss.h: New header.
        * src/Makefile.am (strace_SOURCES): Add them.
        * src/strace.c: Include "strauss.h".
        (version_verbosity): New static variable.
        (print_version): Add verbosity argument, call print_strauss.
        (increase_version_verbosity): New function.
        (init) <case 'V'>: Call increase_version_verbosity.
        (init): Call print_version and exit if version_verbosity is non-zero.
        * tests/strauss_body.exp: New file.
        * tests/strauss_head.exp: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/strace-V.test: Update expected output, add checks.
        * strace.1.in: Document it.
        * NEWS: Mention it.

2022-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: explicitly indicate inability to print SELinux contexts.
        Similarly to the way it is done when -k option is specified.

        * src/filter_qualify.c [!ENABLE_SECONTEXT]: Include "secontext.h".
        [!ENABLE_SECONTEXT] (qualify_secontext): Define to print diagnostics
        message and die.
        [!ENABLE_SECONTEXT] (qual_options): Define "secontext" handler.
        * src/secontext.h [!ENABLE_SECONTEXT] (qualify_secontext): Declare.
        * src/strace.c [!ENABLE_SECONTEXT] (init): Define secontext_qual;
        define GETOPT_QUAL_SECONTEXT;  define "secontext" item in longopts;
        handle GETOPT_QUAL_SECONTEXT option.
        * tests/options-syntax.test: Add checks for the case
        $compiled_with_secontext is empty.

2022-03-28  Max Filippov  <jcmvbkbc@gmail.com>

        xtensa: fix register access using PTRACE_GETREGS API.
        The commit 2429c69961e2 ("xtensa: switch to PTRACE_GETREGS API") changed
        the way xtensa registers are accessed, but the change is only correct
        in case when the xtensa_regs.windowbase is 0 (i.e. the current register
        window starts at the physical registr 0). In other cases decoded syscall
        arguments are bogus. This issue is currently observed on noMMU xtensa
        linux because it uses PTRACE_GETREGS API, while configurations with MMU
        default to using ptrace_get_syscall_info.

        Fix that by taking xtensa_registers.windowbase into an account.
        This is trivial for the first 4 registers in the current window, because
        windowbase indicates 4-register groups and is always valid, so registers
        a0...a3 are guaranteed to be available in the physical registers array
        at indices windowbase * 4 + 0...3.
        Position of the registers with higher numbers may wrap around the end of
        the physical register file, so e.g. with 32 physical resgisters and
        windowbase = 7 the register a5 is stored in the xtensa_registers.a[1].

        This is further complicated by the fact that the size of the physical
        register file may vary and there's no explicit way to inquire it from
        the kernel. Probe for it by trying to set windowbase to ascending powers
        of 2 until it fails.

        * src/linux/xtensa/arch_regs.c (ARCH_SP_REG): Account for
        xtensa_regs.windowbase in xtensa_regs.a indexing.
        * src/linux/xtensa/get_error.c (arch_get_error): New variable
        status_reg that accounts for xtensa_regs.windowbase, use it
        for xtensa_regs.a indexing.
        * src/linux/xtensa/get_syscall_args.c (xtensa_probe_naregs): New
        function.
        (arch_get_syscall_args): New variable naregs_mask, initialize it
        using xtensa_probe_naregs, use it for xtensa_regs.a indexing.
        * src/linux/xtensa/set_error.c (arch_set_error)
        (arch_set_success): Account for xtensa_regs.windowbase in
        xtensa_regs.a indexing.

2022-03-27  Dmitry V. Levin  <ldv@strace.io>

        tests: fix build on systems where <signal.h> does not define SEGV_PKUERR
        * tests/ptrace.c (main) [HAVE_SIGINFO_T_SI_PKEY]: Conditionalize
        on SEGV_PKUERR as well.

        Reported-by: Andreas Schwab <schwab@linux-m68k.org>
        Fixes: v5.17~18 "tests: check decoding of SEGV_PKUERR"
        References: https://github.com/strace/strace/commit/beed7451b02c7c63c6199ac6b027beca7eef097f#commitcomment-69643079

2022-03-27  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.17-1.
        * strace.spec.in: Likewise.

2022-03-26  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.17 release.
        * NEWS: Update for 5.17 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2022-03-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Decode set_mempolicy_home_node syscall.
        Introduced by Linux commits v5.17-rc1~79^2~49 and v5.17-rc1~79^2~48.

        * src/linux/generic/syscallent-common.h ([BASE_NR + 450]): Add
        set_mempolicy_home_node syscall entry.
        * src/numa.c (SYS_FUNC(set_mempolicy_home_node)): New syscall decoder.
        * tests/.gitignore: Add set_mempolicy_home_node.
        * tests/pure_executables.list: Likewise.
        * tests/set_mempolicy_home_node.c: New file.
        * tests/gen_tests.in (set_mempolicy_home_node): New test.
        * NEWS: Mention it.

2022-03-13  Dmitry V. Levin  <ldv@strace.io>

        printpidfd: print pidfd path if pidfd_get_pid fails.
        * src/util.c (printpidfd): If the path associated with the given
        descriptor is "anon_inode:[pidfd]", print the path if pidfd_get_pid
        fails.

2022-03-12  Dmitry V. Levin  <ldv@strace.io>

        printsocket: print socket path if get_sockaddr_by_inode fails.
        * src/util.c (printsocket): If the path associated with the given
        descriptor has a form of "socket:[inode]", print the path if
        get_sockaddr_by_inode fails.

        util: introduce get_inode_of_socket_path.
        * src/util.c (get_inode_of_socket_path): New function.
        (getfdinode, printsocket): Use it.

        util: introduce print_string_in_angle_brackets.
        * src/util.c (print_string_in_angle_brackets): New function.
        (printsocket): Use it.

2022-03-10  Masatake YAMATO  <yamato@redhat.com>

        tests: fix a typo in tests.h.
        * tests/tests.h (error_msg_and_fail): Fix the condition wrapping
        the definition.

        Fixes: v4.21~95 "tests: add file:line to perror_msg_and_fail/error_msg_and_fail output"

2022-03-06  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KEY_* constants.
        * bundled/linux/include/uapi/linux/input-event-codes.h: Update
        to headers_install'ed Linux kernel v5.17-rc7.
        * src/xlat/evdev_keycode.in (KEY_DASHBOARD): Rename to
        KEY_ALL_APPLICATIONS introduced by Linux kernel commit v5.17-rc7~5^2.
        (KEY_DICTATE): New constant introduced by Linux kernel commit
        v5.17-rc7~5^2~1.
        * NEWS: Mention this change.

2022-03-05  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_PPC_AIL_MODE_3): New constant introduced
        by Linux kernel commit v5.17-rc6~27^2~2^2.

2022-02-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.17.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.17-rc5
          using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.17-rc5.
        * maint/ioctls_sym.sh (x86_list): Add KVM_GET_XSAVE2 ioctl.

2022-02-12  Sean Young  <sean@mess.org>

        Add lirc ioctl decoding.
        * NEWS: Mention this change.
        * bundled/linux/include/uapi/linux/lirc.h: New file.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/lirc_ioctl.c: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add it.
        * src/defs.h (DECL_IOCTL(lirc)): New declaration.
        * src/ioctl.c (ioctl_decode) <case 'i'>: Call kd_ioctl.
        * src/xlat/lirc_features.in: New file.
        * src/xlat/lirc_modes.in: Likewise.
        * tests/ioctl_lirc.c: New file.
        * tests/ioctl_lirc-success.c: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_lirc-success.
        * tests/gen_tests.in (ioctl_lirc, ioctl_lirc-success): New tests.
        * tests/pure_executables.list: Add ioctl_lirc.
        * tests/.gitignore: Add ioctl_lirc and ioctl_lirc-success.

        Reviewed-by: Eugene Syromyatnikov <evgsyr@gmail.com>
        Reviewed-by: Dmitry V. Levin <ldv@strace.io>

2022-02-08  Dmitry V. Levin  <ldv@strace.io>

        tests: use ATTRIBUTE_FORMAT for static functions, too.
        * tests/keyctl.c (append_str): Add ATTRIBUTE_FORMAT.
        (kckdfp_to_str): Fix -Wformat warning.

        error_prints: use ATTRIBUTE_FORMAT for static functions, too.
        * src/error_prints.c (verror_msg): Add ATTRIBUTE_FORMAT.

2022-02-08  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux/version.h.
        * bundled/linux/include/uapi/linux/version.h: Update to
        headers_install'ed Linux kernel v5.17-rc2.

        Fixes: v5.16-39-g19b787bbf "bundled: update linux UAPI headers to v5.17-rc2"

2022-02-07  Jonathan Borne  <jborne@kalray.eu>

        tests: add missing <stdint.h> in fanotify_mark.c.
        With musl libc, fanotify_mark.c compilation fails with 'uintptr_t'
        undeclared.

        Following POSIX specification uintptr_t should be defined in <stdint.h>.
        However, fanotify_mark.c does not include <stdint.h> directly.  Instead,
        it includes <sys/fanotify.h>.  With glibc or uclibc-ng, fanotify_mark.c
        compiles because the provided <sys/fanotify.h> includes <stdint.h>.
        This is not the case with musl libc.

        * tests/fanotify_mark.c: Include <stdint.h>.

2022-02-04  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of SEGV_ACCERR.
        * tests/segv_accerr.c: New file.
        * tests/gen_tests.in (segv_accerr): New test.
        * tests/Makefile.am (check_PROGRAMS): Add segv_accerr.
        * tests/.gitignore: Likewise.

2022-02-03  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of SEGV_PKUERR.
        * tests/segv_pkuerr.c: New file.
        * tests/gen_tests.in (segv_pkuerr): New test.
        * tests/Makefile.am (check_PROGRAMS): Add segv_pkuerr.
        * tests/.gitignore: Likewise.
        * tests/ptrace.c (main) [HAVE_SIGINFO_T_SI_PKEY]: Check decoding
        of SEGV_PKUERR.

2022-02-02  Slava Bacherikov  <slava@bacher09.org>

        printsiginfo: decode siginfo_t.si_pkey field.
        This adds decoding of si_pkey field which is set on SIGSEGV in case
        of memory access violation on some modern CPUs (these have pku flag
        in /proc/cpuinfo).

        * NEWS: Mention this change.
        * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_pkey.
        * src/printsiginfo.c (print_si_info) <case SIGSEGV>
        [HAVE_SIGINFO_T_SI_PKEY]: Decode si_pkey field.

2022-02-01  Sven Schnelle  <svens@linux.ibm.com>

        tests/membarrier: add additional return value.
        linux commit 809232619f5b ("sched/membarrier: Fix membarrier-rseq fence
        command missing from query bitmask") changed the returned value, so we
        need to adjust the strace test as well.

2022-01-30  Dmitry V. Levin  <ldv@strace.io>

        prctl: implement PR_SET_VMA decoding for non-Android platforms.
        PR_SET_VMA used to be specific to Android until Linux kernel commit
        v5.17-rc1~79^2~89.

        * NEWS: Mention this change.
        * src/xlat/prctl_options.in (PR_SET_VMA): Remove __ANDROID__ guard.
        * src/xlat/pr_set_vma.in: New file.
        * src/prctl.c [__ANDROID__ && !PR_SET_VMA]: Remove.
        [__ANDROID__ && !PR_SET_VMA_ANON_NAME]: Likewise.
        (SYS_FUNC(prctl)) <PR_SET_VMA>: Remove __ANDROID__ guard, enhance
        decoding.
        * tests/prctl-set_vma.c: New file.
        * tests/gen_tests.in (prctl-set_vma): New test.
        * tests/pure_executables.list: Add prctl-set_vma.
        * tests/.gitignore: Likewise.

2022-01-30  Dmitry V. Levin  <ldv@strace.io>

        xlat: update IORING_* and IOSQE_* constants.
        * NEWS: Mention this change.
        * src/xlat/uring_setup_features.in (IORING_FEAT_CQE_SKIP): New constant
        introduced by Linux kernel commit v5.17-rc1~118^2~25.
        * src/xlat/uring_sqe_flags.in (IOSQE_CQE_SKIP_SUCCESS): Likewise.
        * tests/io_uring_register.c (main): Update expected output.

2022-01-30  Dmitry V. Levin  <ldv@strace.io>

        rtnl_link: decode IFLA_GRO_MAX_SIZE attribute.
        This netlink attribute was introduced by Linux kernel commit
        v5.17-rc1~170^2~46.

        * NEWS: Mention this change.
        * src/rtnl_link.c (ifinfomsg_nla_decoders) Add IFLA_GRO_MAX_SIZE.
        * src/xlat/rtnl_link_attrs.in (IFLA_GRO_MAX_SIZE): New constant.

2022-01-30  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.17-rc2.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Update to
        headers_install'ed Linux kernel v5.17-rc2.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/rtnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.

2022-01-29  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_SYS_ATTRIBUTES): New constant introduced
        by Linux kernel commit v5.17-rc2~24^2~8.

2022-01-25  WANG Xuerui  <git@xen0n.name>

        loongarch64: make use of the newly exposed orig_a0 field for ptrace.
        * src/linux/loongarch64/get_syscall_args.c: Use orig_a0 for first
        syscall argument.
        * src/linux/loongarch64/arch_prstatus_regset.c: Print the new field.
        * tests/ptrace.c (print_prstatus_regset) [__loongarch__]: Update
        expected output.

2022-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: fix infmname printing check.
        As it is a EBCDIC string, it is supposed to be checked
        with IS_ARRAY_ZERO, similarly to other EBCDIC strings.
        Also, it induces a warning with GCC 12:

            s390.c: In function 'print_sthyi_machine':
            s390.c:565:30: error: the comparison will always evaluate as 'true' for the
            address of 'infmname' will never be NULL [-Werror=address]
              565 |                 if (name_val || hdr->infmname) {
                  |                              ^~
            s390.c:119:18: note: 'infmname' declared here
              119 |         char     infmname[8];  /**< EBCDIC Machine Name */
                  |                  ^~~~~~~~

        * src/s390.c (print_sthyi_machine): Use IS_ARRAY_ZERO for hdr->infmname
        non-emptiness check.

        Fixes: v4.21~73 "Introduce s390_sthyi system call decoder"
        Reported-by: Dmitry V. Levin <ldv@strace.io>

2022-01-24  Dmitry V. Levin  <ldv@strace.io>

        Remove remaining bits of Travis CI support.
        Given that in foreseeable future Travis CI is not going to welcome free
        software projects back, there is no use to keep the remaining bits of
        Travis CI support.

        * .gitignore: Remove "/travis_wait_*.log".
        * .travis.yml: Remove.

2022-01-23  Dmitry V. Levin  <ldv@strace.io>

        rtnl_tc_action: implement TCA_ACT_IN_HW_COUNT decoding.
        * src/rtnl_tc_action.c (tcamsg_nla_decoders): Add TCA_ACT_IN_HW_COUNT.
        * tests/nlattr_tcamsg.c [!HAVE_DECL_TCA_ACT_IN_HW_COUNT]
        (TCA_ACT_IN_HW_COUNT): New constant.
        (main): Check TCA_ACT_IN_HW_COUNT decoding.
        * NEWS: Mention this change.

        xlat: update TCA_ACT_* constants.
        * src/xlat/rtnl_tc_action_attrs.in (TCA_ACT_IN_HW_COUNT): New constant
        introduced by Linux kernel commit v5.7-rc1~146^2~25^2.
        * src/xlat/rtnl_tca_act_flags.in (TCA_ACT_FLAGS_SKIP_HW,
        TCA_ACT_FLAGS_SKIP_SW): New constants introduced by Linux kernel commit
        v5.17-rc1~170^2~158^2~6.
        * tests/nlattr_tcamsg.c (main): Update expected output.
        * NEWS: Mention this change.

2022-01-22  Dmitry V. Levin  <ldv@strace.io>

        xlat: update MODULE_INIT_* constants.
        * src/xlat/module_init_flags.in (MODULE_INIT_COMPRESSED_FILE): New constant
        introduced by Linux kernel commit v5.17-rc1~65^2~4.
        * tests/finit_module.c (main): Update expected output.
        * NEWS: Mention this change.

2022-01-21  Dmitry V. Levin  <ldv@strace.io>

        xlat: update *_MAGIC constants.
        * src/xlat/fsmagic.in (EXFAT_SUPER_MAGIC): New constant introduced
        by Linux kernel commit v5.17-rc1~74^2~2.
        (SMB2_MAGIC_NUMBER): Rename to SMB2_SUPER_MAGIC introduced by Linux
        kernel commit v5.17-rc1~57^2~1.
        (CIFS_MAGIC_NUMBER): Rename to CIFS_SUPER_MAGIC introduced by the same
        commit.
        * NEWS: Mention this change.

2022-01-20  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_VM_GPA_BITS): New constant introduced
        by Linux kernel commit v5.17-rc1~15^2~95^2~4.
        (KVM_CAP_XSAVE2): New constant introduced by Linux kernel commit
        v5.17-rc1~15^2~53.
        * NEWS: Mention this change.

2022-01-19  Dmitry V. Levin  <ldv@strace.io>

        xlat: update FAN_* constants.
        * src/xlat/fan_event_flags.in (FAN_RENAME): New constant introduced
        by Linux kernel commit v5.17-rc1~105^2~3.
        * src/xlat/fan_init_flags.in (FAN_REPORT_TARGET_FID): New constant
        introduced by Linux kernel commit v5.17-rc1~105^2~8.
        * tests/fanotify_init.c (main): Update expected output.
        * tests/fanotify_mark.c: Likewise.
        * NEWS: Mention this change.

        tests: fix typo in comment.
        * tests/test_printpath.c (test_printpath_at): Fix typo in comment.

2022-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        secontext: refacor SELinux context printing.
        This is mostly done to enable proper quoting of the printed context,
        as these are raw xattrs that may contain anything:

            $ sudo setfattr -n security.selinux -v "$(echo -e '\1\2\3\4\5\6\7\8\9\10\13\26\27')" ttt
            $ strace -efadvise64 --secontext cat ttt
            $ [unconfined] fadvise64(3 [\8\9
            ], 0, 0, POSIX_FADV_SEQUENTIAL) = 0
            ^[[?1;2c+++ exited with 0 +++

        * src/secontext.c (getcontext): Rename to...
        (parse_secontext): ...this, return pointer in the original context
        string and its size instead of a string copy, do not call freecon()
        on the original secontext.
        (get_expected_filecontext, selinux_getpidcon): Do not call getcontext
        on the result.
        (selinux_getfdcon, selinux_getfilecon): Do not call getcontext on the
        result, return expected context as-is.
        (print_context, selinux_printfdcon, selinux_printfilecon,
        selinux_printpidcon): New functions.
        * src/secontext.h (selinux_getfdcon, selinux_getfilecon,
        selinux_getpidcon, selinux_set_format): Remove declarations.
        (selinux_printfdcon, selinux_printfilecon, selinux_printpidcon): New
        declarations.
        * src/strace.c (printleader): Call selinux_printpidcon
        instead of selinux_getpidcon.
        * src/util.c (printfd_pid): Call selinux_printfdcon
        instead of selinux_getfdcon.
        (printpathn): Call selinux_printfilecon instead of selinux_getfilecon.

2022-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add ability to override xflag setting via string_quote style.
        * src/defs.h (QUOTE_OVERWRITE_HEXSTR, QUOTE_HEXSTR_SHIFT,
        QUOTE_HEXSTR_MASK, QUOTE_HEXSTR_NONE, QUOTE_HEXSTR_ALL,
        QUOTE_HEXSTR_NON_ASCII, QUOTE_HEXSTR_NON_ASCII_CHARS): New macro
        constants.
        (QUOTE_FORCE_HEX): Re-define to (QUOTE_OVERWRITE_HEXSTR |
        QUOTE_HEXSTR_ALL).
        * src/util.c (string_quote) <xstyle>: New local variable.
        (string_quote): Use xstyle instead of xflag/style checks for hexadecimal
        character printing checks.

        tests/linkat: reset context to the expected one if a mismatch has been detected
        * tests/secontext.h (reset_secontext_file): New declaration.
        * tests/secontext.c (reset_secontext_file): New function.
        * tests/linkat.c (main): Check that there is no initial mismatch
        in the sample_1 context, reset it otherwise.

        tests/secontext: eliminate separate secontext_format declaration.
        * tests/secontext.c (secontext_format): Remove declaration, supply
        the attributes to the definition.

        tests/linkat: provide fallback values for secontext fields changes.
        * tests/linkat.c (mangle_secontext_field): New function.
        (main): Replace calls to update_secontext_field
        with mangle_secontext_field calls.

        tests/secontext: add secontext field getters.
        * tests/secontext.h (get_secontext_field, get_secontext_field_file): New
        declarations.
        * tests/secontext.c (get_type_from_context): Rename to...
        (get_secontext_field): ...this;  remove "static" qualifier;  add "field"
        argument, use it.
        (raw_expected_secontext_short_file, raw_secontext_short_pid): Replace
        get_type_from_context call with get_secontext_field.
        (get_secontext_field_file): New function.
        (raw_secontext_short_file): Replace body with get_secontext_field_file
        call.

2022-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/linkat: reset errno before SELinux context manipulation.
        To avoid printing a stale error information in case of mismatch check
        failure.

        * tests/linkat.c: Include <errno.h>.
        (main): Add "errno = 0" before update_secontext_field calls.

2022-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: wfix.
        * doc/strace.1.in (.SH DESCRIPTION): Replace "simple pointers"
        with "pointers to basic types";  add definite article before "elements"
        in "pointers to basic types and arrays are printed using square brackets
        with commas separating elements."

2022-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: align -e inject/--inject syntax description to the left.
        That eliminates warnings about inability to fill the line (that has become
        rather long over the time):

            <standard input>:1287: warning [p 9, 5.8i, div `an-div', 0.0i]: cannot adjust line
            <standard input>:1287: warning [p 9, 5.8i, div `an-div', 0.2i]: can't break line

        (as there are indeed no spaces in the syntax line to accomodate such filling).
        Also, provide additional breakpoints to make it look a bit better.

        * doc/strace.1.in (.SS Tampering): Add ".ad b" before "-e inject" option
        syntax line and ".ad b" after "--inject" option syntax line;  add "\:"
        between option parameters for additional breaking points.

        Reported-by: Dmitry V. Levin <ldv@strace.io>

2022-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: update strace example output.
         - struct timespec has field names in the ouput since
           v4.14-135-gacdb08613;
         - the signal mask rt_sigreturn argument is decoded since v4.17~171;
         - articulate siginfo in the SIGLARM signal trace message.

        * doc/strace.1.in (.SH DESCRIPTION): Add "tv_sec" and "tv_nsec" field
        names to clock_gettime example output;  replace "0xe" with "{mask=[]}"
        in rt_sigreturn example output;  replace ellipsis with "{si_signo=SIGALRM,
        si_code=SI_KERNEL}" in SIGALRM example output.

2022-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: add references to syscall(2) and signal(7) to SEE ALSO.
        These contain some pertinent information about architecture-specific
        syscall caveats and signal handling.

        * doc/strace.1.in (.SH "SEE ALSO"): Add references to syscall(2)
        and signal(7).

2022-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: refer to syscalls(2) for syscall names reference.
        * doc/strace.1.in (.SS Filtering) <.I syscall>: Add a reference
        to syscalls(2) in the description.

2022-01-17  Dmitry V. Levin  <ldv@strace.io>

        Enhance rejection of invalid syscall numbers in syscall specification expressions
        We used to allow any number that does not exceed the maximum syscall
        number for the given personality, including those that do not correspond
        to real syscalls.

        * NEWS: Mention this.
        * src/arch_defs.h [!ARCH_NEEDS_NON_SHUFFLED_SCNO_CHECK]
        (ARCH_NEEDS_NON_SHUFFLED_SCNO_CHECK): Define to 0.
        * src/linux/x32/arch_defs_.h (ARCH_NEEDS_NON_SHUFFLED_SCNO_CHECK):
        Define to 1.
        * src/linux/x86_64/arch_defs_.h: Likewise.
        * src/basic_filters.c (qualify_syscall_number): Use shuffle_scno to
        obtain the internal syscall number, use scno_pers_is_valid to reject
        invalid syscall numbers.
        * tests/filtering_syscall-syntax.test: Check this.

2022-01-17  Dmitry V. Levin  <ldv@strace.io>

        Introduce scno_pers_in_range and scno_pers_is_valid.
        * src/defs.h (scno_pers_in_range, scno_pers_is_valid): New functions.
        * src/syscall_name.c (syscall_name_arch): Use scno_pers_is_valid.

2022-01-16  Dmitry V. Levin  <ldv@strace.io>

        Extend personality designation syntax to support all@pers.
        * NEWS: Mention this.
        * src/basic_filters.c (lookup_class): Change to support zero flags,
        handle "all" as a class with zero flags.
        (qualify_syscall_class): Update to new lookup_class semantics.
        * src/strace.c (usage): Update --trace description.
        * doc/strace.1.in (.SS Filtering): Likewise.
        * tests/filtering_syscall-syntax.test: Update expected output.
        * tests/qualify_personality_all.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/gen_tests.in (trace_personality_all_32,
        trace_personality_all_64, trace_personality_all_x32): New tests.

2022-01-15  Dmitry V. Levin  <ldv@strace.io>

        tests: extend personality designation syntax checks.
        * tests/filtering_syscall-syntax.test: Repeat some checks also with
        a correct personality designator.

2022-01-15  Dmitry V. Levin  <ldv@strace.io>

        tests: move current personality designator detection code to init.sh.
        This functionality is going to be used in different tests.

        * tests/init.sh (print_current_personality_designator): New function.
        * tests/qualify_personality.sh: Use it.

2022-01-15  Dmitry V. Levin  <ldv@strace.io>

        Extend personality designation syntax to support %class@pers.
        * NEWS: Mention this.
        * src/basic_filters.c (qualify_syscall_number,
        qualify_syscall_number_personality): Squash into a new function
        qualify_syscall_number taking personality as an argument instead of
        iterating over all personalities, remove personality designation syntax
        support.
        (qualify_syscall_regex): Change to take personality as an argument
        instead of iterating over all personalities, remove personality
        designation syntax support.
        (qualify_syscall_class): Change to take personality as an argument
        instead of iterating over all personalities.
        (qualify_syscall_name): Remove.
        (qualify_syscall_name_personality): Rename to qualify_syscall_name.
        (qualify_syscall_pers): New function.
        (qualify_syscall): Use it to iterate over all supported personalities,
        add personality designation syntax support.
        * src/strace.c (usage): Update --trace description.
        * doc/strace.1.in (.SS Filtering): Likewise.
        * tests/options-syntax.test: Update expected output.
        * tests/trace_personality_statfs_32.in: New file.
        * tests/trace_personality_statfs_64.in: Likewise.
        * tests/trace_personality_statfs_x32.in: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/gen_tests.in (trace_personality_statfs_32,
        trace_personality_statfs_64, trace_personality_statfs_x32): New tests.

2022-01-15  Dmitry V. Levin  <ldv@strace.io>

        Use the last @ as a starting point of the personality designator.
        There is no difference from a practical point of view as long as
        we don't have syscall names containing @ symbol.

        * src/basic_filters.c (qualify_syscall_separate_personality): Use
        the last @ of the syscall trace expression as a starting point of
        the personality designator.

2022-01-15  Dmitry V. Levin  <ldv@strace.io>

        tests: add more checks of --trace=number@pers support.
        * tests/print_scno_getcwd.sh: New file.
        * tests/trace_personality_number_32.in: Likewise.
        * tests/trace_personality_number_64.in: Likewise.
        * tests/trace_personality_number_x32.in: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/gen_tests.in (trace_personality_number_32,
        trace_personality_number_64, trace_personality_number_x32): New tests.

2022-01-14  Dmitry V. Levin  <ldv@strace.io>

        Make sprint_hwaddr and sprint_mac_addr functions static.
        Apparently, these functions are not used beyond the file where they are
        defined.

        * src/defs.h (sprint_hwaddr, sprint_mac_addr): Remove.
        * src/print_mac.c (sprint_hwaddr, sprint_mac_addr): Add static
        qualifier.

2022-01-13  Dmitry V. Levin  <ldv@strace.io>

        Remove unused function ts_mul.
        The last user of this function was removed by commit v5.3~71.

        * src/defs.h (ts_mul): Remove.
        * src/util.c: Likewise.

2022-01-13  Dmitry V. Levin  <ldv@strace.io>

        loongarch64: implement NT_PRSTATUS and NT_FPREGSET regsets decoding.
        * src/linux/loongarch64/arch_fpregset.c: New file.
        * src/linux/loongarch64/arch_fpregset.h: Likewise.
        * src/linux/loongarch64/arch_prstatus_regset.c: Likewise.
        * src/linux/loongarch64/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c [__loongarch__] (TRACEE_REGS_STRUCT): Define.
        (print_prstatus_regset, print_fpregset) [__loongarch__]: Update
        expected output.

2022-01-13  Dmitry V. Levin  <ldv@strace.io>

        xlat: add AUDIT_ARCH_LOONGARCH* constants.
        * src/xlat/audit_arch.in (AUDIT_ARCH_LOONGARCH32,
        AUDIT_ARCH_LOONGARCH64): New constants.

        Link: https://lore.kernel.org/lkml/20211013063656.3084555-4-chenhuacai@loongson.cn/

2022-01-13  WANG Xuerui  <git@xen0n.name>

        Add 64-bit LoongArch support.
        This is based on the WIP Linux port still under review, but the port is
        re-using asm-generic syscall numbers and parameters, so breakage should
        be minimal when the port is eventually merged, if at all.

        Currently only the LP64* ABIs are implemented in the toolchains, so only
        support the host type "loongarch64".

        * NEWS: Mention this.
        * configure.ac [$host_cpu == loongarch64]: Define LOONGARCH64.
        * src/linux/loongarch64/arch_defs_.h: New file.
        * src/linux/loongarch64/arch_regs.c: Likewise.
        * src/linux/loongarch64/get_error.c: Likewise.
        * src/linux/loongarch64/get_scno.c: Likewise.
        * src/linux/loongarch64/get_syscall_args.c: Likewise.
        * src/linux/loongarch64/ioctls_arch0.h: Likewise.
        * src/linux/loongarch64/ioctls_inc0.h: Likewise.
        * src/linux/loongarch64/raw_syscall.h: Likewise.
        * src/linux/loongarch64/set_error.c: Likewise.
        * src/linux/loongarch64/set_scno.c: Likewise.
        * src/linux/loongarch64/syscallent.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * src/xlat/elf_em.in: Add EM_LOONGARCH.

        Link: https://lore.kernel.org/lkml/20211013063656.3084555-1-chenhuacai@loongson.cn/

2022-01-12  Dmitry V. Levin  <ldv@strace.io>

        Remove unused function syscall_name.
        The last user of this function was removed by commit v5.15~209.

        * src/defs.h (syscall_name): Remove.
        * src/syscall_name.c: Likewise.

2022-01-11  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.16-1.
        * strace.spec.in: Likewise.

2022-01-10  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.16 release.
        * NEWS: Update for 5.16 release.

        .mailmap: add more entries to avoid duplication in CREDITS.
        * .mailmap: Add another email address of Paul Chaignon to avoid
        duplication in CREDITS file.

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

        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:]]' src tests |grep -v '\.sh$') |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: remove PACKET_ADD_MEMBERSHIP #ifdef guards.
        Both PACKET_ADD_MEMBERSHIP and struct packet_mreq are provided by
        <linux/if_packet.h> at least since Linux 2.6.12.

        * src/xlat/packet_mreq_type.in: Add #value_indexed, provide fallback
        definitions.
        * src/net.c: Remove PACKET_ADD_MEMBERSHIP #ifdef guards.

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: remove PACKET_RX_RING and PACKET_TX_RING #ifdef guards.
        All of them as well as struct tpacket_req are provided by
        <linux/if_packet.h> at least since Linux 2.6.12.

        * src/net.c: Remove PACKET_RX_RING and PACKET_TX_RING #ifdef guards.

        Complements: v5.15~139 "xlat: add fallback values to sock_packet_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: remove IPV6_ADD_MEMBERSHIP and IPV6_{JOIN,LEAVE}_ANYCAST guards.
        All of them are present since at least Linux 2.6.12 and glibc-2.3.3~616.

        * src/net.c [!IPV6_ADD_MEMBERSHIP] (print_mreq6): Enable function
        declaration.
        [!IPV6_ADD_MEMBERSHIP || !IPV6_JOIN_ANYCAST || !IPV6_LEAVE_ANYCAST] (print_setsockopt):
        Enable case IPV6_ADD_MEMBERSHIP, case IPV6_DROP_MEMBERSHIP,
        case IPV6_JOIN_ANYCAST, and case IPV6_LEAVE_ANYCAST.

        Complements: v5.15~140 "xlat: add fallback values to sock_ipv6_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove MCAST_JOIN_GROUP #ifdef guards.
        These are long defined (before Linux 2.6.12 and since glibc-2.3.4~748),
        so there seems to be no need to conditionalise on them.

        * src/net.c [!MCAST_JOIN_GROUP]: Enable case MCAST_JOIN_GROUP
        and case MCAST_LEAVE_GROUP.
        * src/print_group_req.c [!MCAST_JOIN_GROUP]: Enable
        DEF_MPERS_TYPE(struct_group_req) include, struct_group_req typedef,
        and print_group_req function.

        Complements: v5.15~141 "xlat: add fallback values to sock_ip_options"
        Complements: v5.15~140 "xlat: add fallback values to sock_ipv6_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: remove IP_ADD_MEMBERSHIP #ifdef guards.
        IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP are always defined since commit
        v5.15~141 "xlat: add fallback values to sock_ip_options", and the struct
        ip_mreq definition is present in UAPI since at least v2.6.12, so simply
        remove the #ifdef guards.

        * src/net.c [!IP_ADD_MEMBERSHIP] (print_mreq): Provide definition.
        [!IP_ADD_MEMBERSHIP] (print_setsockopt): Enable case IP_ADD_MEMBERSHIP
        and case IP_DROP_MEMBERSHIP.

        Complements: v5.15~141 "xlat: add fallback values to sock_ip_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: remove PACKET_STATISTICS #ifdef guards.
        The constant is always defined since v5.15~139 "xlat: add fallback values
        to sock_packet_options", and the decoder function does not require
        any extra definitions, so the #fidef guards are now superficial.

        * src/net.c [!PACKET_STATISTICS] (print_tpacket_stats): Make available.
        [!PACKET_STATISTICS] (print_getsockopt) <case SOL_PACKET: case
        PACKET_STATISTICS>: Call print_tpacket_stats.

        Complements: v5.15~139 "xlat: add fallback values to sock_packet_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: initialise struct icmp_filter read buffer with ~0.
        Since only the unset bits are printed, this avoids printing
        of bits not returned by the kernel when a short read is performed.

        * src/net.c (print_icmp_filter): Set filter.data to ~0U.

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: fix SO_ERROR socket option len clamping.
        Looks like a typo: err is set if len is too big instead of len.
        Fixes possible out-of-bounds read on umoven_or_printaddr when len
        is too big.

        * src/net.c (print_get_error) <if (len > sizeof(err))>: Set len
        to sizeof(err) and not err.

        Fixes: v4.26~45 "net: enhance decoding of getsockopt(SO_ERROR)"

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of futex_waitv syscall.
        * tests/futex_waitv.c: New file.
        * tests/gen_tests.in (futex_waitv): New test.
        * tests/pure_executables.list: Add futex_waitv.
        * tests/.gitignore: Likewise.

        futex_waitv: implement decoding of struct futex_waitv array.
        * bundled/linux/include/uapi/linux/futex.h: New file, imported from
        headers_install'ed Linux kernel v5.16-rc8.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/xlat/futex_waiter_flags.in: New file.
        * src/futex_waitv.c: Include <linux/futex.h> and
        "xlat/futex_waiter_flags.h".
        (print_waiter_data): New struct.
        (print_waiter, print_waiter_array): New functions.
        (SYS_FUNC(futex_waitv)): Use print_waiter_array to print the first
        argument of futex_waitv syscall.
        * NEWS: Mention this change.

2022-01-09  André Almeida  <andrealmeid@collabora.com>

        Implement decoding of futex_waitv syscall.
        This is an initial implementation of the new futex_waitv syscall
        introduced by Linux kernel commit v5.16-rc1~200^2~12.

        * src/futex_waitv.c: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add it.
        * src/linux/generic/syscallent-common.h ([BASE_NR + 449]): Add
        futex_waitv syscall entry.

2022-01-08  Dmitry V. Levin  <ldv@strace.io>

        xlat: update NDA_* constants.
        * src/xlat/rtnl_neigh_attrs.in (NDA_FLAGS_EXT): New constant
        introduced by Linux kernel commit v5.16-rc1~159^2~222^2~1.
        * NEWS: Mention this change.

        xlat: update V4L2_* constants.
        * src/xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ALLEGRO_BASE): New
        constant introduced by Linux kernel commit v5.16-rc1~173^2~15.
        * src/xlat/v4l2_control_ids.in (V4L2_CID_NOTIFY_GAINS): New constant
        introduced by Linux kernel commit v5.16-rc1~173^2~231.
        * src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SUNXI_TILED_NV12): Rename
        to V4L2_PIX_FMT_NV12_32L32, renamed by Linux kernel commit
        v5.16-rc1~173^2~279.
        (V4L2_PIX_FMT_HM12): Rename to V4L2_PIX_FMT_NV12_16L16, renamed by Linux
        kernel commit v5.16-rc1~173^2~278.
        (V4L2_PIX_FMT_NV12_4L4): New constant introduced by Linux kernel commit
        v5.16-rc1~173^2~277.
        (V4L2_PIX_FMT_MM21): New constant introduced by Linux kernel commit
        v5.16-rc1~173^2~262.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * src/xlat/kvm_exit_reason.in (KVM_EXIT_RISCV_SBI): New constant
        introduced by Linux kernel commit v5.16-rc1~153^2~50^2~2.
        * NEWS: Mention this change.

        xlat: update DEVCONF_* constants.
        * src/xlat/inet6_devconf_indices.in (DEVCONF_NDISC_EVICT_NOCARRIER):
        New constant introduced by Linux kernel commit v5.16-rc1~159^2~3^2~1.
        * NEWS: Mention this change.

        xlat: update IPV4_DEVCONF_* constants.
        * src/xlat/inet_devconf_indices.in (IPV4_DEVCONF_ARP_EVICT_NOCARRIER-1):
        New constant introduced by Linux kernel commit v5.16-rc1~159^2~3^2~2.
        * NEWS: Mention this change.

        xlat: update ETH_P_* constants.
        * src/xlat/ethernet_protocols.in (ETH_P_REALTEK): New constant
        introduced by Linux kernel commit v5.16-rc1~159^2~168^2~6.
        * NEWS: Mention this change.

        xlat: update FAN_* constants.
        * src/xlat/fan_event_flags.in (FAN_FS_ERROR): New constant introduced
        by Linux kernel commit v5.16-rc1~101^2~16.
        * tests/fanotify_mark.c (main): Update expected output.
        * NEWS: Mention this change.

        xlat: update BTRFS_* constants.
        * src/xlat/btrfs_send_flags.in (BTRFS_SEND_FLAG_VERSION): New constant
        introduced by Linux kernel commit v5.16-rc1~203^2~6.

        bundled: update linux UAPI headers to v5.16-rc8.
        * bundled/linux/include/uapi/asm-generic/fcntl.h: Update to
        headers_install'ed Linux kernel v5.16-rc8.
        * bundled/linux/include/uapi/linux/btrfs.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/mctp.h: Likewise.
        * bundled/linux/include/uapi/linux/neighbour.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
        * bundled/linux/include/uapi/linux/nfc.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/linux/include/uapi/linux/vm_sockets.h: Likewise.

2022-01-07  Dmitry V. Levin  <ldv@strace.io>

        xlat: update AUDIT_* constants.
        * xlat/nl_audit_types.in (AUDIT_URINGOP): New constant introduced
        by Linux kernel commit v5.16-rc1~162^2~18.
        (AUDIT_OPENAT2): New constant introduced by Linux kernel commit
        v5.16-rc1~161^2~1.
        (AUDIT_DM_CTRL, AUDIT_DM_EVENT): New constants introduced by Linux
        kernel commit v5.16-rc1~77^2~12.
        * NEWS: Mention this change.

        xlat: update SO_VM_* constants.
        * bundled/linux/include/uapi/linux/vm_sockets.h: Update to
        headers_install'ed Linux kernel v5.16-rc8.
        * src/xlat/sock_vsock_options.in (SO_VM_SOCKETS_CONNECT_TIMEOUT): Rename
        to SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD, renamed by Linux kernel commit
        v5.16-rc1~159^2~251.
        (SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW): New constant introduced by the same
        commit.

        xlat: update SO_* constants.
        * src/xlat/sock_options.in (SO_RESERVE_MEM): New constant introduced
        by Linux kernel commit v5.16-rc1~159^2~317^2~2.
        * NEWS: Mention this change.

2022-01-06  Dmitry V. Levin  <ldv@strace.io>

        Update copyright year number range.
        * COPYING: Update copyright year number range.
        * tests/COPYING: Likewise.
        * debian/copyright: Likewise.

2022-01-06  Dmitry V. Levin  <ldv@strace.io>

        mips: remove redundant include of syscall_dummy.h.
        As syscall_dummy.h is already included by syscall.h, there is no need
        to include it once more in syscallent.h.

        * src/linux/mips/syscallent.h: Do not include "syscall_dummy.h".

2022-01-05  Dmitry V. Levin  <ldv@strace.io>

        Rework personality_designators and personality_names.
        Move personality_designators definition to the same file with
        its sole user, move arch-specific initialization to arch_defs.h.

        * src/linux/x32/arch_defs_.h (PERSONALITY_DESIGNATORS,
        PERSONALITY_NAMES): New macros.
        * src/linux/x86_64/arch_defs_.h: Likewise.
        * src/arch_defs.h [!PERSONALITY_DESIGNATORS, !PERSONALITY_NAMES]:
        Likewise.
        * src/basic_filters.c (personality_designators): New array.
        * src/defs.h (personality_designators): Remove.
        * src/syscall.c: Likewise.
        (personality_names): Use PERSONALITY_NAMES, add static_assert.

2022-01-04  Dmitry V. Levin  <ldv@strace.io>

        Remove linux/generic/arch_defs_.h.
        Starting with commit v5.15~212, every supported architecture has to
        define PERSONALITY0_AUDIT_ARCH which effectively means that every
        supported architecture has its own arch_defs_.h file, and the generic
        arch_defs_.h is no longer needed.

        * src/Makefile.am (EXTRA_DIST): Remove linux/generic/arch_defs_.h.
        * src/linux/generic/arch_defs_.h: Remove.

        Complements: v5.15~212 "src/linux: add PERSONALITY0_AUDIT_ARCH definitions where possible"

2022-01-04  Renaud Métrich  <rmetrich@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Implement displaying of expected context upon mismatch.
        New option to --secontext=... (also available as -e secontext=...)
        - mismatch: print expected context on mismatch

        When using 'mismatch', an additional check is made on the context by
        reading the context database and comparing the output after stripping
        the unwanted part (e.g. stripping nothing in 'full' mode, keeping the
        type only in default mode):
        - if it differs, prints the expected context after printing '!!'
        - if not, don't print anything

        Example with /home/rmetrich/GIT/strace/autom4te.cache/output.3 file:

        ----
        $ matchpathcon /home/rmetrich/GIT/strace/autom4te.cache/output.3
        /home/rmetrich/GIT/strace/autom4te.cache/output.3       unconfined_u:object_r:user_home_t:s0

        $ ls -Z /home/rmetrich/GIT/strace/autom4te.cache/output.3
        system_u:object_r:user_home_t:s0 /home/rmetrich/GIT/strace/autom4te.cache/output.3
        ----

        From above, we see the user part differs ('unconfined_u' vs 'system_u')

        Output in '!full' mode (no diff found on type):

        ----
        $ strace --secontext=mismatch -e statx stat /home/rmetrich/GIT/strace/autom4te.cache/output.3
        ... statx(AT_FDCWD, "/home/rmetrich/GIT/strace/autom4te.cache/output.3" [user_home_t], ...
        ----

        Output in 'full' mode (diff found on user):

        ----
        ... statx(AT_FDCWD, "/home/rmetrich/GIT/strace/autom4te.cache/output.3" [system_u:object_r:user_home_t:s0!!unconfined_u:object_r:user_home_t:s0], ...
        ----

        * NEWS: Mention this change.
        * doc/strace.1.in: Document it.
        * m4/st_selinux.m4 (st_SELINUX): Check for selabel_open
        and selabel_lookup.
        * src/filter_qualify.c [ENABLE_SECONTEXT]: Include "secontext.h".
        [ENABLE_SECONTEXT] (secontext_set): New variable.
        [ENABLE_SECONTEXT] (secontextstr_to_uint, qualify_secontext): New
        functions.
        (qual_options) [ENABLE_SECONTEXT]: Add "secontext".
        * src/secontext.c: Include <sys/stat.h>, <unistd.h>, <selinux/label.h>,
        "largefile_wrappers.h", "number_set.h", and "xmalloc.h".
        (selinux_context, selinux_context_full): Remove.
        (getcontext): Use is_number_in_set instead of selinux_context_full.
        (selinux_getpidcon): Use is_number_in_set instead of selinux_context.
        (get_expected_filecontext): New function.
        (selinux_getfdcon, selinux_getfilecon): Use it to print context mismatch
        if SECONTEXT_MISMATCH is set in secontext_set.
        * src/secontext.h (selinux_context, selinux_context_full): Remove.
        (secontext_bits): New enum.
        (secontext_set, qualify_secontext, selinux_set_format): New
        declarations.
        * src/strace.c (SECONTEXT_E_QUAL): New macro.
        (usage): Use it, describe --secontext.
        (init) [ENABLE_SECONTEXT]: Call qualify_secontext, rename
        GETOPT_SECONTEXT to GETOPT_QUAL_SECONTEXT, use is_number_in_set
        instead of selinux_context.
        (init) [ENABLE_SECONTEXT] (secontext_qual): New variable.
        (init) [ENABLE_SECONTEXT] <GETOPT_QUAL_SECONTEXT>: Use it.
        * tests/.gitignore: Add *--secontext_full_mismatch,
        *--secontext_full_mismatch.c, *--secontext_mismatch, and
        *--secontext_mismatch.c.
        * tests/gen_secontext.sh: Generate *--secontext_full_mismatch.c
        and *--secontext_mismatch.c.
        * tests/gen_tests.in (access--secontext_full_mismatch,
        access--secontext_mismatch, chmod--secontext_full_mismatch,
        chmod--secontext_mismatch, execve--secontext_full_mismatch,
        execve--secontext_mismatch, execveat--secontext_full_mismatch,
        execveat--secontext_mismatch, faccessat--secontext_full_mismatch,
        faccessat--secontext_mismatch, faccessat-y--secontext_full_mismatch,
        faccessat-y--secontext_mismatch, fanotify_mark--secontext_full_mismatch,
        fanotify_mark--secontext_mismatch, fchmod--secontext_full_mismatch,
        fchmod--secontext_mismatch, fchmod-y--secontext_full_mismatch,
        fchmod-y--secontext_mismatch, fchmodat--secontext_full_mismatch,
        fchmodat--secontext_mismatch, fchownat--secontext_full_mismatch,
        fchownat--secontext_mismatch, file_handle--secontext_full_mismatch,
        file_handle--secontext_mismatch, linkat--secontext_full_mismatch,
        linkat--secontext_mismatch, open--secontext_full_mismatch,
        open--secontext_mismatch, openat--secontext_full_mismatch,
        openat--secontext_mismatch): New tests.
        * tests/linkat.c: Include <string.h>.
        (main) [PRINT_SECONTEXT_MISMATCH]: Check context mismatch.
        * tests/options-syntax.test: Check --secontext and -e secontext syntax.
        * tests/secontext.h (secontext_field): New enum.
        (secontext_full_file, secontext_short_file): Add "mismatch" argument.
        (update_secontext_type): Rename to update_secontext_field, add "field"
        argument.
        (SECONTEXT_FILE): Conditionalize "mismatch" argument passed to
        secontext_full_file and secontext_short_file on
        PRINT_SECONTEXT_MISMATCH.
        * tests/secontext.c: Include <sys/stat.h> and <selinux/label.h>.
        (get_type_from_context, raw_expected_secontext_full_file,
        raw_expected_secontext_short_file): New functions.
        (raw_secontext_short_file, raw_secontext_short_pid): Use
        get_type_from_context.
        (secontext_full_file): Add "mismatch" argument, use
        raw_expected_secontext_full_file if mismatch is enabled.
        (secontext_short_file): Add "mismatch" argument, use
        raw_expected_secontext_short_file if mismatch is enabled.
        (update_secontext_type): Rename to update_secontext_field, add "field"
        argument.

2022-01-03  Dmitry V. Levin  <ldv@strace.io>

        Update .mailmap.
        * .mailmap: Add both email addresses of Ahelenia Ziemiańska to avoid
        duplication in CREDITS file.

2022-01-03  наб  <nabijaczleweli@nabijaczleweli.xyz>

        Regenerate OpenZFS ioctls with vdev props.
        * src/ioctls_zfs.h (ZFS_IOC_VDEV_GET_PROPS, ZFS_IOC_VDEV_SET_PROPS): New
        entries.

2022-01-02  Dmitry V. Levin  <ldv@strace.io>

        tests: bring lists back to the sorted order.
        * tests/Makefile.am (check_PROGRAMS): Make the list sorted again.
        * tests/gen_tests.in: Likewise.
        * tests/pure_executables.list: Likewise.
        * tests/.gitignore: Likewise.

2022-01-01  Dmitry V. Levin  <ldv@strace.io>

        Use a separate manpage date for strace-log-merge.1.
        strace-log-merge.1 used cause confusion by sharing the manpage date
        with strace.1.

        * Makefile.am (dist-hook): Rename MANPAGE_DATE to STRACE_MANPAGE_DATE,
        generate $(distdir)/doc/.strace-log-merge.1.in.date.
        * configure.ac (manpage_date): Rename to strace_manpage_date.
        (slm_manpage_date): Define from doc/strace-log-merge.1.in.
        (MANPAGE_DATE): Rename to STRACE_MANPAGE_DATE.
        (SLM_MANPAGE_DATE): Define to slm_manpage_date.
        * doc/strace-log-merge.1.in: Replace MANPAGE_DATE with SLM_MANPAGE_DATE.
        * doc/strace.1.in: Replace MANPAGE_DATE with STRACE_MANPAGE_DATE.
        * strace.spec.in: Likewise, generate doc/.strace-log-merge.1.in.date.

2021-12-30  Sahil Kang  <sahil.kang@asilaycomputing.com>

        btrfs: add decoding of fs_info checksum, generation and metadata.
        * src/xlat/btrfs_csum_types.in: New file.
        * src/xlat/btrfs_fs_info_flags.in: Likewise.
        * src/btrfs.c: Include "xlat/btrfs_csum_types.h" and
        "xlat/btrfs_fs_info_flags.h".
        (btrfs_ioctl): Print csum_type, csum_size, flags, generation,
        and metadata_uuid fields of struct btrfs_ioctl_fs_info_args.
        * NEWS: Mention it.
        * tests/btrfs.c: Include "print_utils.h", "xlat/btrfs_csum_types.h",
        and "xlat/btrfs_fs_info_flags.h".
        (print_hex, print_uuid, btrfs_print_fs_info_args,
        btrfs_fs_info_args_subtest): New functions.
        (btrfs_test_fs_info_ioctl): New function for write_ok mode.
        (main): Use btrfs_test_fs_info_ioctl.

        tests: fix btrfs read-write tests.
        * tests/btrfs.c (btrfs_test_subvol_ioctls): Remove deprecated
        BTRFS_SUBVOL_CREATE_ASYNC flag to prevent -EOPNOTSUPP.
        (btrfs_test_ino_path_ioctls): Add fe_flags= field prefix to printed output.

2021-12-30  Paul Chaignon  <paul@isovalent.com>

        bpf: add support for new fields in struct bpf_prog_info.
        * src/bpf_attr.h (struct bpf_prog_info_struct): Add recursion_misses and
        verified_insns fields.
        (expected_bpf_prog_info_struct_size): Update.
        * src/bpf.c (print_bpf_prog_info): Decode recursion_misses and
        verified_insns fields introduced by Linux kernel commits
        v5.12-rc1~200^2~28^2~28 and v5.16-rc1~159^2~2^2~43^2~1.
        * tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

        bpf: support commands BPF_LINK_GET_*_ID.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_GET_FD_BY_ID): Decode the
        BPF_LINK_GET_FD_BY_ID command.
        (decode_BPF_BTF_GET_NEXT_ID): New macro.
        (SYS_FUNC(bpf)): Decode the commands.
        * src/bpf_attr.h (BPF_LINK_GET_FD_BY_ID_struct): New structure introduced
        by Linux commit v5.8-rc1~165^2~343^2~16^2~8.
        (BPF_LINK_GET_FD_BY_ID_struct_size): New macro.
        * NEWS: Mention this.
        * tests/bpf.c (union bpf_attr_data): Add BPF_LINK_GET_FD_BY_ID.
        (BPF_LINK_GET_FD_BY_ID_checks): Test for the BPF_LINK_GET_FD_BY_ID
        command.
        (BPF_LINK_GET_NEXT_ID_checks): New macro.
        (main) <checks>: Add BPF_LINK_GET_NEXT_ID and BPF_LINK_GET_FD_BY_ID.

        bpf: support new fields for BPF_PROG_TEST_RUN.
        * src/bpf_attr.h (BPF_PROG_TEST_RUN_struct): Add flags and cpu fields
        introduced by Linux kernel commit v5.10-rc1~107^2~96^2~36.
        (expected_BPF_PROG_TEST_RUN_struct_size): Update.
        * src/xlat/bpf_test_run_flags.in: New file.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Decode the new
        fields.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_PROG_TEST_RUN_check): Update expected output.

        bpf: implement decoding of BPF_PROG_LOAD fd_array field.
        * src/bpf_attr.h (BPF_PROG_LOAD_struct): Add fd_array field introduced by
        Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
        (expected_BPF_PROG_LOAD_struct_size): Update.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode the new field.
        * NEWS: Mention this.
        * tests/bpf-obj_get_info_by_fd.c (print_prog_load): Update expected
        output.
        * tests/bpf.c (BPF_PROG_LOAD_checks): Likewise.
        * tests/kernel_version.c (print_bpf_attr): Likewise.

        bpf: implement decoding of BPF_MAP_CREATE map_extra field.
        * src/bpf_attr.h (BPF_MAP_CREATE_struct): Add map_extra field introduced
        by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
        (bpf_map_info_struct): Likewise.
        (expected_BPF_MAP_CREATE_struct_size, expected_bpf_map_info_struct_size):
        Update.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode the new field.
        * NEWS: Mention this.
        * tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
        output.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Add a check that includes the
        map_extra field.

        bpf: update BPF_* constants.
        * src/xlat/bpf_map_types.in (BPF_MAP_TYPE_BLOOM_FILTER): New constant
        introduced in Linux kernel commit v5.16-rc1~159^2~2^2~20^2~4.
        * src/xlat/bpf_attach_types.in (BPF_PERF_EVENT): New constant introduced
        in Linux kernel commit v5.15-rc1~157^2~22^2~33^2~12.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_QUERY_checks): Update
        checks and their expected output.
        * NEWS: Mention this.

2021-12-26  Dmitry V. Levin  <ldv@strace.io>

        Move some gcc-agnostic macros from gcc_compat.h to macros.h.
        * src/gcc_compat.h (SAME_TYPE): Document it, rename to IS_SAME_TYPE.
        (FAIL_BUILD_ON_ZERO, MUST_BE_ARRAY): Move ...
        * src/macros.h: ... here, document them.
        (IS_NOT_ARRAY): New macro.
        * src/xstring.h: Include "macros.h" instead of "gcc_compat.h".

2021-12-25  Dmitry V. Levin  <ldv@strace.io>

        tests/ptrace: fix expected output for riscv64.
        * tests/ptrace.c (print_prstatus_regset] [__riscv]: Do not print
        delimiters before regs->pc.

        Fixes: v5.13~255 "riscv64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding"

2021-12-25  Dmitry V. Levin  <ldv@strace.io>

        tests: fix riscv64 support.
        Apparently, the preprocessor macro defined by gcc for riscv64 is __riscv
        instead of __riscv__ as one might expect.

        * tests/bpf.c: Replace __riscv__ with __riscv.
        * tests/cur_audit_arch.h: Likewise.
        * tests/io_uring_register.c: Likewise.
        * tests/ptrace.c: Likewise.

        Fixes: v4.22~18 "bpf: use print_big_u64_addr"
        Fixes: v5.5~41 "io_uring: add support for IORING_REGISTER_FILES_UPDATE"
        Fixes: v5.13~255 "riscv64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding"
        Fixes: v5.15~210 "tests: add cur_audit_arch.h"

2021-12-17  Chih-Hsuan Yen  <yan12125@gmail.com>

        Fix building for older Android.
        With the following commands,

            $ ./bootstrap
            $ _pkg_arch=aarch64
            $ export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
            $ CC=$_pkg_arch-linux-android21-clang \
              ./configure --prefix=/opt/android-libs/${_pkg_arch/_/-} \
                --host=$_pkg_arch-linux-android \
                --without-libunwind \
                --enable-mpers=no \
                --disable-gcc-Werror
            $ make

        Building fails with error diagnostics like this:

            In file included from sync_file_range.c:12:
            ./xlat/sync_file_range_flags.h:7:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
            static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1");

        This is a build regression from bd87cc95120b3707a6fe55129451bb0453730a6d,
        where "#unconditional" is added given that <linux/fs.h> is bundled,
        but the latter is not explicitly #include'd.

        As a side note, SYNC_FILE_RANGE* symbols are not available with
        ANDROID_API__ < 26 [1].

        [1] https://android.googlesource.com/platform/bionic/+/refs/tags/android-12.0.0_r15/libc/include/fcntl.h#98

        * src/sync_file_range.c: Include <linux/fs.h>.
        * src/sync_file_range2.c: Likewise.

        Fixes: v5.15~76 "xlat: add #unconditional to sync_file_range_flags"

2021-12-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.16.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.16-rc5
          using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.16-rc5.
        * maint/ioctls_sym.sh: Workaround incompatible definition of
        __alloc_size__ macro introduced by the Linux commit v5.16-rc1~106^2~224.

2021-12-04  Dmitry V. Levin  <ldv@strace.io>

        tests: adopt net-yy-unix test to the latest kernel changes.
        As noted in the previous commit, the Linux kernel commit
        v5.15-rc1~157^2~22^2~30^2~3 changed the value of system.sockprotoname
        attribute for AF_UNIX SOCK_STREAM sockets from "UNIX" to "UNIX-STREAM".
        Consequently, the test cannot assume any particular value for this
        attribute anymore.

        * tests/net-yy-unix.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>
        and "xmalloc.h".
        (main) [HAVE_SYS_XATTR_H]: Use the value of system.sockprotoname
        attribute instead of fixed string "UNIX".

2021-12-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketutils: add "UNIX-STREAM" protocol support.
        It is the same as the old AF_UNIX for all intents and purposes,
        but it has a different name since v5.15-rc1~157^2~22^2~30^2~3
        (and, due to the fact that Chrome OS uses datagrm AF_UNIX sockets
        and not stream ones, it hasn't been fixed back in v5.15-rc6~34^2~22).

        Reported-by: Renaud Métrich <rmetrich@redhat.com>
        Reported-by: Dmitry V. Levin <ldv@strace.io>

2021-12-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update KVM_CAP_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_HYPERV_ENFORCE_CPUID): New constant,
        introduced by Linux commit v5.14-rc1~166^2~173.
        (KVM_CAP_SREGS2): New constant, introduced by Linux commit
        v5.14-rc1~166^2~138.
        (KVM_CAP_EXIT_HYPERCALL): New constant, introduced by Linux commit
        v5.14-rc1~166^2~107.
        (KVM_CAP_PPC_RPT_INVALIDATE): New constant, introduced by Linux commit
        v5.14-rc1~104^2~71^2~2, obtained its value in Linux commit
        v5.14-rc1~166^2~92.
        (KVM_CAP_BINARY_STATS_FD): New constant, introduced by Linux commit
        v5.14-rc1~166^2~66.
        (KVM_CAP_EXIT_ON_EMULATION_FAILURE): New constant, introduced by Linux
        commit v5.14-rc1~166^2~5.
        (KVM_CAP_ARM_MTE): New constant, introduced by Linux commit
        v5.14-rc1~166^2^2~1^2~4, obtained its value in Linux commit
        v5.14-rc1~166^2.
        (KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM): New constant, introduced by Linux
        commit v5.16-rc1~29^2~4^2~3.

2021-12-02  Dmitry V. Levin  <ldv@strace.io>

        ci: re-enable testing with the latest mainline kernel headers.
        There should be no issues with v5.16-rc3.

        * .github/workflows/ci.yml (env): Remove KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2021-12-02  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.15-1.
        * strace.spec.in: Likewise.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.15 release.
        * NEWS: Update for 5.15 release.

2021-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_ifindex: fix IFNAME_QUOTED_SZ definition.
        sizeof(IFNAMSIZ) instead of IFNAMSIZ was mistakenly used
        for IFNAME_QUOTED_SZ initial definition in commit v4.23~87
        "print_ifindex: respect xlat style settings".

        * src/print_ifindex.c (IFNAME_QUOTED_SZ): Use IFNAMSIZ
        instead of sizeof(IFNAMSIZ).
        * NEWS: Mention it.

        Reported-by: Paulo Andrade <pandrade@redhat.com>
        Suggested-by: Paulo Andrade <pandrade@redhat.com>
        Fixes: v4.23~87 "print_ifindex: respect xlat style settings"
        References: https://bugzilla.redhat.com/show_bug.cgi?id=2028146

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        tests: move keyctl syscalls of keyctl tests into a subprocess.
        For some mysterious reason, this helps to workaround
        the following resource starvation issue on some systems:

          $ ./keyctl >/dev/null && /bin/true
          -sh: fork: retry: Resource temporarily unavailable
          -sh: fork: retry: Resource temporarily unavailable
          -sh: fork: retry: Resource temporarily unavailable
          -sh: fork: retry: Resource temporarily unavailable
          -sh: fork: Resource temporarily unavailable

        * tests/keyctl.c: Include <sys/wait.h>.
        (pid): New variable.
        (do_keyctl): Update expected output.
        (main): Fork a subprocess and move all keyctl syscalls there,
        update expected output.
        * tests/gen_tests.in (keyctl, keyctl-Xabbrev, keyctl-Xraw,
        keyctl-Xverbose): Add options: -f --signal='!chld'.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        tests/keyctl.c: make all global variables static.
        * tests/keyctl.c (nul_terminated_buf, buf_in_arg): Add static qualifier.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        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:]]' src tests |grep -v '\.sh$') |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        Fix typos found using codespell tool.
        * debian/changelog.in: Replace "archictectures" with "architectures".
        * tests/cur_audit_arch.h: Replace "arcitectures" with "architectures".

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        tests: fix net-sockaddr test on older systems.
        * tests/net-sockaddr.c (check_ipx): Explicitly initialize ipx->sipx_zero
        before use.

        Fixes: v5.14-96-g8352a541f "sockaddr: print struct sockaddr_ipx.sipx_zero if it is non-zero"

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        tests: robustify ioctl_hdio tests.
        * tests/ioctl_hdio.c (main): Do not assume 0xdeadbeef is an inaccessible
        pointer because sometimes this address is accessible, create an
        inaccessible pointer and use it instead of 0xdeadbeef.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        tests: disable tests for invalid msgctl and semctl commands on glibc >= 2.28
        Starting with commit glibc-2.32.9000-149-gbe9b0b9a012780a403a2,
        glibc skips msgctl syscall invocations and returns EINVAL
        for invalid msgctl commands.

        Likewise, starting with commit glibc-2.32.9000-147-ga16d2abd496bd974a882,
        glibc skips semctl syscall invocations and returns EINVAL
        for invalid semctl commands.

        These changes were later backported to vendor packages, e.g.:
          * Thu Mar 18 2021 Carlos O'Donell <carlos@redhat.com> - 2.28-153
          - Support SEM_STAT_ANY via semctl. Return EINVAL for unknown commands
            to semctl, msgctl, and shmctl. (#1912670)

        * tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 28)] (TEST_MSGCTL_BOGUS_CMD):
        Define to 0.
        * tests/ipc_sem.c [GLIBC_PREREQ_GE(2, 28)] (TEST_SEMCTL_BOGUS_CMD):
        Likewise.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

        upoken: workaround buggy process_vm_writev.
        The upoken implementation assumed that process_vm_writev could perform
        partial writes, but in older Linux kernel versions (my guess is in Linux
        before v3.15) process_vm_writev could not do partial writes properly.

        * src/ucopy.c (upoken): Fall back to upoken_pokedata when
        process_vm_writev fails with EFAULT or EIO.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        gcc_compat.h: bump required GCC version for diagnostic workarounds.
        Diagnostic push/pop pragmas were added only in gcc 4.6.

        * src/gcc_compat.h [!GNUC_PREREQ(4, 6)] (DIAG_PUSH_IGNORE_OVERRIDE_INIT,
        DIAG_POP_IGNORE_OVERRIDE_INIT, DIAG_PUSH_IGNORE_NONNULL,
        DIAG_POP_IGNORE_NONNULL): Define as empty.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sttaic_assert: disable -Wnested-externs when the fallback is used.
        The fallback is only used with old compilers, and their diagnostics
        is less useful anyway.

        * src/static_assert.h [!HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT &&
        __GNUC__]: Disable "-Wnested-externs" diagnostics.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/sockaddr_xlat: explicitly nest anonymous union member initialisation
        Unfortunately, gcc 4.4.7 from RHEL 6 does not support designated
        initialisation of members of anonymous unions/structs without additional
        nesting brackets.

        * tests/sockaddr_xlat.c (check_ieee802154): Add curly brackets around
        short_addr/hwaddr field initialisation, prepend with pan_id field
        initialisation where needed.

        Complements: v5.14-167-g87ba9609f "sockaddr: implement decoding of AF_IEEE802154 socket addresses"

2021-11-30  Dmitry V. Levin  <ldv@strace.io>

        socketutils: fix protocol lookup in get_sockaddr_by_inode_lookup.
        If getfdproto() fails to obtain system.sockprotoname attribute,
        it returns SOCK_PROTO_UNKNOWN.  When this happens,
        get_sockaddr_by_inode_lookup() receives no hints about the protocol
        number and falls back to iterating over the protocols table.
        Apparently, it failed to implement this properly.

        * src/socketutils.c (get_sockaddr_by_inode_lookup): When iterating
        over protocols table, pass data from protocols[i] instead of
        protocols[SOCK_PROTO_UNKNOWN] to protocols[i].get().

        Fixes: v4.25~37 "socketutils: store more information in protocols table"

2021-11-29  Dmitry V. Levin  <ldv@strace.io>

        exec_or_die: fix race condition.
        * src/strace.c (exec_or_die): Repeat wait() invocation while it fails
        with EINTR.

        tests/count-f.c: fix race condition.
        * tests/count-f.c (main): Allow waitpid() to fail with EINTR.

        tests/attach-f-p.c: fix race condition.
        * tests/attach-f-p.c (thread): Allow read() to fail with EINTR.

2021-11-29  Dmitry V. Levin  <ldv@strace.io>

        m4: fix st_SELINUX check.
        * m4/st_selinux.m4: Make sure selinux support is enabled only if
        all expected functions are provided by libselinux.

        Fixes: v5.12~49 "Implement --secontext[=full] option to display SELinux contexts"

2021-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        NEWS: mention --decode-fds={socket,dev,pidfd} behaviour fix.
        Complements: v5.14-193-g8d83c8270 "Do not decode fd path unless --decode-fds=path is specified"

2021-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Document AT_FDCWD path decoding feature.
        * doc/strace.1.in (-e decode-fds, -y): Mention that current working
        directory is printed on AT_FDCWD occurrence in addition to fd path decoding.
        * NEWS: Mention it.

        Complements: v5.14-199-g48de116c2 "Print cwd path for AT_FDCWD when -y (--decode-fd=path) option is used"

2021-11-29  Renaud Métrich  <rmetrich@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        tests: check corner cases of AT_FDCWD path decoding.
        * tests/at_fdcwd-pathmax.c: New file.
        * tests/.gitignore: Add at_fdcwd-pathmax.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (at_fdcwd-pathmax): New test.

2021-11-28  Renaud Métrich  <rmetrich@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Print cwd path for AT_FDCWD when -y (--decode-fd=path) option is used.
        When syscalls use AT_FDCWD (e.g. openat()), the corresponding current
        working directory is not always obvious, one might need to search back
        for chdir() syscalls in the process or some of its parents.

        With this change, the current working directory corresponding to
        AT_FDCWD is printed when -y (--decode-fd=path) option is used, e.g.:

        openat(AT_FDCWD</home/rmetrich/GIT/strace>, "/lib64/libselinux.so.1" ...)

        * src/open.c: Include "number_set.h".
        (print_dirfd) <fd == AT_FDCWD>: Print the current working directory of
        tracee when DECODE_FD_PATH is set.
        * tests/dev-yy.c [!PRINT_AT_FDCWD_PATH] (PRINT_AT_FDCWD_PATH):
        New macro.
        (main): Update expected output.
        * tests/dev--decode-fds-all.c (PRINT_DEVNUM): New macro.
        Include "dev-yy.c" instead of "dev--decode-fds-dev.c".
        * tests/dev--decode-fds-dev.c (PRINT_AT_FDCWD_PATH): New macro.
        * tests/dev--decode-fds-path.c (PRINT_AT_FDCWD_PATH): Likewise.
        * tests/faccessat.c (AT_FDCWD_FMT, AT_FDCWD_ARG): New macros.
        (tests_with_existing_file, main): Update expected output.
        * tests/faccessat2.c (YFLAG): New macro.
        (main): Update expected output.
        * tests/fsconfig.c (test_fsconfig_set_path): Update expected output.
        * tests/fspick.c (main): Likewise.
        * tests/mount_setattr.c (main): Likewise.
        * tests/move_mount.c (main): Likewise.
        * tests/open_tree.c (main): Likewise.
        * tests/openat2.c (YFLAG, AT_FDCWD_FMT, AT_FDCWD_ARG): New macros.
        (main): Update expected output.

        Resolves: https://github.com/strace/strace/issues/194

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix bpf-obj_get_info_by_fd-prog-v expected output.
        Since we cannot reliably predict the value of xlated_prog_len field
        returned by the kernel, do not hard-code it.

        * tests/bpf-obj_get_info_by_fd.c (main): Print the value
        of the xlated_prog_len field returned by the kernel
        instead of hard-coding an expected value.

        Fixes: v5.14-46-g835c65c0e "bpf: fix bpf_prog_info.map_ids array printing"

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make --decode-pids usage more in line with --decode-fds.
        Enable -e decode-pids syntax and document it in the man page.

        * src/filter_qualify.c (qual_options): Add "decode-pid" and "decode-pids"
        that associated with qualify_decode_pid decoder.
        * tests/options-syntax.test: Add option syntax checks for --decode-pids
        and -e decode-pids.
        * doc/strace.1.in (.BI "\-e " expr): Document decode-pids/decode-pid as
        a possible argument.
        (.SS Output format): Document -e decode-pids/--decode-pids.

        Complements: v5.14-184-gbac60e6a0 "Use traditional parser for --decode-pids option"

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/strace.c: remove Yflag_qual.
        It is used only once, contrary to {y,q,t}flag_qual variables.

        * src/strace.c (init) <Yflag_qual>: Remove.
        (init) <case 'Y'>: Replace Yflag_qual with "comm" in the argument
        to qualify_decode_pid.

        Complements: v5.14-180-g255a59247 "Implement -Y/--decode-pids=comm option for printing command names for PIDs"

2021-11-28  Dmitry V. Levin  <ldv@strace.io>

        tests: remove ATTRIBUTE_ALLOC_SIZE from tail_alloc and tail_memdup.
        Many tests are intentionally feeding their target syscalls with garbage.
        Unfortunately, the compiler stands in the way, issuing tons of
        -Warray-bounds and -Wstringop-overread warnings when it is aware
        of the amount of memory allocated by tail_alloc and tail_memdup.

        * m4/st_broken_cc.m4: Remove.
        * configure.ac: Remove st_BROKEN_CC invocation.
        * tests/tests.h (tail_alloc, tail_memdup): Remove ATTRIBUTE_ALLOC_SIZE
        attribute.

        Resolves: https://github.com/strace/strace/issues/203

2021-11-28  Alex Xu (Hello71)  <alex_y_xu@yahoo.ca>

        tests: add shebang where necessary.
        musl does not implement the shell fallback for execvp, causing tests
        to fail.  It is also good practice to provide a shebang anyway.

        * tests/qual_fault-syscall.test: Add shebang.
        * tests/qual_inject-error-signal-syscall.test: Likewise.
        * tests/qual_inject-retval-syscall.test: Likewise.
        * tests/qual_inject-signal-syscall.test: Likewise.

        Resolves: https://github.com/strace/strace/issues/202

2021-11-27  Dmitry V. Levin  <ldv@strace.io>

        Do not decode fd path unless --decode-fds=path is specified.
        Before this change, --decode-fds with any argument would result to the
        file path corresponding to the file descriptor being printed even when
        the descriptor type does not match the type specified by the
        --decode-fds argument.  After this change, the file path corresponding
        to the file descriptor will be printed only when --decode-fds argument
        is not specified or contains "path".

        * src/util.c (print_quoted_string_in_angle_brackets): New function.
        (printfd_pid): Use it to print the file path when DECODE_FD_PATH is set.
        * tests/dev--decode-fds-all.c: New file.
        * tests/dev--decode-fds-none.c: Likewise.
        * tests/net--decode-fds-all-netlink.c: Likewise.
        * tests/pidfd_open--decode-fd-all.c: Likewise.
        * tests/pidfd_open--decode-fd-none.c: Likewise.
        * tests/dev--decode-fds-socket.c: Include "dev--decode-fds-none.c"
        instead of "dev-yy.c".
        (PRINT_DEVNUM): Remove.
        * tests/dev-yy.c: Add PRINT_PATH support.
        * tests/net--decode-fds-dev-netlink.c: Include
        "net--decode-fds-none-netlink.c" instead of net-yy-netlink.c.
        (PRINT_SOCK): Remove.
        * tests/pidfd_open--decode-fd-socket.c: Include
        "pidfd_open--decode-fd-none.c" instead of "pidfd_open-y.c".
        * tests/.gitignore: Add dev--decode-fds-all, dev--decode-fds-none,
        net--decode-fds-all-netlink, pidfd_open--decode-fd-all, and
        pidfd_open--decode-fd-none.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (dev--decode-fds-all, dev--decode-fds-none,
        net--decode-fds-all-netlink, pidfd_open--decode-fd-all,
        pidfd_open--decode-fd-none): New tests.
        (dev--decode-fds-socket): Update argument for -a option.
        (net--decode-fds-dev-netlink): Add -a option.

        Reported-by: Renaud Métrich <rmetrich@redhat.com>
        Fixes: v5.6~168 "strace: add a long option alias for -y"

2021-11-27  Dmitry V. Levin  <ldv@strace.io>

        Move printing of angle brackets from printfd_pid to individual printers.
        This is required by the follow-up change.

        * src/defs.h (print_sockaddr_by_inode): Remove.
        * src/socketutils.c (print_sockaddr_by_inode_cached,
        print_sockaddr_by_inode_uncached, print_sockaddr_by_inode): Likewise.
        (get_sockaddr_by_inode_uncached): Rename to
        get_sockaddr_by_inode_lookup, implement get_sockaddr_by_inode_uncached
        on top of it.
        * src/util.c (printsocket): Rewrite using get_sockaddr_by_inode instead
        of print_sockaddr_by_inode, print angle brackets around the output
        string.
        (printdev, printpidfd): Print angle brackets around the output string.
        (printfd_pid): Do not print angle brackets around the output string.

2021-11-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1: elaborate on support of multiple PIDs as a -p argument.
        While it was mentioned that -p "`pidof PROG`" syntax is supported,
        it was not explicitly stated what characters can be used as separators
        (like newline, which is used by pgrep, as noted in process_opt_p_list).

        * doc/strace.1.in (.SS Startup): Explicitly mention that multiple PIDs
        can be provided as an argument to a single -p option;  list all
        supported separator characters;  mention possible -p "$(pgrep PROG)"
        syntax.

2021-11-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pidns: reorder struct translate_id_params fields.
        Moving output fields after input ones reduces the structure size
        by whopping 25 percents (from 32 down to 24 bytes) on 64-bit systems,
        and also makes the order of the fields a bit more natural.

        * src/pidns.c (struct translate_id_params) <result_id, pd>: Move
        to the end of the structure.
        (translate_pid) <tip>: Reorder field initialisation in order
        with the field order.

2021-11-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/linux/x32/syscallent.h: add TSD flag to execve#64 and execveat#64.
        They are to be always traced with seccomp-bpf, similarly to their x32
        counterparts.

        Fixes: v5.3~36 "Add seccomp filter syscall flag"

2021-11-24  Dmitry V. Levin  <ldv@strace.io>

        tests: check diagnostics that -k has no effect with -c.
        * tests/options-syntax.test: Check strace -c -k diagnostics.

2021-11-23  Dmitry V. Levin  <ldv@strace.io>

        Fix formatting of --decode-pids=comm output.
        Do not print an extra space between the pid number and the comm string
        when the number is less than 10000.

        * src/strace.c (printleader) <print_pid_pfx && len>: Print pid using %u
        format instead of %-5u.
        * tests/strace--decode-pids-comm.c (do_default_action): Update expected
        output.
        * tests/strace-p1-Y-p.c (main): Likewise.

2021-11-22  Dmitry V. Levin  <ldv@strace.io>

        tests: check that -p pid1 -Y -p pid2 prints /proc/$pid1/comm properly.
        * tests/strace-p1-Y-p.c: New file.
        * tests/strace-p-Y-p2.c: Likewise.
        * tests/strace-p-Y-p.test: New test.
        * tests/.gitignore: Add strace-p1-Y-p and strace-p-Y-p2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add strace-p-Y-p.test.

2021-11-21  Dmitry V. Levin  <ldv@strace.io>

        Refactor printleader to reduce code duplication.
        * src/strace.c (print_comm_str): New function.
        (printleader, print_pid_comm): Use it to print command names obtained
        from /proc/$pid/comm.

2021-11-20  Dmitry V. Levin  <ldv@strace.io>

        Use traditional parser for --decode-pids option.
        Use the same method of handling --decode-pids arguments as for other
        options with bitset arguments.  This enables such options syntax as
        --decode-pids=comm,pidns and --decode-pids=all.

        * src/defs.h (pid_decoding, pid_decoding_flags): Remove.
        (maybe_printpid_comm): Rename to print_pid_comm.
        * src/filter_qualify.c (decode_pid_set): New variable.
        (decode_pid_str_to_uint): New function.
        (qualify_decode_pid): Rewrite using qualify_tokens.
        * src/filter_seccomp.c (traced_by_seccomp): Use decode_pid_set instead
        of pid_decoding.
        * src/pidns.c (printpid_translation): Likewise.
        * src/number_set.h (decode_pid_bits): New enum.
        (decode_pid_set): New variable declaration.
        * src/strace.c (pid_decoding): Remove.
        (printleader, maybe_load_task_comm, init): Use decode_pid_set instead of
        pid_decoding.
        (maybe_printpid_comm): Likewise, rename to print_pid_comm.
        * tests/options-syntax.test: Update expected output.

2021-11-14  Dmitry V. Levin  <ldv@strace.io>

        Properly escape strings printed by -Y/--decode-pids=comm option.
        Command names obtained from /proc/$pid/comm can contain arbitrary
        symbols and therefore require proper escaping.

        * src/strace.c (printleader): Print tcp->comm using
        print_quoted_string_ex.
        (maybe_printpid_comm): Print the data obtained from load_pid_comm
        using print_quoted_string_ex.
        * tests/strace--decode-pids-comm.c (do_default_action): Check it.

        Resolves: https://github.com/strace/strace/issues/191

2021-11-14  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Extend -Y option to decode PIDs in arguments and return values.
        This change extends -Y/--decode-pids=comm option.  In addition to the
        information printed before this change, command names would be printed
        also for PIDs appeared in syscall arguments and return values.

        For example:

          getppid()                  = 3781395<strace>
          getpid()                   = 3781398<a.out>
          pidfd_open(1<systemd>, 0)  = 3<pid:1<systemd>>

        NOTE: The code printing the pid in printclockname() is not changed in
        this commit.  CLOCKID_TO_FD macro used in printclockname() was removed
        from the kernel, so printclockname() may change drastically in the
        near future.

        * src/defs.h (maybe_printpid_comm): New function declaration.
        * src/strace.c (maybe_printpid_comm): New function printing
        command name for the given PID.
        * src/pidns.c (printpid_translation): Call `maybe_printpid_comm'.
        * tests/strace--decode-pids-comm.c (do_default_action): Update expected
        output.

2021-11-14  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        tests: add tests for -Y/--decode-pids=comm option.
        * tests/strace--decode-pids-comm.c: New file.
        * tests/strace-Y-0123456789.c: Likewise.
        * tests/gen_tests.in (strace-Y-0123456789, strace--decode-pids-comm):
        New tests.
        * tests/Makefile.am (CHECK_PROGRAMS): Add strace-Y-0123456789 and
        strace--decode-pids-comm.
        * tests/.gitignore: Likewise.

2021-11-14  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Implement -Y/--decode-pids=comm option for printing command names for PIDs
        In some applications like qemu-kvm, threads change their
        command names to indicate their roles in the application.
        Users can access the command name via /proc/$pid/comm.
        The command name can be a great hint to understand the application
        behavior.

        This change introduces -Y/-decode-pids=comm option that enables
        printing command names where PIDs appear.

        For example (without -Y option):

        [pid 254329] ioctl(18, KVM_RUN <unfinished ...>
        [pid 254332] ioctl(21, KVM_RUN <unfinished ...>
        [pid 254331] ioctl(20, KVM_RUN <unfinished ...>
        [pid 254330] ioctl(19, KVM_RUN <unfinished ...>
        [pid 254309] poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ...
        [pid 254309] poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ...

        (with -Y option):

        [pid 254329<CPU 0/KVM>] ioctl(18, KVM_RUN <unfinished ...>
        [pid 254332<CPU 3/KVM>] ioctl(21, KVM_RUN <unfinished ...>
        [pid 254331<CPU 2/KVM>] ioctl(20, KVM_RUN <unfinished ...>
        [pid 254330<CPU 1/KVM>] ioctl(19, KVM_RUN <unfinished ...>
        [pid 254309<qemu-system-x86>] poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ...
        [pid 254309<qemu-system-x86>] poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ...

        This change considers only PIDs in the prefixes of trace lines.
        Printing command names for PIDs in arguments and return values
        will be implemented in a follow-up commit.

        * doc/strace.1.in (.SS Output format): Document -Y and
        --decode-pids=comm options.
        * src/strace.c (usage): Describe -Y and --decode-pids=comm options.
        (printleader): Print the command name for the given tcb.
        (init): Add -Y/--decode-pids=comm option.
        Call `qualify_decode_pid' when one of the options is given.
        Call `maybe_load_task_comm' to handle the case the options are given
        after -p option.
        * src/filter_qualify.c (qualify_decode_pid): Set PID_DECODING_COMM
        and PID_DECODING_NS_TRANSLATION flags to pid_decoding if "comm" is given.
        * NEWS: Mention this change.

        Enabling PID_DECODING_NS_TRANSLATION for "comm" argument is
        Suggested-by: Ákos Uzonyi <uzonyi.akos@gmail.com>.

2021-11-14  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Load /proc/$pid/comm into struct tcb.
        In preparation for the forthcoming -Y/--decode-pids=comm option.

        Load the content of /proc/$pid/comm to `comm', a newly introduced
        member of struct tcb.

        The loading is done when
        A. a tcb is initialized,
        B. execve or execveat is called, and
        C. prctl(PR_SET_NAME,...) is called.

        Limitation: this change is not enough for handling the case that
        someone writes a value to /proc/$pid/comm directly.
        (e.g. running echo "foo" > /proc/$pid/comm)

        * src/defs.h (struct tcb): New member `comm'.
        (enum pid_decoding_flags): Add PID_DECODING_COMM as a new flag.
        (PROC_COMM_LEN): New macro.
        (maybe_load_task_comm): New function declaration.
        * src/strace.c (strip_trailing_newlines): New function.
        (load_task_comm): New function loading the contents of /proc/$pid/comm
        into struct tcb.comm.
        (maybe_load_pid_comm): New function.
        (alloctcb): Call it for initializing the `comm' member.
        * src/syscall.c: Include <linux/prctl.h>.
        (syscall_exiting_decode): Call maybe_load_task_comm().
        * src/sysent.h (COMM_CHANGE): New macro.
        * src/sysent_shorthand_defs.h (CC): Likewise.
        * src/sysent_shorthand_undefs.h (CC): Undefine.
        * src/linux/32/syscallent.h: Add CC flag to syscalls changing
        /proc/$pid/comm.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * src/filter_seccomp.c (traced_by_seccomp): Force tracing syscalls
        marked with `COMM_CHANGE' if `PID_DECODING_COMM' flag is set in
        `pid_decoding'.

2021-11-14  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Introduce --decode-pids=pidns as an alias for --pidns-translation.
        In preparation for the forthcoming -Y/--decode-pids=comm option.

        * doc/strace.1.in (.SS Output format): Document --decode-pids=pidns
        option.
        * src/defs.h (pidns_translation): Remove.
        (pid_decoding): New variable declaration.
        (enum pid_decoding_flags): New enum.
        (qualify_decode_pid): New function prototype.
        * src/strace.c (pidns_translation): Remove.
        (pid_decoding): New variable.
        (usage): Describe --decode-pids=pidns option.
        (init) <enum>: Add GETOPT_QUAL_DECODE_PID.
        <longopts>: Add --decode-pids as a long option.
        <case GETOPT_PIDNS_TRANSLATION>: Call qualify_decode_pid
        to update pid_decoding indirectly.
        <case GETOPT_QUAL_DECODE_PID>: New condition.
        * src/filter_qualify.c (qualify_decode_pid): New function.
        * src/pidns.c (printpid_translation): Refer to pid_decoding as
        the replacement for pidns_translation.
        * tests/init.sh (test_pidns_run_strace): Replace --pidns-translation
        with --decode-pids=pidns.
        * tests/options-syntax.test: Check invalid --decode-pids argument.
        * NEWS: Mention this change.

        Making --decode-pids option a super set of --pidns-translation option is
        Suggested-by: by Eugene Syromyatnikov <evgsyr@gmail.com>.

2021-11-14  Masatake YAMATO  <yamato@redhat.com>

        Use printpid for printing pid of pidfd.
        * src/util.c (printpidfd): Use printfd instead of
        PRINT_VAL_D.

        Suggested-by: Ákos Uzonyi <uzonyi.akos@gmail.com>

2021-11-13  Srikavin Ramkumar  <srikavinramkumar@gmail.com>
            Dmitry V. Levin  <ldv@strace.io>

        hdio: improve HDIO support.
        Add decoders for HDIO_DRIVE_RESET, HDIO_GET_32BIT, HDIO_GET_ACOUSTIC,
        HDIO_GET_ADDRESS, HDIO_GET_BUSSTATE, HDIO_GET_DMA, HDIO_GET_IDENTITY,
        HDIO_GET_KEEPSETTINGS, HDIO_GET_MULTCOUNT, HDIO_GET_NICE, HDIO_GET_NOWERR,
        HDIO_GET_UNMASKINTR, HDIO_GET_WCACHE, HDIO_OBSOLETE_IDENTITY, HDIO_SCAN_HWIF,
        HDIO_SET_32BIT, HDIO_SET_ACOUSTIC, HDIO_SET_ADDRESS, HDIO_SET_BUSSTATE,
        HDIO_SET_DMA, HDIO_SET_KEEPSETTINGS, HDIO_SET_MULTCOUNT, HDIO_SET_NICE,
        HDIO_SET_NOWERR, HDIO_SET_PIO_MODE, HDIO_SET_UNMASKINTR, HDIO_SET_WCACHE,
        and HDIO_UNREGISTER_HWIF.

        [ldv: note that HDIO compat has never been supported by the kernel, so
        adjust HDIO ioctl decoder and its tests accordingly.]

        * maint/gen/defs/hdio.def: New file.
        * src/gen/gen_hdio.c: New generated file.
        * src/gen/generated.h: Likewise.
        * src/Makefile.am (libstrace_a_SOURCES): Add gen/generated.h and
        gen/gen_hdio.c.
        * src/hdio.c: Include "gen/generated.h".
        (hdio_ioctl): Call var_ioctl_HDIO for unimplemented commands.
        * src/xlat/hdio_busstates.in: New file.
        * src/xlat/hdio_ide_nice.in: Likewise.
        * tests/ioctl_hdio.c: Add tests for newly implemented commands.
        * NEWS: Mention this change.

        Resolves: https://github.com/strace/strace/issues/131

2021-11-13  Dmitry V. Levin  <ldv@strace.io>

        maint/gen: use print_xint_array_member to print uint32_t arrays.
        * maint/gen/defs/common.def (ptr[in, array[uint32_t, $1]]): Replace
        print_uint_array_member with print_xint_array_member.

2021-11-13  Dmitry V. Levin  <ldv@strace.io>

        maint/gen: use printflags64 and printxval64 instead of 32-bit versions.
        This is necessary to print 64-bit integer types properly.

        * maint/gen/codegen.c (generate_printer): Use printflags64 instead of
        printflags, use printxval64 instead of printxval.

2021-11-13  Dmitry V. Levin  <ldv@strace.io>

        maint/gen: cleanup.
        * maint/gen/xmalloc.c: New file.
        * maint/gen/xmalloc.h: Likewise.
        * maint/gen/Makefile: Rewrite.
        * maint/gen/codegen.c: Add copyright header, wrap very long lines,
        use CLEANUP_FREE, xstrdup, and xasprintf.
        * maint/gen/ast.c: Add copyright header, wrap very long lines,
        use xstrdup.
        * maint/gen/ast.h: Add copyright header, wrap very long lines.
        * maint/gen/deflang.h: Add copyright header and include guard,
        wrap very long lines, add attributes to prototypes.
        * maint/gen/lex.l: Add copyright header, wrap very long lines,
        fix warnings, use xstrdup.
        * maint/gen/parse.y: Add copyright header, wrap very long lines,
        fix warnings.
        * maint/gen/preprocess.c: Add copyright header, wrap very long lines.
        * maint/gen/preprocess.h: Include "ast.h".
        * maint/gen/symbols.c: Wrap very long lines, use xasprintf.
        * maint/gen/symbols.h: Wrap very long lines.
        * maint/gen/defs/common.def: Add copyright header.

2021-11-13  Srikavin Ramkumar  <srikavinramkumar@gmail.com>

        maint: add a definition-based syscall decoder generator.
        Implement a code generation tool capable of parsing system call definitions
        and generating system call decoders.

        * maint/gen/.gitignore: New file.
        * maint/gen/Makefile: Likewise.
        * maint/gen/README.md: Likewise.
        * maint/gen/ast.c: Likewise.
        * maint/gen/ast.h: Likewise.
        * maint/gen/codegen.c: Likewise.
        * maint/gen/deflang.h: Likewise.
        * maint/gen/defs/common.def: Likewise.
        * maint/gen/lex.l: Likewise.
        * maint/gen/parse.y: Likewise.
        * maint/gen/preprocess.c: Likewise.
        * maint/gen/preprocess.h: Likewise.
        * maint/gen/symbols.c: Likewise.
        * maint/gen/symbols.h: Likewise.

2021-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: implement IFLA_AF_SPEC decoding for AF_BRIDGE.
        It is special with relation to the others as it employs a completely
        different structure, disregarding the existing one.

        * src/xlat/rtnl_ifla_af_spec_bridge_attrs.in: New file.
        * src/xlat/rtnl_ifla_af_spec_bridge_vlan_tunnel_info_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_bridge_flags.in: Likewise.
        * src/xlat/rtnl_ifla_bridge_modes.in: Likewise.
        * src/defs.h (nl_bridge_vlan_flags): New declaration.
        * src/rtnl_link.c: Include <linux/if_bridge.h>,
        "xlat/rtnl_ifla_af_spec_bridge_attrs.h",
        "xlat/rtnl_ifla_af_spec_bridge_vlan_tunnel_info_attrs.h",
        "xlat/rtnl_ifla_bridge_flags.h", and "xlat/rtnl_ifla_bridge_modes.h".
        (decode_ifla_bridge_flags, decode_ifla_bridge_mode,
        decode_ifla_bridge_vlan_info, decode_bridge_vlan_info_flags,
        decode_ifla_bridge_vlan_tunnel_info): New functions.
        (ifla_af_spec_bridge_vlan_tunnel_info_decoders,
        ifla_af_spec_bridge_nla_decoders): New decoder tables.
        (decode_ifla_af_spec): Add special handling for the ifi_family=AF_BRIDGE
        case by calling decode_nlattr directly with
        rtnl_ifla_af_spec_bridge_attrs and ifla_af_spec_bridge_nla_decoders.
        * tests/nlattr_ifla_af_spec.c: Include <linux/if_bridge.h>.
        (msg_af, msg_af_str): New static variables.
        (IFLA_AF): New macro, define to msg_af.
        (IFLA_AF_STR): New macro, define to msg_af_str.
        (init_IFLA_BRIDGE_VLAN_TUNNEL_INFO_msg,
        print_IFLA_BRIDGE_VLAN_TUNNEL_INFO_msg): New functions, defined
        via AF_SPEC_FUNCS.
        (main): Check unsupported IFLA_AF_SPEC address families for each
        ifinfomsg address family, skip AF_BRIDGE; add AF_BRIDGE IFLA_AF_SPEC
        checks.
        * NEWS: Mention it.

2021-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move ENUM_KNOWN to tests.h.
        Its definition is shared by several tests already.

        * tests/tests.h (ENUM_KNOWN): New macro, yet another wrapper
        for XLAT_KNOWN.
        * tests/nlattr_cachereport.c (ENUM_KNOWN): Remove.
        * tests/nlattr_ifla_brport.c (ENUM_KNOWN): Likewise.
        * tests/nlattr_ifla_vfinfo.c (ENUM_KNOWN): Likewise.

2021-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: enhance decoding of AF_NETLINK socket addresses.
        Before, the size limit was incorrect and padding was never printed.

        * src/sockaddr.c (print_sockaddr_data_nl): Print nl_pad field
        if it is non-zero.
        (sa_printers) <[AF_NETLINK]>: Fix the min_len field value.
        * tests/net-sockaddr.c (check_nl): Add checks for undersized sockaddr
        and non-zero nl_pad; explicitly initialise nl_pad to zero when needed.
        * NEWS: Mention it.

2021-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: implement decoding of AF_RXRPC socket addresses.
        * configure.ac (AC_CHECK_HEADERS): Add linux/rxrpc.h.
        * src/xlat/rxrpc_services.in: New file.
        * src/sockaddr.c: Include "xlat/rxrpc_services.h".
        (struct sockaddr_rxrpc): New type definition.
        (print_sockaddr_data_rxrpc): New function.
        (sa_printers) <[AF_RXRPC]>: New printer.
        * tests/sockaddr_xlat.c [HAVE_LINUX_RXRPC_H]: Include <linux/rxrpc.h>.
        [!HAVE_LINUX_RXRPC_H] (struct sockaddr_rxrpc): New type definition.
        (#include "xlat/addrfams.h"): Move out of XLAT_MACROS_ONLY definition.
        (check_rxrpc): New function.
        (main): Call it.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_IEEE802154 socket addresses.
        * src/xlat/ieee802154_addr_types.in: New file.
        * src/xlat/ieee802154_addrs.in: Likewise.
        * src/xlat/ieee802154_pan_ids.in: Likewise.
        * src/sockaddr.c: Include "xlat/ieee802154_addr_types.h",
        "xlat/ieee802154_addrs.h", and "xlat/ieee802154_pan_ids.h".
        (IEEE802154_ADDR_LEN): New macro.
        (struct ieee802154_addr_sa, struct sockaddr_ieee802154): New type
        definitions.
        (print_sockaddr_data_ieee802154): New function.
        (sa_printers) <[AF_IEEE802154]>: New printer.
        * tests/sockaddr_xlat.c (IEEE802154_ADDR_NONE, IEEE802154_ADDR_SHORT,
        IEEE802154_ADDR_LONG): New enum items.
        (IEEE802154_ADDR_LEN, IEEE802154_PANID_BROADCAST,
        IEEE802154_ADDR_BROADCAST, IEEE802154_ADDR_UNDEF): New macros.
        (struct ieee802154_addr_sa, struct sockaddr_ieee802154): New type
        definitions.
        (check_ieee802154): New function.
        (main): Call it.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_ALG socket addresses.
        * bundled/linux/include/uapi/linux/if_alg.h: New file, imported from
        headers_install'ed Linux kernel v5.15.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/xlat/alg_sockaddr_flags.in: New file.
        * configure.ac (AC_CHECK_HEADERS): Check for linux/if_alg.h.
        (AC_CHECK_TYPES): Check for struct sockaddr_alg_new.
        * src/sockaddr.c: Include <linux/if_alg.h>
        and "xlat/alg_sockaddr_flags.h".
        (print_sockaddr_data_alg): New functions.
        (sa_printers) <[AF_ALG]>: New printer.
        * tests/sockaddr_xlat.c [HAVE_LINUX_IF_ALG_H]: Include <linux/if_alg.h>.
        [!HAVE_LINUX_IF_ALG_H] (struct sockaddr_alg): New type definition.
        [!CRYPTO_ALG_KERN_DRIVER_ONLY] (CRYPTO_ALG_KERN_DRIVER_ONLY): New macro
        constant.
        [!HAVE_STRUCT_SOCKADDR_ALG_NEW] (struct sockaddr_alg_new): New type
        definition.
        (check_alg): New function.
        (main): Call it.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_NFC socket addresses.
        * bundled/linux/include/uapi/linux/nfc.h: New file, imported from
        headers_install'ed Linux kernel v5.15.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/nfc.h.
        * src/xlat/nfc_saps.in: New file.
        * src/xlat/nfc_sockaddr_protocols.in: Likewise.
        * src/sockaddr.c: Include <linux/nfc.h>, "xlat/nfc_saps.h",
        and "xlat/nfc_sockaddr_protocols.h".
        (print_sockaddr_data_nfc): New function.
        (sa_printers) <[AF_NFC]>: New printer.
        * tests/sockaddr_xlat.c [HAVE_LINUX_NFC_H]: Include <linux/nfc.h>.
        [!HAVE_LINUX_NFC_H] (NFC_LLCP_MAX_SERVICE_NAME): New macro.
        [!HAVE_LINUX_NFC_H] (struct sockaddr_nfc, struct sockaddr_nfc_llcp): New
        type definitions.
        (check_nfc): New function.
        (main): Call check_nfc.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_VSOCK socket addresses.
        * configure.ac (AC_CHECK_HEADERS): Add linux/vm_sockets.h.
        (AC_CHECK_TYPES): Check for struct sockaddr_vm.
        (AC_CHECK_MEMBERS): Check for struct sockaddr_vm.svm_flags.
        * src/xlat/vsock_cids.in: New file.
        * src/xlat/vsock_flags.in: Likewise.
        * src/xlat/vsock_ports.in: Likewise.
        * src/sockaddr.c: Include <linux/vm_sockets.h>, "xlat/vsock_cids.h",
        "xlat/vsock_flags.h", and "xlat/vsock_ports.h".
        (print_sockaddr_data_vsock): New function.
        (sa_printers) <[AF_VSOCK]>: New printer.
        * tests/sockaddr_xlat.c [HAVE_LINUX_VM_SOCKETS_H]: Include
        <linux/vm_sockets.h>.
        [!HAVE_STRUCT_SOCKADDR_VM] (struct sockaddr_vm): New type definition.
        (SVM_FLAGS, SVM_ZERO, SVM_ZERO_FIRST): New macros.
        (check_vsock): New function.
        (main): Call it.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_QIPCRTR socket addresses.
        * bundled/linux/include/uapi/linux/qrtr.h: New file, imported from
        headers_install'ed Linux kernel v5.15.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/qrtr.h.
        * src/xlat/qipcrtr_nodes.in: New file.
        * src/xlat/qipcrtr_ports.in: Likewise.
        * src/sockaddr.c: Include <linux/qrtr.h>, "xlat/qipcrtr_nodes.h",
        and "xlat/qipcrtr_ports.h".
        (print_sockaddr_data_qrtr): New function.
        (sa_printers) <[AF_QIPCRTR]>: New printer.
        * tests/sockaddr_xlat.c [HAVE_LINUX_QRTR_H]: Include <linux/qrtr.h>.
        [!HAVE_LINUX_QRTR_H] (struct sockaddr_qrtr): New type definition.
        (check_qrtr): New function.
        (main): Call check_qrtr.
        * NEWS: Mention it.

        sockaddr: implement decoding of AF_XDP socket addresses.
        * bundled/linux/include/uapi/linux/if_xdp.h: New file, imported from
        headers_install'ed Linux kernel v5.15.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/if_xdp.h.
        (AC_CHECK_TYPES): Check for struct sockaddr_xdp presence
        in <linux/if_xdp.h>.
        * src/xlat/xdp_sockaddr_flags.in: New file.
        * src/sockaddr.c: Include <linux/if_xdp.h> and "xlat/xdp_sockaddr_flags.h".
        (print_sockaddr_data_xdp): New function.
        (sa_printers) <[AF_XDP]>: New socket address decoding entry.
        * tests/sockaddr_xlat-Xabbrev-y.c: New file.
        * tests/sockaddr_xlat-Xraw-y.c: Likewise.
        * tests/sockaddr_xlat-Xverbose-y.c: Likewise.
        * tests/sockaddr_xlat.c: Include "xlat/xdp_sockaddr_flags.h".
        [HAVE_LINUX_IF_XDP_H]: Include <linux/if_xdp.h>.
        [!HAVE_STRUCT_SOCKADDR_XDP] (struct sockaddr_xdp): New type definition.
        [SKIP_IF_PROC_IS_UNAVAILABLE] (SKIP_IF_PROC_IS_UNAVAILABLE): New macro.
        [!FD0_PATH] (FD0_PATH): Likewise.
        [!FD7_PATH] (FD7_PATH): Likewise.
        (check_xdp): New function.
        (main): Add SKIP_IF_PROC_IS_UNAVAILABLE and check_xdp call.
        * tests/.gitignore: Add sockaddr_xlat-Xabbrev-y, sockaddr_xlat-Xraw-y,
        and sockaddr_xlat-Xverbose-y.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (sockaddr_xlat-Xabbrev-y, sockaddr_xlat-Xraw-y,
        sockaddr_xlat-Xverbose-y): New tests.
        * NEWS: Mention it.

        net: add AF_VSOCK socket option names decoding support.
        * bundled/linux/include/uapi/linux/vm_sockets.h: New file, copied from
        headers_install'ed Linux kernel v5.15.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/xlat/sock_vsock_options.in: New file.
        * src/xlat/socketlayers.in (AF_VSOCK): New constant.
        * src/net.c: Include <linux/vm_sockets.h> and
        "xlat/sock_vsock_options.h".
        (print_sockopt_fd_level_name) <case AF_VSOCK>: Print AF_VSOCK socket
        options.

        net: decode SOL_CAN_RAW socket options.
        * xlat/sock_can_raw_options.in: New file.
        * net.c: Include "xlat/sock_can_raw_options.h".
        (print_sockopt_fd_level_name) <case SOL_CAN_RAW>: Print socket option
        name using sock_can_raw_options xlat.

2021-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: handle QUOTE_0_TERMINATED|QUOTE_EXPECT_TRAILING_0 in print_quoted_string_ex
        Similarly to the way it is done in printstr_ex.

        * src/util.c (print_quoted_string_ex): Print ellipsis if both
        QUOTE_0_TERMINATED and QUOTE_EXPECT_TRAILING_0 were set and string_quote
        returned non-zero.

2021-11-12  Dmitry V. Levin  <ldv@strace.io>
            Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        poke: add support of unaligned address/length when process_vm_writev is unavailable
        * src/ucopy.c (upoken_peekpoke): New function.
        (upoken_pokedata): Use it for unaligned address and length.
        * tests/poke.c (main): Update.
        * tests/poke.test: Likewise.
        * tests/poke-ptrace.test: Likewise.
        * tests/poke-unaligned.test: Likewise.
        * tests/poke-unaligned.expected: Update expected output.

        Complements: v5.11~49 "Add -e inject=<...>:poke_{enter,exit}=<...> functionality"

2021-11-12  Dmitry V. Levin  <ldv@strace.io>

        ucopy: introduce a data type for PTRACE_PEEKDATA operations.
        * src/ucopy.c (dissected_long_t): New type.
        (umoven_peekdata, umovestr_peekdata): Use it instead of open-coding it.

        Suggested-by: Elvira Khabirova <lineprinter@altlinux.org>

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add --strings-in-hex=non-ascii-chars option.
        It seems that some people prefer hexadecimal numbers instead of octal
        in C string escape sequences;  unfortunately, before it also led
        to printing of the whole strings using escape sequences, which may
        negatively impacted the output comprehensibility in cases where only few
        characters are actually non-ASCII.  Add an option that satisfies
        that preference without any downsides.

        * doc/strace.1.in (.SS Output format): Add --strings-in-hex option
        description, fix formatting for --strings-in-hex=non-ascii
        and --strings-in-hex=all mentions.
        * src/defs.h (enum xflag_opts): Add HEXSTR_NON_ASCII_CHARS.
        * src/strace.c (xflag_str): Add HEXSTR_NONE and HEXSTR_NON_ASCII_CHARS.
        (usage): Add --strings-in-hex=non-ascii-chars option description, fix "ASCII"
        capitalisation in -x option description.
        (init) <xflag_long>: Initialise with -1 instead of HEXSTR_NONE.
        (init) <case 'x'>: Cap xflag incrementing at HEXSTR_ALL.
        (init) <case GETOPT_HEX_STR>: Treat -1 as invalid option value
        instead of HEXSTR_NONE.
        (init): Set xflag if xflag_long is non-negative, not just positive.
        * src/util.c (string_quote): Check against specific xflag values;  use
        sprint_byte_hex instead of sprint_byte_oct if xflag is set
        to HEXSTR_NON_ASCII_CHARS.
        * tests/.gitignore: Add strace--strings-in-hex-non-ascii-chars,
        strace--strings-in-hex-none, and strace-no-x.
        * tests/pure_executables.list: Likewise.
        * tests/strace--strings-in-hex-all.c: Set STRACE_X to 2
        instead of STRACE_XX to 1.
        * tests/strace--strings-in-hex.c: Likewise.
        * tests/strace-xx.c: Likewise.
        * tests/strace--strings-in-hex-non-ascii-chars.c: New file.
        * tests/strace--strings-in-hex-non-ascii.c: Set STRACE_X to 1
        instead of STRACE_XX to 0.
        * tests/strace--strings-in-hex-none.c: New file.
        * tests/strace-no-x.c: Likewise.
        * tests/strace-x.c: Update expected output.
        * tests/gen_tests.in (strace--strings-in-hex-non-ascii-chars,
        strace--strings-in-hex-none, strace-no-x): New tests.
        * NEWS: Mention it.

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: implement RTM_NEWCACHEREPORT message decoding.
        * bundled/linux/include/uapi/linux/mroute.h: New file, copied from
        headers_install'ed Linux kernel v5.15.
        * bundled/linux/include/uapi/linux/mroute6.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/xlat/rtnl_family.in: New file.
        * src/xlat/rtnl_ip6mra_creport_attr.in: Likewise.
        * src/xlat/rtnl_ip6mra_msg_types.in: Likewise.
        * src/xlat/rtnl_ipmra_creport_attr.in: Likewise.
        * src/xlat/rtnl_ipmra_msg_types.in: Likewise.
        * src/rtnl_cachereport.c: Likewise.
        * src/Makefile.am (strace_SOURCES): Add it.
        * src/netlink_route.c (route_decoders) <[RTM_NEWCACHEREPORT - RTM_BASE]>:
        New decoder, call decode_cachereport.
        * src/netlink_route.h (decode_cachereport): New declaration.
        * tests/.gitignore: Add nlattr_cachereport, nlattr_cachereport-Xabbrev,
        nlattr_cachereport-Xraw, and nlattr_cachereport-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/netlink_route.c (test_rtnl_rtgen) <types>: Add
        RTM_NEWCACHEREPORT.
        (test_rtnl_rtgen): Move RTM_NEWCACHEREPORT-related unknown message
        checks from...
        (main): ...here.  Remove the unsupported message check
        for RTM_NEWCACHEREPORT.
        * tests/nlattr_cachereport.c: New file.
        * tests/nlattr_cachereport-Xabbrev.c: Likewise.
        * tests/nlattr_cachereport-Xraw.c: Likewise.
        * tests/nlattr_cachereport-Xverbose.c: Likewise.
        * tests/gen_tests.in (nlattr_cachereport, nlattr_cachereport-Xabbrev,
        nlattr_cachereport-Xraw, nlattr_cachereport-Xverbose): New tests.
        * NEWS: Mention it.

        rtnl_link: implement IFLA_VFINFO_LIST decoding.
        * src/xlat/rtnl_ifla_vf_info_attrs.in: New file
        * src/xlat/rtnl_ifla_vf_link_states.in: Likewise.
        * src/xlat/rtnl_ifla_vf_stats_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_vf_vlan_list_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_vfinfo_list_attrs.in: Likewise.
        * src/rtnl_link.c: Include "xlat/rtnl_ifla_vf_info_attrs.h",
        "xlat/rtnl_ifla_vf_link_states.h", "xlat/rtnl_ifla_vf_stats_attrs.h",
        "xlat/rtnl_ifla_vf_vlan_list_attrs.h",
        and "xlat/rtnl_ifla_vfinfo_list_attrs.h".
        (decode_ifla_vf_mac, decode_ifla_vf_vlan, decode_ifla_vf_tx_rate,
        decode_ifla_vf_spoofchk, decode_ifla_vf_link_state, decode_ifla_vf_rate,
        decode_ifla_vf_rss_query_en, decode_ifla_vf_stats, decode_ifla_vf_trust,
        decode_ifla_vf_guid, decode_ifla_vf_vlan_info, decode_ifla_vf_vlan_list,
        decode_ifla_vf_broadcast, decode_ifla_vf_info, decode_ifla_vfinfo_list):
        New functions.
        (ifla_vf_stats_nla_decoders, ifla_vf_vlan_list_nla_decoders,
        ifla_vf_info_nla_decoders, ifla_vfinfo_list_nla_decoders): New decoder
        tables.
        (ifinfomsg_nla_decoders) <[IFLA_VFINFO_LIST]>: Change decoder
        to decode_ifla_vfinfo_list.
        * tests/.gitignore: Add nlattr_ifla_vfinfo, nlattr_ifla_vfinfo-Xabbrev,
        nlattr_ifla_vfinfo-Xraw, and nlattr_ifla_vfinfo-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/nlattr_ifla_vfinfo.c: New file.
        * tests/nlattr_ifla_vfinfo-Xabbrev.c: Likewise.
        * tests/nlattr_ifla_vfinfo-Xraw.c: Likewise.
        * tests/nlattr_ifla_vfinfo-Xverbose.c: Likewise.
        * tests/gen_tests.in (nlattr_ifla_vfinfo, nlattr_ifla_vfinfo-Xabbrev,
        nlattr_ifla_vfinfo-Xraw, nlattr_ifla_vfinfo-Xverbose): New tests.
        * NEWS: Mention it.

        rtnl_link: enhance IFLA_EXT_MASK decoding.
        * src/xlat/rtnl_ifla_ext_filter_flags.in: New file.
        * src/rtnl_link.c: Include "xlat/rtnl_ifla_ext_filter_flags.h".
        (decode_ifla_ext_mask): New function.
        (ifinfomsg_nla_decoders) <[IFLA_EXT_MASK]>: Change decoder
        to decode_ifla_ext_mask.
        * tests/nlattr_ifinfomsg.c: Add checks for IFLA_EXT_MASK attribute
        decoding.
        * NEWS: Mention it.

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: print IFLA_BRPORT_GROUP_FWD_MASK as hex.
        Similarly to IFLA_BR_GROUP_FWD_MASK.

        * src/rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_GROUP_FWD_MASK]>:
        Change decoder to decode_nla_x16.
        * tests/test_nlattr.h (check_x16_nlattr): New function, defined
        via DEF_NLATTR_INTEGER_CHECK_.
        * tests/nlattr_ifla_brport.c: Update expected output.
        * tests/nlattr_ifla_linkinfo.c: Likewise.

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: implement initial IFLA_INFO_SLAVE_DATA decoding.
        * src/nlattr.h (struct ifla_linkinfo_ctx): Add slave_kind field,
        increase the size of the kind field to 64.
        * src/rtnl_link.c (decode_nla_linkinfo_slave_kind,
        decode_nla_linkinfo_slave_data_bridge, decode_nla_linkinfo_slave_data):
        New functions.
        (ifla_linkinfo_nla_decoders) <[IFLA_INFO_SLAVE_KIND]>: Use
        decode_nla_linkinfo_slave_kind as a decoder.
        (ifla_linkinfo_nla_decoders) <[IFLA_INFO_SLAVE_DATA]>: Decode using
        decode_nla_linkinfo_slave_data.
        * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS, TEST_LINKINFO_,
        TEST_LINKINFO, TEST_NESTED_LINKINFO): Add kindtype_ argument, use it
        instead of IFLA_INFO_KIND, update callers.
        (main) <unsupported_slave_data_types, supported_tunnel_types>: New
        static constants.
        (main): Use supported_tunnel_types instead of unsupported_xstats_types
        and unsupported_data_types pair;  add checks for the
        IFLA_INFO_SLAVE_KIND and IFLA_INFO_SLAVE_DATA attributes decoding.
        * NEWS: Mention it.

        rtnl_link: decode IFLA_BR_MCAST_QUERIER_STATE.
        * src/xlat/rtnl_ifla_br_mcast_querier_attrs.in: New file.
        * src/xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MCAST_QUERIER_STATE):
        New constant, introduced by Linux commit v5.15-rc1~157^2~209^2~2.
        * src/rtnl_link.c: Include "xlat/rtnl_ifla_br_mcast_querier_attrs.h".
        (ifla_br_mcast_querier_decoders): New decoder table.
        (decode_ifla_br_mcast_qstate): New function.
        (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_MCAST_QUERIER_STATE]>:
        Decode using decode_ifla_br_mcast_qstate.
        * tests/nlattr_ifla_linkinfo.c: Include "xmalloc.h".
        (main): Update expected output, add IFLA_BR_MCAST_QUERIER_STATE
        attribute decoding checks.
        * NEWS: Mention it.

        rtnl_link: decode IFLA_BR_MULTI_BOOLOPT.
        * src/xlat/rtnl_ifla_br_boolopt_flags.in: New file.
        * src/xlat/rtnl_ifla_br_boolopts.in: Likewise.
        * src/rtnl_link.c: Include <linux/if_bridge.h>,
        "xlat/rtnl_ifla_br_boolopts.h", and "xlat/rtnl_ifla_br_boolopt_flags.h".
        (decode_ifla_br_boolopt): New function.
        (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_MULTI_BOOLOPT]>: Decode
        using decode_ifla_br_boolopt.
        * tests/nlattr_ifla_linkinfo.c: Include <linux/if_bridge.h>, add checks
        for IFLA_BR_MULTI_BOOLOPT attribute decoding.
        * NEWS: Mention it.

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link, rtnl_mdb: switch relevant attribute decoding to decode_nla_clock_t
        There is quite a few attributes that use clock_t time units for
        reporting time intervals (for whatever reason), so it makes sense to
        improve decoding for them, considering the fact that clock_t decoding
        has been already implemented (in v5.14-30-g3270b1358 "util: implement
        clock_t type decoding").

        * configure.ac: Add a check for a library required for mathematical
        functions.
        * src/rtnl_link.c (ifla_brport_nla_decoders)
        <[IFLA_BRPORT_MESSAGE_AGE_TIMER], [IFLA_BRPORT_FORWARD_DELAY_TIMER],
        [IFLA_BRPORT_HOLD_TIMER]>: Decode using decode_nla_clock_t.
        (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_FORWARD_DELAY],
        [IFLA_BR_HELLO_TIME], [IFLA_BR_MAX_AGE], [IFLA_BR_AGEING_TIME],
        [IFLA_BR_HELLO_TIMER], [IFLA_BR_TCN_TIMER],
        [IFLA_BR_TOPOLOGY_CHANGE_TIMER], [IFLA_BR_GC_TIMER],
        [IFLA_BR_MCAST_LAST_MEMBER_INTVL], [IFLA_BR_MCAST_MEMBERSHIP_INTVL],
        [IFLA_BR_MCAST_QUERIER_INTVL], [IFLA_BR_MCAST_QUERY_INTVL],
        [IFLA_BR_MCAST_QUERY_RESPONSE_INTVL],
        [IFLA_BR_MCAST_STARTUP_QUERY_INTVL]>: Likewise.
        * src/rtnl_mdb.c (mdba_mdb_eattr_nla_decoders) <[MDBA_MDB_EATTR_TIMER]>:
        Likewise.
        (mdba_router_pattr_nla_decoders) <[MDBA_ROUTER_PATTR_TIMER],
        [MDBA_ROUTER_PATTR_INET_TIMER], [MDBA_ROUTER_PATTR_INET6_TIMER]>: Likewise.
        * tests/Makefile.am (nlattr_ifla_linkinfo_LDADD,
        nlattr_mdba_router_port_LDADD): Add m_libs.
        * tests/nlattr_ifla_brport.c: Update expected output.
        * tests/nlattr_ifla_linkinfo.c: Likewise.
        * tests/nlattr_mdba_router_port.c: Likewise.
        * tests/nlattr_nhmsg.c: Likewise.
        * NEWS: Mention it.

2021-11-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: make IFLA_PROTINFO decoding address family-aware.
        The IFLA_BRPORT_* attributes are placed in there only for messages
        with ifi_family=AF_BRIDGE, and ifi_family=AF_INET6 messages put IFLA_INET6_*
        attributes in there.

        * src/rtnl_link.c (decode_ifla_inet6_flags, decode_ifla_inet6_conf,
        decode_ifla_inet6_stats, decode_ifla_inet6_cacheinfo,
        decode_ifla_inet6_icmp6_stats, decode_ifla_inet6_agm,
        ifla_inet6_nla_decoders): Move before decode_ifla_protinfo.
        (decode_ifla_protinfo): Add protos, describe AF_BRIDGE and AF_INET6
        protocols there, decode using decode_nla_af_spec.
        * tests/nlattr_ifla_brport.c (IFLA_AF, IFLA_AF_STR): Define to change
        the address family from AF_UNIX to AF_BRIDGE.
        * tests/nlattr_ifla_af_inet6.h: New file.
        * tests/nlattr_ifla_af_spec.c: Include it.
        (print_arr_val, print_arr_uval, print_inet6_conf_val,
        print_inet6_stats_val, print_icmp6_stats_val): Move
        to nlattr_ifla_af_inet6.h.
        (main): Move AF_INET6-related checks to check_ifla_af_inet6()
        in nlattr_ifla_af_inet6.h;  call it.
        * tests/.gitignore: Add nlattr_ifla_protinfo,
        nlattr_ifla_protinfo-Xabbrev, nlattr_ifla_protinfo-Xraw,
        and nlattr_ifla_protinfo-Xverbose.
        * tests/Makefile.am (EXTRA_DIST): Add nlattr_ifla_af_inet6.h.
        * tests/gen_tests.in (nlattr_ifla_protinfo,
        nlattr_ifla_protinfo-Xabbrev, nlattr_ifla_protinfo-Xraw,
        nlattr_ifla_protinfo-Xverbose): New tests.
        * tests/nlattr_ifla_protinfo-Xabbrev.c: New file.
        * tests/nlattr_ifla_protinfo-Xraw.c: Likewise.
        * tests/nlattr_ifla_protinfo-Xverbose.c: Likewise.
        * tests/nlattr_ifla_protinfo.c: Likewise.
        * NEWS: Mention it.

        Fixes: v4.19~19 "rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg"

2021-11-11  Dmitry V. Levin  <ldv@strace.io>

        tests: fix build on mips n32/o32.
        * tests/cur_audit_arch.h [__mips__]: Fix _MIPS_SIM check.

        Fixes: v5.14-11-gd4ee5d43b "tests: add cur_audit_arch.h"

2021-11-10  Dmitry V. Levin  <ldv@strace.io>

        xlat: add #unconditional to sync_file_range_flags.
        * src/xlat/sync_file_range_flags.in: Add #unconditional given that
        <linux/fs.h> is bundled.

        xlat: add #unconditional to pr_cap_ambient, pr_fp_mode, and pr_mce_kill_policy
        * src/xlat/pr_cap_ambient.in: Add #unconditional given that
        <linux/prctl.h> is bundled.
        * src/xlat/pr_fp_mode.in: Likewise.
        * src/xlat/pr_mce_kill_policy.in: Likewise.

        xlat: add #unconditional to unix_diag_show.
        * src/xlat/unix_diag_show.in: Add #unconditional given that
        <linux/unix_diag.h> is bundled.

        xlat: add #unconditional to packet_diag_info_flags and packet_diag_show.
        * src/xlat/packet_diag_info_flags.in: Add #unconditional given that
        <linux/packet_diag.h> is bundled.
        * src/xlat/packet_diag_show.in: Likewise.

        xlat: add #unconditional to netlink_diag_show and netlink_socket_flags.
        * src/xlat/netlink_diag_show.in: Add #unconditional given that
        <linux/netlink_diag.h> is bundled.
        * src/xlat/netlink_socket_flags.in: Likewise.

        xlat: add #unconditional to blkpg_ops.
        * src/xlat/blkpg_ops.in: Add #unconditional given that <linux/blkpg.h>
        is bundled.

2021-11-09  Dmitry V. Levin  <ldv@strace.io>

        landlock: do not open-code landlock_* structures.
        * src/rtnl_link.c (print_landlock_ruleset_attr): Use struct
        landlock_ruleset_attr ifla_cacheinfo defined in bundled
        <linux/landlock.h> instead of open-coding it.
        (print_landlock_path_beneath_attr): Use struct
        landlock_path_beneath_attr defined in bundled <linux/landlock.h>
        instead of open-coding it.

        Complements: v5.13~16 "Implement landlock_{add_rule,create_ruleset,restrict_self} syscall decoding"

2021-11-09  Dmitry V. Levin  <ldv@strace.io>

        rtnl_link: do not open-code struct ifla_cacheinfo.
        * src/rtnl_link.c (decode_ifla_inet6_cacheinfo): Use struct
        ifla_cacheinfo defined in bundled <linux/if_link.h> instead of
        open-coding it.

        Complements: v5.11~16 "rtnl_link: switch to use bundled <linux/if_link.h>"

2021-11-08  Dmitry V. Levin  <ldv@strace.io>

        xlat: update SO_* constants.
        * src/xlat/sock_options.in (SO_NETNS_COOKIE): New constant
        introduced by Linux kernel commit v5.14-rc1~119^2~45.
        (SO_BUF_LOCK): New constant introduced by Linux kernel commit
        v5.15-rc1~157^2~294.
        * NEWS: Mention this change.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields: add PRINT_FIELD_FLAGS_VERBOSE.
        * src/print_fields.h (PRINT_FIELD_FLAGS_VERBOSE): New macro.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields: add PRINT_FIELD_XVAL_VERBOSE and PRINT_FIELD_XVAL_U_VERBOSE
        They make the task of printing a field with symbolic name values buried
        inside Linux non-UAPI headers a bit easier (and more correct with
        respect to the raw xlat verbosity style).

        * src/print_fields.h (PRINT_FIELD_XVAL_VERBOSE,
        PRINT_FIELD_XVAL_U_VERBOSE): New macros.
        * src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Use
        PRINT_FIELD_XVAL_U_VERBOSE for printing the numa_node field.
        * src/netlink_smc_diag.c (decode_smc_diag_fallback): Use
        PRINT_FIELD_XVAL_VERBOSE for printing the reason and peer_diagnosis
        fields of struct smc_diag_fallback.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: embolden --secontext argument.
        * doc/strace.1.in (.SS Output format): Print "full" in bold.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: factor out octal character printing.
        Ideally, it ought to be incorporated inside sprint_char and employed
        by string_quote, but the former has too many features and the latter
        is too hot, so that will probably get some performance hit.

        * src/print_utils.h (sprint_byte_oct): New function.
        * src/util.c (string_quote): Use it.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: make print_sockaddr_data_ax25 more structured.
        * src/sockaddr.c (print_ax25_array_member): New function.
        (print_sockaddr_data_ax25): Use print_local_array_ex()
        instead of open-coding it and use tprint_struct_next()
        instead of explicit tprints(", ").
        * tests/net-sockaddr.c (check_ax25): Update expected output.

        tests/tests.h: add struct strval8 definition.
        * tests/tests.h (struct strval8): New type definition.

        tests/test_netlink.h: enable usage of TEST_NETLINK_ with xlat verbosity styles
        tests/test_netlink.h (TEST_NETLINK_): Use XLAT_FMT/XLAT_ARGS for
        printing MSG_DONTWAIT.

        rtnl_link: factor out context string update.
        * src/rtnl_link.c (update_ctx_str): New function.
        (decode_nla_linkinfo_kind): Use update_ctx_str for updating kind field
        of the ctx.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/nlattr_ifla_linkinfo.c: constify unsupported_*_types.
        There is no need them to be non-constant.

        * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS) <arrstrs,
        arrstrs_pos, arrstr>: Add const qualifier.
        (main) <unsupported_tunnel_types, unsupported_xstats_types,
        unsupported_data_types>: Likewise.

2021-11-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update nl_xfrm_types.
        * src/xlat/nl_xfrm_types.in: Add #sorted, #enum, and #include
        directives.
        (XFRM_MSG_SETDEFAULT, XFRM_MSG_GETDEFAULT): New constants, introduced
        by Linux commit v5.15-rc1~157^2~52^2~1 and received proper values
        in Linux commit v5.15-rc5~21^2~2^2~2.
        * NEWS: Mention it.

        tests/nlattr_ifla_linkinfo.c: update the list of unsupported tunnel types
        * tests/nlattr_ifla_linkinfo.c (unsupported_tunnel_types): Add
        "bareudp" (introduced by Linux commit v5.7-rc1~146^2~339^2~1),
        "wireguard" (introduced by Linux commit v5.6-rc1~151^2~283),
        "wwan" (introduced by Linux commit v5.14-rc1~119^2~191^2~1),
        and "xfrm" (introduced by Linux commit v4.19-rc1~140^2~230^2~10).

        xlat: update inet6_devconf_indices.
        * src/xlat/inet6_devconf_indices.in (DEVCONF_IOAM6_ENABLED,
        EVCONF_IOAM6_ID, DEVCONF_IOAM6_ID_WIDE): New constants, introduced
        by Linux commit v5.15-rc1~157^2~433^2~4.
        * NEWS: Mention it.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: add TEST_NESTED_NLATTR_ARRAY_EX_
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY_EX_): Rename from
        TEST_NESTED_NLATTR_ARRAY_EX, add nla_type_str_ argument, use it instead
        of #nla_type_.
        (TEST_NESTED_NLATTR_ARRAY_EX): New macro, a thin wrapper around
        TEST_NESTED_NLATTR_ARRAY_EX_.

        rtnl_link: decode IFLA_INET6_RA_MTU.
        * src/xlat/rtnl_ifla_af_spec_inet6_attrs.in (IFLA_INET6_RA_MTU): New
        constant, introduced by Linux commit v5.15-rc1~157^2~44.
        * src/rtnl_link.c (ifla_inet6_nla_decoders) <[IFLA_INET6_RA_MTU]>:
        Decode using decode_nla_u32.
        * tests/nlattr_ifla_af_spec.c: Add check, update expected output.
        * NEWS: Mention it.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/nlattr_ifla_brport: check all IFLA_BRPORT_* attributes.
        Also check them with various xlat verbosity levels.

        * tests/nlattr_ifla_brport-Xabbrev.c: New file.
        * tests/nlattr_ifla_brport-Xraw.c: Likewise.
        * tests/nlattr_ifla_brport-Xverbose.c: Likewise.
        * tests/.gitignore: Add nlattr_ifla_brport-Xabbrev, nlattr_ifla_brport-Xraw,
        and nlattr_ifla_brport-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (nlattr_ifla_brport-Xabbrev, nlattr_ifla_brport-Xraw,
        nlattr_ifla_brport-Xverbose): New tests.
        * tests/nlattr_ifla_brport.c (ENUM_KNOWN): New macro.
        (main): Check each IFLA_BRPORT_* attribute.
        * tests/test_nlattr.h (check_u8_nlattr): New function, defined using
        DEF_NLATTR_INTEGER_CHECK_.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/nlattr_ifla.h: enable usage with different xlat verbosity styles.
        * tests/nlattr_ifla.h (print_ifinfomsg): Adjust to generate correct
        output for various xlat verbosity levels.

        tests: allow overriding address family in init_ifinfomsg/print_ifinfomsg
        * tests/nlattr_ifla.h [!IFLA_AF] (IFLA_AF): New macro, define to
        AF_UNIX.
        [!IFLA_AF_STR] (IFLA_AF_STR): New macro, define to "AF_UNIX".
        (init_ifinfomsg): Use IFLA_AF.
        (print_ifinfomsg): Use IFLA_AF_STR.

        xlat: add MOVE_MOUNT_SET_GROUP to move_mount_flags.
        * src/xlat/move_mount_flags.in (MOVE_MOUNT_SET_GROUP): New constant,
        introduced by Linux commit v5.15-rc1~175^2~1.
        * tests/move_mount.c: Add checks, update expected output.
        * NEWS: Mention it.

        rtnl_link: decode IFLA_MCTP_* IFLA_AF_SPEC attributes.
        * src/xlat/rtnl_ifla_af_spec_mctp_attrs.in: New file.
        * src/rtnl_link.c: Include "xlat/rtnl_ifla_af_spec_mctp_attrs.h",
        include "xlat/addrfams.h" under XLAT_MACROS_ONLY.
        (ifla_mctp_nla_decoders): New decoders table.
        (decode_ifla_af) <protos>: Add AF_MCTP record.
        * tests/nlattr_ifla_af_spec.c (init_AF_MCTP_msg, print_AF_MCTP_msg): New
        functions, defined using AF_SPEC_FUNCS.
        (main) <skip_afs>: Add AF_MCTP.
        (main): Add AF_MCTP checks.
        * NEWS: Mention it.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: consistently check all unknown address families.
        Iterate over all possible values of address family to verify
        that the decoder indeed does not decode the payload.

        * tests/nlattr_ifla_af_spec.c: Include "xlat.h" and "xlat/addrfams.h".
        (main): Perform "unknown AF_*" check for each possible address family
        value except those that are listed in skip_afs.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: implement AF_MCTP socket addresses decoding.
        * bundled/linux/include/uapi/linux/mctp.h: Import headers_install'ed
        include/uapi/linux/mctp.h at Linux commit v5.15-rc7~22^2~20.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/xlat/mctp_addrs.in: New file.
        * src/xlat/mctp_nets.in: Likewise.
        * src/sockaddr.c: Include <linux/mctp.h>, "xlat/mctp_addrs.h",
        and "xlat/mctp_nets.h".
        (print_sockaddr_data_mctp): New function.
        (sa_printers): Add AF_MCTP decoding.
        * tests/gen_tests.in (sockaddr_xlat-Xabbrev, sockaddr_xlat-Xraw,
        sockaddr_xlat-Xverbose): Add -a option.
        * tests/sockaddr_xlat.c: Add checks for AF_MCTP socket address
        decoding.
        * NEWS: Mention this.

        xlat: add AF_MCTP, ARPHRD_MCTP, and ETH_P_MCTP.
        * src/xlat/addrfams.in (AF_MCTP): New constant, introduced by Linux
        commit v5.15-rc1~157^2~360^2~14.
        * src/xlat/arp_hardware_types.in (ARPHRD_MCTP): New constant, introduced
        by Linux commit v5.15-rc1~157^2~360^2~10.
        * src/xlat/ethernet_protocols.in (ETH_P_MCTP): New constant, introduced
        by Linux commit v5.15-rc1~157^2~360^2~9.
        * src/print_mac.c (hwaddr_sizes) <[ARPHRD_MCTP]>: New item.
        * tests/netlink_route.c: Update expected output.
        * NEWS: Mention this.

        print_fields: add PRINT_FIELD_XVAL_D.
        * src/print_fields.h (PRINT_FIELD_XVAL_D): New macro.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: factor out AF_SPEC-typed netlink attribute decoding.
        decode_ifstats_af and decode_ifla_af do about the same thing, except
        the latter employs AF-indexed array and the former uses a list.  This
        is going to change with the addition of AF_MCTP protocol IFLA_AF_SPEC
        decoding support, as its address family number (45) necessitates
        the switch from AF-indexed array to a list as well, so these two
        decoders are going to have exactly the same logic, and that is a reason
        for factoring it out in a separate function.

        * src/nlattr.h (struct af_spec_decoder_desc): New type definition.
        (decode_nla_af_spec): New declaration.
        * src/nlattr.c (decode_nla_af_spec): New function.
        * src/rtnl_link.c (ifla_af_spec_protos): Move inside decode_ifla_af,
        rename to protos, change type to struct af_spec_decoder_desc[],
        initialise af fields of each item.
        (decode_ifla_af): Call decode_nla_af_spec.
        (decode_ifstats_af): Change type of the protos local variable
        to struct af_spec_decoder_desc[], replace the body with a call
        to decode_nla_af_spec.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: implement KD* ioctl decoding.
        * configure.ac (AC_CHECK_TYPES): Check for struct kbdiacruc
        and struct kbdiacrsuc.
        * src/kd_ioctl.c: New file.
        * src/kd_mpers_ioctl.c: Likewise.
        * src/Makefile.am (strace_SOURCES): Add them.
        * src/defs.h (DECL_IOCTL(kd)): New declaration.
        * src/ioctl.c (ioctl_decode) <case 'K'>: Call kd_ioctl.
        * src/xlat/kd_default_led_flags.in: New file.
        * src/xlat/kd_font_flags.in: Likewise.
        * src/xlat/kd_font_ops.in: Likewise.
        * src/xlat/kd_ioctl_cmds.in: Likewise.
        * src/xlat/kd_kbd_modes.in: Likewise.
        * src/xlat/kd_kbd_types.in: Likewise.
        * src/xlat/kd_key_ascii_keys.in: Likewise.
        * src/xlat/kd_key_brl_keys.in: Likewise.
        * src/xlat/kd_key_cur_keys.in: Likewise.
        * src/xlat/kd_key_dead_keys.in: Likewise.
        * src/xlat/kd_key_fn_key_vals.in: Likewise.
        * src/xlat/kd_key_fn_keys.in: Likewise.
        * src/xlat/kd_key_lock_keys.in: Likewise.
        * src/xlat/kd_key_pad_keys.in: Likewise.
        * src/xlat/kd_key_shift_keys.in: Likewise.
        * src/xlat/kd_key_slock_keys.in: Likewise.
        * src/xlat/kd_key_spec_keys.in: Likewise.
        * src/xlat/kd_key_tables.in: Likewise.
        * src/xlat/kd_key_types.in: Likewise.
        * src/xlat/kd_keymap_flags.in: Likewise.
        * src/xlat/kd_led_flags.in: Likewise.
        * src/xlat/kd_meta_vals.in: Likewise.
        * src/xlat/kd_modes.in: Likewise.
        * tests/.gitignore: Add ioctl_kd, ioctl_kd-Xabbrev, ioctl_kd-Xraw,
        ioctl_kd-Xverbose, ioctl_kd-success, ioctl_kd-success-Xabbrev,
        ioctl_kd-success-Xraw, ioctl_kd-success-Xverbose,
        ioctl_kd-success-s1024, ioctl_kd-success-s1024-Xabbrev,
        ioctl_kd-success-s1024-Xraw, and ioctl_kd-success-s1024-Xverbose.
        * tests/pure_executables.list: Add ioctl_kd, ioctl_kd-Xabbrev,
        ioctl_kd-Xraw, and ioctl_kd-Xverbose.
        * tests/Makefile.am: Add ioctl_kd-success, ioctl_kd-success-Xabbrev,
        ioctl_kd-success-Xraw, ioctl_kd-success-Xverbose,
        ioctl_kd-success-s1024, ioctl_kd-success-s1024-Xabbrev,
        ioctl_kd-success-s1024-Xraw, and ioctl_kd-success-s1024-Xverbose.
        * tests/gen_tests.in (ioctl_kd, ioctl_kd-Xabbrev, ioctl_kd-Xraw,
        ioctl_kd-Xverbose, ioctl_kd-success, ioctl_kd-success-Xabbrev,
        ioctl_kd-success-Xraw, ioctl_kd-success-Xverbose,
        ioctl_kd-success-s1024, ioctl_kd-success-s1024-Xabbrev,
        ioctl_kd-success-s1024-Xraw, ioctl_kd-success-s1024-Xverbose): New
        tests.
        * tests/ioctl_kd-Xabbrev.c: New file.
        * tests/ioctl_kd-Xraw.c: Likewise.
        * tests/ioctl_kd-Xverbose.c: Likewise.
        * tests/ioctl_kd-success-Xabbrev.c: Likewise.
        * tests/ioctl_kd-success-Xraw.c: Likewise.
        * tests/ioctl_kd-success-Xverbose.c: Likewise.
        * tests/ioctl_kd-success-s1024-Xabbrev.c: Likewise.
        * tests/ioctl_kd-success-s1024-Xraw.c: Likewise.
        * tests/ioctl_kd-success-s1024-Xverbose.c: Likewise.
        * tests/ioctl_kd-success-s1024.c: Likewise.
        * tests/ioctl_kd-success.c: Likewise.
        * tests/ioctl_kd.c: Likewise.
        * NEWS: Mention it.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: handle QUOTE_0_TERMINATED|QUOTE_EXPECT_TRAILING_0 in printstr_ex.
        There is a number of places in Linux kernel where the last character
        of a string-typed structure field is not fetched and/or overwritten
        with '\0'.  So far, it was difficult to signify this in strace output
        performed via printstr_ex.  This change adds a logic that decreases
        the size passed to print_quoted_string in order to signify the fact
        that despite the presence of an additional non-NUL character in the field,
        this non-NUL character will be ignored by the kernel.

        * src/util.c (printstr_ex): Decrease size before print_quoted_string
        call if both QUOTE_0_TERMINATED and QUOTE_EXPECT_TRAILING_0 set.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/tests.h: introduce XLAT_KNOWN_FMT and XLAT_UNKNOWN_FMT macros.
        * tests/tests.h (XLAT_KNOWN_FMT, XLAT_UNKNOWN_FMT): New macros.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce sprint_char, print_char, and PRINT_FIELD_CHAR.
        These are new helper functions for printing separate characters.

        * src/print_fields.h (PRINT_FIELD_CHAR): New macro.
        * src/print_utils.h (BYTE_HEX_CHARS_PRINTF, BYTE_HEX_CHARS_PRINTF_QUOTED):
        Remove.
        (is_print): Move up.
        (SPRINT_CHAR_BUFSZ, print_char): New macros.
        (enum sprint_char_flag_bits, enum sprint_char_flags): New enumerations.
        (sprint_char): New function.
        * src/v4l2.c (print_pixelformat): Use print_char.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: switch rtgenmsg and nsid naming usage.
        nsid refers to specific message type group (that implies semantics
        of the netlink attibutes that follow the header), and rtmsg refers
        to specific message header structure.

        * src/netlink_route.c (route_decoders) <[RTM_NEWNSID - RTM_BASE],
        [RTM_DELNSID - RTM_BASE], [RTM_GETNSID - RTM_BASE]>: Call decode_nsid.
        * src/netlink_route.h (DECL_NETLINK_ROUTE_DECODER(decode_nsid)): Rename
        from DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg).
        * src/rtnl_nsid.c (nsid_nla_decoders): Rename from
        rtgenmsg_nla_decoders.
        (DECL_NETLINK_ROUTE_DECODER(decode_nsid)): Rename
        from DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg), use nsid_nla_decoders
        for decoding.
        * tests/netlink_route.c (test_rtnl_rtgen): Rename from test_rtnl_nsid.
        (main): Call test_rtnl_rtgen instead of test_rtnl_nsid.

2021-11-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: implement RTM_NEWSTATS and RTM_GETSTATS message decoding.
        * src/xlat/ifstats_af_spec_mpls_attrs.in: New file.
        * src/xlat/ifstats_attr_flags.in: Likewise.
        * src/xlat/ifstats_attrs.in: Likewise.
        * src/xlat/ifstats_offload_attrs.in: Likewise.
        * src/xlat/ifstats_xstats_bond_3ad_attrs.in: Likewise.
        * src/xlat/ifstats_xstats_bond_attrs.in: Likewise.
        * src/xlat/ifstats_xstats_bridge_attrs.in: Likewise.
        * src/xlat/ifstats_xstats_bridge_mcast_indices.in: Likewise.
        * src/xlat/ifstats_xstats_type_attrs.in: Likewise.
        * src/xlat/nl_bridge_vlan_flags.in: Likewise.
        * bundled/linux/include/uapi/linux/if_bonding.h: New file, copied from
        headers_install'ed Linux kernel v5.15.
        * bundled/linux/include/uapi/linux/mpls.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/rtnl_stats.c: New file.
        * src/Makefile.am (strace_SOURCES): Add it.
        * src/netlink_route.c (route_decoders) <[RTM_NEWSTATS - RTM_BASE],
        [RTM_GETSTATS - RTM_BASE]>: New decoder, call decode_ifstatsmsg.
        * src/netlink_route.h (decode_ifstatsmsg): New declaration.
        * src/nlattr.h (DECL_NLA(rtnl_link_stats64)): Likewise.
        * src/rtnl_link.c (decode_nla_rtnl_link_stats64): Rename from
        decode_rtnl_link_stats64.
        (ifinfomsg_nla_decoders) <[IFLA_STATS64]>: Use
        decode_nla_rtnl_link_stats64.
        * src/print_fields.h (PRINT_FIELD_ARRAY_INDEXED): New macro.
        * tests/nlattr_ifstats.c: New file.
        * tests/nlattr_ifstats-Xabbrev.c: Likewise.
        * tests/nlattr_ifstats-Xraw.c: Likewise.
        * tests/nlattr_ifstats-Xverbose.c: Likewise.
        * tests/.gitignore: Add nlattr_ifstats, nlattr_ifstats-Xabbrev,
        nlattr_ifstats-Xraw, and nlattr_ifstats-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (nlattr_ifstats, nlattr_ifstats-Xabbrev,
        nlattr_ifstats-Xraw, nlattr_ifstats-Xverbose): New tests.
        * tests/netlink_route.c: Update/add checks for the RTM_*STATS message
        types.
        * NEWS: Mention it.

2021-11-07  Dmitry V. Levin  <ldv@strace.io>

        Assume linux/nexthop.h is bundled.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/nexthop.h.
        * src/xlat/rtnl_nexthop_attrs.in: Add #unconditional, remove #enum,
        do not include <linux/nexthop.h>.
        * src/xlat/rtnl_nexthop_grp_types.in: Likewise.
        * src/xlat/rtnl_nha_res_bucket_attrs.in: Likewise.
        * src/xlat/rtnl_nha_res_group_attrs.in: Likewise.
        * tests/netlink_route.c: Include <linux/nexthop.h> unconditionally,
        do not define struct_nhmsg, use struct nhmsg instead.
        * tests/nlattr_nhmsg.c: Include <linux/nexthop.h> unconditionally,
        do not define struct nhmsg and struct nexthop_grp.

        Complements: v5.14-90-gb17393bc3 "netlink_route: implement RTM_{NEW,DEL,GET}NEXTHOP decoding"

2021-11-06  Dmitry V. Levin  <ldv@strace.io>

        xlat/gen.sh: generate assertion checks for #unconditional xlats.
        * src/xlat/gen.sh: When fallback definitions are specified for xlats
        marked as #unconditional, treat them as expected values and generate
        assertion checks.

2021-11-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: add TEST_NESTED_NLATTR_OBJECT_EX_MINSZ_
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_MINSZ_): Rename
        from TEST_NESTED_NLATTR_OBJECT_EX_, add minsz_ parameter,
        use it for the short read check.
        (TEST_NESTED_NLATTR_OBJECT_EX_): New macro, a thin wrapper around
        TEST_NESTED_NLATTR_OBJECT_EX_MINSZ_.

        test_nlattr.h: add check_u64_nlattr.
        * tests/test_nlattr.h: Include <inttypes.h>.
        (check_u64_nlattr): New function, defined using
        the DEF_NLATTR_INTEGER_CHECK_ macro.

        tests: add fill_memory64_ex, fill_memory64.
        * tests/fill_memory.c (fill_memory64_ex, fill_memory64): New functions.
        * tests/tests.h (fill_memory64_ex, fill_memory64): New declarations.

2021-11-05  Dmitry V. Levin  <ldv@strace.io>

        Use loop initial declarations.
        This make the code easier to read.

        * src/bpf.c (decode_attr_extra_data): Use "for" loop initial
        declarations.
        * src/count.c (call_summary): Likewise.
        * src/dm.c (dm_decode_dm_target_spec, dm_decode_dm_name_list,
        dm_decode_dm_target_versions): Likewise.
        * src/dyxlat.c (dyxlat_free, dyxlat_add_pair): Likewise.
        * src/filter_qualify.c (parse_poke_token): Likewise.
        * src/filter_seccomp.c (check_seccomp_order_tracer): Likewise.
        * src/ipc.c (SYS_FUNC(ipc)): Likewise.
        * src/kexec.c (print_seg): Likewise.
        * src/kvm.c (kvm_vcpu_info_free): Likewise.
        * src/linux/alpha/get_syscall_args.c (arch_get_syscall_args): Likewise.
        * src/linux/arc/get_syscall_args.c (arch_get_syscall_args): Likewise.
        * src/linux/bfin/get_syscall_args.c (arch_get_syscall_args): Likewise.
        * src/linux/ia64/get_syscall_args.c (arch_get_syscall_args): Likewise.
        * src/linux/metag/get_syscall_args.c (arch_get_syscall_args): Likewise.
        * src/linux/microblaze/get_syscall_args.c (arch_get_syscall_args):
        Likewise.
        * src/mmap_notify.c (mmap_notify_report): Likewise.
        * src/mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
        * src/nlattr.c (decode_nlattr): Likewise.
        * src/number_set.c (clear_number_set_array, invert_number_set_array):
        Likewise.
        * src/pathtrace.c (pathmatch, pathtrace_match_set): Likewise.
        * src/poll.c (decode_poll_exiting): Likewise.
        * src/signal.c (sprintsigmask_n): Likewise.
        * src/sockaddr.c (print_sockaddr_data_ll): Likewise.
        * src/socketutils.c (unix_parse_response, get_proto_by_name,
        get_sockaddr_by_inode_uncached, genl_parse_families_response): Likewise.
        * src/strace.c (expand_tcbtab, alloctcb, droptcb, startup_attach,
        redirect_standard_fds, cleanup): Likewise.
        * src/syscall.c (decode_socket_subcall, decode_ipc_subcall): Likewise.
        * src/term.c (decode_termio): Likewise.
        * src/util.c (dumpiov_upto): Likewise.
        * src/v4l2.c (print_pixelformat): Likewise.
        * tests/add_key.c (main): Likewise.
        * tests/attach-f-p.c (main): Likewise.
        * tests/btrfs.c (max_flags_plus_one, btrfs_print_qgroup_inherit,
        btrfs_test_subvol_ioctls, btrfs_print_tree_search_buf,
        btrfs_test_space_info_ioctl, btrfs_test_ino_path_ioctls,
        btrfs_test_get_dev_stats_ioctl, btrfs_test_read_ioctls): Likewise.
        * tests/count-f.c (thread, process, main): Likewise.
        * tests/fanotify_init.c (main): Likewise.
        * tests/fanotify_mark.c (main): Likewise.
        * tests/file_handle.c (main): Likewise.
        * tests/fill_memory.c (fill_memory_ex, fill_memory16_ex,
        fill_memory32_ex): Likewise.
        * tests/filter-unavailable.c (process, main): Likewise.
        * tests/futex.c (invalid_op, main): Likewise.
        * tests/get_mempolicy.c (print_nodes): Likewise.
        * tests/group_req.c (main): Likewise.
        * tests/hexdump_strdup.c (hexdump_memdup): Likewise.
        * tests/hexquote_strndup.c (hexquote_strndup): Likewise.
        * tests/inet-cmsg.c (print_opts, main): Likewise.
        * tests/init_delete_module.h (print_str): Likewise.
        * tests/ioctl_block.c (main): Likewise.
        * tests/ioctl_dm.c (main): Likewise.
        * tests/ioctl_evdev.c (main): Likewise.
        * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise.
        * tests/ip_mreq.c (main): Likewise.
        * tests/ipc.c (main): Likewise.
        * tests/kcmp.c (main): Likewise.
        * tests/kexec_file_load.c (main): Likewise.
        * tests/kexec_load.c (main): Likewise.
        * tests/keyctl.c (do_keyctl, main): Likewise.
        * tests/ksysent.c (main): Likewise.
        * tests/list_sigaction_signum.c (main): Likewise.
        * tests/mincore.c (print_mincore): Likewise.
        * tests/mmsg_name.c (test_mmsg_name): Likewise.
        * tests/move_pages.c (print_page_array, print_node_array,
        print_status_array): Likewise.
        * tests/mq_sendrecv.c (printstr, dumpstr): Likewise.
        * tests/msg_control.c (print_fds, test_scm_rights3, test_sol_socket,
        print_ip_opts, test_ip_opts): Likewise.
        * tests/netlink_protocol.c (send_query): Likewise.
        * tests/nlattr.c (test_nlattr): Likewise.
        * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS): Likewise.
        * tests/nlattr_rtmsg.c (print_quoted_hex_ellipsis): Likewise.
        * tests/perf_event_open.c (main): Likewise.
        * tests/perf_event_open_nonverbose.c (main): Likewise.
        * tests/pkey_alloc.c (main): Likewise.
        * tests/pkey_free.c (main): Likewise.
        * tests/pkey_mprotect.c (main): Likewise.
        * tests/poll.c (print_pollfd_array_entering,
        print_pollfd_array_exiting): Likewise.
        * tests/prctl-arg2-intptr.c (main): Likewise.
        * tests/prctl-name.c (main): Likewise.
        * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump, main):
        Likewise.
        * tests/preadv.c (print_iov, print_iovec): Likewise.
        * tests/print_quoted_string.c (print_quoted_memory_ex,
        print_quoted_hex): Likewise.
        * tests/process_vm_readv_writev.c (print_iov): Likewise.
        * tests/pwritev.c (print_iovec, main): Likewise.
        * tests/qual_fault.c (main): Likewise.
        * tests/qual_signal.c (main): Likewise.
        * tests/read-write.c (dump_str_ex, print_hex, test_dump, main):
        Likewise.
        * tests/readahead.c (main): Likewise.
        * tests/redirect-fds.c (main): Likewise.
        * tests/request_key.c (main): Likewise.
        * tests/rt_sigsuspend.c (iterate): Likewise.
        * tests/s390_pci_mmio_read_write.c (main): Likewise.
        * tests/s390_runtime_instr.c (main): Likewise.
        * tests/seccomp-filter-v.c (main): Likewise.
        * tests/seccomp_get_action_avail.c (main): Likewise.
        * tests/set_mempolicy.c (print_nodes): Likewise.
        * tests/setfsugid.c (main): Likewise.
        * tests/setns.c (main): Likewise.
        * tests/setresugid.c (main): Likewise.
        * tests/setreugid.c (main): Likewise.
        * tests/setugid.c (main): Likewise.
        * tests/socketcall.c (main): Likewise.
        * tests/sockopt-sol_netlink.c (main): Likewise.
        * tests/test_nlattr.h (print_sockfd): Likewise.
        * tests/test_printpath.c (test_printpath_at, test_printpath): Likewise.
        * tests/test_printstrn.c (test_printstrn_at, test_efault,
        test_printstrn): Likewise.
        * tests/unix-pair-send-recv.c (transpose): Likewise.
        * tests/unix-pair-sendto-recvfrom.c (transpose): Likewise.
        * tests/unshare.c (main): Likewise.
        * tests/xchownx.c (main): Likewise.

2021-11-04  Dmitry V. Levin  <ldv@strace.io>

        ci: use kernel headers from Linux kernel v5.15.
        * .github/workflows/ci.yml (env): Change KBRANCH from v5.14 to v5.15.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2021-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/times: calculate nanoseconds more accurately.
        After the increase of the CPU time limit in v5.14-31-gbe5657c47
        "tests/times: try to burn more system time", the comparisons against
        limit became incorrect, as triple the child CPU limit is more than
        one second.

        * tests/times.c (nsecs): New function.
        (enjoy_time): Use it.

2021-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/times: sequentialise time enjoyment.
        Factor out the time enjoyment routine and call it first in the parent,
        and then, after the fork, in the child only.

        This should hopefully help the kernel to do proper time accounting.

        * tests/times.c (enjoy_time): New function.
        (main): Call it before the fork and after the fork in the child.

2021-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@strace.io>

        tests: avoid zero userspace time.
        Spawned child can return early due to fast dummy increment loop, leading
        to zero cutime/cstime.  That, in turn, breaks enhanced clock_t printing
        check, that relies on the fact that the printed fields are non-zero.

        * tests/times.c (NUM_USER_ITERS_SQRT): Increase to 2000.
        (main): Convert userpace CPU time wasting loop into a for loop iterating
        over i up to NUM_USER_ITERS_SQRT, make internal loop iterate over
        a separate variable, no longer treat zero
        clock_getttime(CLOCK_PROCESS_CPUTIME_ID) as a reason to skip the check
        (just let the for loop finish).

2021-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: print struct sockaddr_ipx.sipx_zero if it is non-zero.
        * src/sockaddr.c (print_sockaddr_data_ipx): Print sipx_zero field
        if it is non-zero.
        * tests/net-sockaddr.c (check_ipx): Add a check for sipx_zero field
        printing.
        * NEWS: Mention it.

2021-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Avoid relying on presence of ipx.h.
        After Linux has broken UAPI in commit v5.15-rc1~157^2~207, it is well
        possible that neither kernel nor libc (such as musl, for example)
        provides an IPX-related header.  Avoid relying on its presence
        in the strace's code and conditionalise the relevant checks in the tests.

        * configure.ac (AC_CHECK_HEADERS): Add linux/ipx.h.
        * src/net.c: Remove <netipx/ipx.h>/<linux/ipx.h> includes.
        * src/sockaddr.c: Likewise.
        (IPX_NODE_LEN): New macro constant.
        (struct sockaddr_ipx): New type definition.
        * src/xlat/sock_ipx_options.in (IPX_TYPE): Provide a fallback value.
        * tests/net-sockaddr.c [!HAVE_LINUX_IPX_H]: Do not include
        <linux/ipx.h>.
        [!HAVE_LINUX_IPX_H && HAVE_NETIPX_IPX_H]: Include <netipx/ipx.h>.
        [!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)] (check_ipx): Do not
        define.
        (main) [!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)]: Do not call
        check_ipx.

        Closes: https://github.com/strace/strace/issues/201

2021-10-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/netlink_route.c: consistently check decoding of known message types
        * tests/netlink_route.c (TEST_NL_ROUTE_): Rename from TEST_NL_ROUTE, add
        type_str_ argument.
        (TEST_NL_ROUTE): New macro, a wrapper for TEST_NL_ROUTE_.
        (test_rtnl_link, test_rtnl_addr, test_rtnl_route, test_rtnl_rule,
        test_rtnl_neigh, test_rtnl_neightbl, test_rtnl_tc, test_rtnl_tca,
        test_rtnl_addrlabel, test_rtnl_dcb, test_rtnl_netconf, test_rtnl_mdb,
        test_rtnl_nsid, test_rtnl_nexthop): Add types constant that contains
        list of all message types that are decoded using the checked struct,
        iterate TEST_NL_ROUTE_/TEST_NETLINK_ check over it.

        tests/netlink_route.c: check for unknown and unsupported message types.
        * tests/netlink_route.c (test_rtnl_unsupported_msg,
        test_rtnl_unknown_msg): New functions.
        (test_rtnl_addr, test_rtnl_route, test_rtnl_rule, test_rtnl_neigh,
        test_rtnl_neightbl, test_rtnl_tc, test_rtnl_tca, test_rtnl_addrlabel,
        test_rtnl_dcb, test_rtnl_netconf, test_rtnl_mdb, test_rtnl_nsid): Add
        checks for unknown message types in the same message type group.
        (main): Re-order calls in accordance with starting message type number;
        add checks for unsupported message type groups.

        nl_route_types: add RTM_NEWCACHEREPORT.
        * src/xlat/nl_route_types.in (RTM_NEWCACHEREPORT): New constant, added
        by Linux commit v4.13-rc1~157^2~129^2~3.
        * NEWS: Mention it.

2021-10-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: reorder route_decoders items.
        For some reason, its order differs from the order of items in the
        corresponding enum in rtnetlink.h.  Moreover, as a result of the
        reorder, a couple of message types with missing decoders are unraveled.

        * src/netlink_route.c (route_decoders): Put in ascending order, add
        comments for the RTM_* messages with missing decoders.

2021-10-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: implement RTM_{NEW,DEL,GET}NEXTHOP decoding.
        * bundled/linux/include/uapi/linux/nexthop.h: Add version at Linux commit
        v5.13-rc1~94^2~581^2~10.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/nexthop.h.
        * src/Makefile.am (libstrace_a_SOURCES): Add rtnl_nh.c.
        * src/defs.h (route_nexthop_flags, routing_protocols): New declarations.
        * src/netlink_route.c (route_decoders) <[RTM_NEWNEXTHOP - RTM_BASE],
        [RTM_DELNEXTHOP - RTM_BASE], [RTM_GETNEXTHOP - RTM_BASE]>: Decode using
        decode_nhmsg.
        * src/netlink_route.h (DECL_NETLINK_ROUTE_DECODER(decode_nhmsg)): New
        declaration.
        * src/rtnl_nh.c: New file.
        * src/xlat/rtnl_nexthop_attrs.in: Likewise.
        * src/xlat/rtnl_nexthop_grp_types.in: Likewise.
        * src/xlat/rtnl_nha_res_bucket_attrs.in: Likewise.
        * src/xlat/rtnl_nha_res_group_attrs.in: Likewise.
        * tests/.gitignore: Add nlattr_nhmsg, nlattr_nhmsg-Xabbrev,
        nlattr_nhmsg-Xraw, and nlattr_nhmsg-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (nlattr_nhmsg, nlattr_nhmsg-Xabbrev,
        nlattr_nhmsg-Xraw, nlattr_nhmsg-Xverbose): New tests.
        * tests/netlink_route.c: Add checks for struct nhmsg (RTM_NEWNEXTHOP,
        RTM_DELNEXTHOP, and RTM_GETNEXTHOP) messages.
        * tests/nlattr_nhmsg.c: New file.
        * tests/nlattr_nhmsg-Xabbrev.c: Likewise.
        * tests/nlattr_nhmsg-Xraw.c: Likewise.
        * tests/nlattr_nhmsg-Xverbose.c: Likewise.
        * NEWS: Mention it.

2021-10-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: fix printing of ioctl numbers in -Xverbose mode.
        When NULL is passed as dflt to printflags, nothing is printed at all
        if flags is 0.  (Ab)use the fact that comment printing is not triggered
        for an empty string and pass "" instead of NULL.

        * src/ioctl.c (ioctl_print_code, evdev_decode_number,
        evdev_decode_number): Pass "" as dflt instead of NULL if abbrev is false.

        Fixes: v5.3~10 "ioctl: do not print comments twice in -Xverbose"

2021-10-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update and provide fallback values to sysctl_* xlats.
        * src/xlat/sysctl_kern.in: Remove #(un)conditional, add #value_indexed,
        add fallback values.
        (KERN_NRINODE, KERN_MAXINODE, KERN_NRFILE, KERN_MAXFILE, KERN_MAXID,
        KERN_CAP_BSET, KERN_NFSRNAME, KERN_NFSRADDRS, KERN_JAVA_INTERPRETER,
        KERN_JAVA_APPLETVIEWER): New constants.
        * src/xlat/sysctl_net.in: Remove #(un)conditional, add #sorted, add
        fallback values.
        * src/xlat/sysctl_net_core.in: Remove #(un)conditional, add #value_indexed,
        add fallback values.
        * src/xlat/sysctl_net_ipv4.in: Remove #(un)conditional, replace #sorted
        with #value_indexed, add fallback values.
        (NET_TCP_WESTWOOD, NET_TCP_VEGAS, NET_TCP_VEGAS_ALPHA, NET_TCP_VEGAS_BETA,
        NET_TCP_VEGAS_GAMMA, NET_TCP_BIC, NET_TCP_BIC_FAST_CONVERGENCE,
        NET_TCP_BIC_LOW_WINDOW): New constants.
        * src/xlat/sysctl_net_ipv4_conf.in: Remove #(un)conditional,
        add #value_indexed, add fallback values.
        (NET_IPV4_CONF_ACCEPT_LOCAL, NET_IPV4_CONF_SRC_VMARK,
        NET_IPV4_CONF_PROXY_ARP_PVLAN): New constants.
        * src/xlat/sysctl_net_ipv4_route.in: Remove #(un)conditional,
        add #value_indexed, add fallback values.
        * src/xlat/sysctl_net_ipv6.in: Remove #(un)conditional, add #sorted,
        add fallback values.
        * src/xlat/sysctl_net_ipv6_route.in: Remove #(un)conditional,
        add #value_indexed, add fallback values.
        * src/xlat/sysctl_net_unix.in: Remove #unconditional, add #enum
        and #include, add fallback values.
        * src/xlat/sysctl_root.in: Remove #(un)conditional, reorder, add #sorted,
        add fallback values.
        (CTL_INOTIFY. CTL_APPLDATA): New constants.
        * src/xlat/sysctl_vm.in: Remove #(un)conditional, add #sorted, add
        fallback values.
        (VM_UNUSED1, VM_UNUSED2, VM_UNUSED3, VM_UNUSED4, VM_UNUSED5, VM_UNUSED6,
        VM_UNUSED7, VM_UNUSED8, VM_UNUSED9, VM_DROP_PAGECACHE,
        VM_PERCPU_PAGELIST_FRACTION, VM_ZONE_RECLAIM_MODE, VM_MIN_UNMAPPED,
        VM_PANIC_ON_OOM, VM_VDSO_ENABLED, VM_MIN_SLAB, VM_CMM_PAGES,
        VM_CMM_TIMED_PAGES, VM_CMM_TIMEOUT): New constants.

2021-10-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: generate conditional constant sort order check under presence guard
        If a constant is conditional and doesn't have a fallback definition,
        then its value may be undefined, so the sort order check has to be
        generated under constant-presence-checking #if.

        * src/xlat/gen.sh (cond_def): Put #if around the check_sort_order call.

        Fixes: v5.14-75-g5034a5eb4 "xlat/gen.sh: add a compile-time check for sorted xlat order"

2021-10-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.15.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.15-rc5
          using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * NEWS: Mention this.

2021-10-12  Renaud Métrich  <rmetrich@redhat.com>

        tests/pc: avoid program from creating a coredump.
        * tests/pc.c: Include <sys/prctl.h>.
        (main): Clear the dumpable attribute right before raising SIGSEGV.

2021-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: mark some big xlats as #sorted.
        * src/xlat/nt_descriptor_types.in: Add #sorted.
        (NT_FILE, NT_PRXFPREG, NT_SIGINFO): Sort.
        (NT_TASKSTRUCT): Remove, as it is overshadowed by NT_PRXREG.
        * src/xlat/sock_sctp_options.in: Add #sorted.
        * src/xlat/sysctl_net_ipv4.in: Likewise.
        * src/xlat/v4l2_control_ids.in: Likewise.

        xlat/sock_packet_options: add PACKET_IGNORE_OUTGOING.
        * xlat/sock_packet_options.in (PACKET_IGNORE_OUTGOING): New constant,
        introduced by Linux commit v4.19-rc2-323-gfa788d986a3a.
        * NEWS: Mention it.

        xlat: add fallback values to sock_packet_options.
        * xlat/sock_packet_options.in: Add fallback values, mark the xlat
        as value indexed.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add fallback values to sock_ipv6_options.
        * xlat/sock_ipv6_options.in: Add fallback values, remove
        IPV6_RECVORIGDSTADDR as it is a synonym to IPV6_ORIGDSTADDR, add
        "#value_indexed".

        xlat: add fallback values to sock_ip_options.
        * src/xlat/sock_ip_options.in: Add fallback values, remove IP_RECVOPTIONS,
        IP_RECVRETOPTS, IP_RECVDSTADDR, IP_RECVIFINDEX, IP_BROADCAST_IF that are
        not present in Linux, remove IP_RECVORIGDSTADDR as it is synonymous to
        IP_ORIGDSTADDR, add "#value_indexed".

        prctl: handle PR_SPEC_L1D_FLUSH PR_[GS]ET_SPECULATION_CTRL prctl sub-command
        * src/xlat/pr_spec_cmds.in (PR_SPEC_L1D_FLUSH): New constant, introduced
        by Linux commit v5.15-rc1~193^2~1.
        * src/prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL,
        case PR_SET_SPECULATION_CTRL>: Handle PR_SPEC_L1D_FLUSH in arg2.
        * tests/prctl-spec-inject.c (prctl-spec-inject): Adjust expected
        "-a" option value.
        * tests/prctl-spec-inject.c: Update expected output.

        xlat: add DM_IMA_MEASUREMENT_FLAG to dm_flags.
        * src/xlat/dm_flags.in (DM_IMA_MEASUREMENT_FLAG): New constant,
        introduced by Linux commit v5.15-rc1~161^2~14.
        * tests/ioctl_dm.c: Update expected output.
        * NEWS: Mention it.

        xlat: update btrfs_features_compat_ro and btrfs_key_types.
        * src/xlat/btrfs_features_compat_ro.in (BTRFS_FEATURE_COMPAT_RO_VERITY):
        New constant, introduced by Linux commit v5.15-rc1~35^2~48.
        * src/xlat/btrfs_key_types.in (BTRFS_VERITY_DESC_ITEM_KEY,
        BTRFS_VERITY_MERKLE_ITEM_KEY): Likewise.
        * NEWS: Mention it.

        src/xlat: add #sorted directive to btrfs_key_types.
        * src/xlat/btrfs_key_types.in: Add #sorted.
        (BTRFS_BALANCE_ITEM_KEY, BTRFS_DEV_STATS_KEY): Remove obsolete
        constants that duplicate BTRFS_TEMPORARY_ITEM_KEY
        and BTRFS_PERSISTENT_ITEM_KEY, respectively.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: add a compile-time check for sorted xlat order.
        * src/xlat/gen.sh (check_sort_order): New function.
        (cond_def): Accept xlat_type parameter, call check_sort_order
        if xlat_type is XT_SORTED.
        (gen_header): Call check_sort_order for lines that start with "[A-Z_]*"
        (only of $unconditional is set to non-empty string: otherwise, call
        is done inside cond_def), "'1<<'[A-Z_]*", and "[0-9]*" if xlat_type
        is XT_SORTED.

        Suggested-by: Dmitry V. Levin <ldv@strace.io>

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: fix constant order in elf_em.
        * src/xlat/elf_em.in (EM_CYGNUS_M32R): Move before EM_CYGNUS_V850.

        Fixes: v5.3~87 "xlat: add elf_em.in"

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: try to avoid excessive filter_seccomp-perf false positives.
        Increase test time threefold and relax minimum expected ratio a bit.

        * tests/filter_seccomp-perf.c (main): Set alarm to 3 seconds
        instead of 1.
        * tests/filter_seccomp-perf.test (min_ratio): Change from 6 to 5.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: try to make pidns-cache test a bit more robust.
        Increase SYSCALL_COUNT tenfold in an attempt to get more stable time
        measurements.  While at it, print some additional information
        about the time spent.

        * tests/pidns-cache.c (SYSCALL_COUNT): Change from 1000 to 10000.
        (main): Store original run time in orig_us variable, print
        it along with the run time under the PID NS test harness in a message
        to stderr.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/pidns.c: allow skipping tests inside the pidns harness.
        * tests/pidns.c (pidns_fork): Handle exit code 77 from the child.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        block: decode BLKGETDISKSEQ ioctl.
        Introduced by Linux commit v5.15-rc1~161^2~41.

        * src/block.c (block_ioctl) <case BLKGETDISKSEQ>: Decode using
        printnum_in64.
        * src/linux/32/ioctls_inc_align16.h: Add BLKGETDISKSEQ entry.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewse.
        * tests/ioctl_block.c: Add a check for NULL pointer for BLKGETDISKSEQ.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add FAN_REPORT_PIDFD to fan_init_flags.
        * src/xlat/fan_init_flags.in (FAN_REPORT_PIDFD): New constant,
        introduced by Linux commit v5.15-rc1~219^2~4.
        * tests/fanotify_init.c: Update expected output.
        * NEWS: Mention this.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: implement IORING_REGISTER_IOWQ_MAX_WORKERS op decoding.
        Introduced by Linux commit v5.15-rc1~83^2~22.

        * src/xlat/uring_iowq_acct.in: New file.
        * src/io_uring.c: Include "xlat/uring_iowq_acct.h".
        (print_io_uring_iowq_acct): New function.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_IOWQ_MAX_WORKERS>:
        Decode, call print_io_uring_iowq_acct.
        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_IOWQ_MAX_WORKERS):
        New constant.
        * tests/io_uring_register.c: Update expected output, add
        IORING_REGISTER_IOWQ_MAX_WORKERS checks.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add io_uring_register-success* tests.
        * tests/.gitignore: Add io_uring_register-success,
        io_uring_register-success-Xabbrev, io_uring_register-success-Xraw,
        and io_uring_register-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (io_uring_register-success,
        io_uring_register-success-Xabbrev, io_uring_register-success-Xraw,
        io_uring_register-success-Xverbose): New tests.
        * tests/io_uring_register-success-Xabbrev.c: New file.
        * tests/io_uring_register-success-Xraw.c: Likewise.
        * tests/io_uring_register-success-Xverbose.c: Likewise.
        * tests/io_uring_register-success.c: Likewise.
        * tests/io_uring_register.c: Update expected output.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: print struct io_cqring_offsets.flags as integer and not flags.
        Since this is the offset of the cq_flags field in struct io_rings
        and not the flags themselves.

        * src/xlat/uring_cqring_flags.in: Remove.
        * src/io_uring.c: Remove "xlat/uring_cqring_flags.h" include.
        (print_io_cqring_offsets): Print flags using PRINT_FIELD_U.
        * tests/io_uring_setup.c: Remove "xlat/uring_cqring_flags.h";  update
        expected output.

        Fixes: v5.8~57 "io_uring: Add io_cqring_offset flags"

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: cap io_uring_probe element count to nargs on exiting.
        While a sane kernel would set ops_len to a sane value, its tampering
        may lead to strace reading out of probe value bounds.  While at it,
        set PAF_ARRAY_TRUNCATED in cases when nargs is less than probe->ops_len.

        * src/io_uring.c (print_io_uring_probe): Print minimum of nargs and
        probe->ops_len probe->ops array elements on exiting, set
        PAF_ARRAY_TRUNCATED flag if nargs is less than probe->ops_len.

        Fixes: v5.6~94 "io_uring: support IORING_REGISTER_PROBE io_uring_register command"

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: print ellipsis inside an empty array if PAF_ARRAY_TRUNCATED is set
        * src/util.c (print_array_ex) <!nmemb>: Call tprint_more_data_follows()
        if PAF_ARRAY_TRUNCATED is set in flags.

        io_uring: decode IORING_REGISTER_IOWQ_AFF io_uring_register op.
        * src/io_uring.c (SYS_FUNC(io_uring_register))
        <case IORING_REGISTER_IOWQ_AFF>: Decode, call print_affinitylist.
        * tests/io_uring_register.c: Add checks for IORING_REGISTER_IOWQ_AFF op
        deocding.

        xlat: update printxvals_ex doxygen.
        * src/xlat.c (printxvals_ex): Update the doxygen comment.

        tests/sched_xetaffinity: add a check for a non-properly-sized CPU set.
        * tests/sched_xetaffinity.c: Add a check for sched_setaffinity with size
        of 7 bytes.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        affinity: make print_affinitylist externally available.
        As it is to be used in other files.

        * src/affinity.c (print_affinitylist): Remove "static" qualifier.
        * src/defs.h (print_affinitylist): New declaration.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        affinity: print cpuset of len 0 as "[]"
        To be consistent with print_array_ex behaviour.

        * src/affinity.c (print_affinitylist): Handle "!len" and "!cpu" cases
        separately;  print "[]" in the former.
        * tests/sched_xetaffinity.c: Add a check for a cpuset of size 0.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        affinity: use MIN and ROUNDUP macros in print_affinitylist.
        * src/affinity.c (print_affinitylist): Use MIN macro to calculate
        umove_size;  use ROUNDUP macro to calculate size.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: no longer interpret NULL xlat as continuation.
        This feature, originally introduced by commit v4.23~52 "xlat.c:
        handle NULL xlat in lookup routines as incremental search", was
        poorly documented, was of limited use (the only use case was in
        print_array_ex, introduced in commit v4.23~91 "print_array: add
        support for printing array indices" (which means that between
        the two aforementioned commits printing xlats in indices was
        broken)), of limited value (it was actually useful only for sorted
        xlats, which are lg2(N) anyway, and even there an iteration
        from the saved cursor position is preferable for search continuation
        rather than bsearch), and ultimately was rendered non-operational
        by commit v5.3~105 "Add xlat description structure".

        * src/util.c (print_array_ex): Do not pass NULL as xlat in printxval_ex
        call.
        * src/xlat.c (xlookup): Remove x local static variable;  remove static
        qualifier from idx and init it to 0;  remove x, idx initialisation when
        xlat in non-NULL;  remove xlat argument to x.
        (printxvals_ex): Remove the last local static variable and related
        logic.

        Reverts: v4.23~52 "xlat.c: handle NULL xlat in lookup routines as incremental search"

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: decode struct io_uring_rsrc_register and io_uring_rsrc_update2
        * src/io_uring.c (print_io_uring_rsrc_data, print_io_uring_rsrc_tags,
        print_io_uring_register_rsrc, print_io_uring_update_rsrc): New functions.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES2,
        case IORING_REGISTER_BUFFERS2>: Call print_io_uring_register_rsrc.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES_UPDATE2,
        case IORING_REGISTER_BUFFERS_UPDATE>: Call print_io_uring_update_rsrc.
        * tests/io_uring_register.c (BIG_ADDR_MASK): New macro.
        (path_null, path_full): New constants, moved out of main.
        (print_rsrc_data, print_rsrc_tags): New functions.
        (main): Add checks for new decoders.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: decode IORING_REGISTER_FILES_SKIP in IORING_REGISTER_FILES_UPDATE
        Introduced by Linux commit v5.12~270^2~95.

        * src/xlat/uring_files_update_fds.in: New file.
        * src/io_uring.c (print_files_update_array_member): New function.
        (print_io_uring_files_update): Use print_files_update_array_member
        instead of print_fd_array_member.
        * tests/io_uring_register.c: Add checks for printing of fds -1, -2, -3.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: deсode IORING_REGISTER_RESTRICTIONS io_uring_register op.
        Implemented in Linux commit v5.10-rc1~167^2~51.

        * src/io_uring.c (print_io_uring_restriction,
        print_io_uring_restrictions): New functions.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_RESTRICTIONS>:
        New decoder, calls print_io_uring_restrictions.
        * src/xlat/uring_restriction_opcodes.in: New file.
        * src/xlat/uring_sqe_flags.in: Likewise.
        * tests/io_uring_register.c: Add checks
        for IORING_REGISTER_RESTRICTIONS.
        * NES: Mention this.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src: use is_bigendian.
        * src/disable_ptrace_request.c (ARG_OFFSET): Remove.
        (main): Use is_bigendian-conditioned ternary operator
        instead of ARG_OFFSET.
        * src/sockaddr.c (btohs): Conditionalise return value on is_bigendian
        value.

        tests: add io_uring_register-X* tests.
        * tests/.gitignore: Add io_uring_register-Xabbrev,
        io_uring_register-Xraw, and io_uring_register-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (io_uring_register-Xabbrev,
        io_uring_register-Xraw, io_uring_register-Xverbose): Add tests.
        * tests/io_uring_register-Xabbrev.c: New file.
        * tests/io_uring_register-Xraw.c: Likewise.
        * tests/io_uring_register-Xverbose.c: Likewise.
        * tests/io_uring_register.c: Update to produce output in accordance
        with XLAT_* definitions presence.

        xlat: update uring_ops.
        * src/xlat/uring_ops.in (IORING_OP_MKDIRAT): New constant, introduced
        by Linux commit v5.15-rc1~184^2~2.
        (IORING_OP_SYMLINKAT): New constant, introduced by Linux commit
        v5.15-rc1~184^2~1.
        (IORING_OP_LINKAT): New constant, introduced by Linux commit
        v5.15-rc1~184^2.
        * tests/io_uring_register.c: Update expected output.
        * NEWS: Mention it.

        io_uring: explicitly list io_uring_register ops without arg.
        * src/io_uring.c (SYS_FUNC(io_uring_register)): Add
        IORING_UNREGISTER_BUFFERS, IORING_UNREGISTER_FILES,
        IORING_UNREGISTER_EVENTFD, IORING_REGISTER_PERSONALITY,
        IORING_UNREGISTER_PERSONALITY, IORING_REGISTER_ENABLE_RINGS,
        and IORING_UNREGISTER_IOWQ_AFF to the opcode switch statement.
        * tests/io_uring_register.c: Add checks for IORING_REGISTER_ENABLE_RINGS
        and IORING_UNREGISTER_IOWQ_AFF.

        io_uring: sort xlat includes lexicographically.
        * src/io_uring.c: Move "xlat/uring_enter_flags.h"
        and "xlat/uring_cqring_flags.h" forward to establish a lexicographical
        order of includes.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs: update print_array_ex doxygen.
        This change updates the description of index_xlat (as xlat is no longer
        a naked array, but rather a description structure), removes index_xlat_size
        description, and adds description for the return value semantics.
        Interestingly, the change that introduced index_xlat_size description
        (v5.3~15 "Add support for printing local arrays to print_array") was
        applied after the change that removed the argument (v5.3~105 "Add xlat
        description structure").

        Complements: v5.3~15 "Add support for printing local arrays to print_array"

        * src/defs.h (print_array_ex): Update description.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: unify differently-sized variants of print_{,u,x}int_array_member.
        Different functions are more or less unnecessary, since the argument
        size is passed in elem_size parameter anyway, and without any check
        of it the only thing differently-sized function variants do is concealing
        the discrepancies between the printed and fetched element size (as it
        was with bpf_prog_info.map_ids).

        All the callers are updated automatically using

            sed -i 's/print_\([xu]\)\?int\(8\|16\|32\|64\)_array_member/print_\1int_array_member/g' \
                `git grep -l 'print_.*int.*_array_member'`

        with additional manual cleanup in src/linux/*/arch_*.c.

        * src/defs.h (print_int8_array_member, print_uint8_array_member,
        print_xint8_array_member, print_int32_array_member,
        print_uint32_array_member, print_xint32_array_member,
        print_uint64_array_member, print_xint64_array_member,
        print_xlong_array_member, print_kulong_array_member): Remove.
        (print_int_array_member, print_uint_array_member,
        print_xint_array_member): New declarations.
        * src/util.c (print_int8_array_member, print_uint8_array_member,
        print_xint8_array_member, print_int32_array_member,
        print_uint32_array_member, print_xint32_array_member,
        print_uint64_array_member, print_xint64_array_member): Remove.
        (print_int_array_member, print_uint_array_member,
        print_xint_array_member): New functions.
        * src/bpf.c (print_bpf_prog_info,
        BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use print_uint_array_member
        instead of print_uint32_array_member.
        * src/btrfs.c (btrfs_print_qgroup_inherit): Use print_uint_array_member
        instead of print_uint64_array_member.
        * src/clone.c (SYS_FUNC(clone3)): Use print_int_array_member instead
        of print_int32_array_member.
        * src/evdev.c (decode_bitset): Use print_xint_array_member instead
        of print_xlong_array_member.
        (mtslots_ioctl): Use print_int_array_member instead
        of print_int32_array_member.
        * src/gpio_ioctl.c (print_gpiohandle_request): Use
        print_uint_array_member instead of print_uint32_array_member
        and print_uint8_array_member.
        (print_gpiohandle_data, print_gpiohandle_set_config): Use
        print_uint_array_member instead of print_uint8_array_member.
        (print_gpio_v2_line_request): Use print_uint_array_member instead
        of print_uint32_array_member.
        * src/io_uring.c (SYS_FUNC(io_uring_setup), print_io_uring_probe): Use
        print_xint_array_member instead of print_xint32_array_member.
        * src/keyctl.c (keyctl_dh_compute, print_pkey_query,
        fetch_print_pkey_params): Likewise.
        * src/msghdr.c (print_cmsg_uint): Use print_uint_array_member instead
        of print_uint32_array_member.
        (print_cmsg_xint8_t): Use print_xint_array_member instead
        of print_xint8_array_member.
        * src/mtd.c (print_xint32x2_array_member, decode_nand_oobinfo,
        decode_nand_ecclayout_user): Use print_xint_array_member instead
        of print_xint32_array_member.
        * src/net.c (print_getsockopt): Use print_uint_array_member instead
        of print_uint32_array_member.
        * src/nlattr.c (decode_nla_meminfo): Likewise.
        * src/numa.c (SYS_FUNC(move_pages)): Use print_int_array_member instead
        of print_int32_array_member.
        * src/perf_ioctl.c (perf_ioctl_query_bpf): Use print_uint_array_member
        instead of print_uint32_array_member.
        * src/print_statfs.c (print_f_fsid): Use print_xint_array_member instead
        of print_xint64_array_member.
        * src/ptrace_syscall_info.c (print_psi_entry, print_psi_seccomp):
        Likewise.
        * src/rtnl_link.c (decode_ifla_bridge_id): Use print_uint_array_member
        instead of print_uint8_array_member.
        (decode_ifla_inet_conf, decode_ifla_inet6_conf): Use
        print_int_array_member instead of print_int32_array_member.
        (decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats): Use
        print_uint_array_member instead of print_uint64_array_member.
        * src/seccomp_ioctl.c (print_struct_seccomp_data): Use
        print_xint_array_member instead of print_xint64_array_member.
        * src/sysinfo.c (SYS_FUNC(sysinfo)): Use print_uint_array_member instead
        of print_kulong_array_member.
        * src/v4l2.c (print_v4l2_queryctrl): Use print_xint_array_member instead
        of print_xint32_array_member.
        (print_v4l2_query_ext_ctrl): Use print_uint_array_member instead
        of print_uint32_array_member;  use print_xint_array_member instead
        of print_xint32_array_member.
        * src/linux/aarch64/arch_prstatus_regset.c
        (arch_decode_prstatus_regset): Use print_xint_array_member instead
        of print_xint64_array_member.
        * src/linux/arm/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Use print_xint_array_member instead of print_xint32_array_member.
        * src/linux/i386/arch_fpregset.c (arch_decode_fpregset): Likewise.
        * src/linux/mips/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Use print_xint_array_member instead of print_xint32_array_member
        and print_xint64_array_member.
        * src/linux/mips/arch_pt_regs.c (arch_decode_pt_regs): Use
        print_xint_array_member instead of print_xint64_array_member.
        * src/linux/powerpc/arch_fpregset.c (arch_decode_fpregset): Likewise.
        * src/linux/powerpc/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Use print_xint_array_member instead of print_xint32_array_member
        and print_xint64_array_member.
        * src/linux/powerpc/arch_pt_regs64.c (decode_pt_regs64): Use
        print_xint_array_member instead of print_xint64_array_member
        * src/linux/s390/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Use print_xint_array_member instead of print_xint32_array_member
        and print_xint64_array_member.
        (arch_decode_prstatus_regset): Use print_xint_array_member instead
        of print_xint32_array_member.
        * src/linux/sparc/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Use print_xint_array_member instead of print_xint32_array_member.
        * src/linux/sparc/arch_pt_regs.c (arch_decode_pt_regs): Likewise.
        * src/linux/sparc64/arch_prstatus_regset.c
        (arch_decode_prstatus_regset): Use print_xint_array_member instead
        of print_xint64_array_member.
        * src/linux/sparc64/arch_pt_regs64.c (decode_pt_regs64): Likewise.
        * src/linux/x86_64/arch_fpregset.c (arch_decode_fpregset): Use
        print_xint_array_member instead of print_xint32_array_member.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: fix bpf_prog_info.map_ids array printing.
        map_id_buf had an incorrect storage size (8 bytes instead of 4), which led
        to incorrect fetching of map_ids array elements, so only odd/even-indexed
        elements (on big/little-endian architectures, respectively) were printed.

        * src/bpf.c (print_bpf_prog_info): Change map_id_buf type from uint64_t
        to uint32_t.
        * tests/bpf-obj_get_info_by_fd.c: Create second bpf map, use it in the
        bpf program, and add additional checks regarding map_ids printing.
        * NEWS: Mention this.

        Fixes: v4.23~99 "bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command"

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Decode process_mrelease syscall.
        Introduced by Linux commits v5.14-159-g884a7e5964e0
        and v5.14-160-gdce491039628.

        * src/linux/generic/syscallent-common.h ([BASE_NR + 448]): Add
        process_mrelease syscall entry.
        * src/mem.c (SYS_FUNC(process_mrelease)): New syscall decoder.
        * tests/.gitignore: Add process_mrelease and process_mrelease-y.
        * tests/gen_tests.in (process_mrelease, process_mrelease-y): New tests.
        * tests/process_mrelease.c: New file.
        * tests/process_mrelease-y.c: Likewise.
        * NEWS: Mention it.

2021-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add MPOL_PREFERRED_MANY to mpol_modes.
        * src/xlat/mpol_modes.in (MPOL_PREFERRED_MANY): New constant, introduced
        by Linux commit v5.14-152-gb27abaccf8e8.
        * tests/mbind.c: Add MPOL_PREFERRED_MANY check, update expected output.
        * tests/set_mempolicy.c: Likewise.
        * NEWS: Mention the change.

2021-10-10  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.15-rc4.
        * bundled/linux/include/uapi/linux/btrfs.h: Update to
        headers_install'ed Linux kernel v5.15-rc4.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/dm-ioctl.h: Likewise.
        * bundled/linux/include/uapi/linux/fs.h: Likewise.
        * bundled/linux/include/uapi/linux/if_bridge.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/in6.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/mount.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_conntrack.h:
        Likewise.
        * bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/socket.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use BE_LE macro in more places.
        It makes reading the code where only little pieces are switched
        on WORDS_BIGENDIAN a little bit easier.

        * tests/io_uring_register.c (BE_LE): Move it...
        * tests/tests.h (BE_LE): ...here.
        * tests/bpf.c (bpf_attr_check): Use BE_LE instead of #ifdef WORDS_BIGENDIAN.
        * tests/clone3.c: Likewise.
        * tests/nlattr_ifla_linkinfo.c: Likewise.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: helper macros for integer attr testing.
        It is one of the most common attribute type decoder flavours,
        so it should be as trivial to test as possible.

        * tests/test_nlattr.h (DEF_NLATTR_INTEGER_CHECK_,
        TEST_NLATTR_VAL): New macros.
        (check_u32_nlattr, check_x32_nlattr): New functions, defined using
        DEF_NLATTR_INTEGER_CHECK_.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: provide TEST_NLATTR_OBJECT_ and TEST_NLATTR_ARRAY_
        So they can be used along with custom nla_type string format.

        * tests/test_nlattr.h (TEST_NLATTR_OBJECT_): New macro, a wrapper
        for TEST_NLATTR_OBJECT_EX_.
        (TEST_NLATTR_ARRAY_): Rename from TEST_NLATTR_ARRAY, add nla_type_str_
        argument.
        (TEST_NLATTR_ARRAY): New macro, a wrapper for TEST_NLATTR_ARRAY_.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/tests.h: add struct strval16 type.
        Analogous to strval32 and strval64.

        * tests/tests.h (struct strval16): New type.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr: allow TEST_NLATTR_EX_ usage with various xlat verbosity
        * tests/test_nlattr.h (TEST_NLATTR_EX_): Wrap MSG_DONTWAIT printing
        in XLAT_FMT/XLAT_ARG so it can be used with different xlat verbosity
        levels.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_route: make encap type decoder globally available.
        And rename it to decode_nla_lwt_encap_type.

        * src/nlattr.h (DECL_NLA(lwt_encap_type)): New declaration.
        * src/rtnl_route.c (decode_rta_encap_type): Rename it to...
        (decode_nla_lwt_encap_type): ...this.
        (rtmsg_nla_decoders) <[RTA_ENCAP_TYPE]>: Use decode_nla_lwt_encap_type.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: make xval/flag nlattr printing a bit more structured.
        Since the only usage for prefix/suffix was to enframe the xval/flag
        output in a function call syntax (that is inverse to process_fn),
        let's simply provide fn_str and print it using tprints_arg_begin
        and tprint_arg_end.

        * src/nlattr.h (decode_nla_xlat_opts): Remove prefix and suffix fields,
        add fn_str field.
        * src/nlattr.c (decode_nla_xval, decode_nla_flags): Output fn_str using
        tprints_arg_begin, call tprint_arg_end if fn_str is non-NULL.
        (decode_nla_ether_proto): Pass "htons" in fn_str field of the opts
        structure instead of "htons(" and ")" as prefix and suffix,
        respectively.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ipc_msg: sign-extend msgtyp.
        Most of the architectures have indirect IPC calls for compat,
        but not ARM, and that unraveled a missing sign extension
        of the msgtyp argument before printing.

        * src/ipc_msg.c (tprint_msgrcv): Sign-extend msgtyp using
        truncate_klong_to_current_klongsize.

        Reported-by: Dmitry V. Levin <ldv@strace.io>

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs: add truncate_k{,u}long_to_current_klongsize.
        * src/defs.h (truncate_klong_to_current_klongsize,
        truncate_kulong_to_current_klongsize): New functions.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ptrace: handle AArch64's COMPAT_PTRACE_* macros.
        This also fixes ptrace command handling for the AArch32 mode on AArch64.
        Note that COMPAT_PTRACE_GETFPREGS/COMPAT_PTRACE_SETFPREGS are not defined
        in arch/arm64/include/asm/ptrace.h, but we define them anyway since
        we still handle compat binaries that try to perform the corresponding
        PTRACE_GETFPREGS and PTRACE_SETFPREGS requests.

        * src/xlat/compat_ptrace_cmds.in: New file.
        * src/xlat/ptrace_cmds.in [__arm64__ || __aarch64__] (PTRACE_GETREGS,
        PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS, PTRACE_GETHBPREGS,
        PTRACE_SETHBPREGS, PTRACE_GET_THREAD_AREA, PTRACE_SET_SYSCALL,
        PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define to the same value as for arm.
        * src/ptrace.c: Include "xlat/compat_ptrace_cmds.h".
        (HAVE_COMPAT_PTRACE_MACROS): New macro.
        [HAVE_COMPAT_PTRACE_MACROS] (decode_ptrace_entering): Use
        compat_ptrace_cmds xlat for printing request for the non-m32
        personality; handle COMPAT_PTRACE_* requests for the non-m32 personality
        by printing addr and data as undecoded addresses.
        * tests/ptrace.c: Add checks for COMPAT_PTRACE_* requests.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        times: enhance decoding of clock_t-typed fields.
        * src/times.c (SYS_FUNC(times)): Use PRINT_FIELD_CLOCK_T instead
        of PRINT_FIELD_U.
        * tests/.gitignore: Add times-Xabbrev, times-Xraw, and times-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (times-Xabbrev, times-Xraw, times-Xverbose): New
        tests.
        (clock, sched, trace_clock, trace_personality_regex_32,
        trace_personality_regex_64, trace_personality_regex_x32): Add 'times-.*'
        to the list of excluded pure executables.
        * tests/Makefile.am (times_Xabrrev_LDADD, times_Xraw_LDADD,
        times_Xverbose_LDADD): Add $(clock_LIBS).
        * tests/times-Xabbrev.c: New file.
        * tests/times-Xraw.c: Likewise.
        * tests/times-Xverbose.c: Likewise.
        * tests/times.c: Update expected output.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/times: try to burn more system time.
        The check agains CLOCK_PROCESS_CPUTIME_ID does not necessarily guarantee
        that system time has been spent as well;  let's try to do some actual
        work that involves some amount of kernel code by reading our precess'es
        status.  And also increase the limits to increase the chance of making
        the system time non-zero.

        * tests/times.c: Include <fcntl.h>, <sys/stat.h>, and <sys/types.h>.
        (PARENT_CPUTIME_LIMIT_NSEC): Increase to 300000000.
        (CHILD_CPUTIME_LIMIT_NSEC): Increase to 500000000.
        (READ_BUF_SIZE, READ_ITER): New enum items.
        (main): Open /proc/self/status and try to read from it READ_ITER times;
        increase the time limit for system time spending by cputime_limit.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: implement clock_t type decoding.
        * src/defs.h (print_clock_t): New declaration.
        * src/util.c: Include "print_fields.h".
        (ILOG10_ITER_): New macro.
        (ilog10, print_clock_t): New functions.
        * src/nlattr.h (DECL_NLA(clock_t)): New declaraion.
        * src/nlattr.c (decode_nla_clock_t): New function.
        * src/print_fields.h (PRINT_FIELD_CLOCK_T): New macro.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add umoven_uint64_or_printaddr{,64}
        There is a couple of places (in generic code) where an integer
        of a specified size is to be retrieved;  refactor it into a separate
        function.

        * src/defs.h (umoven_to_uint64_or_printaddr64): New declaration.
        (umoven_to_uint64_or_printaddr): New function, a wrapper
        for umoven_to_uint64_or_printaddr64.
        * src/util.c (umoven_to_uint64_or_printaddr64): New function.
        * src/nlattr.c (decode_nla_xval, decode_nla_flags): Rewrite using
        umoven_to_uint64_or_printaddr.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net, sockaddr: remove *_size constants.
        These are no longer needed after the move to xlat description structures.

        * src/net.c (inet_protocols_size): Remove.
        * src/sockaddr.c (arp_hardware_types_size, ethernet_protocols_size):
        Likewise.

        Complements: v5.3~105 "Add xlat description structure"

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/perf_event_open.c: avoid unaligned accesses on AArch64.
        Some AArch64 implementations do not support unaligned accesses,
        so let's add it to the list of architectures where the checks
        that require it are to be avoided.

        * tests/perf_event_open.c [AARCH64] (ATTR_REC): Define the aligned
        version.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/nlattr_rtmsg.c: add checks for address-containing RTA_* attributes
        * tests/nlattr_rtmsg.c (print_quoted_hex_ellipsis, init_rtmsg_inet6,
        print_rtmsg_inet6): New functions.
        (main): Add checks for RTA_DST, RTA_SRC, RTA_GATEWAY, RTA_PREFSRC,
        RTA_NEWDST attribute decoding.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_route: handle multiple next hop entries inside RTA_MULTIPATH.
        * configure.ac (AC_CHECK_FUNCS): Add mempcpy.
        * src/rtnl_route.c (decode_rta_multipath): Navigate through attribute
        payload and print it as an array if there are more data in the payload
        than the first struct rtnexthop.rtnh_len indicates.
        * tests/nlattr_rtmsg.c [!HAVE_MEMPCPY] (mempcpy): Re-define
        to strace_mempcpy.
        [!HAVE_MEMPCPY] (mempcpy): New function.
        (DEF_NLATTR_RTMSG_FUNCS): New macro for defining init/print functions.
        (init_rtmsg_inet, print_rtmsg_inet): New functions, defined using
        DEF_NLATTR_RTMSG_FUNCS macro.
        (main): Update expected output, add a check for multiple
        struct rtnexthop inside RTA_MULTIPATH.

        Resolves: https://github.com/strace/strace/issues/195

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        macros: add BE* macros.
        For (statically) defined big-endian values.

        * src/macros.h (BE16, BE32, BE64): New macros.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement SECCOMP_IOCTL_* decoding.
        * src/seccomp_ioctl.c: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add it.
        * src/defs.h (DECL_IOCTL(seccomp)): New declaration.
        * src/ioctl.c (ioctl_decode_command_number) <case '!'>: Print
        SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR.
        (ioctl_decode) <case '!'>: Call seccomp_ioctl.
        * src/xlat/seccomp_ioctl_addfd_flags.in: New file.
        * src/xlat/seccomp_ioctl_resp_flags.in: Likewise.
        * tests/.gitignore: Add ioctl_seccomp, ioctl_seccomp--pidns-translation,
        ioctl_seccomp-success, ioctl_seccomp-y, ioctl_seccomp-y-success,
        ioctl_seccomp-y-success-Xabbrev, ioctl_seccomp-y-success-Xraw,
        ioctl_seccomp-y-success-Xverbose, ioctl_seccomp-y-success--pidns-translation,
        ioctl_seccomp-y-success--pidns-translation-Xabbrev,
        ioctl_seccomp-y-success--pidns-translation-Xraw,
        and ioctl_seccomp-y-success--pidns-translation-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (ioctl_seccomp, ioctl_seccomp--pidns-translation,
        ioctl_seccomp-success, ioctl_seccomp-y, ioctl_seccomp-y-success,
        ioctl_seccomp-y-success-Xabbrev, ioctl_seccomp-y-success-Xraw,
        ioctl_seccomp-y-success-Xverbose, ioctl_seccomp-y-success--pidns-translation,
        ioctl_seccomp-y-success--pidns-translation-Xabbrev,
        ioctl_seccomp-y-success--pidns-translation-Xraw,
        ioctl_seccomp-y-success--pidns-translation-Xverbose): New tests.
        * tests/ioctl_seccomp--pidns-translation.c: New file.
        * tests/ioctl_seccomp-success.c: Likewise.
        * tests/ioctl_seccomp-y-success--pidns-translation-Xabbrev.c: Likewise.
        * tests/ioctl_seccomp-y-success--pidns-translation-Xraw.c: Likewise.
        * tests/ioctl_seccomp-y-success--pidns-translation-Xverbose.c: Likewise.
        * tests/ioctl_seccomp-y-success--pidns-translation.c: Likewise.
        * tests/ioctl_seccomp-y-success-Xabbrev.c: Likewise.
        * tests/ioctl_seccomp-y-success-Xraw.c: Likewise.
        * tests/ioctl_seccomp-y-success-Xverbose.c: Likewise.
        * tests/ioctl_seccomp-y-success.c: Likewise.
        * tests/ioctl_seccomp-y.c: Likewise.
        * tests/ioctl_seccomp.c: Likewise.
        * NEWS: Mention it.

        tests/init.sh: add START-OF-TEST-OUTPUT-REGEX and PROG_ARGS quirks.
        * tests/init.sh (sed_escape): New function.
        (run_strace_match_diff, test_pidns_run_strace): Add prog_args local variable;
        handle "QUIRK:START-OF-TEST-OUTPUT:*" and "QUIRK:START-OF-TEST-OUTPUT-REGEX:*"
        arguments;  set args to $prog_args after run_prog call.

        seccomp: decode SECCOMP_GET_NOTIF_SIZES.
        * src/seccomp.c (SYS_FUNC(seccomp)): Print seccomp op only on entering.
        (SYS_FUNC(seccomp)) <case SECCOMP_GET_NOTIF_SIZES>: Implement decoding.
        * tests/.gitignore: Add seccomp_get_notif_sizes
        and seccomp_get_notif_sizes-success.
        * tests/Makefile.am (check_PROGRAMS): Add
        seccomp_get_notif_sizes-success.
        * tests/gen_tests.in (seccomp_get_notif_sizes,
        seccomp_get_notif_sizes-success): New tests.
        * tests/pure_executables.list: Add seccomp_get_notif_sizes.
        * tests/seccomp_get_notif_sizes-success.c: New file.
        * tests/seccomp_get_notif_sizes.c: Likewise.
        * NEWS: Mention it.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint/ioctls_sym.sh: indent sed argument.
        To make it a bit more readable.

        * maint/ioctls_sym.sh: Indent sed argument containuation
        with an additional indent level to signify its affiliation.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint/ioctls_sym.sh: use <<- for here-documents where suitable.
        It simplifies reading the file a bit.

        * maint/ioctls_sym.sh: Replace <<'__EOF__' occurrences with
        <<-'__EOF__';  replace <<__EOF__ occurrences with <<-__EOF__ except
        the first one that contains leading tabs.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        seccomp: print flags variable as a hexadecimal value.
        It seems more natural that way for the argument called "flags".

        * src/seccomp.c (SYS_FUNC(seccomp)) <case SECCOMP_GET_ACTION_AVAIL,
        case SECCOMP_SET_MODE_STRICT, default>: Change PRINT_VAL_U to
        PRINT_VAL_X for flags argument printing.
        * tests/seccomp-strict.c: Update expected output.
        * tests/seccomp_get_action_avail.c: Likewise.

2021-10-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add ptrace-X* tests.
        * tests/.gitignore: Add ptrace-Xabbrev, ptrace-Xraw,
        and ptrace-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/ptrace-Xabbrev.c: New file.
        * tests/ptrace-Xraw.c: Likewise.
        * tests/ptrace-Xverbose.c: Likewise.
        * tests/ptrace.c: Update expected output.
        * tests/gen_tests.in (ptrace-Xabbrev, ptrace-Xraw,
        ptrace-Xverbose): New tests.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        signal: enable xlat style support for signal mask printing.
        * src/signal.c (sprintsigmask_n): Print in accordance with xlat
        verbosity.

        tests: add ptrace_syscall_info-X* tests.
        * tests/.gitignore: Add ptrace_syscall_info-Xabbrev,
        ptrace_syscall_info-Xraw, and ptrace_syscall_info-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/ptrace_syscall_info-Xabbrev.c: New file.
        * tests/ptrace_syscall_info-Xraw.c: Likewise.
        * tests/ptrace_syscall_info-Xverbose.c: Likewise.
        * tests/gen_tests.in (ptrace_syscall_info-Xabbrev,
        ptrace_syscall_info-Xraw, ptrace_syscall_info-Xverbose): New tests.
        * tests/ptrace_syscall_info.c: Update expected output.

        tests/tests.h: add XLAT_FMT_D, XLAT_FMT_L and XLAT_FMT_U macros.
        * tests/tests.h (XLAT_FMT_D, XLAT_FMT_L, XLAT_FMT_U): New macros.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove PERSONALITY0_AUDIT_ARCH guards.
        Since PERSONALITY0_AUDIT_ARCH is defined for each architecture,
        there is no need to conditionalise on it.

        * src/linux/generic/nr_prefix.c (nr_prefix): Remove PERSONALITY0_AUDIT_ARCH
        guard.
        * src/syscall_name.c: Likewise.
        * tests/filter_seccomp-flag.c: Likewise.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printsiginfo: decode si_syscall field using syscall_name_arch.
        It was subtly broken all this time as si_arch may be not equivalent
        to strace's current personality's audit arch: this may well happen when
        siginfo_t is decoded as an argument (like in ptrace(PTRACE_SETSIGINFO)),
        as the author of the comment in v4.21~43 should have definitely known.

        * src/printsiginfo.c: Remove "nr_prefix.c" include.
        [HAVE_SIGINFO_T_SI_SYSCALL] (print_si_syscall): Remove.
        (print_si_info): Use PRINT_SYSCALL_NAME for si_syscall field printing.
        * tests/ptrace.c: Update expected output, add checks for the cases when
        {CUR,PERS0,M32,MX32}_AUDIT_ARCH are defined.
        * src/linux/generic/nr_prefix.c [!HAVE_SIGINFO_T_SI_SYSCALL
        && !PERSONALITY0_AUDIT_ARCH] (nr_prefix): Do not provide the function.
        * NEWS: Mention it.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add cur_audit_arch.h.
        It might come handy for some tests involving syscall/audit_arch pair
        decoding.

        * tests/cur_audit_arch.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ptrace_syscall_info: print syscall name.
        * src/ptrace_syscall_info.c (print_psi_entry, print_psi_seccomp): Add
        arch argument, replace PRINT_FIELD_U call with PRINT_FIELD_SYSCALL_NAME
        for nr field printing and pass arch there.
        (print_ptrace_syscall_info) <case PTRACE_SYSCALL_INFO_ENTRY,
        case PTRACE_SYSCALL_INFO_SECCOMP>: Pass info.arch as an additional
        argument in PRINT_FIELD_OBJ_PTR.
        * tests/ptrace_syscall_info.c (sc_names): New variable.
        (test_entry): Update expected output.
        * NEWS: Mention it.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/linux: add PERSONALITY0_AUDIT_ARCH definitions where possible.
        That should expand usability of syscall_name_arch on these
        architectures.

        * src/Makefile.am (EXTRA_DIST): Add linux/arc/arch_defs_.h,
        linux/avr32/arch_defs_.h, linux/csky/arch_defs_.h,
        linux/metag/arch_defs_.h, linux/or1k/arch_defs_.h,
        linux/riscv64/arch_defs_.h, and linux/xtensa/arch_defs_.h.
        * src/linux/alpha/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): New macro.
        * src/linux/arm/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/bfin/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/hppa/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/i386/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/m68k/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/microblaze/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/mips/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/nios2/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/powerpc/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/powerpc64le/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/s390/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/sh/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/sh64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/sparc/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise.
        * src/linux/tile/arch_defs_.h (PERSONALITY1_AUDIT_ARCH): Define based
        on __tilepro__ definition presence.
        * src/linux/arc/arch_defs_.h: New file.
        * src/linux/avr32/arch_defs_.h: Likewise.
        * src/linux/csky/arch_defs_.h: Likewise.
        * src/linux/metag/arch_defs_.h: Likewise.
        * src/linux/or1k/arch_defs_.h: Likewise.
        * src/linux/riscv64/arch_defs_.h: Likewise.
        * src/linux/xtensa/arch_defs_.h: Likewise.

2021-10-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Provide a routine for printing syscall name from nr/audit_arch pair.
        The pair of raw syscall number and AUDIT_ARCH_* is used by kernel
        to describe syscall for userspace in increasing number of places,
        so it is deemed advisable to provide information about syscall name
        to user when possible.  This commit defines such a routine,
        syscall_name_arch, along with PRINT_FIELD_SYSCALL_NAME macro that
        enables syscall name printing inside structures.  While we are here,
        let's consolidate syscall_name* routines in a separate file.

        * src/Makefile.am (libstrace_a_SOURCES): Add syscall_name.c.
        * src/defs.h (syscall_name_arch): New declaration.
        (struct audit_arch_t): Moved from filter_seccomp.c.
        (audit_arch_vec): New declaration.
        * src/filter_seccomp.c [PERSONALITY0_AUDIT_ARCH]: Remove
        <linux/audit.h>, "xlat/elf_em.h", and "xlat/audit_arch.h" includes.
        (struct audit_arch_t): Move it to defs.h
        (audit_arch_vec): Move it to src/syscall_name.c.
        * src/print_fields.h (PRINT_FIELD_SYSCALL_NAME): New macro.
        * src/syscall.c (syscall_name): Move it to src/syscall_name.c.
        * src/syscall_name.c: New file.
        * src/linux/generic/nr_prefix.c [PERSONALITY0_AUDIT_ARCH] (nr_prefix):
        Make the function available.
        * src/linux/ia64/arch_defs_.h: Include "syscallent_base_nr.h" to make
        PERSONALITY0_AUDIT_ARCH definition usable.

2021-09-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Provide an ability to specify the personality for which to shuffle scno.
        Rename shuffle_scno to shuffle_scno_pers and add a second argument,
        provide a wrapper with an old name and semantics for existing users.

        * src/defs.h(shuffle_scno_pers): Rename from shuffle_scno, add pers
        argument.
        (shuffle_scno): New function, a wrapper for shuffle_scno_pers
        with current_personality passed as the second argument.
        * src/linux/aarch64/shuffle_scno.c (shuffle_scno_is_static): Rename
        to...
        (shuffle_scno_pers_is_static): ...this.
        (shuffle_scno): Rename to...
        (shuffle_scno_pers): ...this.
        (shuffle_scno): Rename to...
        (shuffle_scno_pers): ...this, add per argument, use it instead
        of current_personality, call arm_shuffle_scno_pers instead
        of arm_shuffle_scno.
        * src/linux/arm/shuffle_scno.c (shuffle_scno_is_static): Rename to...
        (shuffle_scno_pers_is_static): ...this.
        (shuffle_scno): Rename to...
        (shuffle_scno_pers): ...this.
        * src/linux/generic/shuffle_scno.c (shuffle_scno): Rename to...
        (shuffle_scno_pers): ...this, add pers argument.
        * src/linux/ia64/shuffle_scno.c: Likewise.
        * src/linux/x32/shuffle_scno.c (shuffle_scno): Rename to...
        (shuffle_scno_pers): ...this, add pers argument, use it instead
        of current_personality.
        * src/linux/x86_64/shuffle_scno.c: Likewise.

2021-09-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: use CHECK_TYPE_SIZE for type size checks.
        * src/s390.c: Use CHECK_TYPE_SIZE for checking sizes of struct
        sthyi_hdr, struct sthyi_machine, struct sthyi_partition,
        struct sthyi_hypervisor, and struct sthyi_guest instead of open-coding
        it with static_assert.

        macros: introduce CHECK_TYPE_SIZE shorthand.
        * src/macros.h: Include "static_assert.h"
        (CHECK_TYPE_SIZE): New macro.
        * src/static_assert.h: Avoid static_assert definition if such macro
        is already defined; otherwise mpers checks produce double-definition
        warning since macros.h brings static_assert.h now, and the latter relies
        on config.h-provided defines that are not generated yet.

2021-09-04  Dmitry V. Levin  <ldv@strace.io>

        Remove redundant static inline specifications.
        There is usually no need to add "inline" qualifier to static functions
        defined in .c files, compilers are quite capable of inlining static
        functions without additional hints.

        * src/dm.c (dm_ioctl_has_params): Remove "inline" qualifier.
        * src/filter_qualify.c (check_inadvertent_fault_injection): Likewise.
        * src/xlat.c (get_xlat_style, sprint_xlat_val, print_xlat_val): Likewise.
        * src/linux/arm/nr_prefix.c (nr_prefix): Likewise.
        * tests/bpf.c (get_log_buf, get_log_buf_tail): Likewise.
        * tests/clone3.c (print_addr64, print_clone3): Likewise.
        * tests/fork-f.c (logit_): Likewise.
        * tests/vfork-f.c (logit_): Likewise.
        * tests/ioctl_gpio.c (do_ioctl_ptr): Likewise.
        * tests/ioctl_hdio.c (do_ioctl_ptr): Likewise.
        * tests/read-write.c (dump_str): Likewise.
        * tests/sprintrc.c (sprintrc_ex): Likewise.
        * tests/s390_sthyi.c (print_0x8, print_u16, print_x32, print_weight,
        ebcdic2ascii, print_ebcdic): Likewise.
        (print_u8, is_empty, print_funcs): Remove "inline" qualifier,
        conditionalize on [VERBOSE].
        * src/linux/generic/nr_prefix.c (nr_prefix): Remove "inline" qualifier,
        conditionalize on [HAVE_SIGINFO_T_SI_SYSCALL].
        * src/sigreturn.c (print_sigmask_addr_size): Add comment.

2021-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: minimise static variable usage in qual_fault.c.
        * tests/qual_fault.c (first, last, step, iter, try): Remove.
        (invoke): Declare try as a static variable.
        (main): Declare first, last, step, iter variables.

2021-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: print iteration number in error messages in qual_fault.c.
        To aid diagnosing possible issues.

        * tests/qual_fault.c (invoke): Accept iteration number as the first
        argument; print it in the beginning of error messages.
        (main): Pass i to invoke call in the first argument.

2021-09-03  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.14-1.
        * strace.spec.in: Likewise.

2021-09-02  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.14 release.
        * NEWS: Update for 5.14 release.

2021-09-01  Dmitry V. Levin  <ldv@strace.io>

        ci: use kernel headers from Linux kernel v5.14.
        When Linux kernel merge window opens, changes of all sorts start to pour
        down, breaking UAPI in various ways.  This does not work for strace,
        we need a stable UAPI.

        This change repeats commit v5.8~1.

        * .github/workflows/ci.yml (env): Add KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2021-08-31  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2021-08-30  Dmitry V. Levin  <ldv@strace.io>

        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:]]' src tests |grep -v '\.sh$') |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: reduce thoroughness of qual_fault's when= check.
        The addition of the third inner loop to qual_fault test has pushed
        the test's execution time to the hight tens of seconds even on machines
        with fast fork/exec.  Let's reduce its thoroughness a bit by reducing
        the number of variants of first/last/step values being checked from six
        down to four;  that should decrease the number of check_fault_injection
        calls from 3040 down to 1200, a circa two-and-a-half-fold reduction.

        * tests/qual_fault.test: Remove two elements from each of the iteration
        lists for F, L, and S variables.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Call get_proc_pid instead of translate_pid where only proc_pid is needed
        That makes the code a bit simpler.

        * src/pathtrace.c (getfdpath_pid): Assign get_proc_pid result
        to proc_pid instead of passing the latter to the translate_pid call.
        * src/secontext.c (selinux_getpidcon, selinux_getfdcon,
        selinux_getfilecon): Likewise.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Pass PID instead of TCB pointer to get_proc_pid.
        This allows its use for use cases where we do not have TCB setup
        for a PID to get /proc name for.

        * src/defs.h (get_proc_pid): Accept pid instead of tcp.
        * src/pidns.c (get_proc_pid): Accept pid instead of tcp, pass pid
        instead of tcp->pid to the translate_pid call.
        * src/mmap_cache.c (mmap_cache_rebuild_if_invalid): Pass tcp->pid
        instead of tcp to the get_proc_pid call.
        * src/strace.c (attach_tcb): Likewise.
        * src/util.c (getfdproto): Likewise.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util, pidns: generalise get_id_list.
        The parsing code implemented in it can be easily utilised for reading
        other /proc/pid/status fields (Uid/Gid, for example), so let's move it
        to util.c and make more generic.

        * src/defs.h (proc_status_get_id_list): New declaration.
        * src/util.c (proc_status_get_id_list): New function.
        * src/pidns.c (get_id_list): Implement as a proc_status_get_id_list
        wrapper.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: make ptrace_attach_cmd local.
        Returning information from a function via a global variable is rather
        distasteful;  moreover, wasting a pointer worth of memory for a variable
        used for error reporting is quite wasteful.

        * src/strace.c (ptrace_attach_cmd): Remove.
        (ptrace_attach_or_seize): Add ptrace_attach_cmd argument, assign cmd
        string literal to a pointer pointed by it.
        (attach_tcb, startup_child): Add ptrace_attach_cmd local variable,
        pass it to ptrace_attach_or_seize.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add prlimit64-success and prlimit64-success--pidns-translation.
        These may be useful in cases where prlimit64 syscall is not available.

        * tests/.gitignore: Add prlimit64-success
        and prlimit64-success--pidns-translation.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (prlimit64-success,
        prlimit64-success--pidns-translation): New tests.
        * tests/prlimit64-success--pidns-translation.c: New file.
        * tests/prlimit64-success.c: Likewise.
        * tests/prlimit64.c: Update to accomodate output when return value
        is injected.

2021-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        filter_qualify: fix indentation in check_inadvertent_fault_injection.
        * src/filter_qualify.c (check_inadvertent_fault_injection): De-indent.

        Complements: v5.13-74-gb0dc9a1b3 "filter_qualify: factor out inadvertent fault injection check routine"

2021-08-25  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.14.
        * src/linux/32/ioctls_inc_align16.h: Update from linux
        v5.14-rc7-11-g6e764bcd1cf7 using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: call setsockopt directly in sockopt-timestamp.
        While commit v5.13-10-g0211fdc "tests: change sockopt-timestamp test to
        use syscall(__NR_recvmsg)" has fixed issues with glibc-induced mangling
        on newer kernels, the combination of an older kernel and new glibc still
        causes issues, as glibc silently falls back to SO_TIMESTAMP{,NS}_OLD,
        as implemented in glibc-2.34~294 "linux: Add fallback for 64-bit time_t
        SO_TIMESTAMP{NS}".  Avoid that by calling setsockopt directly as well.

        * tests/sockopt-timestamp.c (SC_setsockopt): New macro constant.
        (k_setsockopt): New function.
        (test_sockopt): Call k_setsockopt instead of setsockopt.

        Complements: v5.13-10-g0211fdc "tests: change sockopt-timestamp test to use syscall(__NR_recvmsg)"

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        filter_qualify: factor out inadvertent fault injection check routine.
        Move out a rather finicky inadvertent fault injection check
        in an attempt to make the humongous parse_inject_token function
        a bit more comprehensible.

        * src/filter_qualify.c (check_inadvertent_fault_injection): New
        function, factored out from...
        (parse_inject_token): ...here.  Call check_inadvertent_fault_injection.

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/unwind.c: avoid including libiberty.h.
        libiberty.h header that is pulled in by demangle.h is troublesome:
        it defines some macros and symbols that are also defined in strace's
        headers;  since the definitions from there are not actually needed
        by neither unwind.c nor demangle.h, let's try to avoid its inclusion
        by defining its header guard.

        * src/unwind.c [USE_DEMANGLE] (LIBIBERTY_H): Define.

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: fix whitespace alignment for INJECT_F_SIGNAL and INJECT_F_RETVAL
        * src/defs.h (INJECT_F_SIGNAL, INJECT_F_RETVAL): Fix spacing between
        the name and the value to align with other declarations.

        Complements: v5.0~98 "Fix preprocessor indentation"

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1.in: rewrite simultaneous signal and retval/error injection part
        It might as well be a bit clearer this way.

        * doc/strace.1.in (.SS Tampering): Rewrite description of the behaviour
        when both signal and retval/error injection are employed.

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src: use xobjdup/xarraydup.
        * src/mmap_cache.c (mmap_cache_rebuild_if_invalid): Use xobjdup to
        duplicate mmap cache.
        * src/sg_io_v3.c (decode_request): Use xobjdup to copy sg_io
        into entering_sq_io.
        * src/sg_io_v4.c (decode_request): Likewise.
        * src/strace.c (copy_trace_wait_data): Use xopbjdup to duplicate wd.
        * src/syscall.c (tamper_with_syscall_entering): Use xarraydup
        to duplicate inject_vec.

2021-08-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xmalloc: add xmemdup and xarraydup utility functions.
        There are multiple instances of using pair of x*alloc and memcpy calls
        to duplicate an entity;  sometimes they even utilise xcalloc and perform
        unnecessary zeroing of the memory.  Implement a separate routine
        that allows more compact code.

        * src/xmalloc.h (xmemdup, xarraydup): New declarations.
        (xobjdup): New macro, a wrapper for xmemdup.
        * src/xmalloc.c (xmemdup, xarraydup): New functions.

2021-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall: use xallocarray instead of xcalloc for an array to be copied over
        * src/syscall.c (tamper_with_syscall_entering): Allocate
        tcp->inject_vec[current_personality] with xallocarray
        instead of xcalloc, as it is to be overwritten by memcpy.

        doc/strace.1.in: mention poke_enter/poke_exit as valid inject actions.
        * doc/strace.1.in (.SS Tampering): Add poke_enter and poke_exit
        to the list of actions of which at least one hast to be specified.

2021-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        trie: optimise fill_value calculation.
        A closer look at the fill_value calculation code revealed that it
        was not implemented in an expected way: instead of doubling the shift
        and bitwise-OR'ing with itself, it bitwise-OR's with the original value,
        which led to 64/item_size iterations instead of 6 - item_size_lg;
        so, let's prematurely optimise this code further.

        * src/trie.c (trie_create): Rewrite fill_value field calculation.

2021-08-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tee: rewrite num_params access in tee_fetch_buf_data.
        Pointer to num_params field of the fetched structure is passed in a
        separate function argument which provokes covscan complaints about
        uninitialised accesses and also tingles my aliasing rules senses.
        Rewrite to access it via the arg_struct argument which is fetched
        earlier in the function flow.

        * src/tee.c (TEE_FETCH_BUF_DATA): Change &arg_.num_params
        to offsetof(typeof(arg_), num_params).
        (tee_fetch_buf_data): Accept offset of the num_params field instead
        of pointer to it; reconstruct the num_params pointer using it.

2021-08-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc/strace.1.in: tfix.
        doc/strace.1.in: Remove an excess space character
        in "\-\-summary\-syscall\-overhead".

2021-08-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        signal: simplify an expression for calculating signal mask size a bit.
        With all the cool macros we have now it can be rewritten into something
        a bit more comprehensible and easier to read.

        * src/signal.c (sprintsigmask_n): Rewrite size calculation using
          ROUNDUP_DIV and MIN.

2021-08-19  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.14.
        * src/linux/32/ioctls_inc_align16.h: Update from linux v5.14-rc6
        using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/aarch64/ioctls_arch0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/mips/ioctls_arch0.h: Likewise.
        * src/linux/powerpc/ioctls_arch0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.14-rc6.
        * maint/ioctls_sym.sh (x86_list): Add KVM_[SG]ET_SREGS2 ioctls.

2021-08-19  Dmitry V. Levin  <ldv@strace.io>

        tests: replace AUDIO_STOP with NET_REMOVE_IF in ioctl_ubi test.
        Do not use constants defined in <linux/dvb/audio.h> as the latter was
        moved to staging by Linux kernel commit v5.14-rc1~165^2~129.

        * tests/ioctl_ubi.c (main): Replace AUDIO_STOP with NET_REMOVE_IF.

2021-08-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        trie: cache fill_value value instead of calculating it each time.
        trie_create_data_block may be a rather hot function if a trie is actively
        used;  it seems wasteful to re-calculate fill_value each time a new data
        block is allocated, considering the fact that it, as well as empty_value,
        remains constant after the trie creation.  Let's prematurely optimise it
        by pre-calculating the value in trie_create.

        * src/trie.h (struct trie): Add fill_value field.
        * src/trie.c (trie_create_data_block): Move fill_value calculation...
        (trie_create): ...here, assign it to the fill_value field.

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        trie: use BIT* and MASK* macros.
        This makes reading the code a bit easier.  It also solves some issues
        where there is a hypothertical possibility of having bit shifts of size
        64, by virtue of using the *_SAFE macros (that should silence some
        reported "left shifting by more than 63 bits has undefined behavior"
        covscan issues).

        * src/trie.c (trie_create): Use BIT32, MASK64.
        (trie_create_data_block): Use BIT32, change iterator variable type
        to size_t.
        (trie_get_node): Use BIT64, MASK64.
        (trie_data_block_calc_pos): Use BIT32, MASK64, MASK64_SAFE.
        (trie_iterate_keys_node): Use BIT64, MASK64, MASK64_SAFE.
        (trie_free_node): Use BIT64.

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pidns: remove the remaining leftover mention of btree.
        It was an original (incorrect) name of the supporting structure;
        see also [1].

        [1] https://lists.strace.io/pipermail/strace-devel/2020-June/009805.html

        * src/pidns.c (ns_pid_to_proc_pid): Fix the comment.

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        macros: expand BIT macros, add MASK macros; add *_SAFE macros.
        These macros might make reading a code that often converts between powers
        of 2 and values/masks a bit easier;  moreover, the *_SAFE versions should
        help in cases where the shift values are expected to be equal to the type
        bit width (which lead to UB otherwise).

        Switching from BIT to BIT32 should also clarify bitness, which may be somewhat
        murky at times (cf. printxval, printflags, and printxvals).

        * src/macros.h [!BIT] (BIT): Rename to...
        [!BIT32] (BIT32): ...this.
        [!BIT64] (BIT64): New macro.
        [!MASK32] (MASK32): Likewise.
        [!MASK64] (MASK64): Likewise.
        (BIT32_SAFE, BIT64_SAFE, MASK32_SAFE, MASK64_SAFE): New macros.
        (FLAG): Use BIT32.

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        filter_qualify: free allocated data on the error path exit of parse_poke_token
        While not terribly required due to the fact that issues with option
        parsing lead to program termination, these changes avoid leaking data
        allocated in the function's scope and not stored elsewhere, which might
        come handy if it ever be used dynamically during the runtime.

        This also has been reported as resource leaks by covscan, and these
        changes should calm it.

        * src/filter_qualify.c (parse_poke_token): Go to err label instead of
        returning right away; free poke->data, poke, and str_tokenized before
        returning false.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1995509

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add prctl(PR_SET_PTRACER) tests.
        * tests/.gitignore: Add prctl-set-ptracer-success,
        prctl-set-ptracer-success-Xabbrev, prctl-set-ptracer-success-Xraw,
        prctl-set-ptracer-success-Xverbose,
        prctl-set-ptracer-success--pidns-translation,
        prctl-set-ptracer-success-Xabbrev--pidns-translation,
        prctl-set-ptracer-success-Xraw--pidns-translation,
        and prctl-set-ptracer-success-Xverbose--pidns-translation.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (prctl-set-ptracer-success,
        prctl-set-ptracer-success-Xabbrev, prctl-set-ptracer-success-Xraw,
        prctl-set-ptracer-success-Xverbose,
        prctl-set-ptracer-success--pidns-translation,
        prctl-set-ptracer-success-Xabbrev--pidns-translation,
        prctl-set-ptracer-success-Xraw--pidns-translation,
        prctl-set-ptracer-success-Xverbose--pidns-translation): New tests.
        * tests/prctl-set-ptracer-success--pidns-translation.c: New file.
        * tests/prctl-set-ptracer-success-Xabbrev--pidns-translation.c: Likewise.
        * tests/prctl-set-ptracer-success-Xabbrev.c: Likewise.
        * tests/prctl-set-ptracer-success-Xraw--pidns-translation.c: Likewise.
        * tests/prctl-set-ptracer-success-Xraw.c: Likewise.
        * tests/prctl-set-ptracer-success-Xverbose--pidns-translation.c: Likewise.
        * tests/prctl-set-ptracer-success-Xverbose.c: Likewise.
        * tests/prctl-set-ptracer-success.c: Likewise.

2021-08-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_SCHED_CORE op decoding.
        Introduced by Linux commit v5.14-rc1~6^2~50.

        * src/xlat/pr_sched_core_cmds.in: New file.
        * src/xlat/pr_sched_core_pidtypes.in: Likewise.
        * src/xlat/prctl_options.in (PR_SCHED_CORE): New constant.
        * src/prctl.c: Include "xlat/pr_sched_core_cmds.h",
        "xlat/pr_sched_core_pidtypes.h".
        (SYS_FUNC(prctl)) <case PR_SCHED_CORE>: Implement decoding.
        * tests/prctl-sched-core--pidns-translation-Xabbrev.c: New file.
        * tests/prctl-sched-core--pidns-translation-Xraw.c: Likewise.
        * tests/prctl-sched-core--pidns-translation-Xverbose.c: Likewise.
        * tests/prctl-sched-core--pidns-translation.c: Likewise.
        * tests/prctl-sched-core-Xabbrev.c: Likewise.
        * tests/prctl-sched-core-Xraw.c: Likewise.
        * tests/prctl-sched-core-Xverbose.c: Likewise.
        * tests/prctl-sched-core-success--pidns-translation-Xabbrev.c: Likewise.
        * tests/prctl-sched-core-success--pidns-translation-Xraw.c: Likewise.
        * tests/prctl-sched-core-success--pidns-translation-Xverbose.c: Likewise.
        * tests/prctl-sched-core-success--pidns-translation.c: Likewise.
        * tests/prctl-sched-core-success-Xabbrev.c: Likewise.
        * tests/prctl-sched-core-success-Xraw.c: Likewise.
        * tests/prctl-sched-core-success-Xverbose.c: Likewise.
        * tests/prctl-sched-core-success.c: Likewise.
        * tests/prctl-sched-core.c: Likewise.
        * tests/.gitignore: Add prctl-sched-core, prctl-sched-core-Xabbrev,
        prctl-sched-core-Xraw, prctl-sched-core-Xverbose,
        prctl-sched-core--pidns-translation,
        prctl-sched-core--pidns-translation-Xabbrev,
        prctl-sched-core--pidns-translation-Xraw,
        prctl-sched-core--pidns-translation-Xverbose,
        prctl-sched-core-success, prctl-sched-core-success-Xabbrev,
        prctl-sched-core-success-Xraw, prctl-sched-core-success-Xverbose,
        prctl-sched-core-success--pidns-translation,
        prctl-sched-core-success--pidns-translation-Xabbrev,
        prctl-sched-core-success--pidns-translation-Xraw,
        and prctl-sched-core-success--pidns-translation-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add
        prctl-sched-core--pidns-translation,
        prctl-sched-core--pidns-translation-Xabbrev,
        prctl-sched-core--pidns-translation-Xraw,
        prctl-sched-core--pidns-translation-Xverbose,
        prctl-sched-core-success, prctl-sched-core-success-Xabbrev,
        prctl-sched-core-success-Xraw, prctl-sched-core-success-Xverbose,
        prctl-sched-core-success--pidns-translation,
        prctl-sched-core-success--pidns-translation-Xabbrev,
        prctl-sched-core-success--pidns-translation-Xraw,
        and prctl-sched-core-success--pidns-translation-Xverbose.
        * tests/gen_tests.in (prctl-sched-core, prctl-sched-core-Xabbrev,
        prctl-sched-core-Xraw, prctl-sched-core-Xverbose,
        prctl-sched-core--pidns-translation,
        prctl-sched-core--pidns-translation-Xabbrev,
        prctl-sched-core--pidns-translation-Xraw,
        prctl-sched-core--pidns-translation-Xverbose,
        prctl-sched-core-success, prctl-sched-core-success-Xabbrev,
        prctl-sched-core-success-Xraw, prctl-sched-core-success-Xverbose,
        prctl-sched-core-success--pidns-translation,
        prctl-sched-core-success--pidns-translation-Xabbrev,
        prctl-sched-core-success--pidns-translation-Xraw,
        and prctl-sched-core-success--pidns-translation-Xverbose): New tests.
        * tests/pure_executables.list: Add prctl-sched-core,
        prctl-sched-core-Xabbrev, prctl-sched-core-Xraw,
        and prctl-sched-core-Xverbose.

2021-08-17  Dmitry V. Levin  <ldv@strace.io>

        tests: use prctl_marker.
        * tests/prctl-arg2-intptr.c (main): Use prctl_marker.
        * tests/prctl-cap-ambient.c: Likewise.
        * tests/prctl-capbset.c: Likewise.
        * tests/prctl-dumpable.c: Likewise.
        * tests/prctl-fp-mode.c: Likewise.
        * tests/prctl-mce-kill.c: Likewise.
        * tests/prctl-name.c: Likewise.
        * tests/prctl-no-args.c: Likewise.
        * tests/prctl-pac-enabled-keys.c: Likewise.
        * tests/prctl-pac-reset-keys.c: Likewise.
        * tests/prctl-pdeathsig.c: Likewise.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/prctl-securebits.c: Likewise.
        * tests/prctl-spec-inject.c: Likewise.
        * tests/prctl-sve.c: Likewise.
        * tests/prctl-syscall-user-dispatch.c: Likewise.
        * tests/prctl-tagged-addr.c: Likewise.
        * tests/prctl-tid_address.c: Likewise.
        * tests/prctl-tsc.c: Likewise.
        * tests/prctl-unalign.c: Likewise.

2021-08-17  Dmitry V. Levin  <ldv@strace.io>

        tests: introduce prctl_marker.
        This helper invokes a prctl syscall with very specific arguments for use
        as a marker.

        * tests/prctl_marker.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add prctl_marker.c.
        * tests/tests.h (prctl_marker): New prototype.

2021-08-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/prctl-success.sh: match strace output with -a value more than 79.
        For some tests it is instructive to set -a to value more than 79; the
        issue is that this alignment width is more than the marker output, which
        leads to a match failure.  To avoid that, allow for arbitrary number
        of spaces before the syscall return value.

        * tests/prctl-success.sh: Relax the regular expression to allow
        for arbitrary (non-zero) number of spaces.

        Complements: v5.13-49-g6f0be228b "tests/prctl.sh: match strace output with -a value more than 79"

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/prctl.sh: match strace output with -a value more than 79.
        For some tests it is instructive to set -a to value more than 79; the
        issue is that this alignment width is more than the marker output, which
        leads to a match failure.  To avoid that, allow for arbitrary number
        of spaces before the syscall return value.

        * tests/prctl.sh: Relax the regular expression to allow for arbitrary
        (non-zero) number of spaces.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move scno tampering check to init.sh.
        And convert it to a function.

        * tests/init.sh (check_scno_tampering): New funtion, move the body
        from...
        * tests/scno_tampering.sh: ...here; call check_scno_tampering.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: print PR_SET_PTRACER_ANY numerical value as int.
        While it is declared as (unsigned long)-1, there's little sense to print
        it as it is, since the comparison is ultimately done against arg2 casted
        to int.

        * src/prctl.c (SYS_FUNC(prctl)) <case PR_SET_PTRACER>: Cast arg2 to int
        when passing to print_xlat_ex; use XLAT_STYLE_FMT_D style.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: convert prctl-fp-mode and prctl-spec-inject into generated tests.
        And also avoid injecting values into prctl() calls issued by libc during
        process startup.

        * tests/Makefile.am (DECODER_TESTS): Remove prctl-fp-mode.test
        and prctl-spec-inject.test.
        * tests/gen_tests.in (prctl-fp-mode, prctl-spec-inject): New tests.
        * tests/prctl-fp-mode.test: Remove.
        * tests/prctl-spec-inject.test: Likewise.
        * tests/prctl-fp-mode.c: Implement injected return value locking sequence.
        * tests/prctl-spec-inject.c: Likewise.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/prctl-success.sh: support error injection.
        * tests/prctl-success.sh: properly construct strace arguments and sed
        expression if an item that begins with "error=" occurs in PRCTL_INJECT_RETVALS.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_PAC_[GS]ET_ENABLED_KEYS ops decoding.
        Introduced by Linux commit v5.13-rc1~17^2~18^2~1.

        * src/xlat/pr_pac_enabled_keys.in: New file.
        * src/xlat/pr_pac_keys.in (PR_PAC_APIAKEY, PR_PAC_APIBKEY,
        PR_PAC_APDAKEY, PR_PAC_APDBKEY): Remove entries that moved
        to src/xlat/pr_pac_enabled_keys.in.
        * src/prctl.c: Include "xlat/pr_pac_enabled_keys.h".
        (SYS_FUNC(prctl)) <case PR_PAC_SET_ENABLED_KEYS, case PR_PAC_GET_ENABLED_KEYS>:
        Implement decoding.
        (SYS_FUNC(prctl)) <case PR_PAC_RESET_KEYS>: Call printflags_ex with both
        pr_pac_enabled_keys and pr_pac_keys.
        * tests/.gitignore: Add prctl-pac-enabled-keys, prctl-pac-enabled-keys-Xabbrev,
        prctl-pac-enabled-keys-Xraw, prctl-pac-enabled-keys-Xverbose,
        prctl-pac-enabled-keys-success, prctl-pac-enabled-keys-success-Xabbrev,
        prctl-pac-enabled-keys-success-Xraw,
        and prctl-pac-enabled-keys-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-pac-enabled-keys-success,
        prctl-pac-enabled-keys-success-Xabbrev,
        prctl-pac-enabled-keys-success-Xraw,
        and prctl-pac-enabled-keys-success-Xverbose.
        * tests/prctl-pac-enabled-keys-Xabbrev.c: New file.
        * tests/prctl-pac-enabled-keys-Xraw.c: Likewise.
        * tests/prctl-pac-enabled-keys-Xverbose.c: Likewise.
        * tests/prctl-pac-enabled-keys-success-Xabbrev.c: Likewise.
        * tests/prctl-pac-enabled-keys-success-Xraw.c: Likewise.
        * tests/prctl-pac-enabled-keys-success-Xverbose.c: Likewise.
        * tests/prctl-pac-enabled-keys-success.c: Likewise.
        * tests/prctl-pac-enabled-keys.c: Likewise.
        * tests/gen_tests.in (prctl-pac-enabled-keys, prctl-pac-enabled-keys-Xabbrev,
        prctl-pac-enabled-keys-Xraw, prctl-pac-enabled-keys-Xverbose,
        prctl-pac-enabled-keys-success, prctl-pac-enabled-keys-success-Xabbrev,
        prctl-pac-enabled-keys-success-Xraw, prctl-pac-enabled-keys-success-Xverbose):
        New tests.
        * tests/pure_executables.list: Add prctl-pac-enabled-keys,
        prctl-pac-enabled-keys-Xabbrev, prctl-pac-enabled-keys-Xraw,
        and prctl-pac-enabled-keys-Xverbose.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: use SPFF_AUXSTR_MODE for ops that use sprintflags for auxstr.
        and also return RVAL_HEX flag in addition to RVAL_STR.

        * src/prctl.c (SYS_FUNC(prctl)) <case PR_GET_SECUREBITS,
        case PR_GET_FP_MODE, case PR_GET_SPECULATION_CTRL>: Use sprintflags_ex,
        pass SPFF_AUXSTR_MODE flag, return RVAL_HEX flag in addition to
        RVAL_STR.
        * tests/prctl-fp-mode.c: Update expected output.
        * tests/prctl-securebits.c: Likewise.
        * tests/prctl-spec-inject.c: Likewise.
        * tests/prctl-spec-inject.test: Add check for the injected value of 32.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add prctl-securebits-success* tests.
        * tests/.gitignore: Add prctl-securebits-success,
        prctl-securebits-success-Xabbrev, prctl-securebits-success-Xraw,
        and prctl-securebits-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in(prctl-securebits-success,
        prctl-securebits-success-Xabbrev, prctl-securebits-success-Xraw,
        prctl-securebits-success-Xverbose): New tests.
        * tests/prctl-securebits-success-Xabbrev.c: New file.
        * tests/prctl-securebits-success-Xraw.c: Likewise.
        * tests/prctl-securebits-success-Xverbose.c: Likewise.
        * tests/prctl-securebits-success.c: Likewise.
        * tests/prctl-securebits.c: Add injected-based and xlat-verbosity-varied
        checks support.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add auxval mode to sprintflags_ex.
        sprintflags is often used to decode flag set returned by a syscall; it,
        however, looks somewhat ugly when collided with xlat styles (and even
        without it, somewhat superfluous[1] when values that do not match any flags
        are printed).  Introduce a special mode that makes sprintflags output
        more akin to XLAT_STYLE_VERBOSE comment (except when XLAT_STYLE_RAW
        is used).

        [1] It may be seen useful as the default return value format is decimal
            and sprintflags uses hex, but at least fcntl always prints flags in
            return values as RVAL_HEX anyway.

        * src/defs.h (enum xlat_style_private_flag_bits) <SPFF_AUXSTR_MODE_BIT>:
        New flag bit.
        (enum xlat_style_private_flags) <SPFF_AUXSTR_MODE>: New flag.
        * src/xlat.c (sprintflags_ex): Handle SPFF_AUXSTR_MODE flag in style.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_[GS]ET_TAGGED_ADDR_CTRL op decoding.
        Introduced by Linux commit v5.4-rc1~100^2~6^9~8 and extended in Linux
        commits v5.10-rc1~49^2~9^2~12 and v5.10-rc1~49^2~9^2~11.

        * src/xlat/pr_tagged_addr_enable.in: New file.
        * src/xlat/pr_tagged_addr_mte_tcf.in: Likewise.
        * src/prctl.c: Include "xlat/pr_tagged_addr_enable.h" and
        "xlat/pr_tagged_addr_mte_tcf.h".
        (sprint_tagged_addr_val): New function.
        (SYS_FUNC(prctl)) <case PR_SET_TAGGED_ADDR_CTRL, case PR_GET_TAGGED_ADDR_CTRL>:
        Implement arg2/retval decoding.
        * tests/.gitignore: Add prctl-tagged-addr, prctl-tagged-addr-Xabbrev,
        prctl-tagged-addr-Xraw, prctl-tagged-addr-Xverbose, prctl-tagged-addr-success,
        prctl-tagged-addr-success-Xabbrev, prctl-tagged-addr-success-Xraw,
        and prctl-tagged-addr-success-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-tagged-addr-success,
        prctl-tagged-addr-success-Xabbrev, prctl-tagged-addr-success-Xraw,
        and prctl-tagged-addr-success-Xverbose.
        (EXTRA_DIST): Add prctl-success.sh.
        * tests/gen_tests.in (prctl-tagged-addr, prctl-tagged-addr-Xabbrev,
        prctl-tagged-addr-Xraw, prctl-tagged-addr-Xverbose, prctl-tagged-addr-success,
        prctl-tagged-addr-success-Xabbrev, prctl-tagged-addr-success-Xraw,
        prctl-tagged-addr-success-Xverbose): New tests.
        * tests/prctl-no-args.c (main) <options>: Remove
        PR_GET_TAGGED_ADDR_CTRL.
        * tests/prctl-success.sh: New file.
        * tests/prctl-tagged-addr-Xabbrev.c: Likewise.
        * tests/prctl-tagged-addr-Xraw.c: Likewise.
        * tests/prctl-tagged-addr-Xverbose.c: Likewise.
        * tests/prctl-tagged-addr-success-Xabbrev.c: Likewise.
        * tests/prctl-tagged-addr-success-Xraw.c: Likewise.
        * tests/prctl-tagged-addr-success-Xverbose.c: Likewise.
        * tests/prctl-tagged-addr-success.c: Likewise.
        * tests/prctl-tagged-addr.c: Likewise.
        * tests/pure_executables.list: Add prctl-tagged-addr, prctl-tagged-addr-Xabbrev,
        prctl-tagged-addr-Xraw, and prctl-tagged-addr-Xverbose.

2021-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: call read with "-r" option.
        There is no need to support backslashes interpretation and the xlat
        input is somewhat user-provided, so it is better to safeguard it a bit.

        * src/xlat/gen.sh: Call read with "-r" option.

2021-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/Makefile.am: whitespace fixes.
        * src/Makefile.am (libstrace_a_SOURCES, EXTRA_DIST): Remove spaces
        before tabs.

2021-08-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: silence clang's complaints about "tautological constant compares"
        For some reason, it complaints about not necessarily meaningful calculations
        stemmed from macro expansions, which seems overly zealous.

        * src/gcc_compat.h (DIAG_PUSH_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE,
        DIAG_POP_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE): New macros.
        * src/xlat/gen.sh: Add DIAG_PUSH_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE/
        DIAG_POP_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE pair around xlat array
        definition.

2021-08-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: print PR_SET_PTRACER as PID.
        * src/prctl.c (SYS_FUNC(prctl)) <case PR_SET_PTRACER>: Print
        non-negative arg2 as TGID.

2021-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/tests.h: introduce XLAT_FMT_LL.
        For the cases when argument is 64-bit (unsigned long long is assumed
        in these cases).

        * tests/tests.h (XLAT_FMT_LL): New macro.

2021-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/prctl.sh: enable usage with -Xraw.
        * tests/prctl.sh: Make " \/\* PR_??? \*\/" part optional so it can be
        used with -Xraw tests.

2021-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xstring: allow xsnprintf/xsprintf calls without format arguments.
        This is useful for the cases when xappendstr if used without format
        arguments.

        * src/xstring.h (xsnprintf, xsnprintf): Use "##__VA_ARGS__" instead
        of "__VA_ARGS__" to glue it to the comma.

2021-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: enable symbolic constants that start with "!"
        That allows defining symbolic constants that are negations of other
        constants.

        * src/xlat/gen.sh (gen_header) <2nd pass>: Allow "!" to start a symbolic
        constant.

2021-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_PAC_RESET_KEYS decoding.
        Introduced by Linux commit v5.0-rc1~35^2~19.

        * src/xlat/pr_pac_keys.in: New file.
        * src/prctl.c: Include "xlat/pr_pac_keys.h".
        (SYS_FUNC(prctl)) <case PR_PAC_RESET_KEYS>: Implement decoding.
        * tests/prctl-pac-reset-keys.c: New file.
        * tests/.gitignore: Add prctl-pac-reset-keys.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (prctl-pac-reset-keys): New test.

2021-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement PR_SET_SYSCALL_USER_DISPATCH op decoding.
        Introduced by Linux commit v5.11-rc1~180^2~9.

        * src/xlat/pr_sud_cmds.in: New file.
        * src/prctl.c: Include "xlat/pr_sud_cmds.h".
        (SYS_FUNC(prctl)): Remove #ifdef __ANDROID__ guard around arg4 and arg5
        definitions.
        (SYS_FUNC(prctl)) <case PR_SET_SYSCALL_USER_DISPATCH>: New decoder.
        * NEWS: Mention this.
        * tests/prctl-syscall-user-dispatch.c: New file.
        * tests/.gitignore: Add prctl-syscall-user-dispatch.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (prctl-syscall-user-dispatch): New test.
        (prctl-*): Fix whitespace.

2021-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_mdb: decode MDBA_ROUTER_PATTR_INET{,6}_TIMER attributes.
        Introduced by Linux commit v5.14-rc1~119^2~549^2~1.

        * src/rtnl_mdb.c (mdba_router_pattr_nla_decoders)
        <[MDBA_ROUTER_PATTR_INET_TIMER], [MDBA_ROUTER_PATTR_INET6_TIMER]>: New
        docedors, call decode_nla_u32.
        * src/xlat/rtnl_mdba_router_pattr_attrs.in
        (MDBA_ROUTER_PATTR_INET_TIMER, MDBA_ROUTER_PATTR_INET6_TIMER): New
        constants.
        * NEWS: Mention this.
        * tests/nlattr_mdba_router_port.c: Add checks.

2021-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update MOUNT_ATTR_* constants.
        * src/xlat/mount_attr_attr.in (MOUNT_ATTR_NOSYMFOLLOW): New constant,
        introduced by Linux commit v5.14-rc1~139^2~1.
        * NEWS: Mention this.
        * tests/mount_setattr.c (main): Update expected output.

2021-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink: decode NFNL_SUBSYS_HOOK message types and flags.
        Introduced by Linux commit v5.14-rc1~119^2~257^2~4.

        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_hook.h: New file,
        copied from headers_install'ed Linux kernel v5.14-rc4.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/xlat/nf_hook_msg_types.in: New file.
        * src/xlat/nl_netfilter_subsys_ids.in (NFNL_SUBSYS_HOOK): New constant.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_hook.h> and
        "xlat/nf_hook_msg_types.h".
        (nf_nlmsg_types) <[NFNL_SUBSYS_HOOK]>: New record.
        (decode_nlmsg_flags_netfilter) <case NFNL_SUBSYS_HOOK>: Provide flags
        for NFNL_MSG_HOOK_GET.

2021-08-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: decode IFLA_PARENT_DEV{,_BUS}_NAME attributes.
        Introduced by Linux commit v5.14-rc1~119^2~191^2~2.

        * src/rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_PARENT_DEV_NAME],
        [IFLA_PARENT_DEV_BUS_NAME]>: New decoders, call decode_nla_str.
        * src/xlat/rtnl_link_attrs.in (IFLA_PARENT_DEV_NAME,
        IFLA_PARENT_DEV_BUS_NAME): New constants.
        * tests/nlattr_ifinfomsg.c: Add checks.

2021-08-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: implement IFLA_PROTO_DOWN_REASON attribute decoding.
        IFLA_PROTO_DOWN_REASON is a nested attribute introduced by Linux commit
        v5.9-rc1~133^2~77.

        * src/xlat/rtnl_ifla_proto_down_reason_attrs.in: New file.
        * src/rtnl_link.c: Include "xlat/rtnl_ifla_proto_down_reason_attrs.h".
        (ifla_proto_down_reason_nla_decoders): New decoder table.
        (decode_ifla_proto_down_reason): New function.
        (ifinfomsg_nla_decoders) <[IFLA_PROTO_DOWN_REASON]>: New decoder,
        calls decode_ifla_proto_down_reason.
        * NEWS: Mention this.
        * tests/nlattr_ifla_proto_down_reason.c: New file.
        * tests/.gitignore: Add nlattr_ifla_proto_down_reason.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (nlattr_ifla_proto_down_reason): New test.

2021-08-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update BPF_* constants.
        * src/xlat/bpf_attach_type.in (BPF_SK_REUSEPORT_SELECT,
        BPF_SK_REUSEPORT_SELECT_OR_MIGRATE): New constants, introduced by Linux
        commit v5.14-rc1~119^2~135^2~7^2~2.
        * src/xlat/bpf_prog_types.in (BPF_PROG_TYPE_SYSCALL): New constant,
        introduced by Linux commit v5.14-rc1~119^2~501^2~2^2~20.
        * NEWS: Mention this.
        * tests/bpf.c: Update the relevant checks.

        xlat: update IORING_* constants.
        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_IOWQ_AFF,
        IORING_UNREGISTER_IOWQ_AFF): New constants, introduced by Linux commit
        v5.14-rc1~115^2~31.
        * NEWS: Mention this.
        * tests/io_uring_register.c: Update invalid ops check.

        xlat: update SCTP_* constants.
        * src/xlat/sock_sctp_options.in (SCTP_PLPMTUD_PROBE_INTERVAL): New
        constant, introduced by Linux commit v5.14-rc1~119^2~56^2~11.
        * NEWS: Mention this.

        xlat: update UFFD_* constants.
        * src/xlat/uffd_api_features.in (UFFD_FEATURE_MINOR_SHMEM): New
        constant, introduced by Linux commit v5.14-rc1~107^2~147.
        * NEWS: Mention this.

        xlat: update MADV_* constants.
        * src/xlat/madvise_cmds.in (MADV_POPULATE_READ, MADV_POPULATE_WRITE):
        New constants, introduced by Linux commit v5.14-rc1~107^2~91.
        * NEWS: Mention this.

2021-08-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement memfd_secret syscall decoding.
        Introduced in Linux commit v5.14-rc1~40^2~43.

        * src/memfd_secret.c: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add it.
        * src/linux/generic/syscallent-common.h ([BASE_NR + 447]): New entry.
        * src/pathtrace.c (pathtrace_match_set): Ignore SEN_memfd_secret.
        * src/xlat/fsmagic.in (SECRETMEM_MAGIC): New constant.
        * src/xlat/memfd_secret_flags.in: New file.
        * NEWS: Mention this.
        * tests/Makefile.am (check_PROGRAMS): Add memfd_secret-success
        and memfd_secret-success-y.
        * tests/gen_tests.in (memfd_secret, memfd_secret-success,
        memfd_secret-success-y): New tests.
        * tests/.gitignore: Add them.
        * tests/memfd_secret.c: New file.
        * tests/memfd_secret-success.c: Likewise.
        * tests/memfd_secret-success-y.c: Likewise.
        * tests/pure_executables.list (memfd_secret): New entry.

2021-08-02  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.14-rc4.
        * bundled/linux/include/uapi/linux/btrfs.h: Update to
        headers_install'ed Linux kernel v5.14-rc4.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/linux/include/uapi/linux/if_bridge.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/mount.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_log.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_queue.h: Likewise.
        * bundled/linux/include/uapi/linux/netlink.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/seccomp.h: Likewise.
        * bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/version.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.

2021-08-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: replace simple syscall-tampering-enabled tests with generated ones
        * tests/Makefile.am (DECODER_TESTS): Remove bpf-success.test,
        bpf-success-v.test, clone3-success.test,
        landlock_create_ruleset-success.test, net-tpacket_stats-success.test,
        quotactl-success.test, quotactl-success-v.test,
        quotactl-xfs-success.test, and quotactl-xfs-success-v.test.
        * tests/gen_tests.in (bpf-success, bpf-success-v, clone3-success,
        landlock_create_ruleset-success, net-tpacket_stats-success,
        quotactl-success, quotactl-success-v, quotactl-xfs-success,
        quotactl-xfs-success-v): New tests.
        (clone3-success-Xabbrev, clone3-success-Xraw, clone3-success-Xverbose,
        landlock_create_ruleset-success): Rewrite to generate test directly
        instead of being a wrapper of a respective *-success test.
        * tests/bpf-success.test: Remove.
        * tests/bpf-success-v.test: Likewise.
        * tests/clone3-success.test: Likewise.
        * tests/landlock_create_ruleset-success.test: Likewise.
        * tests/net-tpacket_stats-success.test: Likewise.
        * tests/quotactl-success.test: Likewise.
        * tests/quotactl-success-v.test: Likewise.
        * tests/quotactl-xfs-success.test: Likewise.
        * tests/quotactl-xfs-success-v.test: Likewise.

2021-08-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add special handling for -einject= in gen_tests.sh.
        When a new syscall-tampering-based is added, some amount of boilerplate
        is required, even though these tests are close to generic ones.  Let's
        add a logic that generates appropriate code for tests that include
        "-einject=..." as a first argument.

        * tests/gen_tests.sh <case "$arg0">: Handle "-einject=*" and "--inject=*":
        generate a script that includes "scno_tampering.sh", does not call
        run_prog (within run_strace_match_diff call), but rather a combination
        of run_strace (with prog name passed explicitly) and match_diff.

2021-08-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: handle "-etrace=*" in addition to "-e trace=*" and "--trace=*"
        Adjust the logic that recognises custom syscall tracing sets to include
        "-etrace=..." syntax as well as "-e trace=..." and "--trace=..." in
        order to allow uniform use of -e options within the sets of test
        descriptions.

        * tests/init.sh (run_strace_match_diff, run_strace_match_grep): Handle
        "-etrace=*" in addition to "-e trace=*" and "--trace=*" as a disablement
        of "-e trace=$NAME" heuristics.

2021-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        m4/mpers.m4: generate HAVE_*_SELINUX_RUNTIME config defines.
        While bootstrap has some provisions for mangling HAVE_SELINUX_RUNTIME
        into HAVE_{M32,MX32}_SELINUX_RUNTIME, and there is logic for checking
        SELinux runtime presence in non-native personalities, the relevant
        configuration definition is not ultimately generated, as it has to be
        defined explicitly, similarly to HAVE_*_MPERS.

        * m4/mpers.m4 (st_MPERS) [$st_cv_selinux_runtime == yes]: AC_DEFINE
        HAVE_SELINUX_RUNTIME.

        Complements: v5.12~49 "Implement --secontext[=full] option to display SELinux contexts"

2021-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        m4/mpers.m4: unquote mpers_name in AC_DEFINE.
        When mpers_name is quoted in AC_DEFINE, it is not substituted in the
        generated config.h macro description.

        * m4/mpers.m4 <AC_DEFINE(HAVE_MPERS)>: Do not quote "mpers_name" part.

2021-07-25  Dmitry V. Levin  <ldv@strace.io>

        Implement decoding of quotactl_fd syscall.
        This new syscall was introduced by Linux kernel commit v5.14-rc1~116^2~4.

        * src/quota.c (SYS_FUNC(quotactl_fd)): New function.
        * src/linux/generic/syscallent-common.h [BASE_NR + 441]: Wire up
        quotactl_fd.
        * NEWS: Mention this change.
        * tests/quotactl_fd.c: New file.
        * tests/quotactl_fd-P.c: Likewise.
        * tests/quotactl_fd-y.c: Likewise.
        * tests/gen_tests.in (quotactl_fd, quotactl_fd-P, quotactl_fd-y):
        New entries.
        * tests/pure_executables.list: Add quotactl_fd, quotactl_fd-P,
        and quotactl_fd-y.
        * tests/.gitignore: Likewise.

2021-07-24  Dmitry V. Levin  <ldv@strace.io>

        tests/quotactl.h: remove redundant fallback definition.
        Starting with commit v5.12~236 we can safely assume that PRJQUOTA is
        defined by <linux/quota.h>.

        * tests/quotactl.h [!PRJQUOTA]: Remove.

        Complements: v5.12~236 "Switch to use bundled <linux/quota.h>"

2021-07-23  Dmitry V. Levin  <ldv@strace.io>

        tests: change sockopt-timestamp test to use syscall(__NR_recvmsg)
        Since the glibc recvmsg wrapper became unsuitable for our needs,
        invoke __NR_recvmsg syscall directly.

        * tests/sockopt-timestamp.c: Include "scno.h" and <errno.h>,
        conditionalize on __NR_recvmsg.
        (TEST_OLD_SCM_TIMESTAMPS): Remove.
        (k_recvmsg): New function.
        (test_sockopt): Use it instead of recvmsg.

2021-07-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: additional diagnostics in sockopt-timestamp.
        As of now, it prints only the actual cmsg_level/cmsg_type (that are
        also likely to be print by strace itself) and not the expected ones;
        since it is the purposely incorrect output that is not supposed to
        match, add the expected cmsg_level/cmsg_type as well to aid debugging.

        * tests/sockopt-timestamp.c (test_sockopt): Print expected cmsg_level
        and cmsg_type in an "expected ..." comment.

2021-07-22  Dmitry V. Levin  <ldv@strace.io>

        tests: skip pidns tests when NS_GET_USERNS ioctl is not permitted.
        Treat EPERM as a valid error code for NS_GET_USERNS ioctl.

        * tests/pidns.c (check_ns_ioctl): Skip if NS_GET_USERNS ioctl fails with
        EPERM.

        Resolves: https://github.com/strace/strace/issues/190

2021-07-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/syslog-success.test: remove run_prog call.
        It has no use, as syslog-success never skips (and run_strace is called
        directly, so there is no need in $args variable initialisation), and
        it is actuall harmful, as the test program tries to perform various
        syslog() calls with side effects (those that have been disabled
        in the non-injected test program version).

        * tests/syslog-success.test: Remove run_prog call.

        Reported-by: Anatoly Pugachev <matorola@gmail.com>
        Complements: v5.13~17 "tests: do not call syslog operations with side effects without -e inject"
        Resolves: https://github.com/strace/strace/issues/185

2021-07-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: relax -a check in prlimit64 test.
        The initial "-a48" check was too strict as it has hit some false
        positives on 32-bit arches:

            -prlimit64(15083, RLIMIT_AS, NULL, 0xf7ff4ff0) = -1 ENOSYS (Function not implemented)
            +prlimit64(15083, RLIMIT_AS, NULL, 0xf7ff4ff0)   = -1 ENOSYS (Function not implemented)l

        Reduce it to the theoretical limit - the width of
        "prlimit64(0, RLIMIT_AS, NULL, NULL) " string.
        Also, add the same check to prlimit64--pidns-translation.

        * tests/gen_tests.in (prlimit64, prlimit64--pidns-translation): Set
        alignment check to -a36.

        Fixes: v5.13~13 "tests: use QUIRK:START-OF-TEST-OUTPUT for prlimit64"

2021-07-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move DIAG_PUSH_IGNORE_NONNULL/DIAG_POP_IGNORE_NONNULL outside main
        Otherwise, gcc-4.4.7 (at least) complains:

            preadv.c:69: error: #pragma GCC diagnostic not allowed inside functions
            preadv.c:72: error: #pragma GCC diagnostic not allowed inside functions
            pwritev.c:112: error: #pragma GCC diagnostic not allowed inside functions
            pwritev.c:114: error: #pragma GCC diagnostic not allowed inside functions

        * tests/preadv.c: Move DIAG_PUSH_IGNORE_NONNULL/DIAG_POP_IGNORE_NONNULL
        outside main().
        * tests/pwritev.c: Likewise.

        Complements: v5.13~20 "tests: ignore -Wnonnull in preadv/pwritev tests"

2021-07-21  Dmitry V. Levin  <ldv@strace.io>

        prctl: fix build using bionic libc.
        * src/prctl.c [__ANDROID__ && !PR_SET_VMA] (PR_SET_VMA): Define.
        * NEWS: Mention this.

        Resolves: https://github.com/strace/strace/issues/189

2021-07-20  Dmitry V. Levin  <ldv@strace.io>

        configure: fix formatting of error diagnostics in enable-mpers and enable-stacktrace options
        * configure.ac (AC_ARG_ENABLE([mpers])): Fix AC_MSG_ERROR formatting.
        * m4/st_stacktrace.m4 (AC_ARG_ENABLE([stacktrace])): Likewise.

2021-07-20  Dmitry V. Levin  <ldv@strace.io>

        configure: implement --enable-bundled option.
        This new configure option controls whether bundled linux kernel headers
        are used to build and test strace.  The default is check, that is, use
        bundled linux kernel headers unless they appear to be definitely older
        than those provided by the operating system.

        * configure.ac (AC_ARG_ENABLE([bundled])): New option.

2021-07-19  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.13-1.
        * strace.spec.in: Likewise.

2021-07-18  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.13 release.
        * NEWS: Update for 5.13 release.

2021-07-18  Dmitry V. Levin  <ldv@strace.io>

        build: do not use old bundled linux kernel headers.
        Do not use bundled linux kernel headers when they are definitely older
        than those provided by the operating system.

        * bundled/linux/include/uapi/linux/version.h: New file, copied from
        headers_install'ed Linux kernel v5.13.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac: Compare LINUX_VERSION_CODE provided by bundled and
        system <linux/version.h> files, define USE_BUNDLED_HEADERS and CPPFLAGS
        appropriately.
        * src/Makefile.am (bundled_CPPFLAGS): New variable.
        (AM_CPPFLAGS): Use it.
        * tests/Makefile.am: Likewise.

2021-07-18  Dmitry V. Levin  <ldv@strace.io>

        tests: skip tests of old scm timestamps on glibc >= 2.33.
        Sadly, starting with commit
        glibc-2.33.9000-707-g13c51549e2077f2f3bf84e8fd0b46d8b0c615912,
        on every 32-bit architecture where 32-bit time_t support is enabled,
        glibc mangles old scm timestamps.

        * tests/sockopt-timestamp.c (TEST_OLD_SCM_TIMESTAMPS): New macro.
        (main) [!TEST_OLD_SCM_TIMESTAMPS]: Skip SO_TIMESTAMP_OLD and
        SO_TIMESTAMPNS_OLD tests.

2021-07-18  Dmitry V. Levin  <ldv@strace.io>

        tests/msg_name: skip bogus address tests on glibc >= 2.33.
        Sadly, starting with commit
        glibc-2.33.9000-707-g13c51549e2077f2f3bf84e8fd0b46d8b0c615912, on every
        32-bit architecture where 32-bit time_t support is enabled, glibc
        blindly dereferences the 2nd argument of recvmsg call.

        * tests/msg_name.c (TEST_RECVMSG_BOGUS_ADDR): New macro.
        (test_msg_name) [TEST_RECVMSG_BOGUS_ADDR == 0]: Skip bogus address
        tests.

2021-07-18  Dmitry V. Levin  <ldv@strace.io>

        tests: use QUIRK:START-OF-TEST-OUTPUT for getrlimit and ugetrlimit.
        Workaround an extra getrlimit or ugetrlimit system call during startup
        introduced by
        glibc-2.33.9000-630-gd03511f48f49fcb9bec4305586c26ab5d0063022
        on some of 32-bit architectures.

        * tests/xgetrlimit.c (main): Invoke NR_GETRLIMIT syscall with predefined
        invalid arguments to be used as a marker.
        * tests/gen_tests.in (getrlimit, ugetrlimit): Add
        QUIRK:START-OF-TEST-OUTPUT.

        Complements: v5.12-306-gfd5e20b1e "tests: use QUIRK:START-OF-TEST-OUTPUT for prlimit64"

2021-07-17  Dmitry V. Levin  <ldv@strace.io>

        tests: fix prctl marker.
        On some platforms, unsigned int arguments passed to syscall() are sign-extended.
        Workaround this by casting prctl marker arguments to unsigned long.

        * tests/prctl-arg2-intptr.c (main): Cast last four prctl marker
        arguments to unsigned long.
        * tests/prctl-cap-ambient.c (main): Likewise.
        * tests/prctl-capbset.c (main): Likewise.
        * tests/prctl-dumpable.c (main): Likewise.
        * tests/prctl-fp-mode.c (main): Likewise.
        * tests/prctl-mce-kill.c (main): Likewise.
        * tests/prctl-name.c (main): Likewise.
        * tests/prctl-no-args.c (main): Likewise.
        * tests/prctl-pdeathsig.c (main): Likewise.
        * tests/prctl-seccomp-filter-v.c (main): Likewise.
        * tests/prctl-seccomp-strict.c (main): Likewise.
        * tests/prctl-securebits.c (prctl): Likewise.
        * tests/prctl-spec-inject.c (main): Likewise.
        * tests/prctl-sve.c (main): Likewise.
        * tests/prctl-tid_address.c (main): Likewise.
        * tests/prctl-tsc.c (main): Likewise.
        * tests/prctl-unalign.c (main): Likewise.

        Fixes: v5.12-310-gb9f9d5b25 "tests: unify common code in prctl decoder tests"
        Fixes: v5.12-311-gcfadf5f5a "tests: improve test coverage of prctl syscall decoder"

2021-07-17  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2021-07-17  Dmitry V. Levin  <ldv@strace.io>

        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:]]' src tests |grep -v '\.sh$') |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2021-07-12  Srikavin Ramkumar  <srikavinramkumar@gmail.com>

        tests: improve test coverage of prctl syscall decoder.
        Add tests for PR_CAP_AMBIENT, PR_CAPBSET_READ, PR_CAPBSET_DROP,
        PR_[GS]ET_FP_MODE, PR_MCE_KILL, PR_SVE_[GS]ET_VL, PR_[GS]ET_UNALIGN.

        * tests/.gitignore: Add prctl-cap-ambient, prctl-capbset, prctl-fp-mode,
        prctl-mce-kill, prctl-sve, and prctl-unalign.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-fp-mode.
        (DECODER_TESTS): Add prctl-fp-mode.test.
        * tests/pure_executables.list: Add prctl-cap-ambient, prctl-capbset,
        prctl-mce-kill, prctl-sve, and prctl-unalign.
        * tests/gen_tests.in (prctl-cap-ambient, prctl-capbset, prctl-mce-kill,
        prctl-sve, prctl-unalign): New entries.
        * tests/prctl-cap-ambient.c: New file.
        * tests/prctl-capbset.c: Likewise.
        * tests/prctl-fp-mode.c: Likewise.
        * tests/prctl-fp-mode.test: Likewise.
        * tests/prctl-mce-kill.c: Likewise.
        * tests/prctl-sve.c: Likewise.
        * tests/prctl-unalign.c: Likewise.

2021-07-12  Srikavin Ramkumar  <srikavinramkumar@gmail.com>

        tests: unify common code in prctl decoder tests.
        * tests/prctl.sh: Extract common test code.
        * tests/gen_tests.in (prctl-arg2-intptr, prctl-dumpable, prctl-name,
        prctl-no-args, prctl-pdeathsig, prctl-seccomp-filter-v, prctl-securebits,
        prctl-tid_address, prctl-tsc): New entries.
        * tests/Makefile.am (DECODER_TESTS): Remove prctl-arg2-intptr.test,
        prctl-dumpable.test, prctl-name.test, prctl-no-args.test,
        prctl-pdeathsig.test, prctl-seccomp-filter-v.test, prctl-securebits.test,
        prctl-tid_address.test, and prctl-tsc.test.
        (EXTRA_DIST): Add prctl.sh.
        * tests/prctl-seccomp-strict.test: Replace output filtering with a sed filter.
        * tests/prctl-spec-inject.test: Likewise.
        * tests/prctl-arg2-intptr.c: Add a marker to indicate the start of the
        expected output.
        * tests/prctl-dumpable.c: Likewise.
        * tests/prctl-name.c: Likewise.
        * tests/prctl-no-args.c: Likewise.
        * tests/prctl-pdeathsig.c: Likewise.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/prctl-securebits.c: Likewise.
        * tests/prctl-tid_address.c: Likewise.
        * tests/prctl-tsc.c: Likewise.
        * tests/prctl-arg2-intptr.test: Remove file.
        * tests/prctl-dumpable.test: Likewise.
        * tests/prctl-name.test: Likewise.
        * tests/prctl-no-args.test: Likewise.
        * tests/prctl-pdeathsig.test: Likewise.
        * tests/prctl-seccomp-filter-v.test: Likewise.
        * tests/prctl-securebits.test: Likewise.
        * tests/prctl-spec-inject.c: Likewise.
        * tests/prctl-tid_address.test: Likewise.
        * tests/prctl-tsc.test: Likewise.

2021-07-16  Dmitry V. Levin  <ldv@strace.io>

        xlat: remove #enum where #unconditional is used.
        * src/xlat/sysctl_net_unix.in: Remove #enum and #include.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use QUIRK:START-OF-TEST-OUTPUT for getrandom.
        To work around polluting getrandom() call for tcache key initialisation,
        introduced in glibc-2.33.9000-879-gfc859c3.

        * tests/gen_tests.in (getrandom): Add QUIRK:START-OF-TEST-OUTPUT.
        * tests/getrandom.c: Call getrandom with pre-defined arguments
        to use it as a marker of the beginning of the test output, put printf first
        to trigger tcache initialisation.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: implement FUTEX_LOCK_PI2 op decoding.
        Introduced by Linux commit v5.14-rc1~180^2~1.

        * src/xlat/futexops.in (FUTEX_LOCK_PI2, FUTEX_LOCK_PI2_PRIVATE): New
        constants.
        * src/futex.c (do_futex) <case FUTEX_LOCK_PI2>: Decode the same way as
        FUTEX_LOCK_PI.
        * tests/futex.c: Add checks for FUTEX_LOCK_PI2, update expected output.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use QUIRK:START-OF-TEST-OUTPUT for prlimit64.
        To work around polluting prlimit64(0, RLIMIT_STACK, NULL, ...) call
        introduced in glibc-2.33.9000-630-gd03511f.

        * tests/gen_tests.in (prlimit64, prlimit64--pidns-translation): Add
        QUIRK:START-OF-TEST-OUTPUT.
        * tests/prlimit64.c: Call prlimit64 with pre-defined arguments
        to use it as a marker of the beinning of the test output.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use QUIRK:START-OF-TEST-OUTPUT for xet_robust_list test.
        Due to output-polluting set_robust_list call introduced in
        glibc-2.33.9000-778-g9a75654.

        * tests/gen_tests.in (xet_robust_list,
        xet_robust_list--pidns-translation): Add QUIRK:START-OF-TEST-OUTPUT.
        * tests/xet_robust_list.c: Call get_robust_list with zero arguments
        to use it as a marker of the beinning of the test output.

        Resolves: https://github.com/strace/strace/issues/184

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add a quirk for filtering out output outside markers.
        Add suuport of "QUIRK:START-OF-TEST-OUTPUT:<STR>" pseudo-argument that
        filters out strace output before the '<STR>' marker string.

        * tests/init.sh (sed_re_escape): New function.
        (run_strace_match_diff): Parse the arguments, enable
        expected output filtering if "QUIRK:START-OF-TEST-OUTPUT:" is present
        among arguments.
        (test_pidns_run_strace): Likewise.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@strace.io>

        Implement landlock_{add_rule,create_ruleset,restrict_self} syscall decoding
        Introduced by Linux commit v5.13-rc1~71^2~4.

        * bundled/linux/include/uapi/linux/landlock.h: New file, copied from
        headers_install'ed Linux kernel v5.13.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/Makefile.am (libstrace_a_SOURCES): Add landlock.c.
        * src/landlock.c: New file.
        * src/linux/generic/syscallent-common.h([BASE_NR + 444], [BASE_NR + 445],
        [BASE_NR + 446]): New entries, for landlock_create_ruleset, landlock_add_rule,
        and landlock_restrict_self, respectively.
        * src/pathtrace.c (pathtrace_match_set): Handle SEN_landlock_add_rule,
        SEN_landlock_create_ruleset, and SEN_landlock_restrict_self.
        * src/xlat/landlock_create_ruleset_flags.in: New xlat.
        * src/xlat/landlock_rule_types.in: Likewise.
        * src/xlat/landlock_ruleset_access_fs.in: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add
        landlock_create_ruleset-success and landlock_create_ruleset-success-y.
        (DECODER_TESTS): Add landlock_create_ruleset-success.test.
        * tests/gen_tests.in (landlock_add_rule, landlock_add_rule-y,
        landlock_create_ruleset, landlock_create_ruleset-success-y,
        landlock_create_ruleset-y, landlock_restrict_self,
        landlock_restrict_self-y): New tests.
        * tests/landlock_add_rule.c: New file.
        * tests/landlock_add_rule-y.c: Likewise.
        * tests/landlock_create_ruleset-success.c: Likewise.
        * tests/landlock_create_ruleset-success-y.c: Likewise.
        * tests/landlock_create_ruleset.c: Likewise.
        * tests/landlock_create_ruleset-y.c: Likewise.
        * tests/landlock_restrict_self.c: Likewise.
        * tests/landlock_restrict_self-y.c: Likewise.
        * tests/landlock_create_ruleset-success.test: New test.
        * tests/pure_executables.list: Add landlock_add_rule,
        landlock_add_rule-y, landlock_create_ruleset, landlock_create_ruleset-y,
        landlock_restrict_self, and landlock_restrict_self-y.
        * tests/.gitignore: Add landlock_add_rule, landlock_add_rule-y,
        landlock_create_ruleset, landlock_create_ruleset-success,
        landlock_create_ruleset-success-y, landlock_create_ruleset-y,
        landlock_restrict_self, and landlock_restrict_self-y.
        * NEWS: Mention it.

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: do not call syslog operations with side effects without -e inject
        Otherwise it has funny side effects when the test suite runs under root;
        note that the decoder coverage still holds thanks to the syslog-success
        test.

        * tests/syslog.c (main) <no_args>: Put SYSLOG_ACTION_CLEAR,
        SYSLOG_ACTION_CONSOLE_OFF, and SYSLOG_ACTION_CONSOLE_ON elements under
        "#ifdef RETVAL_INJECTED".
        (main) <two_args>: Put SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL,
        and SYSLOG_ACTION_READ_CLEAR elements under "#ifdef RETVAL_INJECTED".

        Resolves: https://github.com/strace/strace/issues/185

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/xlat/gen.sh: ignore #enum if #unconditional is set.
        Otherwise, it generates (useless) m4 check file.

        * src/xlat/gen.sh (gen_header): Set $enum to empty string if
        $unconditional is set after the first pass; swap the arguments
        in $enum comparisons to avoid possibility of breakage if $enum
        is ever set to a value that begins with "-".

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        src/linux/generic/syscallent-common.h: whitespace fix in pidfd_send_signal entry

2021-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: ignore -Wnonnull in preadv/pwritev tests.
        Specifically, these warnings:
            preadv.c:69:13: error: argument 2 is null but the corresponding size argument 3 value is 1 [-Werror=nonnull]
               69 |         if (preadv(0, NULL, 1, -2) != -1)
                  |             ^~~~~~~~~~~~~~~~~~~~~~
            pwritev.c:112:14: error: argument 2 is null but the corresponding size argument 3 value is 1 [-Werror=nonnull]
              112 |         rc = pwritev(0, NULL, 1, -3);
                  |              ^~~~~~~~~~~~~~~~~~~~~~~

        * src/gcc_compat.h (DIAG_PUSH_IGNORE_NONNULL, DIAG_POP_IGNORE_NONNULL):
        New macros.
        * tests/preadv.c: Use them around the offending call.
        * tests/pwritev.c: Likewise.

2021-07-16  Dmitry V. Levin  <ldv@strace.io>

        ipc: use more print_fields.h helpers.
        * src/ipc.c (sys_ipc): Use PRINT_VAL_U.

2021-07-15  Dmitry V. Levin  <ldv@strace.io>

        futex: use more print_fields.h helpers.
        * src/futex.c (do_futex): Use PRINT_VAL_X in more places.

2021-07-14  Dmitry V. Levin  <ldv@strace.io>

        perf: use more print_fields.h helpers.
        * src/perf.c (print_perf_event_attr): Use PRINT_VAL_X and
        tprintf_comment.

2021-07-13  Dmitry V. Levin  <ldv@strace.io>

        bpf_sock_filter: use more print_fields.h helpers.
        * src/bpf_sock_filter.c (print_sock_filter_k): Use PRINT_VAL_U.

2021-07-12  Dmitry V. Levin  <ldv@strace.io>

        bpf_seccomp_filter: use more print_fields.h helpers.
        * src/bpf_seccomp_filter.c (print_seccomp_filter_k): Use PRINT_VAL_X.

2021-07-11  Dmitry V. Levin  <ldv@strace.io>

        bpf_filter: use more print_fields.h helpers.
        * src/bpf_filter.c (print_bpf_filter_code): Use PRINT_VAL_X.

2021-07-10  Dmitry V. Levin  <ldv@strace.io>

        util: use more print_fields.h helpers.
        * src/util.c (DEF_PRINTPAIR): Use tprint_array_begin,
        tprint_array_next, and tprint_array_end.
        (printpidfd, printfd_pid, print_int8_array_member,
        print_int32_array_member, ): Use PRINT_VAL_D.
        (print_uint8_array_member, print_uint32_array_member,
        print_uint64_array_member): Use PRINT_VAL_U.
        (printaddr64, print_xint8_array_member, print_xint32_array_member,
        print_xint64_array_member): Use PRINT_VAL_X.
        (print_quoted_cstring, printstr_ex, print_nonzero_bytes): Use
        tprint_more_data_follows.
        (print_array_ex): Use tprint_array_begin, tprint_array_end,
        tprint_array_next, and tprint_more_data_follows.
        (printargs): Use tprint_arg_next and PRINT_VAL_X.
        (printargs_u): Use tprint_arg_next and PRINT_VAL_U.
        (printargs_d): Use tprint_arg_next and PRINT_VAL_D.

2021-07-09  Dmitry V. Levin  <ldv@strace.io>

        v4l2: use more print_fields.h helpers.
        * src/v4l2.c (print_pixelformat): Use PRINT_VAL_X, tprints_arg_begin,
        tprint_arg_next, and tprint_arg_end.
        (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
        print_v4l2_buffer, print_v4l2_standard, print_v4l2_input,
        print_v4l2_queryctrl, print_v4l2_query_ext_ctrl, print_v4l2_cropcap,
        print_v4l2_crop, print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
        print_v4l2_create_buffers, v4l2_ioctl): Use tprint_arg_next.
        (print_v4l2_requestbuffers): Use tprint_arg_next and PRINT_VAL_U.
        (print_v4l2_buffer_flags): Use PRINT_VAL_U.
        (print_v4l2_buf_type): Use tprint_arg_next, tprint_indirect_begin,
        and tprint_indirect_end.
        (print_v4l2_streamparm, print_v4l2_tuner, print_v4l2_ext_controls):
        Use tprint_arg_next and tprint_struct_next.
        (print_v4l2_cid): Use PRINT_VAL_X.
        (print_v4l2_control): Use tprint_arg_next and PRINT_VAL_D.

2021-07-08  Dmitry V. Levin  <ldv@strace.io>

        wait: use more print_fields.h helpers.
        * src/wait.c (printstatus): Use tprint_indirect_begin, PRINT_VAL_X,
        and tprint_indirect_end.
        (printwaitn): Use tprint_arg_next.
        (sys_waitid): Use tprint_arg_next and PRINT_VAL_D.

2021-07-07  Dmitry V. Levin  <ldv@strace.io>

        xlat: use more print_fields.h helpers.
        * src/xlat.c (printflags_ex): Use PRINT_VAL_U.

2021-07-06  Dmitry V. Levin  <ldv@strace.io>

        sockaddr: use more print_fields.h helpers.
        * src/sockaddr.c (print_inet_addr): Use tprints_arg_begin,
        tprint_arg_next, and tprint_arg_end.
        (print_sockaddr_data_in6): Use tprint_comment_begin, tprints_arg_begin,
        PRINT_VAL_U, tprint_arg_end, and tprint_comment_end.
        (print_sockaddr_data_ax25): Use tprint_array_begin, tprint_array_next,
        tprint_unavailable, and tprint_array_end.
        (print_sockaddr_data_ipx): Use tprints_arg_begin, PRINT_VAL_X,
        and tprint_arg_end.
        (print_sll_protocol): Use tprints_arg_begin and tprint_arg_end.
        (print_sockaddr_data_ll): Use tprint_array_begin, tprint_array_next,
        and tprint_array_end.
        (print_bluetooth_l2_psm, print_bluetooth_l2_cid): Use tprints_arg_begin,
        PRINT_VAL_X, PRINT_VAL_U, and tprint_array_end.
        (print_sockaddr_data_bt): Use tprints_arg_begin, PRINT_VAL_U,
        and tprint_array_end.
        (print_sockaddr): Use tprint_struct_next.
        * tests/net-sockaddr.c (check_ax25): Update expected output.

2021-07-05  Dmitry V. Levin  <ldv@strace.io>

        printsiginfo: use more print_fields.h helpers.
        * src/printsiginfo.c (print_si_syscall): Use PRINT_VAL_U.

2021-07-04  Dmitry V. Levin  <ldv@strace.io>

        printmode: use more print_fields.h helpers.
        * src/print_fields.h (PRINT_VAL_03O): New macro.
        * src/printmode.c (print_symbolic_mode_t, print_numeric_umode_t,
        print_numeric_ll_umode_t): Use it.

2021-07-03  Dmitry V. Levin  <ldv@strace.io>

        evdev: use more print_fields.h helpers.
        * src/evdev.c (keycode_ioctl): Use tprint_array_begin,
        tprint_array_next, tprint_array_end, and PRINT_VAL_U.
        (decode_bitset): Use tprint_bitset_begin, tprint_bitset_next,
        and tprint_bitset_end.
        * tests/ioctl_evdev-success.c (main): Update expected output.

2021-07-02  Dmitry V. Levin  <ldv@strace.io>

        dm: use more print_fields.h helpers.
        * src/dm.c (dm_decode_dm_name_list): Use PRINT_VAL_U.
        (dm_decode_dm_target_versions): Use PRINT_FIELD_U_ARRAY.
        (dm_known_ioctl): Use tprint_arg_next and PRINT_FIELD_U_ARRAY.
        * tests/ioctl_dm.c (main): Update expected output.

2021-07-01  Dmitry V. Levin  <ldv@strace.io>

        desc: use more print_fields.h helpers.
        * src/desc.c (decode_select): Use tprint_bitset_begin,
        tprint_bitset_next, and tprint_bitset_end.

2021-06-30  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce tprint_bitset_{begin,next,end}
        * src/print_fields.h (tprint_bitset_begin, tprint_bitset_next,
        tprint_bitset_end): New inline functions.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: print sample_*, read_format, and non-zero flags in abbreviated output
        To make it somewhat more useful.

        * src/perf.c (fetch_perf_event_attr): change read size to offsetof
        wakeup_events.
        (print_perf_event_attr): Move abbrev(tcp) printing cutoff past flags;
        print only non-zero flags if output is abbreviated.
        * tests/perf_event_open.c: Update expected output.
        * tests/ioctl_perf.c: Likewise.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: refactor bit flag printing.
        * src/perf.c (STRACE_PERF_PRINT_FLAG): New macro.
        (print_perf_event_attr): Use STRACE_PERF_PRINT_FLAG for printing bit
        flags.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: rename _PERF_CHECK_FIELD, fix grammar in comment.
        Avoid usage of underscore prefixes, as these are reserved for libc/kernel
        use.

        * src/perf.c (_PERF_CHECK_FIELD): Rename to...
        (STRACE_PERF_CHECK_FIELD): ...this;  rename _field argument to field_.
        (print_perf_event_attr): Use STRACE_PERF_CHECK_FIELD instead of
        _PERF_CHECK_FIELD.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: extended PERF_TYPE_HARDWARE/PERF_TYPE_HW_CACHE config decoding.
        Introduced in Linux commit v5.13-rc1~119^2~7.

        * src/perf.c (print_perf_event_attr) <case PERF_TYPE_HARDWARE>: Decode
        extended PMU tupe separately.
        <case PERF_TYPE_HW_CACHE>: Decode extended PMU type separatel, reorder
        the rest of the fields.
        * src/perf_event_struct.h (PERF_PMU_TYPE_SHIFT, PERF_HW_EVENT_MASK): New
        macros.
        * tests/perf_event_open.c:Update expected output.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PERF_COUNT_SW_CGROUP_SWITCHES to perf_sw_ids.
        * src/xlat/perf_sw_ids.in (PERF_COUNT_SW_CGROUP_SWITCHES): New constant,
        introduced in Linux commit v5.13-rc1~119^2~30.
        * tests/perf_event_open.c: Update expected output.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: decode sigtrap and sig_data fields of struct perf_event_attr.
        Introduced in Linux commit v5.13-rc1~119^2~35.

        * bundled/linux/include/uapi/linux/perf_event.h: Updated to v5.13.
        * src/perf_event_struct.h (struct perf_event_attr): Add sigtrap and sig_data
        fields.
        * src/perf.c (print_perf_event_attr): Print sigtrap field;  correct
        __reserved_1 comment;  print __reserved_3 field if non-zero;  print
        sig_data field.
        * src/xlat/perf_attr_size.in (PERF_ATTR_SIZE_VER7): New constant.
        * tests/perf_event_open.c: Add checks for new struct sizes and fields.
        * NEWS: Mention it.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.remove_on_exec field decoding.
        Introduced in Linux commit v5.13-rc1~119^2~37.

        * bundled/linux/include/uapi/linux/perf_event.h: Updated to commit
        v5.13-rc1~119^2~37.
        * src/perf_event_struct.h (struct perf_event_attr): Add remove_on_exec field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1 comment.
        * tests/perf_event_open.c (struct pea_flags): Add remove_on_exec field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.inherit_thread field decoding.
        Introduced in Linux commit v5.13-rc1~119^2~38.

        * bundled/linux/include/uapi/linux/perf_event.h: Updated to commit
        v5.13-rc1~119^2~38.
        * src/perf_event_struct.h (struct perf_event_attr): Add inherit_thread field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1 comment.
        * tests/perf_event_open.c (struct pea_flags): Add inherit_thread field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PERF_SAMPLE_WEIGHT_STRUCT to perf_event_sample_format.
        * src/xlat/perf_event_sample_format.in (PERF_SAMPLE_WEIGHT_STRUCT):
        New constant, introduced in Linux commit v5.12~401^2~9.
        * tests/perf_event_open.c: Update the expected output for sample_type
        field checks.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.build_id field decoding.
        Introduced in Linux commit v5.12~455^2~324^2^2.

        * src/perf_event_struct.h (struct perf_event_attr): Add build_id field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1 comment.
        * tests/perf_event_open.c (struct pea_flags): Add build_id field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PERF_SAMPLE_{DATA,CODE}_PAGE_SIZE to perf_event_sample_format.
        * src/xlat/perf_event_sample_format.in (PERF_SAMPLE_DATA_PAGE_SIZE):
        New constant, introduced in Linux commit v5.11-rc1~177^2~24.
        (PERF_SAMPLE_CODE_PAGE_SIZE): New constant, introduced by Linux commit
        v5.11-rc1~177^2~21.
        Re-align the rest of the file.
        * tests/perf_event_open.c: Update the expected output for sample_type
        field checks.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.text_poke field decoding.
        Introduced in Linux commit v5.9-rc1~201^2~42.

        * src/perf_event_struct.h (struct perf_event_attr): Add text_poke field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1 comment.
        * tests/perf_event_open.c (struct pea_flags): Add text_poke field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PERF_SAMPLE_CGROUP to perf_event_sample_format.
        * src/xlat/perf_event_sample_format.in (PERF_SAMPLE_CGROUP): New
        constant, introduced in Linux commit v5.7-rc1~77^2^2~23.
        * tests/perf_event_open.c: Update the expected output for sample_type
        field checks.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.cgroup field decoding.
        Introduced in Linux commit v5.7-rc1~77^2^2~24.

        * src/perf_event_struct.h (struct perf_event_attr): Add cgroup field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1 comment.
        * tests/perf_event_open.c (struct pea_flags): Add cgroup field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.aux_output field decoding.
        Introduced in Linux commit v5.4-rc1~177^2~7.

        * src/perf_event_struct.h (struct perf_event_attr): Add aux_output field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1
        comment.
        * tests/perf_event_open.c (struct pea_flags): Add aux_output field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement struct perf_event_attr.bpf_event field decoding.
        Introduced in Linux commit v5.1-rc1~163^2~29^2~8.

        * src/perf_event_struct.h (struct perf_event_attr): Add bpf_event field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1
        comment.
        * tests/perf_event_open.c (struct pea_flags): Add bpf_event field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: implement perf_event_attr.ksymbol field decoding.
        Introduced in Linux commit v5.1-rc1~163^2~29^2~10.

        * src/perf_event_struct.h (struct perf_event_attr): Add ksymbol field.
        * src/perf.c (print_perf_event_attr): Print it;  correct __reserved_1
        comment.
        * tests/perf_event_open.c (struct pea_flags): Add ksymbol field.
        (print_event_attr): Print it, correct the __reserved_1 field comment.

2021-06-30  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.13.
        * src/linux/32/ioctls_inc_align16.h: Update from src/linux v5.13
        using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * NEWS: Mention this.

2021-06-29  Dmitry V. Levin  <ldv@strace.io>

        xlat: update V4L2_* constants.
        * src/xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_COLORIMETRY): New
        constant introduced by Linux kernel commit v5.13-rc1~124^2~106.
        * src/xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_AU_DELIMITER): New
        constant introduced by Linux kernel commit v5.13-rc1~124^2~339.
        (V4L2_CID_MPEG_VIDEO_LTR_COUNT, V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX,
        V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES): New constant introduced by Linux
        kernel commit v5.13-rc1~124^2~115.
        (V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR): New constant introduced
        by Linux kernel commit v5.13-rc1~124^2~108.
        * src/xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_HDR10_CLL_INFO,
        V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY): New constant introduced
        by Linux kernel commit v5.13-rc1~124^2~104.
        (V4L2_CTRL_TYPE_VP8_FRAME): New constant introduced by Linux kernel
        commit v5.13-rc1~124^2~329.
        * src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_YUV24): New constant
        introduced by Linux kernel commit v5.13-rc1~124^2~306.
        (V4L2_PIX_FMT_VP8_FRAME): New constant introduced by Linux kernel
        commit v5.13-rc1~124^2~330.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2.c (main): Update.

2021-06-28  Dmitry V. Levin  <ldv@strace.io>

        xlat: update UFFD_* and UFFDIO_* constants.
        * src/xlat/uffd_api_features.in (UFFD_FEATURE_MINOR_HUGETLBFS): New
        constant introduced by Linux kernel commit v5.13-rc1~39^2~89.
        * src/xlat/uffd_register_mode_flags.in (UFFDIO_REGISTER_MODE_MINOR):
        Likewise.
        * src/xlat/uffd_register_ioctl_flags.in (1<<_UFFDIO_CONTINUE): New
        constant introduced by Linux kernel commit v5.13-rc1~39^2~86.
        * NEWS: Mention this change.

2021-06-27  Dmitry V. Levin  <ldv@strace.io>

        xlat: update RTPROT_* constants.
        * src/xlat/routing_protocols.in (RTPROT_OPENR): New constant introduced
        by Linux kernel commit v5.13-rc1~94^2~410.
        * NEWS: Mention this change.

2021-06-26  Dmitry V. Levin  <ldv@strace.io>

        xlat: update RTM_* constants.
        * src/xlat/nl_route_types.in (RTM_NEWNEXTHOPBUCKET,
        RTM_DELNEXTHOPBUCKET, RTM_GETNEXTHOPBUCKET): New constants introduced
        by Linux kernel commit v5.13-rc1~94^2~581^2~10.
        * NEWS: Mention this change.

2021-06-25  Dmitry V. Levin  <ldv@strace.io>

        xlat: update PTRACE_* constants.
        * src/ptrace.h [!PTRACE_GET_RSEQ_CONFIGURATION]
        (PTRACE_GET_RSEQ_CONFIGURATION): Define.
        * src/xlat/ptrace_cmds.in (PTRACE_GET_RSEQ_CONFIGURATION): New constant
        introduced by Linux kernel commit v5.13-rc1~118^2~38.
        * NEWS: Mention this change.

2021-06-24  Dmitry V. Levin  <ldv@strace.io>

        xlat: update PR_* constants.
        * src/xlat/prctl_options.in: Add #unconditional, remove fallback
        definitions.
        (PR_SET_VMA): Conditionalize on __ANDROID__.
        (PR_PAC_SET_ENABLED_KEYS, PR_PAC_GET_ENABLED_KEYS): New constants
        introduced by Linux kernel commit v5.13-rc1~17^2~18^2~1.
        * NEWS: Mention this change.

2021-06-23  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_SET_GUEST_DEBUG2): New constant
        introduced by Linux kernel commit v5.13-rc1~76^2~126.
        (KVM_CAP_SGX_ATTRIBUTE): New constant introduced by Linux kernel
        commit v5.13-rc1~76^2~62.
        (KVM_CAP_VM_COPY_ENC_CONTEX): New constant introduced by Linux kernel
        commit v5.13-rc1~76^2~59.
        (KVM_CAP_PTP_KVM): New constant introduced by Linux kernel
        commit v5.13-rc1~76^2~38.
        * NEWS: Mention this change.

2021-06-22  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KEXEC_* constants.
        * src/xlat/kexec_arch_values.in (KEXEC_ARCH_RISCV): New constant
        introduced by Linux kernel commit v5.13-rc1~36^2~13.
        * NEWS: Mention this change.

        Use bundled <linux/kexec.h>
        * bundled/linux/include/uapi/linux/kexec.h: New file, copied from
        headers_install'ed Linux kernel v5.13-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/kexec.c: Include <linux/kexec.h>.
        [!KEXEC_ARCH_MASK, !KEXEC_SEGMENT_MAX]: Remove.
        * src/xlat/kexec_arch_values.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/kexec_file_load_flags.in: Likewise.
        * src/xlat/kexec_load_flags.in: Likewise.

2021-06-21  Dmitry V. Levin  <ldv@strace.io>

        xlat: update IORING_* constants.
        * src/xlat/uring_register_opcodes.in (IORING_REGISTER_FILES2,
        IORING_REGISTER_FILES_UPDATE2, IORING_REGISTER_BUFFERS2,
        IORING_REGISTER_BUFFERS_UPDATE): New constants introduced
        by Linux kernel commit v5.13-rc6~13^2~1.
        * src/xlat/uring_setup_features.in (IORING_FEAT_RSRC_TAGS): New
        constant introduced by Linux kernel commit v5.13-rc6~13^2.
        * NEWS: Mention this change.
        * tests/io_uring_register.c (main): Update.

2021-06-20  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KEY_* constants.
        * src/xlat/evdev_keycode.in (KEY_EMOJI_PICKER): New constant
        introduced by Linux kernel commit v5.13-rc5~21^2~26.
        * NEWS: Mention this change.

2021-06-19  Dmitry V. Levin  <ldv@strace.io>

        xlat: update NT_* constants.
        * src/xlat/nt_descriptor_types.in (NT_ARM_PAC_ENABLED_KEYS): New
        constant introduced by Linux kernel commit v5.13-rc1~17^2~18^2~1.
        * NEWS: Mention this change.

2021-06-18  Dmitry V. Levin  <ldv@strace.io>

        xlat: update BPF_* constants.
        * src/xlat/bpf_attach_type.in (BPF_SK_SKB_VERDICT): New constant
        introduced by Linux kernel commit v5.13-rc1~94^2~255^2^2~7.
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_PROG_QUERY_checks): Update.

2021-06-17  Dmitry V. Levin  <ldv@strace.io>

        xlat: update TRAP_* constants.
        * src/xlat/sigtrap_codes.in (TRAP_PERF): New constant introduced
        by Linux kernel commit v5.13-rc1~119^2~36.
        * NEWS: Mention this change.

2021-06-16  Dmitry V. Levin  <ldv@strace.io>

        bundled: update linux UAPI headers to v5.13-rc6.
        Update all bundled linux UAPI headers except linux/perf_event.h
        which has to be updated along with the parser and its test.

        * bundled/linux/include/uapi/linux/blkpg.h: Update to
        headers_install'ed Linux kernel v5.13-rc6.
        * bundled/linux/include/uapi/linux/dm-ioctl.h: Likewise.
        * bundled/linux/include/uapi/linux/dqblk_xfs.h: Likewise.
        * bundled/linux/include/uapi/linux/fs.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/input-event-codes.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
        * bundled/linux/include/uapi/linux/prctl.h: Likewise.
        * bundled/linux/include/uapi/linux/rtnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/linux/include/uapi/mtd/mtd-abi.h: Likewise.

2021-06-15  Dmitry V. Levin  <ldv@strace.io>

        signal: use print_fields.h helpers.
        * src/signal.c (printsignal): Use PRINT_VAL_D.
        (sys_sigaction, sys_signal, sys_osf_sigprocmask, sys_sigprocmask,
        sys_kill, sys_tkill, sys_tgkill, print_sigqueueinfo,
        sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, ): Use tprint_arg_next.
        (sys_rt_sigprocmask, sys_rt_sigpending, sys_rt_sigsuspend,
        do_rt_sigtimedwait): Use tprint_arg_next and PRINT_VAL_U.
        (sys_rt_sigaction): Use tprint_arg_next, PRINT_VAL_U, and PRINT_VAL_X.
        (sys_pidfd_send_signal): Use tprint_arg_next and PRINT_VAL_X.

2021-06-14  Dmitry V. Levin  <ldv@strace.io>

        rtnl_tc_action: use print_fields.h helpers.
        * src/rtnl_tc_action.c (decode_tcamsg): Use tprint_array_next.

        rtnl_tc: use print_fields.h helpers.
        * src/rtnl_tc.c (print_stab_data): Use PRINT_VAL_U.
        (decode_tcmsg): Use tprint_struct_next and tprint_array_next.

        rtnl_rule: use print_fields.h helpers.
        * src/rtnl_rule.c (decode_fib_rule_hdr): Use tprint_struct_next and
        tprint_array_next.

        rtnl_route: use print_fields.h helpers.
        * src/rtnl_route.c (decode_rtvia): Use tprint_struct_next.
        (decode_rta_multipath): Use tprint_array_next.
        (decode_rtmsg): Use tprint_struct_next and tprint_array_next.

        rtnl_nsid: use print_fields.h helpers.
        * src/rtnl_nsid.c (decode_rtgenmsg): Use tprint_array_next.

        rtnl_netconf: use print_fields.h helpers.
        * src/rtnl_netconf.c (decode_netconfmsg): Use tprint_array_next.

        rtnl_neightbl: use print_fields.h helpers.
        * src/rtnl_neightbl.c (decode_ndtmsg): Use tprint_array_next.

        rtnl_neigh: use print_fields.h helpers.
        * src/rtnl_neigh.c (decode_ndmsg): Use tprint_struct_next and
        tprint_array_next.

        rtnl_mdb: use print_fields.h helpers.
        * src/rtnl_mdb.c (decode_mdba_mdb_entry_info): Use tprints_arg_begin,
        tprint_arg_end, and tprint_array_next.
        (decode_mdba_router_port): Use tprint_array_next.
        (decode_br_port_msg): Use tprint_struct_next and tprint_array_next.

2021-06-13  Dmitry V. Levin  <ldv@strace.io>

        Do not distribute generated manual pages.
        * Makefile.am (EXTRA_DIST): Remove $(man_MANS).

        Complements: v4.19~153 "Make strace.1 generated"

2021-06-12  Dmitry V. Levin  <ldv@strace.io>

        github: add jobs for gcc-11, clang-12, and clang-11.
        * .github/workflows/ci.yml (gcc11-x86_64-kheaders, gcc11-x86_64-dw,
        gcc11-x86_64-unwind, clang12-x86_64-kheaders, clang12-x86_64-dw,
        clang12-x86_64-unwind, clang11-x86_64-kheaders, clang11-x86_64-dw,
        clang11-x86_64-unwind, gcc11-x32-kheaders, gcc11-x32-nostacktrace,
        gcc11-x86-kheaders, gcc11-x86-nostacktrace, clang12-x86-kheaders,
        clang12-x86-nostacktrace, clang11-x86-kheaders,
        clang11-x86-nostacktrace): New jobs.

2021-06-12  Dmitry V. Levin  <ldv@strace.io>

        tests: fix clang -Wgnu-folding-constant warning.
        Fix the following compilation warning reported by clang 12:

        ioctl_tee.c:141:2: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
                DEFINE_BUF_W_PARAMS(struct tee_ioctl_invoke_arg, invoke);
                ^
        ioctl_tee.c:71:11: note: expanded from macro 'DEFINE_BUF_W_PARAMS'
                        uint8_t data[shorthand_ ## _size];                      \
                                ^

        * tests/ioctl_tee.c (DEFINE_BUF_W_PARAMS): Convert data array into
        structure.  Remove shorthand_ ## _size.
        (main): Remove params variable, access invoke_buf.data.params,
        open_session_buf.data.params, supp_recv_buf.data.params and
        supp_send_buf.data.params directly.  Replace invoke_size,
        open_session_size, supp_recv_size, and supp_send_size with
        sizeof(invoke_buf), sizeof(open_session_buf), sizeof(supp_recv_buf),
        and sizeof(supp_send_buf), respectively.

2021-06-11  Dmitry V. Levin  <ldv@strace.io>

        tests: workaround gcc -Wmaybe-uninitialized bug.
        Workaround the following gcc 11.1.1 -Wmaybe-uninitialized regression:

        ioctl_sock_gifconf.c: In function 'gifconf_ioctl':
        ioctl_sock_gifconf.c:39:20: error: 'in_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]

        * tests/ioctl_sock_gifconf.c: Constify everything to appease gcc.

2021-06-11  Dmitry V. Levin  <ldv@strace.io>

        build: enable -Wundef.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wundef.

2021-06-10  Dmitry V. Levin  <ldv@strace.io>

        tests/personality: fix -Wundef warnings.
        * tests/personality.c: Include "tests.h".

        tests/oldstat: fix -Wundef warnings.
        * tests/oldstat.c: Replace "#if ... HAVE_STRUCT___OLD_KERNEL_STAT"
        with "#if ... defined HAVE_STRUCT___OLD_KERNEL_STAT".

        tests/oldlstat: fix -Wundef warnings.
        * tests/oldlstat.c: Replace "#if ... HAVE_STRUCT___OLD_KERNEL_STAT"
        with "#if ... defined HAVE_STRUCT___OLD_KERNEL_STAT".

        tests/oldfstat: fix -Wundef warnings.
        * tests/oldfstat.c: Replace "#if ... HAVE_STRUCT___OLD_KERNEL_STAT"
        with "#if ... defined HAVE_STRUCT___OLD_KERNEL_STAT".

        tests/ipc_msg: fix -Wundef warnings.
        * tests/ipc_msg.c: Replace "#if ... WORDS_BIGENDIAN" with
        "#if ... defined WORDS_BIGENDIAN".

        tests/aio_pgetevents: fix -Wundef warnings.
        * tests/aio_pgetevents.c: Replace "#if !HAVE_STRUCT___AIO_SIGSET" with
        "#ifndef HAVE_STRUCT___AIO_SIGSET".

        tests/overflowuid: fix -Wundef warnings.
        * tests/overflowuid.c: Include <limits.h>.

2021-06-09  Dmitry V. Levin  <ldv@strace.io>

        mpers_type.h: fix -Wundef warnings.
        * src/mpers_type.h: Replace "if IN_MPERS_BOOTSTRAP" with
        "ifdef IN_MPERS_BOOTSTRAP".

        kernel_timespec: fix -Wundef warnings.
        * src/kernel_timespec.h: Include "arch_defs.h".
        * tests/clock_xettime.c: Do not include "arch_defs.h".
        * tests/pselect6.c: Likewise.
        * tests/semtimedop.c: Likewise.
        * tests/semtimedop-ipc.c: Likewise.

        defs: workaround -Wundef warnings produced by old gcc.
        * src/defs.h: Replace "#elif current_wordsize > 4" with
        "#else #if current_wordsize > 4".
        Replace "#elif current_klongsize > 4" with
        "#else #if current_klongsize > 4".

2021-06-08  Dmitry V. Levin  <ldv@strace.io>

        build: enable -Wtrampolines.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wtrampolines.

2021-06-07  Dmitry V. Levin  <ldv@strace.io>

        build: enable -Wdate-time.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wdate-time.

2021-06-06  Dmitry V. Levin  <ldv@strace.io>

        build: enable -Wextra.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wextra, add
        -Wno-missing-field-initializers and -Wno-unused-parameter
        to silence -Wmissing-field-initializers and -Wunused-parameter enabled
        by -Wextra, remove options already enabled by -Wextra: -Wempty-body,
        -Wignored-qualifiers, -Wmissing-parameter-type, -Wold-style-declaration,
        -Woverride-init, -Wsign-compare, and -Wtype-limits.

2021-06-05  Dmitry V. Levin  <ldv@strace.io>

        build: enable -Wmissing-prototypes.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wmissing-prototypes.

2021-06-04  Dmitry V. Levin  <ldv@strace.io>

        tests/xgetrlimit: fix -Wmissing-prototypes warnings.
        * tests/xgetrlimit.c (sprint_rlim): Add static qualifier.

        tests/umask: fix -Wmissing-prototypes warnings.
        * tests/umask.c (test_umask): Add static qualifier.

        tests/syslog: fix -Wmissing-prototypes warnings.
        * tests/syslog.c (valid_cmd, printstr): Add static qualifier.

        tests/setugid: fix -Wmissing-prototypes warnings.
        * tests/setugid.c (printuid): Add static qualifier.

        tests/setgroups: fix -Wmissing-prototypes warnings.
        * tests/setgroups.c (printuid): Add static qualifier.

        tests/setfsugid: fix -Wmissing-prototypes warnings.
        * tests/setfsugid.c (printuid): Add static qualifier.

        tests/secontext: fix -Wmissing-prototypes warnings.
        * tests/secontext.h (secontext_full_file, secontext_full_pid,
        secontext_short_file, secontext_short_pid): Declare unconditionally.

        tests/request_key: fix -Wmissing-prototypes warnings.
        * tests/request_key.c (print_val_str, do_request_key): Add static
        qualifier.

        tests/quotactl: fix -Wmissing-prototypes warnings.
        * tests/quotactl.c (print_dqblk, print_nextdqblk, print_dqinfo,
        print_dqfmt, gen_quotacmd, gen_quotaid): Add static qualifier.

        tests/quotactl-xfs: fix -Wmissing-prototypes warnings.
        * tests/quotactl-xfs.c (print_xdisk_quota, print_xquota_stat,
        print_xquota_statv): Add static qualifier.

        tests/process_vm_readv_writev: fix -Wmissing-prototypes warnings.
        * tests/process_vm_readv_writev.c (ptr_cast): Add static qualifier.

        tests/prlimit64: fix -Wmissing-prototypes warnings.
        * tests/prlimit64.c (sprint_rlim): Add static qualifier.

        tests/prctl-spec-inject: fix -Wmissing-prototypes warnings.
        * tests/prctl-spec-inject.c (do_prctl): Add static qualifier.

        tests/pkey_mprotect: fix -Wmissing-prototypes warnings.
        * tests/pkey_mprotect.c (sprintptr): Add static qualifier.

        tests/modify_ldt: fix -Wmissing-prototypes warnings.
        * tests/modify_ldt.c (printrc): Add static qualifier.

        tests/keyctl: fix -Wmissing-prototypes warnings.
        * tests/keyctl.c (print_quoted_string_limit, print_flags, do_keyctl,
        append_str, kckdfp_to_str, kcpp_to_str): Add static qualifier.

        tests/ipc_msgbuf: fix -Wmissing-prototypes warnings.
        * tests/ipc_msgbuf.c (sys_msgrcv): Add static qualifier.

        tests/getrusage: fix -Wmissing-prototypes warnings.
        * tests/getrusage.c (invoke_print): Add static qualifier.

        tests/futex: fix -Wmissing-prototypes warnings.
        * tests/futex.c (futex_error, invalid_op): Add static qualifier.

        tests/file_handle: fix -Wmissing-prototypes warnings.
        * tests/file_handle.c (print_handle_data, do_name_to_handle_at,
        do_open_by_handle_at): Add static qualifier.

        tests/fcntl-common: fix -Wmissing-prototypes warnings.
        * tests/fcntl-common.c [F_OFD_GETLK && F_OFD_SETLK && F_OFD_SETLKW]
        (NEED_TEST_FLOCK64_EINVAL): Define.
        (test_flock64_einval): Add static qualifier, conditionalize on
        NEED_TEST_FLOCK64_EINVAL.
        * tests/fcntl64.c (NEED_TEST_FLOCK64_EINVAL): Define.

        tests/btrfs: fix -Wmissing-prototypes warnings.
        * tests/btrfs.c (prfl_btrfs, prxval_btrfs): Add static qualifier.

        tests/add_key: fix -Wmissing-prototypes warnings.
        * tests/add_key.c (print_val_str, do_add_key): Add static qualifier.

        tests/accept: fix -Wmissing-prototypes warnings.
        * tests/accept.c (do_accept): Add static qualifier.

2021-06-03  Dmitry V. Levin  <ldv@strace.io>

        aarch64/shuffle_scno: fix -Wmissing-prototypes warnings.
        * src/linux/aarch64/shuffle_scno.c (shuffle_scno_is_static): Define.
        * src/linux/arm/shuffle_scno.c (shuffle_scno) [shuffle_scno_is_static]:
        Add static qualifier.

        syscall: fix -Wmissing-prototypes warnings.
        * src/syscall.c (print_injected_note): Add static qualifier.

        src/strace: fix -Wmissing-prototypes warnings.
        * src/strace.c (set_current_tcp): Add static qualifier.

        sockaddr: fix -Wmissing-prototypes warnings.
        * src/sockaddr.c (check_ax25_address): Add static qualifier.

        rtnl_link: fix -Wmissing-prototypes warnings.
        * src/rtnl_link.c (decode_nla_linkinfo_kind,
        decode_nla_linkinfo_xstats_can, decode_nla_linkinfo_xstats,
        decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data_tun,
        decode_nla_linkinfo_data, decode_ifla_xdp_attached): Add static
        qualifier.

        keyctl: fix -Wmissing-prototypes warnings.
        * src/keyctl.c (print_keyctl_caps): Add static qualifier.

        dm: fix -Wmissing-prototypes warnings.
        * src/dm.c (dm_print_dev): Add static qualifier.

        delay: fix -Wmissing-prototypes warnings.
        * src/delay.c: Include "delay.h".

        defs: fix -Wmissing-prototypes warnings.
        * src/defs.h [!IN_MPERS_BOOTSTRAP]: Include "syscall.h".
        * src/syscall.h: Do not include "sen.h".
        * src/filter_seccomp.c: Do not include "syscall.h".
        * src/pathtrace.c: Include "sen.h" instead of "syscall.h".
        * src/syscall.c: Likewise.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_vmsplice is defined.
        vmsplice syscall entries are present in syscallent files for all
        supported architectures.

        * tests/vmsplice.c: Assume __NR_vmsplice is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_vhangup is defined.
        vhangup syscall entries are present in syscallent files for all
        supported architectures.

        * tests/vhangup.c: Assume __NR_vhangup is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_userfaultfd is defined.
        userfaultfd syscall entries are present in syscallent files for all
        supported architectures.

        * tests/userfaultfd.c: Assume __NR_userfaultfd is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_unshare is defined.
        unshare syscall entries are present in syscallent files for all
        supported architectures.

        * tests/unshare.c: Assume __NR_unshare is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_unlinkat is defined.
        unlinkat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/unlinkat.c: Assume __NR_unlinkat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_uname is defined.
        uname syscall entries are present in syscallent files for all supported
        architectures.

        * tests/uname.c: Assume __NR_uname is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_times is defined.
        times syscall entries are present in syscallent files for all supported
        architectures.

        * tests/times.c: Assume __NR_times is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_timerfd_create is defined.
        timerfd_create syscall entries are present in syscallent files for all
        supported architectures.

        * tests/timerfd_create.c: Assume __NR_timerfd_create is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_timer_create is defined.
        timer_create syscall entries are present in syscallent files for all
        supported architectures.

        * tests/timer_create.c: Assume __NR_timer_create is defined.
        * tests/timer_xettime.c: Likewise.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_tgkill is defined.
        tgkill syscall entries are present in syscallent files for all supported
        architectures.

        * tests/tgkill.c: Assume __NR_tgkill is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_tee is defined.
        tee syscall entries are present in syscallent files for all supported
        architectures.

        * tests/tee.c: Assume __NR_tee is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_syslog is defined.
        syslog syscall entries are present in syscallent files for all supported
        architectures.

        * tests/syslog.c: Assume __NR_syslog is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sync is defined.
        sync syscall entries are present in syscallent files for all supported
        architectures.

        * tests/sync.c: Assume __NR_sync is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_symlinkat is defined.
        symlinkat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/symlinkat.c: Assume __NR_symlinkat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_swapon and __NR_swapoff are defined.
        swapon and swapoff syscall entries are present in syscallent files
        for all supported architectures.

        * tests/swap.c: Assume __NR_swapon and __NR_swapoff are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_splice is defined.
        splice syscall entries are present in syscallent files for all supported
        architectures.

        * tests/splice.c: Assume __NR_splice is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setuid is defined.
        setuid syscall entries are present in syscallent files for all supported
        architectures.

        * tests/setuid.c: Assume __NR_setuid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setreuid is defined.
        setreuid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setreuid.c: Assume __NR_setreuid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setregid is defined.
        setregid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setregid.c: Assume __NR_setregid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setns is defined.
        setns syscall entries are present in syscallent files for all supported
        architectures.

        * tests/setns.c: Assume __NR_setns is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sethostname is defined.
        sethostname syscall entries are present in syscallent files for all
        supported architectures.

        * tests/sethostname.c: Assume __NR_sethostname is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setgroups is defined.
        setgroups syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setgroups.c: Assume __NR_setgroups is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setgid is defined.
        setgid syscall entries are present in syscallent files for all supported
        architectures.

        * tests/setgid.c: Assume __NR_setgid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setfsuid is defined.
        setfsuid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setfsuid.c: Assume __NR_setfsuid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setfsgid is defined.
        setfsgid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setfsgid.c: Assume __NR_setfsgid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_setdomainname is defined.
        setdomainname syscall entries are present in syscallent files for all
        supported architectures.

        * tests/setdomainname.c: Assume __NR_setdomainname is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_set_tid_address is defined.
        set_tid_address syscall entries are present in syscallent files for all
        supported architectures.

        * tests/prctl-tid_address.c: Assume __NR_set_tid_address is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_set_mempolicy is defined.
        set_mempolicy syscall entries are present in syscallent files for all
        supported architectures.

        * tests/set_mempolicy.c: Assume __NR_set_mempolicy is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_seccomp is defined.
        seccomp syscall entries are present in syscallent files for all
        supported architectures.

        * tests/seccomp-filter-v.c: Assume __NR_seccomp is defined.
        * tests/seccomp-strict.c: Likewise.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_yield is defined.
        sched_yield syscall entries are present in syscallent files for all
        supported architectures.

        * tests/sched_yield.c: Assume __NR_sched_yield is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_getaffinity and __NR_sched_setaffinity are defined
        sched_getaffinity and sched_setaffinity syscall entries are present in
        syscallent files for all supported architectures.

        * tests/sched_xetaffinity.c: Assume __NR_sched_getaffinity and
        __NR_sched_setaffinity are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_getscheduler and __NR_sched_setscheduler are defined
        sched_getscheduler and sched_setscheduler syscall entries are present in
        syscallent files for all supported architectures.

        * tests/sched_xetscheduler.c: Assume __NR_sched_getscheduler and
        __NR_sched_setscheduler are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_getattr and __NR_sched_setattr are defined.
        sched_getattr and sched_setattr syscall entries are present in
        syscallent files for all supported architectures.

        * tests/sched_xetattr.c: Assume __NR_sched_getattr and
        __NR_sched_setattr are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_get_priority_max and __NR_sched_get_priority_min are defined
        sched_get_priority_max and sched_get_priority_min syscall entries are
        present in syscallent files for all supported architectures.

        * tests/sched_get_priority_mxx.c: Assume __NR_sched_get_priority_max and
        __NR_sched_get_priority_min are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_sched_getparam and __NR_sched_setparam are defined.
        sched_getparam and sched_setparam syscall entries are present in
        syscallent files for all supported architectures.

        * tests/sched_xetparam.c: Assume __NR_sched_getparam and
        __NR_sched_setparam are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_rt_tgsigqueueinfo is defined.
        rt_tgsigqueueinfo syscall entries are present in syscallent files for
        all supported architectures.

        * tests/rt_tgsigqueueinfo.c: Assume __NR_rt_tgsigqueueinfo is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_rt_sigsuspend is defined.
        rt_sigsuspend syscall entries are present in syscallent files for all
        supported architectures.

        * tests/rt_sigsuspend.c: Assume __NR_rt_sigsuspend is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_rt_sigprocmask is defined.
        rt_sigprocmask syscall entries are present in syscallent files for all
        supported architectures.

        * tests/rt_sigprocmask.c: Assume __NR_rt_sigprocmask is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_rt_sigpending is defined.
        rt_sigpending syscall entries are present in syscallent files for all
        supported architectures.

        * tests/rt_sigpending.c: Assume __NR_rt_sigpending is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_request_key is defined.
        request_key syscall entries are present in syscallent files for all
        supported architectures.

        * tests/request_key.c: Assume __NR_request_key is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_renameat2 is defined.
        renameat2 syscall entries are present in syscallent files for all
        supported architectures.

        * tests/renameat2.c: Assume __NR_renameat2 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_remap_file_pages is defined.
        remap_file_pages syscall entries are present in syscallent files for all
        supported architectures.

        * tests/remap_file_pages.c: Assume __NR_remap_file_pages is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_reboot is defined.
        reboot syscall entries are present in syscallent files for all supported
        architectures.

        * tests/reboot.c: Assume __NR_reboot is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_readlinkat is defined.
        readlinkat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/readlinkat.c: Assume __NR_readlinkat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_process_vm_writev is defined.
        process_vm_writev syscall entries are present in syscallent files for
        all supported architectures.

        * tests/process_vm_writev.c: Assume __NR_process_vm_writev is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_process_vm_readv is defined.
        process_vm_readv syscall entries are present in syscallent files for all
        supported architectures.

        * tests/process_vm_readv.c: Assume __NR_process_vm_readv is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_prlimit64 is defined.
        prlimit64 syscall entries are present in syscallent files for all
        supported architectures.

        * tests/prlimit64.c: Assume __NR_prlimit64 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_preadv2 and __NR_pwritev2 are defined.
        preadv2 and pwritev2 syscall entries are present in syscallent files for
        all supported architectures.

        * tests/preadv2-pwritev2.c: Assume __NR_preadv2 and __NR_pwritev2 are
        defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_prctl is defined.
        prctl syscall entries are present in syscallent files for all supported
        architectures.

        * tests/prctl-arg2-intptr.c: Assume __NR_prctl is defined.
        * tests/prctl-no-args.c: Likewise.
        * tests/prctl-spec-inject.c: Likewise.
        * tests/prctl-tid_address.c: Likewise.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_pkey_mprotect is defined.
        pkey_mprotect syscall entries are present in syscallent files for all
        supported architectures.

        * tests/pkey_mprotect.c: Assume __NR_pkey_mprotect is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_pkey_free is defined.
        pkey_free syscall entries are present in syscallent files for all
        supported architectures.

        * tests/pkey_free.c: Assume __NR_pkey_free is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_pkey_alloc is defined.
        pkey_alloc syscall entries are present in syscallent files for all
        supported architectures.

        * tests/pkey_alloc.c: Assume __NR_pkey_alloc is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_pipe2 is defined.
        pipe2 syscall entries are present in syscallent files for all supported
        architectures.

        * tests/pipe2.c: Assume __NR_pipe2 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_name_to_handle_at and __NR_open_by_handle_at are defined
        name_to_handle_at and open_by_handle_at syscall entries are present in
        syscallent files for all supported architectures.

        * tests/file_handle.c: Assume __NR_name_to_handle_at and
        __NR_open_by_handle_at are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_munlock is defined.
        munlock syscall entries are present in syscallent files for all
        supported architectures.

        * tests/mlock.c: Assume __NR_munlock is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume all __NR_mq_* except __NR_mq_timed* are defined.
        mq_open, mq_notify, and mq_unlink syscall entries are present in
        syscallent files for all supported architectures.

        * tests/mq_sendrecv.c: Assume __NR_mq_open, __NR_mq_notify, and
        __NR_mq_unlink are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_move_pages is defined.
        move_pages syscall entries are present in syscallent files for all
        supported architectures.

        * tests/move_pages.c: Assume __NR_move_pages is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_mlock2 is defined.
        mlock2 syscall entries are present in syscallent files for all supported
        architectures.

        * tests/mlock2.c: Assume __NR_mlock2 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_mknodat is defined.
        mknodat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/mknodat.c: Assume __NR_mknodat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_mkdirat is defined.
        mkdirat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/mkdirat.c: Assume __NR_mkdirat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_migrate_pages is defined.
        migrate_pages syscall entries are present in syscallent files for all
        supported architectures.

        * tests/migrate_pages.c: Assume __NR_migrate_pages is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_memfd_create is defined.
        memfd_create syscall entries are present in syscallent files for all
        supported architectures.

        * tests/memfd_create.c: Assume __NR_memfd_create is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_membarrier is defined.
        membarrier syscall entries are present in syscallent files for all
        supported architectures.

        * tests/membarrier.c: Assume __NR_membarrier is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_mbind is defined.
        mbind syscall entries are present in syscallent files for all supported
        architectures.

        * tests/mbind.c: Assume __NR_mbind is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_lookup_dcookie is defined.
        lookup_dcookie syscall entries are present in syscallent files for all
        supported architectures.

        * tests/lookup_dcookie.c: Assume __NR_lookup_dcookie is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_listen is defined.
        listen syscall entries are present in syscallent files for all supported
        architectures.

        * tests/strace-n.c (main): Assume __NR_listen is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_linkat is defined.
        linkat syscall entries are present in syscallent files for all supported
        architectures.

        * tests/linkat.c: Assume __NR_linkat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_kill is defined.
        kill syscall entries are present in syscallent files for all supported
        architectures.

        * tests/kill.c: Assume __NR_kill is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_kexec_load is defined.
        kexec_load syscall entries are present in syscallent files for all
        supported architectures.

        * tests/kexec_load.c: Assume __NR_kexec_load is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_kcmp is defined.
        kcmp syscall entries are present in syscallent files for all supported
        architectures.

        * tests/kcmp.c: Assume __NR_kcmp is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume all __NR_io_* except __NR_io_getevents are defined.
        io_cancel, io_destroy, io_setup, and io_submit syscall entries are
        present in syscallent files for all supported architectures.

        * tests/aio.c: Assume __NR_io_cancel, __NR_io_destroy,
        __NR_io_setup, and __NR_io_submit are defined.
        * tests/aio_pgetevents.c: Assume io_setup is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getrusage is defined.
        getrusage syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getrusage.c: Assume __NR_getrusage is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getrandom is defined.
        getrandom syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getrandom.c: Assume __NR_getrandom is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getpriority and __NR_setpriority are defined.
        getpriority and setpriority syscall entries are present in syscallent
        files for all supported architectures.

        * tests/xetpriority.c: Assume __NR_getpriority and __NR_setpriority are
        defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getppid is defined.
        getppid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getppid.c: Assume __NR_getppid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getpgid and __NR_setpgid are defined.
        getpgid and setpgid syscall entries are present in syscallent files for
        all supported architectures.

        * tests/xetpgid.c: Assume __NR_getpgid and __NR_setpgid are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getgroups is defined.
        getgroups syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getgroups.c: Assume __NR_getgroups is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_geteuid is defined.
        geteuid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/geteuid.c: Assume __NR_geteuid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getegid is defined.
        getegid syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getegid.c: Assume __NR_getegid is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getdents64 is defined.
        getdents64 syscall entries are present in syscallent files for all
        supported architectures.

        * tests/getdents64.c: Assume __NR_getdents64 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getcwd is defined.
        getcwd syscall entries are present in syscallent files for all supported
        architectures.

        * tests/getcwd.c: Assume __NR_getcwd is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_getcpu is defined.
        getcpu syscall entries are present in syscallent files for all supported
        architectures.

        * tests/getcpu.c: Assume __NR_getcpu is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_get_robust_list and __NR_set_robust_list are defined.
        get_robust_list and set_robust_list syscall entries are present in syscallent
        files for all supported architectures.

        * tests/xet_robust_list.c: Assume __NR_get_robust_list and
        __NR_set_robust_list are defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_get_mempolicy is defined.
        get_mempolicy syscall entries are present in syscallent files for all
        supported architectures.

        * tests/get_mempolicy.c: Assume __NR_get_mempolicy is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fsync is defined.
        fsync syscall entries are present in syscallent files for all supported
        architectures.

        * tests/fsync.c: Assume __NR_fsync is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_flock is defined.
        flock syscall entries are present in syscallent files for all supported
        architectures.

        * tests/flock.c: Assume __NR_flock is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fdatasync is defined.
        fdatasync syscall entries are present in syscallent files for all
        supported architectures.

        * tests/fdatasync.c: Assume __NR_fdatasync is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fchownat is defined.
        fchownat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/fchownat.c: Assume __NR_fchownat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fchmodat is defined.
        fchmodat syscall entries are present in syscallent files for all
        supported architectures.

        * tests/fchmodat.c: Assume __NR_fchmodat is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fchdir is defined.
        fchdir syscall entries are present in syscallent files for all supported
        architectures.

        * tests/fchdir.c: Assume __NR_fchdir is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fanotify_mark is defined.
        fanotify_mark syscall entries are present in syscallent files for all
        supported architectures.

        * tests/fanotify_mark.c: Assume __NR_fanotify_mark is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_fanotify_init is defined.
        fanotify_init syscall entries are present in syscallent files for all
        supported architectures.

        * tests/fanotify_init.c: Assume __NR_fanotify_init is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_eventfd2 is defined.
        eventfd2 syscall entries are present in syscallent files for all
        supported architectures.

        * tests/eventfd2.c: Assume __NR_eventfd2 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_epoll_ctl is defined.
        epoll_ctl syscall entries are present in syscallent files for all
        supported architectures.

        * tests/epoll_ctl.c: Assume __NR_epoll_ctl is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_epoll_create1 is defined.
        epoll_create1 syscall entries are present in syscallent files for all
        supported architectures.

        * tests/epoll_create1.c: Assume __NR_epoll_create1 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_dup3 is defined.
        dup3 syscall entries are present in syscallent files for all supported
        architectures.

        * tests/dup3.c: Assume __NR_dup3 is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_dup is defined.
        dup syscall entries are present in syscallent files for all supported
        architectures.

        * tests/dup.c: Assume __NR_dup is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_copy_file_range is defined.
        copy_file_range syscall entries are present in syscallent files for all
        supported architectures.

        * tests/copy_file_range.c: Assume __NR_copy_file_range is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_chdir is defined.
        chdir syscall entries are present in syscallent files for all supported
        architectures.

        * tests/qual_inject-retval.c: Assume __NR_chdir is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_brk is defined.
        brk syscall entries are present in syscallent files for all supported
        architectures.

        * tests/brk.c: Assume __NR_brk is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_add_key is defined.
        add_key syscall entries are present in syscallent files for all
        supported architectures.

        * tests/add_key.c: Assume __NR_add_key is defined.

2021-06-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume __NR_acct is defined.
        acct syscall entries are present in syscallent files for all supported
        architectures.

        * tests/acct.c: Assume __NR_acct is defined.

2021-06-01  Dmitry V. Levin  <ldv@strace.io>

        NEWS: fix typo.
        * NEWS (5.7): Fix typo.

2021-05-31  Dmitry V. Levin  <ldv@strace.io>

        sparc64: implement decoding of PTRACE_GETREGS64 and PTRACE_SETREGS64.
        * src/linux/sparc64/arch_pt_regs64.c: New file.
        * src/Makefile.am (EXTRA_DIST): Add it.
        * tests/ptrace.c (print_pt_regs64) [__sparc__ && __arch64__]: Check it.

        powerpc*: implement decoding of PTRACE_GETREGS64 and PTRACE_SETREGS64.
        * src/linux/powerpc/arch_pt_regs64.c: New file.
        * src/linux/powerpc/arch_pt_regs64.h: Likewise.
        * src/linux/powerpc64/arch_pt_regs64.c: Likewise.
        * src/linux/powerpc64/arch_pt_regs64.h: Likewise.
        * src/linux/powerpc64le/arch_pt_regs64.c: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * NEWS: Mention this change.
        * tests/ptrace.c (print_pt_regs64) [__powerpc__ || __powerpc64__]: Check
        it.

2021-05-30  Dmitry V. Levin  <ldv@strace.io>

        ptrace: prepare for decoding of PTRACE_GETREGS64 and PTRACE_SETREGS64.
        * src/linux/generic/arch_pt_regs64.c: New file.
        * src/Makefile.am (EXTRA_DIST): Add it.
        * src/ptrace.c [PTRACE_GETREGS64]: Include "arch_pt_regs64.c".
        (decode_ptrace_entering): Handle PTRACE_GETREGS64 and PTRACE_SETREGS64.
        (decode_ptrace_exiting): Handle PTRACE_GETREGS64.
        * tests/ptrace.c (do_ptrace_regs): Define for [PTRACE_GETREGS64].
        [PTRACE_GETREGS64] (print_pt_regs64, do_getregs64_setregs64): New
        functions.
        (test_getregset_setregset): Use them to check decoding of
        PTRACE_GETREGS64 and PTRACE_SETREGS64.

2021-05-29  Dmitry V. Levin  <ldv@strace.io>

        Implement decoding of PTRACE_GETFPREGS and PTRACE_SETFPREGS.
        * src/linux/generic/arch_pt_fpregs.c: New file.
        * src/Makefile.am (EXTRA_DIST): Add it.
        * src/regset.c: Include "arch_pt_fpregs.c".
        (decode_pt_fpregs): New function.
        * src/ptrace.c (decode_ptrace_entering, decode_ptrace_exiting): Use it.
        * NEWS: Mention this change.
        * tests/ptrace.c (print_pt_fpregs): Check it.

2021-05-28  Dmitry V. Levin  <ldv@strace.io>

        Implement decoding of PTRACE_GETREGS and PTRACE_SETREGS.
        * src/linux/generic/arch_pt_regs.c: New file.
        * src/linux/mips/arch_pt_regs.c: Likewise.
        * src/linux/sparc/arch_pt_regs.c: Likewise.
        * src/linux/sparc64/arch_pt_regs.c: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * src/regset.c: Include "arch_pt_regs.c".
        (decode_pt_regs): New function.
        * src/ptrace.c (decode_ptrace_entering, decode_ptrace_exiting): Use it.
        * NEWS: Mention this change.
        * tests/ptrace.c (print_pt_regs): Check it.

2021-05-27  Dmitry V. Levin  <ldv@strace.io>

        ptrace: prepare for decoding of PTRACE_[GS]ETREGS and PTRACE_[GS]ETFPREGS
        * src/ptrace.c (regs_addr): New macro.
        (decode_ptrace_entering): Handle PTRACE_GETREGS, PTRACE_SETREGS,
        PTRACE_GETFPREGS, and PTRACE_SETFPREGS.
        (decode_ptrace_exiting): Handle PTRACE_GETREGS and PTRACE_GETFPREGS.
        * tests/ptrace.c [PTRACE_GETREGS || PTRACE_GETFPREGS] (do_ptrace_regs):
        New function.
        [PTRACE_GETREGS] (print_pt_regs, do_getregs_setregs): Likewise.
        [PTRACE_GETFPREGS] (print_pt_fpregs, do_getfpregs_setfpregs): Likewise.
        (test_getregset_setregset): Use them to check decoding of
        PTRACE_[GS]ETREGS and PTRACE_[GS]ETFPREGS.

        regset: include "ptrace.h"
        * src/regset.c: Include "ptrace.h".
        * src/linux/arm/arch_prstatus_regset.h: Do not include "ptrace.h".
        * src/linux/aarch64/arch_prstatus_regset.h: Likewise.
        * src/linux/powerpc/arch_prstatus_regset.h: Likewise.
        * src/linux/riscv64/arch_prstatus_regset.h: Likewise.
        * src/linux/s390/arch_prstatus_regset.h: Likewise.

2021-05-26  Dmitry V. Levin  <ldv@strace.io>

        tests: use uintptr_t to cast from pointer types in the ptrace test.
        * tests/ptrace.c: Use uintptr_t instead of unsigned long to cast
        from pointer types to numeric types.

        tests: rework ptrace wrapper in the ptrace test.
        * tests/ptrace.c (do_ptrace): Constify arguments, change the type of pid
        from unsigned long to unsigned int, check that unused bits of the pid
        argument are properly ignored, specify all 6 arguments in the syscall
        invocation.  All callers updated.

2021-05-25  Dmitry V. Levin  <ldv@strace.io>

        tests: optimize ptrace test for the case when NT_FPREGSET is not supported
        * tests/ptrace.c (test_getregset_setregset): If the NT_FPREGSET loop
        failed to calculate actual_fpregset_size, fall back to regset_buf_size,
        to avoid unnecessary looping.

        tests: optimize ptrace test for the case when NT_PRSTATUS is not supported
        * tests/ptrace.c (test_getregset_setregset): If the NT_PRSTATUS loop
        failed to calculate actual_prstatus_size, fall back to regset_buf_size,
        to avoid unnecessary looping.

2021-05-24  Dmitry V. Levin  <ldv@strace.io>

        mips o32: fix PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding.
        * src/linux/mips/arch_prstatus_regset.h (struct_prstatus_regset)
        [LINUX_MIPSO32]: Add unused fields.
        * src/linux/mips/arch_prstatus_regset.c (arch_decode_prstatus_regset):
        Take unused fields into account.
        * tests/ptrace.c (print_prstatus_regset) [__mips__] (mips_regs)
        [LINUX_MIPSO32]: Add unused fields, take them into account.

        Fixes: v5.12-65-g5a352d862 "mips: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding"

2021-05-23  Dmitry V. Levin  <ldv@strace.io>

        powerpc*: implement NT_FPREGSET regset decoding.
        * src/linux/powerpc/arch_fpregset.c: New file.
        * src/linux/powerpc/arch_fpregset.h: New file.
        * src/linux/powerpc64/arch_fpregset.c: Likewise.
        * src/linux/powerpc64/arch_fpregset.h: Likewise.
        * src/linux/powerpc64le/arch_fpregset.c: Likewise.
        * src/linux/powerpc64le/arch_fpregset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c (FPREGSET_SLOT_SIZE): New macro.
        (print_fpregset) [__powerpc__ || __powerpc64__]: Update expected output.

2021-05-22  Dmitry V. Levin  <ldv@strace.io>

        x86_64, x32, i386: implement NT_FPREGSET regset decoding.
        * src/linux/i386/arch_fpregset.c: New file.
        * src/linux/i386/arch_fpregset.h: New file.
        * src/linux/x32/arch_fpregset.c: Likewise.
        * src/linux/x32/arch_fpregset.h: Likewise.
        * src/linux/x86_64/arch_fpregset.c: Likewise.
        * src/linux/x86_64/arch_fpregset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * NEWS: Mention this change.
        * tests/gen_tests.in (ptrace): Add -s64.
        * tests/ptrace.c (print_fpregset) [__x86_64__ || __i386__]: Update
        expected output.

2021-05-21  Dmitry V. Levin  <ldv@strace.io>

        Introduce NT_FPREGSET regset decoding infrastructure.
        * src/linux/generic/arch_fpregset.c: New file.
        * src/linux/generic/arch_fpregset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * src/ptrace.c (decode_regset): Handle NT_FPREGSET.
        * src/regset.c: Include "arch_fpregset.h" and "arch_fpregset.c".
        [HAVE_ARCH_FPREGSET]: Include DEF_MPERS_TYPE(struct_fpregset).
        (decode_fpregset): New function.
        * tests/ptrace.c (do_getregset_setregset): Add actual_size argument.
        (actual_fpregset_size): New variable.
        (print_fpregset): New function.
        (test_getregset_setregset): Use them to check the change.

2021-05-20  Dmitry V. Levin  <ldv@strace.io>

        powerpc*: ignore higher bits of pt_regs.trap in the scv ABI check.
        The higher bits of pt_regs.trap are currently zero, but
        this is not guaranteed, and the upcoming change in
        Documentation/powerpc/syscall64-abi.rst would say that
        0xfff0 mask should be used in the scv ABI check instead.

        * src/linux/powerpc/arch_regs.c (PPC_TRAP_FLAGS_MASK, PPC_TRAP): Remove.
        (PPC_TRAP_IS_SCV): Apply 0xfff0 mask.

2021-05-19  Dmitry V. Levin  <ldv@strace.io>

        powerpc*: implement System Call Vectored ABI support.
        Linux kernel commit v5.9-rc1~100^2~164 introduced a new system call ABI
        on powerpc, powerpc64, and powerpc64le.  The scv ABI has a few major
        differences from the traditional sc ABI, the most important of them is
        a different error handling.

        Apparently, there is a way to tell for a particular syscall invocation
        whether the scv ABI or the sc ABI was used by checking
        struct pt_regs.trap.

        * src/linux/powerpc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): Remove.
        * src/linux/powerpc64/arch_defs_.h: Likewise.
        * src/linux/powerpc64le/arch_defs_.h: Likewise.
        * src/linux/powerpc/arch_regs.c (PPC_TRAP_FLAGS_MASK, PPC_TRAP,
        PPC_TRAP_IS_SCV): New macros.
        * src/linux/powerpc/get_error.c: Include "negated_errno.h".
        (arch_get_error): Use PPC_TRAP_IS_SCV to implement scv ABI support.
        * src/linux/powerpc/set_error.c (arch_set_r3_ccr): Remove.
        (arch_set_error, arch_set_success): Use PPC_TRAP_IS_SCV to implement
        scv ABI support.
        * NEWS: Mention this change.

2021-05-18  Dmitry V. Levin  <ldv@strace.io>

        powerpc, powerpc64: use set_regs interface for set_error.
        The use of set_regs interface saves one syscall invocation per set_error
        when PTRACE_GET_SYSCALL_INFO is used.

        Since set_regs is not compatible with getregs_old, the latter is
        removed, consequently, linux kernel >= 2.6.23 is required on powerpc and
        powerpc64, older kernel versions without a decent PTRACE_GETREGS support
        will not work.

        * src/linux/powerpc/arch_regs.c (ARCH_MIGHT_USE_SET_REGS): Remove.
        * src/linux/powerpc/set_error.c (arch_set_r3_ccr): Use set_regs instead
        of upeek and upoke.
        * src/disable_ptrace_getregset.c [HAVE_GETREGS_OLD && __powerpc__]
        (DISABLE_PTRACE_REQUEST): Remove.
        * src/linux/powerpc/getregs_old.c: Remove.
        * src/linux/powerpc/getregs_old.h: Likewise.
        * src/linux/powerpc64/getregs_old.c: Likewise.
        * src/linux/powerpc64/getregs_old.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Remove them.
        * NEWS: Mention this change.

2021-05-17  Dmitry V. Levin  <ldv@strace.io>

        mips: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding.
        * src/linux/mips/arch_prstatus_regset.c: New file.
        * src/linux/mips/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__mips__]: Update expected
        output.

2021-05-16  Dmitry V. Levin  <ldv@strace.io>

        riscv64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding.
        * src/linux/riscv64/arch_prstatus_regset.c: New file.
        * src/linux/riscv64/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__riscv__]: Update expected
        output.

2021-05-15  Dmitry V. Levin  <ldv@strace.io>

        sparc, sparc64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding
        * src/linux/sparc/arch_prstatus_regset.c: New file.
        * src/linux/sparc/arch_prstatus_regset.h: Likewise.
        * src/linux/sparc64/arch_prstatus_regset.c: Likewise.
        * src/linux/sparc64/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__sparc__]: Update expected
        output.

2021-05-14  Dmitry V. Levin  <ldv@strace.io>

        s390, s390x: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding.
        * src/linux/s390/arch_prstatus_regset.c: New file.
        * src/linux/s390/arch_prstatus_regset.h: Likewise.
        * src/linux/s390x/arch_prstatus_regset.c: Likewise.
        * src/linux/s390x/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__s390__ || __s390x__]:
        Update expected output.

2021-05-13  Dmitry V. Levin  <ldv@strace.io>

        aarch64, arm: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding
        * src/linux/aarch64/arch_prstatus_regset.c: New file.
        * src/linux/aarch64/arch_prstatus_regset.h: Likewise.
        * src/linux/arm/arch_prstatus_regset.c: Likewise.
        * src/linux/arm/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__arm__ || __arm64__ ||
        __aarch64__]: Update expected output.

2021-05-12  Dmitry V. Levin  <ldv@strace.io>

        powerpc*: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding.
        * src/linux/powerpc/arch_prstatus_regset.c: New file.
        * src/linux/powerpc/arch_prstatus_regset.h: Likewise.
        * src/linux/powerpc64/arch_prstatus_regset.c: Likewise.
        * src/linux/powerpc64/arch_prstatus_regset.h: Likewise.
        * src/linux/powerpc64le/arch_prstatus_regset.c: Likewise.
        * src/linux/powerpc64le/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * tests/ptrace.c: (print_prstatus_regset) [__powerpc__ || __powerpc64__]:
        Update expected output.

2021-05-11  Dmitry V. Levin  <ldv@strace.io>

        x86_64, x32, i386: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding
        * src/linux/i386/arch_prstatus_regset.c: New file.
        * src/linux/i386/arch_prstatus_regset.h: New file.
        * src/linux/x32/arch_prstatus_regset.c: Likewise.
        * src/linux/x32/arch_prstatus_regset.h: Likewise.
        * src/linux/x86_64/arch_prstatus_regset.c: Likewise.
        * src/linux/x86_64/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * NEWS: Mention this change.
        * tests/ptrace.c: Include "print_fields.h" and <sys/user.h>.
        (print_prstatus_regset) [__x86_64__ || __i386__]: Update expected
        output.

        Introduce PTRACE_GETREGSET/PTRACE_SETREGSET regset decoding infrastructure
        * src/regset.c: New file.
        * src/linux/generic/arch_prstatus_regset.c: Likewise.
        * src/linux/generic/arch_prstatus_regset.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Add them.
        * src/ptrace.c (decode_regset): New function.
        (decode_getregset, decode_setregset): Use it.

2021-05-10  Dmitry V. Levin  <ldv@strace.io>

        ptrace: print both values of struct iovec.iov_len when they change.
        On exiting of PTRACE_GETREGSET request the kernel modifies iov_len
        to indicate the actual number of bytes returned.
        Likewise, on exiting of PTRACE_SETREGSET request the kernel modifies
        iov_len to indicate the actual number of bytes read.

        * src/ptrace.c (decode_getregset, decode_setregset): Save the value
        of struct iovec.iov_len on entering syscall and print the new value
        on exiting when it is different from the old one.
        * tests/ptrace.c (actual_prstatus_size): New variable.
        (print_prstatus_regset, do_getregset_setregset): New functions.
        (test_getregset_setregset): Use them to check the change.

2021-05-10  Dmitry V. Levin  <ldv@strace.io>

        ptrace: print struct iovec as a structure.
        It used to be printed as an array of struct iovec containing just one
        element.

        * src/ptrace.c: Include "struct_iovec.h".
        (decode_getregset, decode_setregset): New functions.
        (decode_ptrace_entering, decode_ptrace_exiting): Use them to decode
        PTRACE_GETREGSET and PTRACE_SETREGSET.
        * tests/ptrace.c: Include <sys/uio.h>.
        (test_getregset_setregset): New function.
        (main): Use it to check PTRACE_GETREGSET and PTRACE_SETREGSET decoding.

2021-05-10  Dmitry V. Levin  <ldv@strace.io>

        Introduce strace_iovec type and fetch_struct_iovec function.
        These are going to be needed for those decoders that need to obtain
        struct iovec objects without printing them, and therefore cannot use
        tprint_iov_upto.

        * src/fetch_struct_iovec.c: New file.
        * src/iovec.h: Likewise.
        * src/Makefile.am (libstrace_a_SOURCES): Add them.

2021-05-09  Dmitry V. Levin  <ldv@strace.io>

        tprint_iov, tprint_iov_upto: replace enum iov_decode with a function pointer
        This paves the way for custom printers of struct iovec.

        * src/defs.h (enum iov_decode): Remove.
        (print_obj_by_addr_size_fn): New typedef.
        (iov_decode_addr, iov_decode_str): New function prototypes.
        (tprint_iov_upto): Remove enum iov_decode argument, add
        print_obj_by_addr_size_fn and void *opaque_data arguments.
        All users updated.
        (tprint_iov): Replace enum iov_decode argument with
        print_obj_by_addr_size_fn.  All users updated.
        * src/io.c (iov_decode_addr, iov_decode_str): New functions.
        (struct print_iovec_config): Replace decode_iov field with
        print_func and opaque_data.
        (print_iovec_klong): Use them.
        (tprint_iov_upto): Likewise.  Remove enum iov_decode argument,
        add print_obj_by_addr_size_fn and void *opaque_data arguments.
        * src/msghdr.c (iov_decode_netlink): New function.
        (print_struct_msghdr): Use it.

2021-05-09  Dmitry V. Levin  <ldv@strace.io>

        io: simplify print_iovec_klong.
        Prepare to replace enum iov_decode with a function pointer.

        * src/io.c (print_iovec_klong): Move struct print_iovec_config.data_size
        manipulations out of the switch statement and perform them regardless of
        struct print_iovec_config.decode_iov value.

2021-05-09  Dmitry V. Levin  <ldv@strace.io>

        io: refactor print_iovec.
        Since print_iovec is called by print_array and a single print_array
        invocation may end up with many print_iovec invocations, move the
        current_wordsize-based logic out of print_iovec to the caller of
        print_array.

        * src/defs.h (ANY_WORDSIZE_EQUALS_TO_KERNEL_LONG): New macro.
        (print_iovec): Refactor into ...
        (print_iovec_klong, print_iovec_elem_int, print_iovec_elem_klong):
        ... new functions.
        (tprint_iov_upto): Use them.

2021-05-08  Dmitry V. Levin  <ldv@strace.io>

        ptrace: move decoder of struct seccomp_metadata into a separate function
        * src/ptrace.c (decode_seccomp_metadata): New function.
        (decode_ptrace_entering, decode_ptrace_exiting): Use it.

        ptrace: move decoder of struct ptrace_peeksiginfo_args into a separate function
        * src/ptrace.c (decode_peeksiginfo_args): New function.
        (decode_ptrace_entering): Use it.

        ptrace: handle requests without addr and data arguments separately.
        * src/ptrace.c (decode_ptrace_entering): Move PTRACE_ATTACH,
        PTRACE_INTERRUPT PTRACE_KILL, and PTRACE_LISTEN into a dedicated
        switch statement.

        ptrace: untangle ia64-specific and sparc-specific code.
        * src/ptrace.c (decode_ptrace_entering): Untangle [IA64]
        and [SPARC || SPARC64] code.

        ptrace: split the ptrace decoder into two functions.
        * src/ptrace.c (decode_ptrace_entering, decode_ptrace_exiting): New
        functions.
        (SYS_FUNC(ptrace)): Use them.

2021-05-08  Dmitry V. Levin  <ldv@strace.io>

        src: rename process.c to ptrace.c.
        Long time ago process.c used to contain decoders of various syscalls,
        but since commit v4.10~295 this file exclusively contains the decoder
        of ptrace syscall.  Now it's time to rename the file, too.

        * src/process.c: Rename to ...
        * src/ptrace.c: this file.
        * src/Makefile.am (libstrace_a_SOURCES): Rename process.c to ptrace.c.

2021-05-08  Dmitry V. Levin  <ldv@strace.io>

        rtnl_link: use print_fields.h helpers.
        * src/rtnl_link.c (decode_ifinfomsg): Use tprint_struct_next and
        tprint_array_next.

        rtnl_dcb: use print_fields.h helpers.
        * src/rtnl_dcb.c (decode_dcbmsg): Use tprint_struct_next and
        tprint_array_next.

        rtnl_addrlabel: use print_fields.h helpers.
        * src/rtnl_addrlabel.c (decode_ifaddrlblmsg): Use tprint_struct_next
        and tprint_array_next.

        rtnl_addr: use print_fields.h helpers.
        * src/rtnl_addr.c (decode_ifaddrmsg): Use tprint_struct_next and
        tprint_array_next.

        netlink_sock_diag: give a name to the nameless field of the artificial structure
        * src/netlink_sock_diag.c (decode_family): When printing the rest of the
        artificial structure as a string, give it a name so it would look like
        a proper structure.
        * tests/netlink_sock_diag.c (test_odd_family_req, test_odd_family_msg):
        Update expected output.

        netlink_route: give a name to the nameless field of the artificial structure
        * src/netlink_route.c (decode_family): When printing the rest of the
        artificial structure as a string, give it a name so it would look like
        a proper structure.
        * tests/netlink_route.c (test_rtnl_unspec): Update expected output.

2021-05-07  Dmitry V. Levin  <ldv@strace.io>

        netlink_kobject_uevent: use print_fields.h helpers.
        * src/netlink_kobject_uevent.c (PRINT_FIELD_HTONL_X): New macro.
        (decode_netlink_kobject_uevent): Use it.

2021-05-07  Dmitry V. Levin  <ldv@strace.io>

        netlink_kobject_uevent: print the structure followed by payload as an array
        When struct udev_monitor_netlink_header is followed by payload, print
        this sequence of data as an array rather than a compound structure
        without fields.

        * src/netlink_kobject_uevent.c (decode_netlink_kobject_uevent): Use
        tprint_array_begin, tprint_array_next, and tprint_array_end instead of
        tprint_struct_begin, tprints(", "), and tprint_struct_end when
        len > offset.
        * tests/netlink_kobject_uevent.c (test_nlmsg_type_udev): Update expected
        output.

2021-05-06  Dmitry V. Levin  <ldv@strace.io>

        netlink_unix_diag: use print_fields.h helpers.
        * src/netlink_unix_diag.c (print_inode): Use PRINT_VAL_U.
        (decode_unix_diag_req, decode_unix_diag_req): Use tprint_struct_next
        and tprint_array_next.

        netlink_smc_diag: use print_fields.h helpers.
        * src/netlink_smc_diag.c (decode_smc_diag_req,
        decode_smc_diag_req): Use tprint_struct_next and tprint_array_next.

        netlink_packet_diag: use print_fields.h helpers.
        * src/netlink_packet_diag.c (decode_packet_diag_req,
        decode_packet_diag_req): Use tprint_struct_next and tprint_array_next.

        netlink_netlink_diag: use print_fields.h helpers.
        * src/netlink_netlink_diag.c (decode_netlink_diag_req,
        decode_netlink_diag_msg): Use tprint_struct_next, tprint_array_next,
        and print_xlat.

        netlink_netfilter: use print_fields.h helpers.
        * src/netlink_netfilter.c (decode_netlink_netfilter): Use
        tprints_arg_begin, PRINT_VAL_U, tprint_arg_end, and tprint_array_next.

2021-05-05  Alyssa Ross  <hi@alyssa.is>

        close_range: fd and max_fd are unsigned.
        The distinction is important, because close_range(2) says that having
        max_fd < fd is an error, but if you give the kernel 1U + INT_MAX as
        max_fd, it'll interpret it as unsigned.

        Since we're working with ranges of file descriptors here, the
        particular properties of only the start and end file descriptors
        aren't really relevant, so it doesn't matter that we're losing fancy
        file descriptor printing in making this change.

2021-05-05  Dmitry V. Levin  <ldv@strace.io>

        netlink_inet_diag: use print_fields.h helpers.
        * src/netlink_inet_diag.c (decode_inet_diag_hostcond): Use
        tprint_struct_next.
        (decode_inet_diag_bc_op): Use tprint_array_next.
        (decode_inet_diag_req_compat, decode_inet_diag_req_v2,
        decode_inet_diag_msg): Use tprint_struct_next and tprint_array_next.

2021-05-05  Dmitry V. Levin  <ldv@strace.io>

        netlink_inet_diag: remove structure wrapping in decode_inet_diag_bc_op.
        decode_inet_diag_bc_op is called by decode_nlattr and therefore is not
        required to print its message as a single structure or a single array.

        * src/netlink_inet_diag.c (decode_inet_diag_bc_op): Remove invocations
        of tprint_struct_begin and tprint_struct_end.
        * tests/nlattr_inet_diag_req_v2.c (print_inet_diag_bc_op,
        test_inet_diag_bc_s_cond, test_in_addr, test_in6_addr,
        test_inet_diag_bc_dev_cond, test_inet_diag_bc_s_le,
        test_inet_diag_bc_mark_cond, test_inet_diag_bc_nop): Update expected
        output.

2021-05-05  Dmitry V. Levin  <ldv@strace.io>

        netlink_crypto: use print_fields.h helpers.
        decode_crypto_user_alg is called by decode_netlink_crypto
        which in turn is called by decode_payload which is called
        by decode_nlmsghdr_with_payload when printing an array.

        * src/netlink_crypto.c (decode_crypto_user_alg): Use tprint_array_next.

2021-05-04  Alyssa Ross  <hi@alyssa.is>

        tests/pidfd_getfd-y*: skip when no /proc.

        tests/openat2*-y: skip when no /proc.

        tests/kcmp-y: skip when no /proc.

        tests/fsync-y: skip when no /proc.

        tests/dev-*: skip when no /proc.

        tests/bpf-success-long-y: skip when no /proc.

        tests/bpf-success-long-y: fix shebang.

        tests/threads-execve: force clock_nanosleep syscall.
        Using clock_nanosleep here means that these sleeps won't show up in
        the test result, which only monitors for nanosleep.  But on Musl,
        clock_nanosleep(CLOCK_REALTIME, 0, ...) will use the nanosleep
        syscall, so on Musl these extra sleeps would appear in the test output
        and break the tests.

        tests/msg_name: skip another test on Musl.
        The second test here doesn't work on Musl either, for exactly the same
        reason as the first.

2021-05-04  Dmitry V. Levin  <ldv@strace.io>

        tests: skip netlink_protocol test if NETLINK_SOCK_DIAG is not supported.
        * tests/gen_tests.in (netlink_protocol): Use netlink_sock_diag.test.

        Fixes: v5.12-11-g047fe83fc "netlink: simplify decoding of struct nlmsgerr"

2021-05-04  Dmitry V. Levin  <ldv@strace.io>

        netlink: fix unbalanced curly brackets in NETLINK_NETFILTER parser output
        * src/netlink_netfilter.c (decode_netlink_netfilter): Mark the end of
        struct nfgenmsg using tprint_struct_end.
        * tests/netlink_netfilter.c (test_nfgenmsg): Update expected output.

        Fixes: v4.22~98 "netlink: introduce NETLINK_NETFILTER parser"

2021-05-04  Alyssa Ross  <hi@alyssa.is>

        tests/file_handle.c: skip the test if the underlying fs can't do handles
        Quoting name_to_handle_at(2):

        > Some care is needed here as EOVERFLOW can also indicate that no file
        > handle is available for this particular name in a filesystem which
        > does normally support file-handle lookup.  This case can be detected
        > when the EOVERFLOW error is returned without handle_bytes being
        > increased.

        This patch handles that case, resolving 20 failures for me on ZFS, and
        making `make check' able to run successfully.

2021-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: pass 0 as opaque_data in decode_ifla_af_spec's decode_nlattr call
        It has to be 0 to properly trigger decode_nlattr's size=0 special case
        logic (since opaque_data argument is generated by decode_nlattr in that case),
        but it was sloppily just passed through the caller's opaque_data
        instead, which coincidentally used to be 0 up to v5.6~125 "rtnl_link:
        use the family from ifinfomsg".

        * src/rtnl_link.c (decode_ifla_af_spec): Pass 0 as the opaque_data argument
        to the decode_nlattr() call.

        Reported-by: Dmitry V. Levin <ldv@strace.io>
        Fixes: v4.23~41 "rtnl_link: decode IFLA_AF_SPEC"
        Fixes: v5.6~125 "rtnl_link: use the family from ifinfomsg"

2021-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xmalloc: use ROUNDUP_DIV instead of open-coding it in xgrowarray.
        * src/xmalloc.c: Include "macros.h".
        (xgrowarray): Use ROUNDUP_DIV macro for the initial array member
        count calculation.

2021-05-03  Dmitry V. Levin  <ldv@strace.io>

        nlattr: use print_fields.h helpers.
        * src/netlink.c (decode_nlattr): Use tprint_array_begin,
        tprint_array_next, and tprint_array_end.
        (decode_nla_be16, decode_nla_be64): Use tprints_arg_begin, PRINT_VAL_U,
        and tprint_arg_end.

        netlink: use print_fields.h helpers.
        * src/netlink.c (decode_nlmsg_type_netfilter): Use PRINT_VAL_X.
        (print_cookie): Use PRINT_VAL_U.
        (decode_payload): Use PRINT_VAL_D.
        (decode_netlink): Use tprint_array_begin, tprint_array_next,
        and tprint_array_end.

2021-05-03  Dmitry V. Levin  <ldv@strace.io>

        netlink, nlattr: print structures followed by payloads as arrays.
        When struct nlmsgerr is followed by payload, print this sequence of data
        as an array rather than a compound structure with a few nameless fields.

        Likewise, when struct nlattr is followed by payload, print this sequence
        of data as an array rather than a compound structure with nameless
        fields.

        * src/netlink.c (decode_nlmsgerr): Print the sequence of data
        as an array when len > payload.
        * src/nlattr.c (decode_nlattr_with_data): Use
        tprint_array_begin and tprint_array_end instead of
        tprint_struct_begin and tprint_struct_end
        when nla_len > NLA_HDRLEN.
        * NEWS: Mention this change.
        * tests/nlattr.c (test_nlattr): Update expected output.
        * tests/nlattr_ifinfomsg.c (print_prop_list_msg): Likewise.
        * tests/nlattr_ifla.h (print_ifinfomsg): Likewise.
        * tests/nlattr_ifla_af_spec.c (print_##family_##_msg): Likewise.
        * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS, TEST_LINKINFO_,
        TEST_NESTED_LINKINFO): Likewise.
        * tests/nlattr_mdba_mdb_entry.c (print_br_port_msg, main): Likewise.
        * tests/nlattr_mdba_router_port.c (print_br_port_msg, main): Likewise.
        * tests/nlattr_nlmsgerr.c (print_nlmsgerr, main): Likewise.
        * tests/nlattr_tc_stats.c (print_tcmsg): Likewise.
        * tests/nlattr_tca_stab.c (print_tcmsg): Likewise.
        * tests/test_nlattr.h (print_nlattr, print_sockfd): Likewise.

2021-05-02  Dmitry V. Levin  <ldv@strace.io>

        netlink: simplify decoding of struct nlmsgerr.
        Since the kernel never sends a NLMSG_ERROR message with an incomplete
        struct nlmsgerr, do not decode incomplete struct nlmsgerr.

        * src/netlink.c (decode_nlmsgerr): Print the data as a hex string when
        its length is less than sizeof(struct nlmsgerr).
        * tests/netlink_protocol.c (test_nlmsgerr): Check it.

2021-05-02  Dmitry V. Levin  <ldv@strace.io>

        netlink: validate struct nlmsgerr.msg.nlmsg_len.
        * src/netlink.c (decode_nlmsgerr): Use sizeof(struct nlmsgerr.msg)
        instead of struct nlmsgerr.msg.nlmsg_len if the latter is invalid.
        * tests/netlink_protocol.c (test_nlmsgerr): Check it.

2021-05-02  Dmitry V. Levin  <ldv@strace.io>

        tests: assume NLM_F_CAPPED and NLM_F_ACK_TLVS are defined.
        * tests/netlink_protocol.c: Assume NLM_F_CAPPED and NLM_F_ACK_TLVS are
        defined.

        Complements: v5.11~18 (netlink.h: switch to use bundled <linux/netlink.h> and <linux/socket.h>)

2021-05-01  Dmitry V. Levin  <ldv@strace.io>

        netlink: print struct nlmsghdr followed by payload as an array.
        When struct nlmsghdr is followed by payload, print this sequence
        of data as an array rather than a compound structure without fields.

        * src/netlink.c (decode_nlmsghdr_with_payload): Use
        tprint_array_begin and tprint_array_end instead of
        tprint_struct_begin and tprint_struct_end
        when nlmsg_len > NLMSG_HDRLEN.
        * tests/test_netlink.h (TEST_NETLINK_): Update expected output.
        * tests/test_nlattr.c (TEST_NLATTR_EX_): Likewise.
        * tests/netlink_generic.c (test_nlmsg_type): Likewise.
        * tests/netlink_protocol.c (send_query, test_nlmsgerr, test_nlmsg_done):
        Likewise.
        * tests/nlattr.c (test_nlattr, test_nla_type): Likewise.

2021-04-30  Dmitry V. Levin  <ldv@strace.io>

        tee: use print_fields.h helpers.
        * src/tee.c (tee_print_param_fn): Use PRINT_VAL_U and PRINT_VAL_X.
        (tee_version, tee_open_session, tee_invoke, tee_cancel,
        tee_close_session, tee_suppl_recv, tee_suppl_send, tee_shm_alloc,
        tee_shm_register_fd, tee_shm_register): Use tprint_arg_next.

2021-04-29  Dmitry V. Levin  <ldv@strace.io>

        ipc: use print_fields.h helpers.
        * src/ipc.c (SYS_FUNC(ipc)): Use tprint_arg_next and PRINT_VAL_X.

        uid: use print_fields.h helpers.
        * src/uid.c (get_print_uid): Use tprint_indirect_begin and
        tprint_indirect_end.

2021-04-28  Dmitry V. Levin  <ldv@strace.io>

        sock: use print_fields.h helpers.
        * src/sock.c (print_ifc_len): Use tprint_comment_begin,
        tprint_comment_end, PRINT_VAL_D, and PRINT_VAL_U.
        (decode_ifconf, sock_ioctl): Use tprint_arg_next and tprint_struct_next.
        * tests/ioctl_sock_gifconf.c (print_ifc_len): Update expected output.

        perf: use print_fields.h helpers.
        * src/perf.c (SYS_FUNC(perf_event_open)): Use tprint_arg_next and
        PRINT_VAL_D.

2021-04-27  Dmitry V. Levin  <ldv@strace.io>

        mpers.m4: extend compilation checks.
        Before this change, configure --enable-mpers=check failed to detect
        the OS misconfiguration that manifested itself as "#include <errno.h>
        doesn't work".

        * m4/mpers.m4 (st_MPERS): Include <errno.h> along with <stdint.h>
        in compilation checks.

        Reported-by: Deborah Brouwer <3563deb6753@gmail.com>
        Link: https://lists.strace.io/pipermail/strace-devel/2021-March/010449.html
        Resolves: https://github.com/strace/strace/issues/183

2021-04-27  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.12-1.
        * strace.spec.in: Likewise.

2021-04-26  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.12 release.
        * NEWS: Update for 5.12 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2021-04-26  Dmitry V. Levin  <ldv@strace.io>

        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:]]' src tests |grep -v '\.sh$') |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2021-04-25  Dmitry V. Levin  <ldv@strace.io>

        swapon: use print_fields.h helpers.
        * src/swapon.c (SYS_FUNC(swapon)): Use tprint_arg_next and PRINT_VAL_U.

        statx: use print_fields.h helpers.
        * src/statx.c (SYS_FUNC(statx)): Use tprint_arg_next.

2021-04-25  наб  <nabijaczleweli@gmail.com>
            Dmitry V. Levin  <ldv@strace.io>

        Add ioctl entries for OpenZFS ioctls.
        Before/after of strace zfs list:
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x4, 0), 0x7ffe7f41e3b0) = 0
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x12, 0), 0x7ffe7f41e3c0) = 0
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x5, 0), 0x7ffe7f41ad30) = 0
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x27, 0), 0x7ffe7f41e320) = 0
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x14, 0), 0x7ffe7f41e370) = 0
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x14, 0), 0x7ffe7f41ad30) = -1 ESRCH (No such process)
        +ioctl(3, ZFS_IOC_POOL_CONFIGS, 0x7ffffae160c0) = 0
        +ioctl(3, ZFS_IOC_OBJSET_STATS, 0x7ffffae160d0) = 0
        +ioctl(3, ZFS_IOC_POOL_STATS, 0x7ffffae12a40) = 0
        +ioctl(3, ZFS_IOC_POOL_GET_PROPS, 0x7ffffae16030) = 0
        +ioctl(3, ZFS_IOC_DATASET_LIST_NEXT, 0x7ffffae16080) = 0
        +ioctl(3, ZFS_IOC_DATASET_LIST_NEXT, 0x7ffffae12a40) = -1 ESRCH (No such process)
        -ioctl(3, _IOC(_IOC_NONE, 0x5a, 0x3f, 0), 0x7ffe7f41e5b0) = -1 EPERM (Operation not permitted)
        +ioctl(3, ZFS_IOC_LOG_HISTORY, 0x7ffffae162c0) = -1 EPERM (Operation not permitted)

        Before/after of strace zfs/cmd/zvol_id/zvol_id /dev/zd0:
        -ioctl(3, _IOC(_IOC_READ, 0x12, 0x7d, 0x100), 0x7fffa7776e20) = 0
        +ioctl(3, BLKZNAME, 0x7ffe02f435b0)      = 0

        * maint/ioctls_zfs.sh New file.
        * src/ioctls_zfs.h: New file, generated from
        https://github.com/openzfs/zfs tree using maint/ioctls_zfs.sh script.
        * ioctlsort.c: Include "ioctls_zfs.h".
        * src/Makefile.am (EXTRA_DIST): Add ioctls_zfs.h.
        (ioctlsort%.o): Add $(srcdir)/ioctls_zfs.h to prerequisites.
        * tests/ioctl.c: Test a few ZFS ioctls.

2021-04-25  Dmitry V. Levin  <ldv@strace.io>

        seccomp: use print_fields.h helpers.
        * src/seccomp.c (SYS_FUNC(seccomp)): Use tprint_arg_next,
        tprint_indirect_begin, tprint_indirect_end, and PRINT_VAL_U.

        scsi: use print_fields.h helpers.
        * src/scsi.c (decode_sg_io, decode_sg_scsi_id, scsi_ioctl): Use
        tprint_arg_next, tprint_indirect_begin, tprint_indirect_end,
        PRINT_VAL_U, and PRINT_VAL_X.

        rtc: use print_fields.h helpers.
        * src/rtc.c (decode_rtc_vl): Use tprint_indirect_begin and
        tprint_indirect_end.
        (rtc_ioctl): Use tprint_arg_next and PRINT_VAL_U.

        quota: use print_fields.h helpers.
        * src/quota.c (decode_cmd_data, print_qcmd, SYS_FUNC(quotactl)): Use
        tprints_arg_begin, tprint_arg_next, tprint_arg_end,
        tprint_indirect_begin, tprint_indirect_end, and PRINT_VAL_U.

        process: use print_fields.h helpers.
        * src/process.c (SYS_FUNC(ptrace)): Use tprint_arg_next and PRINT_VAL_U.

        print_time: use print_fields.h helpers.
        * src/print_time.c (SYS_FUNC(time)): Use tprint_indirect_begin,
        tprint_indirect_end, and PRINT_VAL_D.

        prctl: use print_fields.h helpers.
        * src/prctl.c (print_prctl_args, SYS_FUNC(prctl)): Use tprint_arg_next,
        tprint_indirect_begin, tprint_indirect_end, PRINT_VAL_D, PRINT_VAL_U,
        and PRINT_VAL_X.

        numa: use print_fields.h helpers.
        * src/numa.c (print_mode): Use PRINT_VAL_X.
        (SYS_FUNC(migrate_pages), SYS_FUNC(mbind), SYS_FUNC(set_mempolicy),
        SYS_FUNC(get_mempolicy), SYS_FUNC(move_pages)): Use tprint_arg_next,
        tprint_indirect_begin, tprint_indirect_end, and PRINT_VAL_U.

2021-04-24  Dmitry V. Levin  <ldv@strace.io>

        nsfs: use print_fields.h helpers.
        * src/nsfs.c (nsfs_ioctl): Use tprint_arg_next, tprint_indirect_begin,
        and tprint_indirect_end.

        net: use print_fields.h helpers.
        * src/net.c (SYS_FUNC(socket), decode_sockname, SYS_FUNC(accept4),
        SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom),
        do_pipe, SYS_FUNC(socketpair), print_sockopt_fd_level_name,
        print_get_error, SYS_FUNC(getsockopt), SYS_FUNC(setsockopt)): Use
        tprints_arg_begin, tprint_arg_next, tprint_arg_end,
        tprint_indirect_begin, tprint_indirect_end, tprint_value_changed,
        PRINT_VAL_D, and PRINT_VAL_U.
        * tests/sockname.c (test_sockname_syscall): Update expected output
        by printing " => " instead of "->" in cases of changed socklen.
        * tests/net-y-unix.c (main): Likewise.
        * tests/net-yy-unix.c (main): Likewise.
        * tests/so_linger.c (main): Likewise.
        * tests/so_peercred.c (main): Likewise.
        * tests/sock_filter-v.c (main): Likewise.
        * tests/sockopt-sol_netlink.c (main): Likewise.
        * tests/net.expected: Likewise.
        * tests/sun_path.expected: Likewise.

        net: use print_array.
        * src/net.c (decode_pair_fd): Rewrite using print_array.
        (printpair_fd): Remove.
        (SYS_FUNC(pipe)) [HAVE_ARCH_GETRVAL2]: Rewrite without printpair_fd.

2021-04-23  Dmitry V. Levin  <ldv@strace.io>

        fs_f_ioctl: use print_fields.h helpers.
        * src/fs_f_ioctl.c (decode_fs_ioc_flags): Use tprint_indirect_begin
        and tprint_indirect_end.
        (decode_fiemap, fs_f_ioctl): Use tprint_arg_next.

        mtd: use print_fields.h helpers.
        * src/mtd.c (decode_otp_select): Use tprint_indirect_begin and
        tprint_indirect_end.
        (mtd_ioctl): Use tprint_arg_next.
        (decode_erase_info_user, decode_erase_info_user64, decode_mtd_oob_buf,
        decode_mtd_oob_buf64, decode_otp_info, decode_otp_select,
        decode_mtd_write_req, decode_mtd_info_user, decode_nand_oobinfo,
        decode_nand_ecclayout_user, decode_mtd_ecc_stats): Remove tprints calls.

        msghdr: use print_fields.h helpers.
        * src/msghdr.c (print_cmsg_type_data): Use PRINT_VAL_X.
        (decode_msg_control): Use tprint_array_begin, tprint_array_next,
        tprint_array_end, and PRINT_VAL_U.
        (print_struct_msghdr): Use tprint_value_changed and PRINT_VAL_D.
        (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Use tprint_arg_next and
        PRINT_VAL_D.
        * tests/msg_name.c (test_msg_name): Update expected output by printing
        " => " instead of "->" in cases of changed msg_namelen values.
        * tests/mmsg_name.c (print_msghdr): Likewise.

        msghdr: use print_local_array_ex.
        * src/defs.h (print_xint8_array_member): New prototype.
        * src/util.c (print_xint8_array_member): New function.
        * src/msghdr.c (print_scm_rights, print_cmsg_uint): Rewrite using
        print_local_array_ex.
        (print_cmsg_xint8_t): New function.
        (print_cmsg_uint8_t, print_cmsg_ip_opts): Remove.
        (cmsg_ip_printers): Replace print_cmsg_uint8_t and print_cmsg_ip_opts
        with print_cmsg_xint8_t.
        * tests/inet-cmsg.c (print_opts): Update expected output by printing
        bytes using "%#x" format instead of "0x%02x".

        Make print_fd_array_member global and move it from io_uring.c to util.c.
        * src/defs.h (print_fd_array_member): New prototype.
        * src/io_uring.c (print_fd_array_member): Remove static qualifier,
        move ...
        * src/util.c: ... here.

        mmsghdr: use print_fields.h helpers.
        * src/mmsghdr.c (SYS_FUNC(sendmmsg), do_recvmmsg): Use tprint_arg_next
        and PRINT_VAL_U.

        mount: use print_fields.h helpers.
        * src/mount.c (SYS_FUNC(mount)): Use tprint_arg_next.

2021-04-22  Dmitry V. Levin  <ldv@strace.io>

        mem: use print_fields.h helpers.
        * src/mem.c (print_mmap_flags, print_mmap, SYS_FUNC(munmap),
        do_mprotect, SYS_FUNC(mremap), SYS_FUNC(madvise),
        SYS_FUNC(process_madvise), SYS_FUNC(msync), SYS_FUNC(mlock2),
        SYS_FUNC(mincore), SYS_FUNC(remap_file_pages), print_protmap_entry,
        SYS_FUNC(subpage_prot)): Use tprint_arg_next, PRINT_VAL_D,
        PRINT_VAL_U, and PRINT_VAL_X.

        mem: use print_array to decode mincore syscall.
        * src/mem.c (print_mincore_entry): New function.
        (SYS_FUNC(mincore)): Use it with print_array to print the 3rd argument
        of mincore syscall.

2021-04-22  Dmitry V. Levin  <ldv@strace.io>

        mem: assume that MREMAP_FIXED is defined.
        Starting with commit v5.7~80, xlat/mremap_flags.h provides fallback
        definitions for all its constants including MREMAP_FIXED.

        * src/mem.c (SYS_FUNC(mremap)): Assume that MREMAP_FIXED is defined.

2021-04-21  Dmitry V. Levin  <ldv@strace.io>

        kvm: use print_fields.h helpers.
        * src/kvm.c (kvm_ioctl_create_vcpu, kvm_ioctl_set_user_memory_region,
        kvm_ioctl_decode_regs, kvm_ioctl_decode_cpuid2, kvm_ioctl_decode_sregs,
        kvm_ioctl_decode_check_extension): Use tprint_arg_next,
        tprint_array_begin, tprint_array_end, and PRINT_VAL_U.

        kexec: use print_fields.h helpers.
        * src/kexec.c (print_seg): Use PRINT_VAL_U.
        (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Use tprint_arg_next
        and PRINT_VAL_U.

        ipc_shm: use print_fields.h helpers.
        * src/ipc_shm.c (print_shmaddr_shmflg): Use tprint_arg_next.

2021-04-20  Dmitry V. Levin  <ldv@strace.io>

        mpers.awk, ioctls_sym.awk: add binutils 2.36 support.
        The output format of "readelf --debug-dump=info --wide" changed
        in binutils 2.36, breaking mpers.awk and ioctls_sym.awk scripts.

        * src/mpers.awk: Extend regexps to handle the output format of
        "readelf --debug-dump=info --wide" produced by binutils 2.36.
        * maint/ioctls_sym.awk: Likewise.
        * NEWS: Mention this change.

        Resolves: https://github.com/strace/strace/issues/171
        Resolves: https://github.com/strace/strace/issues/180

2021-04-19  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.12.
        * src/linux/32/ioctls_inc_align16.h: Update from src/linux v5.12-rc8
        using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/aarch64/ioctls_arch0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/mips/ioctls_arch0.h: Likewise.
        * src/linux/powerpc/ioctls_arch0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2021-04-19  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        arm: remove kvm ioctl definitions.
        arm 32bit KVM host support was removed in Linux v5.7-rc1.

        * maint/ioctls_sym.sh: Remove arm architecture from the list
        of kvm-capable architectures.
        * src/linux/arm/ioctls_arch0.h: Regenerate.

2021-04-19  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of mount_setattr syscall.
        * tests/mount_setattr.c: New file.
        * tests/mount_setattr-P.c: Likewise.
        * tests/gen_tests.in (mount_setattr, mount_setattr-P): New entries.
        * tests/pure_executables.list: Add mount_setattr and mount_setattr-P.
        * tests/.gitignore: Likewise.

2021-04-18  Dmitry V. Levin  <ldv@strace.io>

        Implement decoding of mount_setattr syscall.
        ... introduced by Linux kernel commits v5.12-rc1~64^2~6 and
        v5.12-rc1~64^2~5.

        * src/mount_setattr.c: New file.
        * Makefile.am (strace_SOURCES): Add mount_setattr.c.
        * src/xlat/mount_attr_attr.in: New file.
        * src/xlat/mount_attr_propagation.in: Likewise.
        * src/xlat/mount_setattr_flags.in: Likewise.
        * src/linux/generic/syscallent-common.h [BASE_NR + 442]: Wire up
        mount_setattr.
        * src/pathtrace.c (pathtrace_match_set): Handle SEN_mount_setattr.
        * NEWS: Mention this change.

2021-04-18  Dmitry V. Levin  <ldv@strace.io>

        xlat: rename mount_attr_flags.in to fsmount_attr_flags.in.
        * src/xlat/mount_attr_flags.in: Rename to
        src/xlat/fsmount_attr_flags.in, to avoid confusion introduced by upcoming mount_setattr syscall.
        * src/fsmount.c: Include "xlat/fsmount_attr_flags.h" instead of
        "xlat/mount_attr_flags.h".
        (SYS_FUNC(fsmount)): Replace mount_attr_flags with fsmount_attr_flags.

2021-04-17  Dmitry V. Levin  <ldv@strace.io>

        ipc_shm: use print_fields.h helpers.
        * src/ipc_shm.c (SYS_FUNC(shmget)): Use tprint_arg_next and PRINT_VAL_U.
        (print_shmaddr_shmflg): New function.
        (SYS_FUNC(shmat)): Use it, tprint_arg_next, and PRINT_VAL_D.

2021-04-16  Dmitry V. Levin  <ldv@strace.io>

        ipc_semctl: use print_fields.h helpers.
        * src/ipc_semctl.c (print_semid_ds, print_seminfo, SYS_FUNC(semctl)):
        Use tprint_indirect_begin, tprint_indirect_end, tprint_arg_next, and
        PRINT_VAL_D.

2021-04-15  Dmitry V. Levin  <ldv@strace.io>

        ipc_sem: use print_fields.h helpers.
        * src/ipc_sem.c (tprint_sembuf_array, SYS_FUNC(semop), do_semtimedop,
        SYS_FUNC(semget)): Use tprint_arg_next, PRINT_VAL_U, and PRINT_VAL_D.

2021-04-14  Dmitry V. Levin  <ldv@strace.io>

        ipc_msg: use print_fields.h helpers.
        * src/ipc_msg.c (tprint_msgsnd, tprint_msgrcv, SYS_FUNC(msgget),
        SYS_FUNC(msgrcv)): Use tprint_arg_next, PRINT_VAL_U, and PRINT_VAL_D.

2021-04-13  Dmitry V. Levin  <ldv@strace.io>

        futex: use print_fields.h helpers.
        * src/futex.c (do_futex): Use tprint_arg_next, PRINT_VAL_U, and
        PRINT_VAL_X.

2021-04-12  Dmitry V. Levin  <ldv@strace.io>

        fanotify: use print_fields.h helpers.
        * src/fanotify.c (SYS_FUNC(fanotify_init), SYS_FUNC(fanotify_mark)): Use
        tprint_arg_next.

2021-04-11  Dmitry V. Levin  <ldv@strace.io>

        evdev: use print_fields.h helpers.
        * src/evdev.c (abs_ioctl, keycode_ioctl, keycode_V2_ioctl, getid_ioctl,
        decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl, evdev_read_ioctl,
        evdev_write_ioctl): Remove tprints(", ") invocations.
        (evdev_write_ioctl): Use PRINT_VAL_D and PRINT_VAL_U.
        (evdev_ioctl): Use tprint_arg_next.
        * src/evdev_mpers.c (evdev_write_ioctl_mpers): Remove tprint_arg_next
        invocation.

2021-04-10  Dmitry V. Levin  <ldv@strace.io>

        evdev: use print_array.
        * src/evdev.c (mtslots_ioctl): Use print_array instead of fetching data
        into a VLA and printing it manually.

2021-04-09  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce tprint_indirect_begin and tprint_indirect_end.
        * src/print_fields.h (tprint_indirect_begin, tprint_indirect_end): New
        inline functions.
        * src/util.c (DEF_PRINTNUM, DEF_PRINTNUM_ADDR, DEF_PRINTPAIR,
        printnum_fd, printnum_pid): Use them.

2021-04-08  Dmitry V. Levin  <ldv@strace.io>

        desc: use print_fields.h helpers.
        * src/desc.c (decode_select, do_pselect6): Use tprint_arg_next and
        PRINT_VAL_D.

2021-04-07  Dmitry V. Levin  <ldv@strace.io>

        capability: use print_fields.h helpers.
        * src/capability.c (SYS_FUNC(capget), SYS_FUNC(capset)): Use
        tprint_arg_next.

2021-04-06  Dmitry V. Levin  <ldv@strace.io>

        bpf_filter: use print_fields.h helpers.
        * src/bpf_filter.c (print_bpf_filter_stmt, print_bpf_filter_jump): Use
        tprints_arg_begin, tprint_arg_next, tprint_arg_end, and PRINT_VAL_X.

2021-04-05  Dmitry V. Levin  <ldv@strace.io>

        xlat: update NFT_MSG_* constants.
        * src/xlat/nf_nftables_msg_types.in (NFT_MSG_NEWFLOWTABLE,
        NFT_MSG_GETFLOWTABLE, NFT_MSG_DELFLOWTABLE): New constants introduced
        by Linux kernel commit v4.16-rc1~123^2~216^2~8.
        * src/netlink.c (decode_nlmsg_flags_netfilter) Handle NFT_MSG_NEWFLOWTABLE,
        NFT_MSG_GETFLOWTABLE, and NFT_MSG_DELFLOWTABLE.
        * NEWS: Mention this change.

2021-04-04  Renaud Métrich  <rmetrich@redhat.com>
            Dmitry V. Levin  <ldv@strace.io>

        Implement --secontext[=full] option to display SELinux contexts.
        This is very useful when debugging SELinux issues, in particular, when
        a process runs in an unexpected context or didn't transition properly,
        or typically when a file being opened does not have the proper context.

        When --secontext=full is specified, strace will print the complete
        context (user, role, type and category) instead of just the type which
        is printed for --secontext option, as shown in the examples below:

        Without any "--secontext" options:
        -----------------------------------------------------------------------
        118104  16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416>
        119820  16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys", O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> <0.000399>
        -----------------------------------------------------------------------

        With "--secontext=full" option:
        -----------------------------------------------------------------------
        118104 [system_u:system_r:sshd_t:s0-s0:c0.c1023] 16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416>
        119820 [system_u:system_r:sshd_t:s0-s0:c0.c1023] 16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys" [system_u:object_r:nfs_t:s0], O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> [system_u:object_r:nfs_t:s0] <0.000399>
        -----------------------------------------------------------------------

        With "--secontext" option:
        -----------------------------------------------------------------------
        118104 [sshd_t] 16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416>
        119820 [sshd_t] 16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys" [nfs_t], O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> [nfs_t] <0.000399>
        -----------------------------------------------------------------------

        To implement this, a new "--with-libselinux" configure option has been
        introduced.  It defaults to "check", which means automatic support on
        SELinux aware systems.

2021-04-04  Alyssa Ross  <hi@alyssa.is>

        pathtrace: fix typo in comment.
        * src/pathtrace.c (pathtrace_match_set): Replace TRACE_DESCRIPTOR
        with TRACE_DESC in comment.

2021-04-04  Dmitry V. Levin  <ldv@strace.io>

        xlat: update MTD_* constants.
        * src/xlat/mtd_flags_options.in (MTD_SLC_ON_MLC_EMULATION): New constant
        introduced by Linux kernel commit v5.8-rc1~68^2~5^2~145.
        * NEWS: Mention this change.

2021-04-03  Dmitry V. Levin  <ldv@strace.io>

        xlat: update V4L2_* constants.
        * src/xlat/v4l2_control_id_bases.in (V4L2_CID_USER_CCS_BASE): New
        constant introduced by Linux kernel commit v5.12-rc1~134^2~264.
        * src/xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY):
        New constant introduced by Linux kernel commit v5.10-rc1~175^2~362.
        (V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE): New constant introduced
        by Linux kernel commit v5.10-rc1~175^2~360.
        (V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID): New constant introduced
        by Linux kernel commit v5.12-rc1~134^2~188.
        (V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MAX_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MAX_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MAX_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP): New constants introduced
        by Linux kernel commit v5.12-rc1~134^2~191.
        (V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L0_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L1_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L2_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L3_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L4_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L5_BR,
        V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR): New constants introduced
        by Linux kernel commit v5.12-rc1~134^2~190.
        * NEWS: Mention this change.

2021-04-02  Dmitry V. Levin  <ldv@strace.io>

        tests: simplify vcpu_dev_should_have_cpuid.
        * tests/ioctl_kvm_run_common.c (vcpu_dev_should_have_cpuid): Use
        "/proc/self/fd/%u" instead of "/proc/%d/fd/%d" with getpid().

2021-04-01  Dmitry V. Levin  <ldv@strace.io>

        tests: introduce create_and_enter_subdir and leave_and_remove_subdir.
        Introduce the pair of functions that is going to be used to make sure
        the current workdir of the tracee is different from the current workdir
        of the tracer.

        Use the new interface in a few tests where the difference is going to be
        relevant with --secontext option.

        * tests/subdir.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add subdir.c.
        * tests/tests.h (create_and_enter_subdir, leave_and_remove_subdir):
        New function prototypes.
        * tests/access.c (main): Use create_and_enter_subdir and
        leave_and_remove_subdir.
        * tests/chmod.c (main): Likewise.
        * tests/execve.c (main): Likewise.
        * tests/fchmod.c (main): Likewise.
        * tests/fchmodat.c (main): Likewise.
        * tests/fchownat.c (main): Likewise.
        * tests/linkat.c (main): Likewise.
        * tests/open.c (main): Likewise.
        * tests/openat.c (main): Likewise.

2021-03-31  Dmitry V. Levin  <ldv@strace.io>
            Renaud Métrich  <rmetrich@redhat.com>

        tests: add fchmod-y test.
        * tests/dirfd.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add dirfd.c.
        * tests/tests.h (get_dir_fd, get_fd_path): New function prototypes.
        * tests/fchmod-y.c: New file.
        * tests/fchmod.c (main): Create a sample file, handle YFLAG macro.
        * tests/gen_tests.in (fchmod-y): New entry.
        * tests/pure_executables.list: Add fchmod-y.
        * tests/.gitignore: Likewise.

2021-03-30  Dmitry V. Levin  <ldv@strace.io>

        Bring lists back to the sorted order.
        * src/Makefile.am (libstrace_a_SOURCES): Make the list sorted again.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in: Likewise.

2021-03-29  Dmitry V. Levin  <ldv@strace.io>

        xlat: update RTM_* constants.
        * src/xlat/routing_flags.in (RTM_F_OFFLOAD_FAILED): New constant
        introduced by Linux kernel commit v5.12-rc1~200^2~116^2~9.
        * NEWS: Mention this change.

        xlat: update RESOLVE_* constants.
        * src/xlat/open_resolve_flags.in (RESOLVE_CACHED): New constant
        introduced by Linux kernel commit v5.12-rc1~169^2~1.
        * NEWS: Mention this change.
        * tests/openat2.c (main): Update expected output.

2021-03-29  Dmitry V. Levin  <ldv@strace.io>

        netlink: remove nfnetlink_cthelper.h nfnl_acct_msg_types workaround.
        <linux/netfilter/nfnetlink_cthelper.h> used to have a cut-and-paste typo
        that required a workaround to allow this header to be included along
        with <linux/netfilter/nfnetlink_acct.h>.  Since this typo was fixed by
        Linux kernel commit v5.12-rc3~39^2~22^2~8 and the bundled
        <linux/netfilter/nfnetlink_cthelper.h> was updated, the workaround is no
        longer needed.

        * src/netlink.c: Remove nfnetlink_cthelper.h nfnl_acct_msg_types workaround.

2021-03-28  Dmitry V. Levin  <ldv@strace.io>

        tests: remove redundant __NR_* checks for syscallent-common.h syscalls.
        Assume that all __NR_* macros corresponding to syscalls listed in
        syscallent-common.h are properly defined when "scno.h" is included.

        * tests/close_range.c: Assume that __NR_close_range is defined.
        * tests/faccessat2.c: Assume that __NR_faccessat2 is defined.
        * tests/fsconfig.c: Assume that __NR_fsconfig is defined.
        * tests/fsmount.c: Assume that __NR_fsmount is defined.
        * tests/fsopen.c: Assume that __NR_fsopen is defined.
        * tests/fspick.c: Assume that __NR_fspick is defined.
        * tests/io_uring_enter.c: Assume that __NR_io_uring_enter is defined.
        * tests/io_uring_register.c: Assume that __NR_io_uring_register is
        defined.
        * tests/io_uring_setup.c: Assume that __NR_io_uring_setup is defined.
        * tests/move_mount.c: Assume that __NR_move_mount is defined.
        * tests/open_tree.c: Assume that __NR_open_tree is defined.
        * tests/openat2.c: Assume that __NR_openat2 is defined.
        * tests/pidfd_getfd.c: Assume that __NR_pidfd_getfd is defined.
        * tests/pidfd_open.c: Assume that __NR_pidfd_open is defined.
        * tests/pidfd_send_signal.c: Assume that __NR_pidfd_send_signal is
        defined.

2021-03-28  Deborah Brouwer  <3563deb6753@gmail.com>

        xlat: update ST_* constants.
        * scr/xlat/statfs_flags.in (ST_NOSYMFOLLOW): New constant introduced by
        Linux kernel commit v5.10-rc1~19^2~9.
        * NEWS: Mention this change.

2021-03-27  Dmitry V. Levin  <ldv@strace.io>

        xlat: update MPOL_* constants.
        * src/xlat/mpol_mode_flags.in (MPOL_F_NUMA_BALANCING): New constant
        introduced by Linux kernel commit v5.12-rc1~40^2~13.
        * src/numa.c (print_mode): Add MPOL_F_NUMA_BALANCING to the flags mask.
        * NEWS: Mention this change.
        * tests/mbind.c (mpol_modes): Check it.
        * tests/set_mempolicy.c (mpol_modes): Likewise.

2021-03-26  Dmitry V. Levin  <ldv@strace.io>

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_X86_BUS_LOCK_EXIT): New constant
        introduced by Linux kernel commit v5.12-rc1~26^2~162.
        (KVM_CAP_PPC_DAWR1): New constant introduced by Linux kernel commit
        v5.12-rc1~26^2~37^2~9.
        * src/xlat/kvm_exit_reason.in (KVM_EXIT_X86_BUS_LOCK): New constant
        introduced by Linux kernel commit v5.12-rc1~26^2~162.
        (KVM_EXIT_XEN): New constant introduced by Linux kernel commit
        v5.12-rc1~26^2~97.
        * NEWS: Mention this change.

2021-03-25  Dmitry V. Levin  <ldv@strace.io>

        xlat: update DEVCONF_* constants.
        * src/xlat/inet6_devconf_indices.in (DEVCONF_RPL_SEG_ENABLED): New
        constant introduced by Linux kernel commit v5.7-rc1~146^2~38^2~2.
        (DEVCONF_RA_DEFRTR_METRIC): New constant introduced by Linux kernel
        commit v5.12-rc1~200^2~246.
        * NEWS: Mention this change.

2021-03-24  Dmitry V. Levin  <ldv@strace.io>

        xlat: update IORING_* constants.
        * src/xlat/uring_setup_features.in (IORING_FEAT_NATIVE_WORKERS): New
        constant introduced by Linux kernel commit v5.12-rc1~8^2~11.
        * NEWS: Mention this change.

2021-03-23  Dmitry V. Levin  <ldv@strace.io>

        rtnl_link: update decoding of IFLA_BRPORT_* netlink attributes.
        * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_MRP_RING_OPEN): New
        constant introduced by Linux kernel commit v5.8-rc1~165^2~412^2~7.
        (IFLA_BRPORT_MRP_IN_OPEN): New constant introduced by Linux kernel
        commit v5.9-rc1~133^2~258^2.
        (IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT, IFLA_BRPORT_MCAST_EHT_HOSTS_CNT):
        New constants introduced by Linux kernel commit v5.12-rc1~200^2~235^2.
        * src/rtnl_link.c (ifla_brport_nla_decoders) <IFLA_BRPORT_MRP_RING_OPEN,
        IFLA_BRPORT_MRP_IN_OPEN, IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
        IFLA_BRPORT_MCAST_EHT_HOSTS_CNT>: New decoders.
        * NEWS: Mention this change.

2021-03-22  Dmitry V. Levin  <ldv@strace.io>

        xlat: update PTRACE_SYSEMU* for s390.
        * src/xlat/ptrace_cmds.in (PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP)
        [__s390__]: Provide fallback definitions introduced by Linux kernel
        commit v5.12-rc1~138^2~61.

        bundled: update linux UAPI headers to v5.12-rc4.
        * bundled/linux/include/uapi/linux/dm-ioctl.h: Update to
        headers_install'ed Linux kernel v5.12-rc4.
        * bundled/linux/include/uapi/linux/gpio.h: Likewise.
        * bundled/linux/include/uapi/linux/if_link.h: Likewise.
        * bundled/linux/include/uapi/linux/input.h: Likewise.
        * bundled/linux/include/uapi/linux/io_uring.h: Likewise.
        * bundled/linux/include/uapi/linux/mount.h: Likewise.
        * bundled/linux/include/uapi/linux/openat2.h: Likewise.
        * bundled/linux/include/uapi/linux/perf_event.h: Likewise.
        * bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
        * bundled/linux/include/uapi/linux/rtnetlink.h: Likewise.
        * bundled/linux/include/uapi/linux/tee.h: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cthelper.h:
        Likewise.

2021-03-21  Dmitry V. Levin  <ldv@strace.io>

        ioctl: use print_fields.h helpers.
        * src/ioctl.c: Use tprints_arg_begin, tprint_arg_next, tprint_arg_end,
        PRINT_VAL_U, and PRINT_VAL_X.

        fs_x_ioctl: use print_fields.h helpers.
        * src/fs_x_ioctl.c (fs_x_ioctl): Use tprint_arg_next.

2021-03-20  Dmitry V. Levin  <ldv@strace.io>

        xgetdents: use print_fields.h helpers.
        * src/xgetdents.c (decode_dents): Use tprint_array_begin,
        tprint_array_next, tprint_array_end, and tprint_more_data_follows
        (xgetdents): Use tprint_arg_next and PRINT_VAL_U.

        xattr: use print_fields.h helpers.
        * src/xattr.c: Use tprint_arg_next and PRINT_VAL_U.

2021-03-19  Dmitry V. Levin  <ldv@strace.io>

        watchdog_ioctl: use print_fields.h helpers.
        * src/watchdog_ioctl.c (watchdog_ioctl): Use tprint_arg_next.

2021-03-18  Dmitry V. Levin  <ldv@strace.io>

        utimes: use print_fields.h helpers.
        * src/utimes.c: Use tprint_arg_next.

        utime: use print_fields.h helpers.
        * src/utime.c (SYS_FUNC(utime)): Use tprint_arg_next.

        userfaultfd: use print_fields.h helpers.
        * src/userfaultfd.c: Use tprint_arg_next.

        ubi: use print_fields.h helpers.
        * src/ubi.c: Use tprint_arg_next.

        ustat: use print_fields.h helpers.
        * src/ustat.c (SYS_FUNC(ustat)): Use tprint_arg_next.

        umount: use print_fields.h helpers.
        * src/umount.c (SYS_FUNC(umount2)): Use tprint_arg_next.

2021-03-17  Dmitry V. Levin  <ldv@strace.io>

        time: use print_fields.h helpers.
        * src/time.c: Use tprint_arg_next and PRINT_VAL_D.

2021-03-16  Dmitry V. Levin  <ldv@strace.io>

        sock: print the interface name as a string.
        The interface name passed to SIOCBRADDBR and SIOCBRDELBR ioctl commands
        is not a pathname but an arbitrary string.

        * src/sock.c (sock_ioctl) <SIOCBRADDBR, SIOCBRDELBR>: Print the
        interface name using printstr_ex instead of printpathn.
        * tests/ioctl_sock.c (test_str): Update expected output.

2021-03-16  Dmitry V. Levin  <ldv@strace.io>

        memfd_create: print the first argument as a string.
        The first argument of memfd_create syscall is not a pathname but an
        arbitrary string.

        * src/memfd_create.c [!MFD_NAME_MAX_LEN] (MFD_NAME_MAX_LEN): New macro.
        (SYS_FUNC(memfd_create)): Print the first argument of syscall using
        printstr_ex instead of printpathn.
        * tests/gen_tests.in (memfd_create, memfd_create-Xabbrev,
        memfd_create-Xraw, memfd_create-Xverbose): Pass -s256.
        * tests/memfd_create.c (main): Update expected output.

2021-03-15  Dmitry V. Levin  <ldv@strace.io>

        sysmips: use print_fields.h helpers.
        * src/sysmips.c (SYS_FUNC(sysmips)): Use tprint_arg_next
        and PRINT_VAL_X.

        syslog: use print_fields.h helpers.
        * src/syslog.c (SYS_FUNC(syslog)): Use tprint_arg_next and PRINT_VAL_D.

        statfs64: use print_fields.h helpers.
        * src/statfs64.c (SYS_FUNC(statfs64)): Use tprint_arg_next
        and PRINT_VAL_U.

        statfs: use print_fields.h helpers.
        * src/statfs.c (SYS_FUNC(statfs)): Use tprint_arg_next.

        stat64: use print_fields.h helpers.
        * src/stat64.c (SYS_FUNC(stat64), SYS_FUNC(fstat64),
        SYS_FUNC(fstatat64)): Use tprint_arg_next.

        stat: use print_fields.h helpers.
        * src/stat.c (SYS_FUNC(stat), SYS_FUNC(fstat), SYS_FUNC(newfstatat)):
        Use tprint_arg_next.

        sram_alloc: use print_fields.h helpers.
        * src/sram_alloc.c (SYS_FUNC(sram_alloc)): Use tprint_arg_next
        and PRINT_VAL_U.

        socketcall: use print_fields.h helpers.
        * src/socketcall.c (SYS_FUNC(socketcall)): Use tprint_arg_next.

        signalfd: use print_fields.h helpers.
        * src/signalfd.c (do_signalfd): Use tprint_arg_next and PRINT_VAL_U.

        sigaltstack: use print_fields.h helpers.
        * src/sigaltstack.c (SYS_FUNC(sigaltstack)): Use tprint_arg_next.

        shutdown: use print_fields.h helpers.
        * src/shutdown.c (SYS_FUNC(shutdown)): Use tprint_arg_next.

        sendfile: use print_fields.h helpers.
        * src/sendfile.c (SYS_FUNC(sendfile64), SYS_FUNC(sendfile)): Use
        tprint_arg_next and PRINT_VAL_U.

        sched: use print_fields.h helpers.
        * src/sched.c: Use tprint_arg_next and PRINT_VAL_U.

        tests: use xasprintf instead of asprintf.
        * tests/clone-flags.c: Include "xmalloc.h", replace all asprintf
        invocations followed by perror_msg_and_fail with xasprintf.
        * tests/epoll_pwait2.c: Likewise.
        * tests/faccessat.c: Likewise.
        * tests/faccessat2.c: Likewise.
        * tests/ioctl_kvm_run_common.c: Likewise.
        * tests/keyctl.c: Likewise.
        * tests/lock_file.c: Likewise.
        * tests/mq.c: Likewise.
        * tests/mq_sendrecv.c: Likewise.
        * tests/netlink_protocol.c: Likewise.
        * tests/old_mmap.c: Likewise.
        * tests/tracer_ppid_pgid_sid.c: Likewise.

2021-03-15  Dmitry V. Levin  <ldv@strace.io>

        xmalloc: introduce xasprintf.
        xasprintf is a trivial wrapper around vasprintf,
        the primary purpose of adding it is to simplify tests.

        * src/xmalloc.h (xasprintf): New function declaration.
        * src/xmalloc.c: Include <stdarg.h> and <stdio.h>
        (xasprintf): New function.

2021-03-14  Dmitry V. Levin  <ldv@strace.io>

        riscv: use print_fields.h helpers.
        * src/riscv.c (riscv_flush_icache): Use tprint_arg_next.

        resource: use print_fields.h helpers.
        * src/resource.c (print_rlim64_t, print_rlim32_t, SYS_FUNC(getrlimit),
        SYS_FUNC(setrlimit), SYS_FUNC(prlimit64), SYS_FUNC(getrusage),
        SYS_FUNC(osf_getrusage), priority_print_who, SYS_FUNC(getpriority),
        SYS_FUNC(setpriority)): Use tprint_arg_next, PRINT_VAL_D, and
        PRINT_VAL_U.

        renameat: use print_fields.h helpers.
        * src/renameat.c (decode_renameat, SYS_FUNC(renameat2)): Use
        tprint_arg_next.

        reboot: use print_fields.h helpers.
        * src/reboot.c (SYS_FUNC(reboot)): Use tprint_arg_next.

        readlink: use print_fields.h helpers.
        * src/readlink.c (decode_readlink, SYS_FUNC(readlinkat)): Use
        tprint_arg_next and PRINT_VAL_U.

        random_ioctl: use print_fields.h helpers.
        * src/random_ioctl.c (random_ioctl): Use tprint_arg_next.

        ptp: use print_fields.h helpers.
        * src/ptp.c (ptp_ioctl): Use tprint_arg_next and PRINT_VAL_D.

        process_vm: use print_fields.h helpers.
        * src/process_vm.c (SYS_FUNC(process_vm_readv),
        SYS_FUNC(process_vm_writev)): Use tprint_arg_next and PRINT_VAL_U.

        print_timeval: use print_fields.h helpers.
        * src/print_timeval.c (print_timeval_t, print_timeval32_t): Use
        tprint_struct_begin, tprint_struct_next, tprint_struct_end,
        PRINT_FIELD_D, and PRINT_FIELD_U.

        print_sigevent: use print_fields.h helpers.
        * src/print_sigevent.c (print_sigevent): Use tprint_struct_next.

        print_sg_req_info: use print_fields.h helpers.
        * src/print_sg_req_info.c (decode_sg_req_info): Use tprint_arg_next.

2021-03-13  Dmitry V. Levin  <ldv@strace.io>

        tprint_msgbuf: do not print the size of msgbuf.
        The size of msgbuf is not its part.

        * src/print_msgbuf.c (tprint_msgbuf): Do not print count.
        * src/ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Print count.

2021-03-13  Dmitry V. Levin  <ldv@strace.io>

        print_kernel_version: use print_fields.h helpers.
        * src/print_kernel_version.c (print_kernel_version): Use tprints_arg_begin,
        tprint_arg_next, tprint_arg_end, PRINT_VAL_U, and PRINT_VAL_X.

        print_dev_t: use print_fields.h helpers.
        * src/print_dev_t.c (print_dev_t): Use tprints_arg_begin,
        tprint_arg_next, tprint_arg_end, and PRINT_VAL_X.

        ipc_shmctl: use print_fields.h helpers.
        * src/ipc_shmctl.c (SYS_FUNC(shmctl)): Use tprint_arg_next
        and PRINT_VAL_D.

        ipc_msgctl: use print_fields.h helpers.
        * src/ipc_msgctl.c (SYS_FUNC(msgctl)): Use tprint_arg_next
        and PRINT_VAL_D.

        evdev_mpers: use print_fields.h helpers.
        * src/evdev_mpers.c (evdev_write_ioctl_mpers): Use tprint_arg_next.

        print_fields.h: introduce tprint_comment_{begin,end}
        * src/print_fields.h (tprint_comment_begin, tprint_comment_end): New
        inline functions.
        (PRINT_FIELD_NET_PORT): Use them.
        * src/evdev.c (decode_bitset): Likewise.
        * src/ioctl.c (SYS_FUNC(ioctl)): Likewise.
        * src/mem.c (print_mmap_flags): Likewise.
        * src/memfd_create.c (SYS_FUNC(memfd_create)): Likewise.
        * src/numa.c (print_mode): Likewise.
        * src/print_dev_t.c (print_dev_t): Likewise.
        * src/print_kernel_version.c (print_kernel_version): Likewise.
        * src/process.c (print_user_offset_addr): Likewise.
        * src/quota.c (print_qcmd): Likewise.
        * src/s390.c (print_funcs): Likewise.
        * src/sockaddr.c (print_inet_addr, print_sll_protocol,
        print_bluetooth_l2_psm, print_bluetooth_l2_cid): Likewise.
        * src/strace.c (tprintf_comment): Likewise.
        * src/time.c (printclockname): Likewise.
        * src/xlat.c (printflags_ex): Likewise.

        Replace tprint_arg_begin with tprints_arg_begin.
        * src/print_fields.h (tprint_arg_begin): Remove.
        (tprints_arg_begin): New inline function.
        (PRINT_FIELD_NET_PORT): Use it.
        * src/syscall.c (syscall_entering_decode, syscall_entering_trace): Use
        tprints_arg_begin instead of tprint_arg_begin.

        print_ifindex: use print_fields.h helpers.
        * src/print_ifindex.c (print_ifindex) [!HAVE_IF_INDEXTONAME]:
        Use PRINT_VAL_U.

        poll: use print_fields.h helpers.
        * src/poll.c (decode_poll_entering, do_poll, do_ppoll): Use
        tprint_arg_next, PRINT_VAL_D, and PRINT_VAL_U.

        pkeys: use print_fields.h helpers.
        * src/pkeys.c (SYS_FUNC(pkey_alloc)): Use tprint_arg_next
        and PRINT_VAL_X.

        pidns: use print_fields.h helpers.
        * src/pidns.c (printpid, printpid_tgid_pgid): Use PRINT_VAL_D.

        pidfd_open: use print_fields.h helpers.
        * src/pidfd_open.c (SYS_FUNC(pidfd_open)): Use tprint_arg_next.

        pidfd_getfd: use print_fields.h helpers.
        * src/pidfd_getfd.c (SYS_FUNC(pidfd_getfd)): Use tprint_arg_next,
        PRINT_VAL_D, and PRINT_VAL_X.

        perf_ioctl: use print_fields.h helpers.
        * src/perf_ioctl.c (perf_ioctl_query_bpf, perf_ioctl_modify_attributes,
        perf_ioctl): Use tprint_arg_next, PRINT_VAL_D, and PRINT_VAL_U.

2021-03-12  Dmitry V. Levin  <ldv@strace.io>

        or1k_atomic: use print_fields.h helpers.
        * src/or1k_atomic.c (SYS_FUNC(or1k_atomic)): Use tprint_arg_next
        and PRINT_VAL_X.

        open_tree: use print_fields.h helpers.
        * src/open_tree.c (SYS_FUNC(open_tree)): Use tprint_arg_next.

        open: use print_fields.h helpers.
        * src/open.c (decode_open, SYS_FUNC(openat), SYS_FUNC(openat2),
        SYS_FUNC(creat)): Use tprint_arg_next and PRINT_VAL_U.

        oldstat: use print_fields.h helpers.
        * src/oldstat.c (SYS_FUNC(oldstat), SYS_FUNC(oldfstat)): Use
        tprint_arg_next.

        nbd_ioctl: use print_fields.h helpers.
        * src/nbd_ioctl.c (nbd_ioctl): Use tprint_arg_next and PRINT_VAL_U.

        mq: use print_fields.h helpers.
        * src/mq.c (SYS_FUNC(mq_open), do_mq_timedsend, do_mq_timedreceive,
        SYS_FUNC(mq_notify), SYS_FUNC(mq_getsetattr)): Use tprint_arg_next
        and PRINT_VAL_U.

        move_mount: use print_fields.h helpers.
        * src/move_mount.c (SYS_FUNC(move_mount)): Use tprint_arg_next.

        mknod: use print_fields.h helpers.
        * src/mknod.c (decode_mknod, SYS_FUNC(mknodat)): Use tprint_arg_next.

        membarrier: use print_fields.h helpers.
        * src/membarrier.c (SYS_FUNC(membarrier)): Use tprint_arg_next
        and PRINT_VAL_D.

2021-03-11  Dmitry V. Levin  <ldv@strace.io>

        lseek: use print_fields.h helpers.
        * src/lseek.c (SYS_FUNC(lseek), SYS_FUNC(llseek)): Use tprint_arg_next
        and PRINT_VAL_D.

        loop: use print_fields.h helpers.
        * src/loop.c: Use tprint_arg_next, PRINT_VAL_D, and PRINT_VAL_U.

        listen: use print_fields.h helpers.
        * src/listen.c (SYS_FUNC(listen)): Use tprint_arg_next and PRINT_VAL_D.

        link: use print_fields.h helpers.
        * src/link.c (SYS_FUNC(link), SYS_FUNC(linkat), SYS_FUNC(unlinkat),
        SYS_FUNC(symlinkat)): Use tprint_arg_next.

2021-03-11  Baruch Siach  <baruch@tkos.co.il>

        disable_ptrace_get_syscall_info, disable_ptrace_getregset: require fork()
        These helper programs require fork(), so they are incompatible with
        no-MMU systems.

        * src/disable_ptrace_request.c: Make the code depend on HAVE_FORK.

2021-03-10  Dmitry V. Levin  <ldv@strace.io>

        ldt: use print_fields.h helpers.
        * src/ldt.c (print_user_desc): Use PRINT_VAL_ID.
        (SYS_FUNC(modify_ldt)): Use tprint_arg_next, PRINT_VAL_D,
        and PRINT_VAL_U.

        print_fields.h: introduce PRINT_VAL_ID.
        * src/print_fields.h (PRINT_VAL_ID): New macro.
        (PRINT_FIELD_ID): Use it.
        * src/uid.c (printuid): Likewise.

2021-03-09  Dmitry V. Levin  <ldv@strace.io>

        keyctl: use print_fields.h helpers.
        * src/keyctl.c: Use tprint_arg_next, PRINT_VAL_D, PRINT_VAL_U,
        and PRINT_VAL_X.

        kcmp: use print_fields.h helpers.
        * src/kcmp.c (SYS_FUNC(kcmp)): Use tprint_arg_next and PRINT_VAL_X.

        ioprio: use print_fields.h helpers.
        * src/ioprio.c (SYS_FUNC(ioprio)): Use tprint_arg_next, PRINT_VAL_X,
        and PRINT_VAL_D.

        ioperm: use print_fields.h helpers.
        * src/ioperm.c (SYS_FUNC(ioperm)): Use tprint_arg_next, PRINT_VAL_X,
        and PRINT_VAL_D.

        io_uring: use print_fields.h helpers.
        * src/io_uring.c (SYS_FUNC(io_uring_setup), SYS_FUNC(io_uring_enter),
        SYS_FUNC(io_uring_register)): Use tprint_arg_next and PRINT_VAL_U.

        inotify_ioctl: use print_fields.h helpers.
        * src/inotify_ioctl.c (inotify_ioctl): Use tprint_arg_next
        and PRINT_VAL_D.

        inotify: use print_fields.h helpers.
        * src/inotify.c (SYS_FUNC(inotify_add_watch),
        SYS_FUNC(inotify_rm_watch)): Use tprint_arg_next and PRINT_VAL_D.

2021-03-08  Dmitry V. Levin  <ldv@strace.io>

        hostname: use print_fields.h helpers.
        * src/hostname.c (SYS_FUNC(sethostname), SYS_FUNC(gethostname)):
        Use tprint_arg_next and PRINT_VAL_U.

2021-03-08  Dmitry V. Levin  <ldv@strace.io>

        hdio: print the data returned by HDIO_DRIVE_CMD as a regular structure.
        Although the data returned by HDIO_DRIVE_CMD is not declared as
        a structure in the UAPI, but it is, nevertheless, a structure.

        * src/hdio.c (print_hdio_drive_cmd): Print the data on exiting
        as a structure.
        * tests/ioctl_hdio.c (main): Update expected output.

2021-03-08  Dmitry V. Levin  <ldv@strace.io>

        getrandom: use print_fields.h helpers.
        * src/getrandom.c (SYS_FUNC(getrandom)): Use tprint_arg_next
        and PRINT_VAL_U.

        getpid: use print_fields.h helpers.
        * src/getpid.c (SYS_FUNC(setpgid)): Use tprint_arg_next.

        getcwd: use print_fields.h helpers.
        * src/getcwd.c (SYS_FUNC(getcwd)): Use tprint_arg_next and PRINT_VAL_U.

        getcpu: use print_fields.h helpers.
        * src/getcpu.c (SYS_FUNC(getcpu)): Use tprint_arg_next.

        get_robust_list: use print_fields.h helpers.
        * src/get_robust_list.c (SYS_FUNC(get_robust_list)): Use
        tprint_arg_next.

2021-03-07  Dmitry V. Levin  <ldv@strace.io>

        gpio_ioctl: use print_fields.h helpers.
        * src/gpio_ioctl.c: Use tprint_arg_next and PRINT_VAL_X.

        file_handle: use print_fields.h helpers.
        * src/file_handle.c (SYS_FUNC(name_to_handle_at),
        SYS_FUNC(open_by_handle_at)): Use tprint_arg_next and PRINT_VAL_U.

2021-03-07  Dmitry V. Levin  <ldv@strace.io>

        file_handle: print f_handle as a hexadecimal string.
        Printing the sequence of bytes as a hexadecimal number is misleading
        because the latter depends on endianness.

        * src/file_handle.c (print_f_handle): New function.
        (SYS_FUNC(name_to_handle_at), SYS_FUNC(open_by_handle_at)): Use it
        to print struct file_handle.f_handle.
        * tests/file_handle.c (print_handle_data, do_open_by_handle_at, main):
        Update expected output.

2021-03-06  Dmitry V. Levin  <ldv@strace.io>

        fstatfs64: use print_fields.h helpers.
        * src/fstatfs64.c (SYS_FUNC(fstatfs64)): Use tprint_arg_next and
        PRINT_VAL_U.

        fstatfs: use print_fields.h helpers.
        * src/fstatfs.c (SYS_FUNC(fstatfs)): Use tprint_arg_next.

        fspick: use print_fields.h helpers.
        * src/fspick.c (SYS_FUNC(fspick)): Use tprint_arg_next.

        fsopen: use print_fields.h helpers.
        * src/fsopen.c (SYS_FUNC(fsopen)): Use tprint_arg_next.

        fsmount: use print_fields.h helpers.
        * src/fsmount.c (SYS_FUNC(fsmount)): Use tprint_arg_next.

        fsconfig: use print_fields.h helpers.
        * src/fsconfig.c (SYS_FUNC(fsconfig)): Use tprint_arg_next and
        PRINT_VAL_D.

        fs_0x94_ioctl: use print_fields.h helpers.
        * src/fs_0x94_ioctl.c (decode_file_dedupe_range, fs_0x94_ioctl): Use
        tprint_arg_next, tprint_struct_next, and PRINT_VAL_D.

        flock: use print_fields.h helpers.
        * src/flock.c (SYS_FUNC(flock)): Use tprint_arg_next.

        fcntl: use print_fields.h helpers.
        * src/fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use
        tprint_arg_next, PRINT_VAL_D, and PRINT_VAL_X.

2021-03-05  Dmitry V. Levin  <ldv@strace.io>

        printuid: remove prefix argument.
        * src/defs.h (printuid): Remove first argument.
        * src/uid.c (printuid, get_print_uid): Remove prefix argument,
        all callers updated.

2021-03-04  Dmitry V. Levin  <ldv@strace.io>

        execve: use print_fields.h helpers.
        * src/execve.c (printargv): Use tprint_array_begin, tprint_array_next,
        and tprint_array_end.
        (decode_execve, SYS_FUNC(execveat), SYS_FUNC(execv)): Use
        tprint_arg_next.

2021-03-04  Dmitry V. Levin  <ldv@strace.io>

        execve: robustify address overflow checks.
        If the tracee has managed to make both the very first and the very last
        memory pages mapped and umoven at the end of the last page won't fail
        for some reason, the result of address overflow can be a small non-zero
        address, umoven at a small non-zero address won't fail and the loop
        won't terminate after the address overflow.

        * src/execve.c (printargv, printargc): Robustify address overflow
        checks, streamline implementation.

2021-03-03  Dmitry V. Levin  <ldv@strace.io>

        eventfd: use print_fields.h helpers.
        * src/eventfd.c (do_eventfd): Use tprint_arg_next and PRINT_VAL_U.

        epoll: use print_fields.h helpers.
        * src/epoll.c (SYS_FUNC(epoll_create), SYS_FUNC(epoll_ctl),
        epoll_wait_common, print_timeout_int, epoll_pwait_common): Use
        tprint_arg_next, PRINT_VAL_D, and PRINT_VAL_U.

        dup: use print_fields.h helpers.
        * src/dup.c (dup_123): Use tprint_arg_next.

        dirent: use print_fields.h helpers.
        * src/dirent.c (SYS_FUNC(readdir)): Use tprint_arg_next and PRINT_VAL_U.

2021-03-02  Dmitry V. Levin  <ldv@strace.io>

        copy_file_range: use print_fields.h helpers.
        * src/copy_file_range.c (SYS_FUNC(copy_file_range)): Use tprint_arg_next
        and PRINT_VAL_U.

        close_range: use print_fields.h helpers.
        * src/close_range.c (SYS_FUNC(close_range)): Use tprint_arg_next.

        chmod: use print_fields.h helpers.
        * src/chmod.c (decode_chmod, SYS_FUNC(fchmodat), SYS_FUNC(fchmod)):
        Use tprint_arg_next.

        cacheflush: use print_fields.h helpers.
        * src/cacheflush.c (SYS_FUNC(cacheflush)): Use tprint_arg_next
        and PRINT_VAL_U.

        btrfs: use print_fields.h helpers.
        * src/btrfs.c: Use tprint_arg_next, tprint_struct_next,
        tprint_array_begin, tprint_array_next, tprint_array_end,
        and PRINT_VAL_U.

        print_fields.h: introduce tprint_array_index_{begin,end}
        * src/print_fields.h (tprint_array_index_begin, tprint_array_index_end):
        New inline functions.
        * src/btrfs.c (btrfs_ioctl): Use them.
        * src/util.c (print_array_ex): Likewise.

        bpf: use print_fields.h helpers.
        * src/bpf.c: Use tprint_arg_next and PRINT_VAL_U.

        bpf: print extra data of bpf_attr in a bit more structured way.
        * src/bpf.c (decode_attr_extra_data): When printing extra data, print
        an imaginary field name "extra_data" followed by the data itself and
        the comment.
        * tests/bpf.c (print_extra_data): Update expected output.

        block: use print_fields.h helpers.
        * src/block.c (block_ioctl): Use tprint_arg_next and PRINT_VAL_U.

        bjm: use print_fields.h helpers.
        * src/bjm.c (SYS_FUNC(delete_module), SYS_FUNC(init_module),
        SYS_FUNC(finit_module)): Use tprint_arg_next and PRINT_VAL_U.

        bind: use print_fields.h helpers.
        * src/bind.c (SYS_FUNC(bind)): Use tprint_arg_next and PRINT_VAL_D.

2021-03-01  Dmitry V. Levin  <ldv@strace.io>

        alpha: use print_fields.h helpers.
        * src/alpha.c (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Use
        tprint_arg_next and PRINT_VAL_U.

        aio: use print_fields.h helpers.
        * src/aio.c (SYS_FUNC(io_setup), SYS_FUNC(io_submit),
        SYS_FUNC(io_cancel), print_io_getevents): Use tprint_arg_next,
        PRINT_VAL_U, and PRINT_VAL_D.

        affinity: use print_fields.h helpers.
        * src/affinity.c (print_affinitylist): Use tprint_array_* and
        tprint_more_data_follows.
        (SYS_FUNC(sched_setaffinity), SYS_FUNC(sched_getaffinity)): Use
        tprint_arg_next and PRINT_VAL_U.

        access: use print_fields.h helpers.
        * src/access.c (decode_access, decode_faccessat, SYS_FUNC(faccessat2)):
        Use tprint_arg_next.

2021-03-01  Dmitry V. Levin  <ldv@strace.io>

        Replace printllval with print_arg_lld and print_arg_llu.
        Unlike printllval, print_arg_lld and print_arg_llu do not have format
        arguments which helps in making output more structured.

        Also, change the type of getllval index argument and return value
        from signed int to unsigned int.

        * src/defs.h (getllval): Change the type of index argument and return
        value from int to unsigned int.  All callers updated.
        (printllval): Remove.
        (print_arg_lld, print_arg_llu): New prototypes.
        * src/util.c (getllval): Change the type of index argument and return
        value from int to unsigned int.
        (printllval): Remove.
        (print_arg_lld, print_arg_llu): New functions.
        * src/fadvise.c (SYS_FUNC(fadvise64), SYS_FUNC(fadvise64_64)): Replace
        printllval with print_arg_lld.
        * src/fallocate.c (SYS_FUNC(fallocate)): Likewise.
        * src/io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Likewise.
        * src/readahead.c (SYS_FUNC(readahead)): Likewise.
        * src/sync_file_range.c (SYS_FUNC(sync_file_range)): Likewise.
        * src/sync_file_range2.c (SYS_FUNC(sync_file_range2)): Likewise.
        * src/lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Replace printllval
        with print_arg_llu.
        * src/truncate.c (SYS_FUNC(truncate64), SYS_FUNC(ftruncate64)):
        Likewise.

2021-03-01  Dmitry V. Levin  <ldv@strace.io>

        truncate: use print_fields.h helpers.
        * src/truncate.c (SYS_FUNC(truncate), SYS_FUNC(ftruncate64)): Use
        tprint_arg_next and PRINT_VAL_U.

        sync_file_range2: use print_fields.h helpers.
        * src/sync_file_range2.c (SYS_FUNC(sync_file_range2)): Use
        tprint_arg_next.

        sync_file_range: use print_fields.h helpers.
        * src/sync_file_range.c (SYS_FUNC(sync_file_range)): Use
        tprint_arg_next.

        readahead: use print_fields.h helpers.
        * src/readahead.c (SYS_FUNC(readahead)): Use tprint_arg_next and
        PRINT_VAL_U.

        lookup_dcookie: use print_fields.h helpers.
        * src/lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Use tprint_arg_next
        and PRINT_VAL_U.

        io: use print_fields.h helpers.
        * src/io.c (SYS_FUNC(read), SYS_FUNC(write), print_iovec,
        SYS_FUNC(readv), SYS_FUNC(writev), SYS_FUNC(pread), SYS_FUNC(pwrite),
        do_preadv, do_pwritev, SYS_FUNC(tee), SYS_FUNC(splice),
        SYS_FUNC(vmsplice)): Use tprint_arg_next and PRINT_VAL_U.
        (print_lld_from_low_high_val): Use PRINT_VAL_D.

        fallocate: use print_fields.h helpers.
        * src/fallocate.c (SYS_FUNC(fallocate.c)): Use tprint_arg_next.

        fadvise: use print_fields.h helpers.
        * src/fadvise.c (SYS_FUNC(fadvise64), SYS_FUNC(fadvise64_64)): Use
        tprint_arg_next and PRINT_VAL_U.

2021-02-28  Dmitry V. Levin  <ldv@strace.io>

        print_timespec.h: use print_fields.h helpers.
        * src/print_timespec.h (print_sec_nsec): Remove.
        (print_timespec_t): Rewrite using print_fields.h tools.
        (PRINT_TIMESPEC_ARRAY_DATA_SIZE): Use tprint_array_* functions.

2021-02-27  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce tprint*_arg_* helpers.
        * src/print_fields.h (tprint_arg_begin, tprint_arg_next,
        tprint_arg_end, tprints_arg_name): New inline functions.
        * src/syscall.c (syscall_entering_decode, syscall_entering_trace): Use
        tprint_arg_begin.
        (syscall_exiting_trace): Use tprint_arg_end.
        * src/clone.c (SYS_FUNC(clone)): Use tprints_arg_name and
        tprint_arg_next.
        (SYS_FUNC(clone3), SYS_FUNC(setns)): Use tprint_arg_next.

2021-02-26  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce tprint_unavailable helper.
        * src/print_fields.h (tprint_unavailable): New inline function.
        * src/dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
        dm_decode_dm_name_list, dm_decode_dm_target_versions,
        dm_decode_dm_target_msg, dm_decode_string): Use it.
        * src/perf.c (print_perf_event_attr): Likewise.
        * src/print_timespec.h (PRINT_TIMESPEC_DATA_SIZE,
        PRINT_TIMESPEC_ARRAY_DATA_SIZE): Likewise.
        * src/print_timeval.c (print_struct_timeval_data_size): Likewise.
        * src/util.c (print_quoted_string_ex, print_nonzero_bytes,
        print_array_ex): Likewise.
        * tests/msg_control.c (test_scm_timestamp_old, test_scm_timestampns_old,
        test_scm_timestamping_old, test_scm_timestamp_new,
        test_scm_timestampns_new, test_scm_timestamping_new): Update expected
        output.

2021-02-25  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce tprint_alternative_value helper.
        * src/print_fields.h (tprint_alternative_value): New inline function.
        * src/defs.h (print_big_u64_addr): Use it.
        * src/ioctl.c (SYS_FUNC(ioctl)): Use it.

2021-02-24  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: replace PRINT_FIELD_UINT_ARRAY2D with PRINT_FIELD_VAL_ARRAY2D
        * src/print_fields.h (PRINT_FIELD_UINT_ARRAY2D): Remove.
        (PRINT_FIELD_VAL_ARRAY2D): New macro.
        (PRINT_FIELD_X_ARRAY2D): Use it.

        print_fields.h: replace PRINT_FIELD_{U,S}INT_ARRAY with PRINT_FIELD_VAL_ARRAY
        * src/print_fields.h (PRINT_FIELD_UINT_ARRAY, PRINT_FIELD_SINT_ARRAY):
        Remove.
        (PRINT_FIELD_VAL_ARRAY): New macro.
        (PRINT_FIELD_D_ARRAY): Use it instead of PRINT_FIELD_SINT_ARRAY.
        (PRINT_FIELD_U_ARRAY, PRINT_FIELD_X_ARRAY): Use it instead of
        PRINT_FIELD_UINT_ARRAY.
        * src/sockaddr.c (print_sockaddr_data_ipx): Likewise.

        print_fields.h: introduce PRINT_VAL_{D,U,X,0X}
        * src/print_fields.h (PRINT_VAL_D, PRINT_VAL_U, PRINT_VAL_X,
        PRINT_VAL_0X): New macros.
        (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_U_CAST, PRINT_FIELD_X,
        PRINT_FIELD_X_CAST, PRINT_FIELD_0X, PRINT_FIELD_IDm PRINT_FIELD_U64):
        Use them.

2021-02-23  Dmitry V. Levin  <ldv@strace.io>

        tests: switch to use bundled <linux/perf_event.h>
        * bundled/linux/include/uapi/linux/perf_event.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_MEMBERS): Remove struct perf_event_attr.
        (AC_CHECK_HEADERS): Remove linux/perf_event.h.
        * tests/ioctl_perf-success.c: Include <linux/perf_event.h>
        unconditionally, assume it defines all its types and constants.
        * tests/ioctl_perf.c [!HAVE_LINUX_PERF_EVENT_H, !u64]: Remove.
        * tests/perf_event_open_nonverbose.cc [!HAVE_LINUX_PERF_EVENT_H]: Remove.
        * tests/perf_event_open.c: Likewise.  Assume <linux/perf_event.h>
        defines all its types and constants.

        tests: switch to use bundled <linux/stat.h>
        * bundled/linux/include/uapi/linux/stat.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct statx.
        * tests/statx.c [!HAVE_STRUCT_STATX]: Remove.

2021-02-23  Dmitry V. Levin  <ldv@strace.io>

        tests: do not include "statx.h"
        * tests/xstatx.c: Do not include unused "statx.h".

        Fixes: v4.17~152 "Implement decoding of statx syscall"

2021-02-23  Vineet Gupta  <Vineet.Gupta1@synopsys.com>

        ARC: Enable automatic support for newer ARC ISA variants (ARCv3)
        The syscall TRAP instruction used to be 4 bytes on legacy ARCompact
        based ARC700 cores. Since then ARCv2 (circa 2014) and the upcoming ARCv3
        use the same 2-byte TRAP_S instruction.

        To ease porting of software to new ISA, special case ARC700.

        This is the only change needed to get strace working on 64-bit ARCv3
        cores (kudos to strace for making porting so easy).

2021-02-22  Dmitry V. Levin  <ldv@strace.io>

        netlink: switch to use bundled <linux/netfilter/nfnetlink_osf.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_osf.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/xt_osf.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_osf.h>.
        * src/xlat/nf_osf_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_osf.c: Include <linux/netfilter/nfnetlink_osf.h>
        instead of <linux/ip.h>, <linux/tcp.h>, and <linux/netfilter/xt_osf.h>.
        [!HAVE_LINUX_NETFILTER_XT_OSF_H]: Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_queue.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_queue.h:
        New file, copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_queue.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_queue.h>.
        * src/xlat/nf_queue_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_queue.c [!HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H]:
        Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_log.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_log.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_log.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_log.h>.
        * src/xlat/nf_ulog_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_ulog.c [!HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H]:
        Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_cttimeout.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cttimeout.h:
        New file, copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_cttimeout.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_cttimeout.h>.
        * src/xlat/nf_cttimeout_msg_types.in: Add #unconditional, remove
        fallback definitions.
        * tests/nfnetlink_cttimeout.c
        [!HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H]: Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_cthelper.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cthelper.h:
        New file, copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_cthelper.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_cthelper.h>.
        * src/xlat/nf_cthelper_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_cthelper.c
        [!HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H]: Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_conntrack.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_conntrack.h:
        New file, copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_conntrack.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_conntrack.h>.
        * src/xlat/nf_ctnetlink_exp_msg_types.in: Add #unconditional, remove
        fallback definitions.
        * src/xlat/nf_ctnetlink_msg_types.in: Likewise.
        * tests/nfnetlink_conntrack.c
        [!HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H]: Remove.
        * tests/nfnetlink_ctnetlink_exp.c: Likewise.

        netlink: switch to use bundled <linux/netfilter/nfnetlink_acct.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_acct.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nfnetlink_acct.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink_acct.h>.
        * src/xlat/nf_acct_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_acct.c [!HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H]:
        Remove.

        netlink: switch to use bundled <linux/netfilter/nfnetlink.h>
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/linux/include/uapi/linux/netfilter/nfnetlink_compat.h:
        Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink.h.
        * src/netlink.c: Include <linux/netfilter/nfnetlink.h>.
        [!HAVE_LINUX_NETFILTER_NFNETLINK_H]: Remove.
        * src/netlink_netfilter.c [!HAVE_LINUX_NETFILTER_NFNETLINK_H]: Remove.
        * tests/netlink_netfilter.c: Likewise.
        * tests/nfnetlink_nft_compat.c: Likewise.
        * tests/nfnetlink_nftables.c: Likewise.
        * src/xlat/netfilter_versions.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/nl_netfilter_msg_types.in: Likewise.
        * src/xlat/nl_netfilter_subsys_ids.in: Likewise.

        netlink: switch to use bundled <linux/netfilter/nf_tables_compat.h>
        * bundled/linux/include/uapi/linux/netfilter/nf_tables_compat.h: New
        file, copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/nf_tables_compat.h.
        * src/netlink.c: Include <linux/netfilter/nf_tables_compat.h>.
        * src/xlat/nf_nft_compat_msg_types.in: Remove fallback definitions,
        add #unconditional and #value_indexed.
        * tests/nfnetlink_nft_compat.c: Replace
        HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H
        with HAVE_LINUX_NETFILTER_NFNETLINK_H.

        netlink: switch to use bundled <linux/netfilter/nf_tables.h>
        * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nf_tables.h.
        * src/netlink.c: Include <linux/netfilter/nf_tables.h>.
        * src/xlat/nf_nftables_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/netlink_netfilter.c [!HAVE_LINUX_NETFILTER_NF_TABLES_H,
        !NFT_MSG_NEWTABLE]: Remove.
        * tests/nfnetlink_nftables.c: Replace HAVE_LINUX_NETFILTER_NF_TABLES_H
        with HAVE_LINUX_NETFILTER_NFNETLINK_H.

        netlink: switch to use bundled <linux/netfilter/ipset/ip_set.h>
        * bundled/linux/include/uapi/linux/netfilter/ipset/ip_set.h: New file,
        copied from headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove
        linux/netfilter/ipset/ip_set.h.
        * src/netlink.c: Include <linux/netfilter/ipset/ip_set.h>.
        * src/xlat/nf_ipset_msg_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/nfnetlink_ipset.c [!HAVE_LINUX_NETFILTER_IPSET_IP_SET_H]:
        Remove.

        print_mq_attr: switch to use bundled <linux/mqueue.h>
        * bundled/linux/include/uapi/linux/mqueue.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/mqueue.h.
        * src/kernel_types.h [!HAVE___KERNEL_LONG_T] (__kernel_long_t): New type.
        [!HAVE___KERNEL_ULONG_T] (__kernel_ulong_t): Likewise.
        * src/print_mq_attr.c [HAVE_MQUEUE_H, !HAVE_LINUX_MQUEUE_H]: Remove.
        Include "kernel_types.h" and "kernel_fcntl.h".
        (printmqattr) [!(HAVE_MQUEUE_H || HAVE_LINUX_MQUEUE_H)]: Remove.

        clone: switch to use bundled <linux/sched.h>
        * bundled/linux/include/uapi/linux/sched.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/sched.h.
        (AC_CHECK_MEMBERS): Remove struct clone_args.cgroup.
        * src/clone.c: Include <linux/sched.h> instead of <sched.h>.
        [!CSIGNAL]: Remove.
        (struct strace_clone_args): Remove.
        (SYS_FUNC(clone3)): Replace struct strace_clone_args with struct
        clone_args.
        * src/xlat/clone3_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/clone_flags.in: Likewise.
        * src/xlat/setns_types.in: Likewise.
        * src/xlat/unshare_flags.in: Likewise.
        * tests/clone-flags.c: Include <linux/sched.h> instead of
        "xlat/clone_flags.h".
        * tests/clone3.c: Include <linux/sched.h> unconditionally,
        do not include "xlat/clone_flags.h" and "xlat/clone3_flags.h",
        replace struct_clone_args with struct clone_args.
        (struct test_clone_args, struct_clone_args): Remove.
        * tests/pidns.c [!CLONE_NEWUSER, !CLONE_NEWPID]: Remove.
        * tests/fork--pidns-translation.c: Likewise.

2021-02-21  Dmitry V. Levin  <ldv@strace.io>

        configure.ac: do not check for <linux/io_uring.h> and its types.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/io_uring.h.
        (AC_CHECK_MEMBERS): Remove struct io_cqring_offsets.flags,
        struct io_uring_params.features, struct io_uring_params.wq_fd,
        and struct io_uring_params.resv.

        Complements: v5.11~54 "io_uring: switch to use bundled <linux/io_uring.h>"

2021-02-21  Dmitry V. Levin  <ldv@strace.io>

        Switch to use bundled <mtd/ubi-user.h>
        * bundled/linux/include/uapi/mtd/ubi-user.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct ubi_mkvol_req.flags and
        struct ubi_attach_req.max_beb_per1024.
        * src/ioctl.c [!HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024]: Remove.
        * src/ubi.c [!HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024,
        !HAVE_STRUCT_UBI_MKVOL_REQ_FLAGS, !UBI_IOCRPEB, !UBI_IOCSPEB,
        !UBI_IOCVOLCRBLK, !UBI_IOCVOLRMBLK]: Remove.
        * tests/ioctl_ubi.c: Likewise.
        * src/xlat/ubi_volume_flags.in: Add #unconditional, remove fallback
        definitions.

        Switch to use bundled <mtd/mtd-abi.h>
        * bundled/linux/include/uapi/mtd/mtd-abi.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct mtd_write_req.
        * src/ioctl.c [!HAVE_STRUCT_MTD_WRITE_REQ]: Remove.
        * src/mtd.c: Likewise.
        * tests/ioctl.c: Likewise.
        * tests/ioctl_mtd.c: Likewise.
        * src/xlat/mtd_flags_options.in: Add #unconditional
        * src/xlat/mtd_nandecc_options.in: Add #unconditional and #value_indexed.
        * src/xlat/mtd_otp_options.in: Likewise.
        * src/xlat/mtd_type_options.in: Likewise.

        Switch to use bundled <linux/blkpg.h> and <linux/blkzoned.h>
        * bundled/linux/include/uapi/linux/blkpg.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/linux/include/uapi/linux/blkzoned.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/xlat/block_ioctl_cmds.in: Remove.
        * src/block.c: Include <linux/blkpg.h> and <linux/blkzoned.h> instead of
        "xlat/block_ioctl_cmds.h", assume they provide all their types and
        constants.
        * tests/ioctl_block.c: Include <linux/blkzoned.h>.  Assume <linux/fs.h>,
        <linux/blkpg.h>, <linux/blkzoned.h>, and <linux/blktrace_api.h> provide
        all their types and constants.

        Switch to use bundled <linux/blktrace_api.h>
        * bundled/linux/include/uapi/linux/blktrace_api.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct blk_user_trace_setup.
        * src/block.c: Include <linux/blktrace_api.h>.
        (BLKTRACE_BDEV_SIZE, struct blk_user_trace_setup): Remove.
        * tests/ioctl_block.c [!HAVE_STRUCT_BLK_USER_TRACE_SETUP]: Remove.

        Switch to use bundled <linux/netconf.h>
        * bundled/linux/include/uapi/linux/netconf.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct netconfmsg.
        * src/netlink_route.c [!HAVE_STRUCT_NETCONFMSG]: Remove.
        * src/rtnl_netconf.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/nlattr_netconfmsg.c: Likewise.
        * src/xlat/rtnl_netconf_attrs.in: Add #unconditional, remove fallback
        definitions.

        Switch to use bundled <linux/if_addrlabel.h>
        * bundled/linux/include/uapi/linux/if_addrlabel.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct ifaddrlblmsg.
        * src/netlink_route.c [!HAVE_STRUCT_IFADDRLBLMSG]: Remove.
        * src/rtnl_addrlabel.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/nlattr_ifaddrlblmsg.c: Likewise.
        * src/xlat/rtnl_addrlabel_attrs.in: Add #unconditional, remove fallback
        definitions.

        Switch to use bundled <linux/dcbnl.h>
        * bundled/linux/include/uapi/linux/dcbnl.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct dcbmsg.
        * src/rtnl_dcb.c [!HAVE_STRUCT_DCBMSG]: Remove.
        * src/netlink_route.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/nlattr_dcbmsg.c: Likewise.
        * src/xlat/dcb_commands.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/rtnl_dcb_attrs.in: Likewise.

        Switch to use bundled <linux/pkt_sched.h>
        * bundled/linux/include/uapi/linux/pkt_sched.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct tc_sizespec.
        * src/rtnl_tc.c [!HAVE_STRUCT_TC_SIZESPEC]: Remove.
        * tests/nlattr_tca_stab.c: Likewise.
        * src/xlat/rtnl_tca_stab_attrs.in: Add #unconditional, remove fallback
        definitions, #enum, and #include.

        Switch to use bundled <linux/gen_stats.h>
        * bundled/linux/include/uapi/linux/gen_stats.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct gnet_stats_basic,
        struct gnet_stats_queue, struct gnet_stats_rate_est, and
        struct gnet_stats_rate_est64.
        * src/rtnl_tc.c: Include <linux/gen_stats.h> unconditionally, assume
        it defines all its types and constants.
        * tests/nlattr_tc_stats.c: Likewise.
        * src/xlat/rtnl_tca_stats_attrs.in: Add #unconditional, remove fallback
        definitions, #enum, and #include.

        Switch to use bundled <linux/keyctl.h>
        * bundled/linux/include/uapi/linux/keyctl.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct keyctl_kdf_params,
        struct keyctl_pkey_params, and struct keyctl_pkey_query.
        * src/keyctl.c (struct keyctl_dh_params, struct keyctl_pkey_params,
        struct keyctl_pkey_query): Remove.
        * src/keyctl_kdf_params.h: Include <linux/keyctl.h>.
        (struct keyctl_kdf_params): Remove.
        * src/xlat/key_perms.in: Add comment.
        * src/xlat/key_reqkeys.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/key_spec.in: Likewise.
        * src/xlat/keyctl_caps0.in: Likewise.
        * src/xlat/keyctl_caps1.in: Likewise.
        * src/xlat/keyctl_commands.in: Likewise.
        * src/xlat/keyctl_move_flags.in: Likewise.
        * src/xlat/keyctl_pkey_ops.in: Likewise.
        * tests/keyctl.c: Assume <linux/keyctl.h> defines all its types
        and constants.

2021-02-20  Dmitry V. Levin  <ldv@strace.io>

        Switch to use bundled <linux/ptp_clock.h>
        * bundled/linux/include/uapi/linux/ptp_clock.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct ptp_sys_offset.
        * src/ioctl.c (ioctl_decode) [!HAVE_STRUCT_PTP_SYS_OFFSET]: Remove.
        * src/ptp.c: Assume <linux/ptp_clock.h> is available and defined all its
        types and constants.
        * tests/ioctl_ptp.c: Likewise.
        * src/xlat/ptp_extts_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/ptp_perout_flags.in: Likewise.

        Switch to use bundled <linux/fcntl.h>
        * bundled/linux/include/uapi/linux/fcntl.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_TYPES): Remove struct flock, struct flock64,
        struct __kernel_flock, struct __kernel_flock64, struct f_owner_ex,
        and struct __kernel_f_owner_ex.
        * src/f_owner_ex.h: Remove.
        * src/flock.h: Likewise.
        * src/Makefile.am (libstrace_a_SOURCES): Remove f_owner_ex.h
        and flock.h.
        * src/fcntl.c: Include <linux/fcntl.h> instead of "flock.h".
        (print_struct_flock64, printflock64, printflock): Replace
        struct_kernel_flock64 with struct flock64.
        * src/fetch_struct_flock.c: Include <linux/fcntl.h> instead of "flock.h".
        Replace struct_kernel_flock64 with struct flock64 and
        struct_kernel_flock with struct flock.
        * src/file_handle.c: Include <linux/fcntl.h>.
        * src/open.c: Likewise.
        * src/open_tree.c: Likewise.
        * src/statx.c: Likewise.
        * src/link.c: Include <linux/fcntl.h> instead of <fcntl.h>.
        * src/xlat/at_flags.in: Add #unconditional, remove fallback definitions.
        * src/xlat/f_owner_types.in: Likewise.
        * src/xlat/f_seals.in: Likewise.
        * src/xlat/fcntlcmds.in: Likewise.
        * src/xlat/name_to_handle_at_flags.in: Likewise.
        * src/xlat/open_tree_flags.in: Likewise.
        * src/xlat/fdflags.in: Add #unconditional.
        * src/xlat/lockfcmds.in: Likewise.
        * src/xlat/notifyflags.in: Likewise.
        * tests/fcntl-common.c: Include <linux/fcntl.h> instead of "flock.h",
        do not include "f_owner_ex.h", always define and invoke test_f_owner_ex,
        assume <linux/fcntl.h> defines all its types and constants,
        replace struct_kernel_flock64 with struct flock64,
        struct_kernel_flock with struct flock, and
        struct_kernel_f_owner_ex with struct f_owner_ex.
        * tests/fcntl.c (test_flock64_undecoded): Replace struct_kernel_flock64
        with struct flock64.
        * tests/fcntl64.c (test_flock64_lk64): Likewise.
        * tests/openat2.c: Include <linux/fcntl.h>,  assume it defines
        all its types and constants.

        Switch to use bundled <linux/seccomp.h>
        * bundled/linux/include/uapi/linux/seccomp.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/seccomp.h.
        * src/bpf_seccomp_filter.c: Include <linux/seccomp.h> unconditionally,
        assume all its types and constants are defined.
        * src/disable_ptrace_request.c: Likewise.
        * src/filter_seccomp.c: Likewise.
        * src/prctl.c: Likewise.
        * src/seccomp.c: Likewise.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter.c: Likewise.
        * tests/seccomp_get_action_avail.c: Likewise.
        * src/xlat/seccomp_filter_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/seccomp_mode.in: Likewise.
        * src/xlat/seccomp_ops.in: Likewise.
        * src/xlat/seccomp_ret_action.in: Likewise.

        Switch to use bundled <linux/prctl.h>
        * bundled/linux/include/uapi/linux/prctl.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/prctl.c [!PR_SVE_VL_LEN_MASK]: Remove.
        * src/strace.c: Assume PR_SET_PTRACER and PR_SET_PTRACER_ANY are
        provided by <sys/prctl.h>.
        * tests/prctl-dumpable.c: Assume PR_GET_DUMPABLE and PR_SET_DUMPABLE
        are provided by <linux/prctl.h>.
        * tests/prctl-name.c: Assume PR_GET_NAME and PR_SET_NAME are provided
        by <sys/prctl.h>.
        * tests/prctl-pdeathsig.c: Assume PR_GET_PDEATHSIG and PR_SET_PDEATHSIG
        are provided by <linux/prctl.h>.
        * tests/prctl-seccomp-filter-v.c: Assume PR_SET_NO_NEW_PRIVS and
        PR_SET_SECCOMP are provided by <sys/prctl.h>.
        * tests/prctl-seccomp-strict.c: Assume PR_SET_SECCOMP is provided
        by <sys/prctl.h>
        * tests/prctl-securebits.c: Assume PR_GET_SECUREBITS and
        PR_SET_SECUREBITS are provided by <linux/prctl.h>.
        * tests/prctl-tsc.c: Assume PR_GET_TSC and PR_SET_TSC are provided by
        <linux/prctl.h>.
        * tests/printpath-umovestr-undumpable.c: Assume PR_SET_DUMPABLE is
        provided by <sys/prctl.h>.
        * tests/printstrn-umoven-undumpable.c: Likewise.
        * tests/set_ptracer_any.c: Assume PR_SET_PTRACER and PR_SET_PTRACER_ANY
        are provided by <sys/prctl.h>.

        Switch to use bundled <linux/quota.h>
        * bundled/linux/include/uapi/linux/quota.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/quota.h.
        * tests/quotactl.h: Include <linux/quota.h> unconditionally.
        * tests/quotactl-xfs.c: Assume <linux/quota.h> is available.
        * tests/quotactl.c: Likewise.
        [!Q_GETNEXTQUOTA]: Remove.

        Switch to use bundled <linux/securebits.h>
        * bundled/linux/include/uapi/linux/securebits.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/securebits.h.
        * src/prctl.c: Include <linux/securebits.h> unconditionally.
        * src/xlat/secbits.in: Add #unconditional, remove fallback definitions.
        * tests/prctl-securebits.c: Include <linux/securebits.h>.

        Switch to use bundled <linux/utsname.h>
        * bundled/linux/include/uapi/linux/utsname.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/utsname.h.
        * src/hostname.c: Include <linux/utsname.h> unconditionally, assume
        __NEW_UTS_LEN is defined.
        * tests/sethostname.c: Likewise.
        * src/sysmips.c [MIPS]: Likewise.

        Switch to use bundled <linux/userfaultfd.h>
        * bundled/linux/include/uapi/linux/userfaultfd.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/userfaultfd.h.
        * src/userfaultfd.c [!HAVE_LINUX_USERFAULTFD_H]: Remove.
        * src/ioctl.c: Likewise.
        * src/xlat/uffd_api_features.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/uffd_flags.in: Likewise.
        * src/xlat/uffd_api_flags.in: Add #unconditional.
        * src/xlat/uffd_copy_flags.in: Likewise.
        * src/xlat/uffd_register_ioctl_flags.in: Likewise.
        * src/xlat/uffd_register_mode_flags.in: Likewise.
        * src/xlat/uffd_zeropage_flags.in: Likewise.
        * tests/ioctl_uffdio.c: Include "kernel_fcntl.h" instead of <fcntl.h>.
        [!HAVE_LINUX_USERFAULTFD_H]: Remove.

        Switch to use bundled <linux/nsfs.h>
        * bundled/linux/include/uapi/linux/nsfs.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/nsfs.h.
        * src/nsfs.h: Remove.
        * src/Makefile.am (libstrace_a_SOURCES): Remove nsfs.h.
        * src/nsfs.c: Include <linux/nsfs.h> instead of "nsfs.h".
        * src/pidns.c: Likewise.
        * tests/fork--pidns-translation.c: Likewise.
        * tests/ioctl_nsfs.c: Likewise.
        * tests/pidns.c: Likewise.

2021-02-19  Dmitry V. Levin  <ldv@strace.io>

        Switch to use bundled <linux/memfd.h> and <asm-generic/hugetlb_encode.h>
        * bundled/linux/include/uapi/linux/memfd.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/linux/include/uapi/asm-generic/hugetlb_encode.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/memfd.h.
        * src/memfd.c: Include <linux/memfd.h> unconditionally, assume it
        provides all necessary constants.
        * tests/memfd.c: Likewise.
        * src/xlat/memfd_create_flags.in: Add #unconditional, remove fallback
        definitions.

        Switch to use bundled <linux/kcmp.h>
        * bundled/linux/include/uapi/linux/kcmp.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/kcmp.h.
        (AC_CHECK_TYPES): Remove struct kcmp_epoll_slot.
        * src/kcmp.c: Include <linux/kcmp.h>.
        (struct strace_kcmp_epoll_slot): Remove.
        (SYS_FUNC(kcmp)): Use struct kcmp_epoll_slot instead of
        struct strace_kcmp_epoll_slot.
        * src/xlat/kcmp_types.in: Add #unconditional, remove fallback
        definitions.
        * tests/kcmp.c: Include <linux/kcmp.h>, assume it defines all necessary
        types and constants.

        Switch to use bundled <linux/ip_vs.h>
        * bundled/linux/include/uapi/linux/ip_vs.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/ip_vs.h.
        * src/net.c: Include <linux/ip_vs.h> unconditionally.

        Switch to use bundled <linux/mmtimer.h>
        * bundled/linux/include/uapi/linux/mmtimer.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/mmtimer.h.
        * tests/ioctl.c: Assume <linux/mmtimer.h> is always available and defines
        all its constants.

        Switch to use bundled <linux/hiddev.h>
        * bundled/linux/include/uapi/linux/hiddev.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/hiddev.h.
        * tests/ioctl.c: Assume <linux/hiddev.h> is always available and defines
        all its constants.

        Switch to use bundled <linux/falloc.h>
        * bundled/linux/include/uapi/linux/falloc.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/falloc.h.
        * src/fallocate.c: Include <linux/falloc.h> unconditionally.
        * src/xlat/falloc_flags.in: Add #unconditional, remove fallback
        definitions.
        * tests/fallocate.c: Include <linux/falloc.h>.

        Switch to use bundled <linux/dqblk_xfs.h>
        * bundled/linux/include/uapi/linux/dqblk_xfs.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/dqblk_xfs.h.
        * src/xfs_quota_stat.h: Remove.
        * src/Makefile.am (libstrace_a_SOURCES): Remove xfs_quota_stat.h.
        * src/fetch_struct_xfs_quotastat.c: Include <linux/dqblk_xfs.> instead
        of "xfs_quota_stat.h", use fs_quota_stat_t instead of struct
        xfs_dqstats.
        * src/quota.c: Include <linux/dqblk_xfs.> instead of "xfs_quota_stat.h",
        use fs_quota_stat_t instead of struct xfs_dqstats, and fs_disk_quota_t
        instead of struct xfs_dqblk.
        (struct xfs_dqblk, struct fs_qfilestatv, struct fs_quota_statv,
        XQM_CMD): Remove.
        (decode_cmd_data): Replace "XFS_???_QUOTA" with "FS_???_QUOTA",
        "XFS_QUOTA_???" with "FS_QUOTA_???".
        * src/xlat/xfs_dqblk_flags.in: Add #unconditional, remove fallback
        definitions, rename XFS_QUOTA_* to FS_QUOTA_*.
        * src/xlat/xfs_quota_flags.in: Add #unconditional, remove fallback
        definitions, rename XFS_*_QUOTA to FS_*_QUOTA.
        * tests/quotactl-xfs.c [!HAVE_LINUX_DQBLK_XFS_H, !Q_GETNEXTQUOTA,
        !Q_XGETQSTATV]: Remove.
        (main): Replace XFS_QUOTA_* with FS_QUOTA_* and XFS_*_QUOTA with
        FS_*_QUOTA in expected output.

        Switch to use bundled <linux/dm-ioctl.h>
        * bundled/linux/include/uapi/linux/dm-ioctl.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/dm-ioctl.h.
        * src/dm.c: Assume all constants provided by <linux/dm-ioctl.h>
        are defined.
        [!HAVE_LINUX_DM_IOCTL_H, DM_VERSION_MAJOR != 4]: Remove.
        * src/ioctl.c (ioctl_decode) [!HAVE_LINUX_DM_IOCTL_H]: Remove.
        * src/xlat/dm_flags.in: Add #unconditional, remove fallback definitions.
        * tests/ioctl_dm.c [!HAVE_LINUX_DM_IOCTL_H]: Remove.

        Switch to use bundled <linux/bsg.h>
        * bundled/linux/include/uapi/linux/bsg.h: New file, copied from
        headers_install'ed Linux kernel v5.11.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/bsg.h.
        * src/sg_io_v4.c [!HAVE_LINUX_BSG_H]: Remove.
        * src/xlat/bsg_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/bsg_protocol.in: Add #unconditional and #value_indexed.
        * src/xlat/bsg_subprotocol.in: Likewise.
        * tests/ioctl_sg_io_v4.c: Likewise.

2021-02-19  Dmitry V. Levin  <ldv@strace.io>

        build: fix build using bionic libc.
        Apparently, bionic libc uses unconventional approach of patching Linux
        uapi header files to provide and use struct sockaddr_storage instead of
        struct __kernel_sockaddr_storage.

        * src/linux/generic/socket.h.in: New file.
        * src/Makefile.am (EXTRA_DIST): Add linux/generic/socket.h.in.
        (DISTCLEANFILES): Add linux/generic/linux/socket.h.
        * configure.ac (AC_CHECK_TYPES): Check for struct sockaddr_storage in
        <sys/socket.h>; if not found, install a proxy <linux/socket.h> file.
        * NEWS: Mention this.

        Resolves: https://github.com/strace/strace/issues/174

2021-02-19  Dmitry V. Levin  <ldv@strace.io>

        configure.ac: fix <linux/signal.h> workaround.
        * configure.ac: Fix temporary CPPFLAGS when <linux/signal.h> workaround
        is enabled.

        Fixes: v5.11~73 "Move source files into src subdirectory"

2021-02-18  Dmitry V. Levin  <ldv@strace.io>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.11-1.
        * strace.spec.in: Likewise.

2021-02-17  Dmitry V. Levin  <ldv@strace.io>

        Prepare for 5.11 release.
        * NEWS: Update for 5.11 release.

2021-02-16  Dmitry V. Levin  <ldv@strace.io>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2021-02-16  Dmitry V. Levin  <ldv@strace.io>

        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$' src tests) |while read f; do
                cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
        done

2021-02-16  Dmitry V. Levin  <ldv@strace.io>

        pkeys: use the generic printargs_d printer for pkey_free syscall.
        There is no need to use a specific printer for pkey_free syscall,
        printargs_d does the right thing.

        * src/pkeys.c (SYS_FUNC(pkey_free)): Remove.
        * src/syscall_dummy.h (sys_pkey_free): Alias to printargs_d.

2021-02-16  Dmitry V. Levin  <ldv@strace.io>

        iopl: use the generic printargs_d printer.
        There is no need for the specific printer, printargs_d does the right
        thing.

        * src/iopl.c: Remove.
        * src/Makefile.am (libstrace_a_SOURCES): Remove iopl.c.
        * src/syscall_dummy.h (sys_iopl): Alias to printargs_d.

2021-02-16  Dmitry V. Levin  <ldv@strace.io>

        Switch to use bundled <asm-generic/fcntl.h> and <asm/fcntl.h>
        Linux kernel commit v5.10-rc1~111^2~13 changed the value of O_NONBLOCK
        on hppa from 0200004 to 0200000, breaking the following build assertion:

            xlat/open_mode_flags.h:158:1: error: static assertion failed: "O_NONBLOCK != 0200004"

        Address this issue by switching to use bundled fcntl.h files where
        appropriate.

        * NEWS: Mention this.
        * bundled/linux/include/uapi/asm-generic/fcntl.h: New file, copied
        from Linux kernel v5.11.
        * bundled/linux/arch/alpha/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/arm/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/arm64/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/ia64/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/m68k/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/mips/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/parisc/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/powerpc/include/uapi/asm/fcntl.h: Likewise.
        * bundled/linux/arch/sparc/include/uapi/asm/fcntl.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        (dist-hook): New rule.
        * configure.ac: Invoke AC_PROG_LN_S.
        * src/kernel_fcntl.h: New file.
        * src/Makefile.am (libstrace_a_SOURCES): Add kernel_fcntl.h.
        * src/open.c: Include "kernel_fcntl.h" instead of <asm/fcntl.h>,
        remove redefinitions of O_ACCMODE and O_LARGEFILE.
        * src/open_tree.c: Include "kernel_fcntl.h" instead of
        "xlat/open_mode_flags.h".
        * src/bjm.c: Include "kernel_fcntl.h" instead of <fcntl.h>.
        * src/epoll.c: Likewise.
        * src/inotify.c: Likewise.
        * src/pidfd_open.c: Likewise.
        * src/time.c: Likewise.
        * src/userfaultfd.c: Likewise.
        * src/eventfd.c: Include "kernel_fcntl.h" instead of <fcntl.h> and
        <sys/eventfd.h>.
        * src/signalfd.c: Include "kernel_fcntl.h" instead of <fcntl.h> and
        <sys/signalfd.h>.
        * src/xlat/open_mode_flags.in: Add #unconditional, remove fallback
        definitions.
        (O_ASYNC, O_RSYNC, O_NDELAY): Remove.
        * src/xlat/open_access_modes.in: remove fallback definitions.
        * src/xlat/efd_flags.in (EFD_CLOEXEC): Define unconditionally.
        * src/xlat/epollflags.in (EPOLL_CLOEXEC): Likewise.
        * src/xlat/inotify_init_flags.in (IN_CLOEXEC): Likewise.
        * src/xlat/sfd_flags.in (SFD_CLOEXEC): Likewise.
        * src/xlat/timerfdflags.in (TFD_CLOEXEC): Likewise.
        * tests/dup3.c: Include "kernel_fcntl.h" instead of <fcntl.h>,
        assume O_CLOEXEC is defined.
        (main) [__sparc__]: Remove special handling of O_NDELAY.
        * tests/mq_sendrecv.c: Include "kernel_fcntl.h" instead of <fcntl.h>.
        (main): Replace S_IRWXU with 0700.
        * tests/accept4.c: Include "kernel_fcntl.h" instead of <fcntl.h>,
        assume O_CLOEXEC is defined.
        * tests/epoll_create1.c: Likewise.
        * tests/eventfd.c: Likewise.
        * tests/inotify_init1.c: Likewise.
        * tests/signalfd4.c: Likewise.
        * tests/timerfd_xettime.c: Likewise.
        * tests/userfaultfd.c: Likewise.
        * tests/delete_module.c: Include "kernel_fcntl.h" instead of <fcntl.h>.
        * tests/pipe2.c: Likewise.
        * tests/open_tree.c: Include "kernel_fcntl.h", assume O_CLOEXEC is
        defined.
        * tests/pidfd_open.c: Include "kernel_fcntl.h".

2021-02-15  Dmitry V. Levin  <ldv@strace.io>

        tests: fix fork--pidns-translation test on sparc and sparc64.
        On sparc/sparc64, the value returned by syscall(__NR_fork) to the child
        process is not 0 but the pid of the parent process in the init
        namespace, so a simple check for non-zero is not a correct way
        to distinguish the parent process from its child process.

        * tests/fork--pidns-translation.c (fork_chain): When syscall(__NR_fork)
        returns a non-zero value, do not assume blindly that it's the child process,
        double check using waitpid.
        (main): Call perror_msg_and_fail instead of perror.
        * NEWS: Mention this.

2021-02-14  Dmitry V. Levin  <ldv@strace.io>

        Implement decoding of epoll_pwait2 syscall.
        Introduced by Linux kernel commits v5.11-rc1~61^2~3 and
        v5.11-rc1~61^2~2.

        * src/epoll.c (epoll_wait_common): Add print_timeout argument, use it
        to print tcp->u_arg[3].
        (print_timeout_int): New function.
        (SYS_FUNC(epoll_wait)): Pass it to epoll_wait_common.
        (epoll_pwait_common): New function.
        (SYS_FUNC(epoll_pwait)): Use it.
        (SYS_FUNC(epoll_pwait2)): New function.
        * src/linux/generic/syscallent-common.h [BASE_NR + 441]: Wire up
        epoll_pwait2.
        * NEWS: Mention this change.
        * tests/epoll_pwait2.c: New file.
        * tests/epoll_pwait2-P.c: Likewise.
        * tests/epoll_pwait2-y.c: Likewise.
        * tests/gen_tests.in (epoll_pwait2, epoll_pwait2-P, epoll_pwait2-y):
        New entries.
        * tests/pure_executables.list: Add epoll_pwait2, epoll_pwait2-P,
        and epoll_pwait2-y.
        * tests/.gitignore: Likewise.

2021-02-13  Dmitry V. Levin  <ldv@strace.io>

        Remove src/types infrastructure.
        All its former users have been converted to use bundled Linux uapi
        header files.

        * src/types/gen.sh: Remove.
        * src/types/find_last_type_fields.awk: Likewise.
        * Makefile.am (ACLOCAL_AMFLAGS): Remove "-I src/types".
        * bootstrap: Remove ./src/types/gen.sh invocation.
        * configure.ac: Remove st_CHECK_TYPES invocation.
        * src/Makefile.am: Do not include types/Makemodule.am.
        (EXTRA_DIST): Remove types/find_last_type_fields.awk and types/gen.sh.

2021-02-13  Dmitry V. Levin  <ldv@strace.io>

        rtnl_rule: switch to use bundled <linux/fib_rules.h>
        * src/types/fib_rules.h: Remove.
        * bundled/linux/include/uapi/linux/fib_rules.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/rtnl_rule.c: Include <linux/fib_rules.h> instead of
        "types/fib_rules.h".
        (decode_rule_addr): Replace struct_fib_rule_hdr with struct
        fib_rule_hdr.
        (decode_fib_rule_uid_range): Replace struct_fib_rule_uid_range with
        struct fib_rule_uid_range.
        (decode_rule_port_range): Replace struct_fib_rule_port_range with
        struct fib_rule_port_range.
        (decode_fib_rule_hdr): Replace struct_fib_rule_hdr with struct
        fib_rule_hdr.
        * src/xlat/fib_rule_actions.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/fib_rule_flags.in: Likewise.
        * src/xlat/rtnl_rule_attrs.in: Likewise.
        * tests/netlink_route.c: Include <linux/fib_rules.h> unconditionally,
        assume all its constants, structures and their fields are available.
        * tests/nlattr_fib_rule_hdr.c: Compile unconditionally, remove fallback
        definitions of constants and structures, assume all <linux/fib_rules.h>
        constants, structures and their fields are available.

        rtnl_mdb: switch to use bundled <linux/if_bridge.h>
        * src/types/rtnl_mdb.h: Remove.
        * bundled/linux/include/uapi/linux/if_bridge.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/in6.h: Likewise.
        * bundled/linux/include/uapi/linux/libc-compat.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * configure.ac (AC_CHECK_MEMBERS): Remove struct br_mdb_entry.flags and
        struct br_mdb_entry.vid.
        * src/rtnl_mdb.c: Include <netinet/in.h> and <linux/if_bridge.h>
        instead of "types/rtnl_mdb.h".
        (decode_mdba_mdb_entry_info): Replace struct_br_mdb_entry with struct
        br_mdb_entry.
        (decode_br_port_msg): Replace struct_br_port_msg with struct
        br_port_msg.
        * src/xlat/mdb_flags.in: Add #unconditional.
        * src/xlat/mdb_states.in: Add #unconditional and #value_indexed.
        * src/xlat/multicast_router_types.in: Add #unconditional, remove
        fallback definitions.
        * src/xlat/rtnl_mdb_attrs.in: Likewise.
        * src/xlat/rtnl_mdba_mdb_attrs.in: Likewise.
        * src/xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
        * src/xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
        * src/xlat/rtnl_mdba_router_attrs.in: Likewise.
        * src/xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.
        * tests/netlink_route.c: Do not include <netinet/in.h>,
        Assume all <linux/if_bridge.h> constants, structures and their fields
        are available.
        * tests/nlattr_br_port_msg.c: Compile unconditionally, do not include
        <netinet/in.h>, Assume all <linux/if_bridge.h> constants, structures
        and their fields are available.
        * tests/nlattr_mdba_mdb_entry.c: Likewise.
        * tests/nlattr_mdba_router_port.c: Likewise.

2021-02-12  Dmitry V. Levin  <ldv@strace.io>

        xlat: update RTAX_* constants.
        * src/xlat/rtnl_rta_metrics_attrs.in (RTAX_FASTOPEN_NO_COOKIE):
        New constant introduced by Linux kernel commit v4.15-rc1~84^2~339.
        * NEWS: Mention this change.

        xlat: update RTA_* constants.
        * src/xlat/rtnl_route_attrs.in (RTA_NH_ID): New constant introduced
        by Linux kernel commit v5.3-rc1~140^2~411^2~5.
        * NEWS: Mention this change.

        xlat: update RTM_* constants.
        * src/xlat/nl_route_types.in (RTM_NEWNEXTHOP, RTM_DELNEXTHOP,
        RTM_GETNEXTHOP): New constants introduced by Linux kernel commit
        v5.3-rc1~140^2~411^2~5.
        (RTM_NEWLINKPROP, RTM_DELLINKPROP, RTM_GETLINKPROP): New constants
        introduced by Linux kernel commit v5.5-rc1~174^2~448^2~4.
        (RTM_NEWVLAN, RTM_DELVLAN, RTM_GETVLAN): New constants introduced
        by Linux kernel commit v5.6-rc1~151^2~90^2~5.
        * NEWS: Mention this change.

2021-02-11  Dmitry V. Levin  <ldv@strace.io>

        rtnl_route: switch to use bundled <linux/rtnetlink.h>
        * src/types/rtnl_route.h: Remove.
        * bundled/linux/include/uapi/linux/rtnetlink.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/rtnl_route.c: Include <linux/rtnetlink.h> instead of
        "types/rtnl_route.h".
        (decode_rta_mfc_stats): Replace struct_rta_mfc_stats with struct
        rta_mfc_stats.
        (decode_rtvia): Replace struct_rtvia with struct rtvia.
        * src/xlat/nl_route_types.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/route_nexthop_flags.in: Likewise.
        * src/xlat/routing_flags.in: Likewise.
        * src/xlat/routing_protocols.in: Likewise.
        * src/xlat/routing_scopes.in: Likewise.
        * src/xlat/routing_table_ids.in: Likewise.
        * src/xlat/routing_types.in: Likewise.
        * src/xlat/rtnl_route_attrs.in: Likewise.
        * src/xlat/rtnl_rta_metrics_attrs.in: Likewise.
        * src/xlat/rtnl_tc_attrs.in: Likewise.
        * tests/netlink_route.c: Assume RTM_NEWNSID is available.
        * tests/nlattr_rtgenmsg.c: Assume RTM_GETNSID is available.
        * tests/nlattr_rtmsg.c: Assume RTA_ENCAP_TYPE, struct rta_mfc_stats,
        and struct rtvia are available.
        * tests/nlattr_tca_stab.c: Assume TCA_STAB is available.

        rtnl_neigh: switch to use bundled <linux/neighbour.h>
        * src/types/rtnl_neightbl.h: Remove.
        * bundled/linux/include/uapi/linux/neighbour.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/neighbour.h.
        * src/rtnl_neigh.c: Include <linux/neighbour.h> instead of
        <linux/rtnetlink.h>.
        * src/rtnl_neightbl.c: Include <linux/neighbour.h> instead of
        "types/rtnl_neightbl.h".
        (decode_ndt_config): Replace struct_ndt_config with struct ndt_config.
        (decode_ndt_stats): Replace struct_ndt_stats with struct ndt_stats.
        * src/xlat/neighbor_cache_entry_flags.in: Add #unconditional.
        * src/xlat/neighbor_cache_entry_states.in: Likewise.
        * src/xlat/rtnl_neigh_attrs.in: Add #unconditional, remove fallback
        definitions.
        * tests/netlink_route.c Include <linux/neighbour.h> unconditionally.
        * tests/nlattr_ndmsg.c: Likewise.
        (NDA_PORT): Remove.
        * tests/nlattr_ndtmsg.c: Include <linux/neighbour.h> unconditionally,
        assume all <linux/neighbour.h> types are properly defined, remove
        fallback definitions for constants defined in <linux/neighbour.h>.

        rtnl_link: switch to use bundled <linux/if_link.h>
        * src/types/rtnl_link.h: Remove.
        * bundled/linux/include/uapi/linux/if_link.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/if_link.h.
        (AC_CHECK_TYPES): Remove struct ifla_cacheinfo.
        * src/rtnl_link.c: Include <linux/if_link.h> instead of
        "types/rtnl_link.h".
        (decode_rtnl_link_stats): Replace struct_rtnl_link_stats with struct
        rtnl_link_stats.
        (decode_rtnl_link_stats64): Replace struct_rtnl_link_stats64 with struct
        rtnl_link_stats64.
        (decode_ifla_bridge_id): Use struct ifla_bridge_id.
        (decode_ifla_port_vsi): Replace struct_ifla_port_vsi with struct
        ifla_port_vsi.
        * src/xlat/in6_addr_gen_mode.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_brport_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_events.in: Likewise.
        * src/xlat/rtnl_ifla_info_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_info_data_bridge_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_info_data_tun_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_port_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
        * src/xlat/rtnl_ifla_xdp_attached_mode.in: Add #unconditional, remove
        fallback definitions, #enum and #include.
        * src/xlat/rtnl_ifla_xdp_attrs.in: Likewise.
        * src/xlat/rtnl_link_attrs.in: Likewise.
        * tests/nlattr_ifinfomsg.c: Include <linux/if_link.h> unconditionally,
        assume all <linux/if_link.h> types are properly defined, remove
        fallback definitions for constants defined in <linux/if_link.h>.
        * tests/nlattr_ifla_af_spec.c: Likewise.
        * tests/nlattr_ifla_brport.c: Likewise.
        * tests/nlattr_ifla_linkinfo.c: Likewise.
        * tests/nlattr_ifla_port.c: Likewise.
        * tests/nlattr_ifla_xdp.c: Likewise.

        rtnl_addr: switch to use bundled <linux/if_addr.h>
        * bundled/linux/include/uapi/linux/if_addr.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/if_addr.h.
        * src/rtnl_addr.c: Include <linux/if_addr.h> unconditionally.
        * src/xlat/ifaddrflags.in: Add #unconditional.
        * src/xlat/rtnl_addr_attrs.in: Add #unconditional, remove fallback
        definitions.
        * tests/netlink_route.c: Include <linux/if_addr.h> unconditionally.
        * tests/nlattr_ifaddrmsg.c: Likewise.
        (IFA_FLAGS): Remove.

        netlink.h: switch to use bundled <linux/netlink.h> and <linux/socket.h>
        * bundled/linux/include/uapi/linux/netlink.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/socket.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/netlink.h: Remove fallback definitions of constants defined
        in <linux/netlink.h>.
        * src/xlat/netlink_delete_flags.in: Add #unconditional.
        * src/xlat/netlink_get_flags.in: Likewise.
        * src/xlat/netlink_new_flags.in: Likewise.
        * src/xlat/netlink_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/netlink_ack_flags.in: Likewise.
        * src/xlat/netlink_protocols.in: Likewise.
        * src/xlat/netlink_types.in: Likewise.
        * src/xlat/nlmsgerr_attrs.in: Likewise.
        * src/xlat/sock_netlink_options.in: Likewise.

2021-02-10  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.11.
        * src/linux/32/ioctls_inc_align16.h: Update from src/linux v5.11-rc7
        using ioctls_gen.sh.
        * src/linux/32/ioctls_inc_align32.h: Likewise.
        * src/linux/32/ioctls_inc_align64.h: Likewise.
        * src/linux/64/ioctls_inc.h: Likewise.
        * src/linux/x32/ioctls_inc0.h: Likewise.
        * src/linux/aarch64/ioctls_arch0.h: Likewise.
        * src/linux/arm/ioctls_arch0.h: Likewise.
        * src/linux/i386/ioctls_arch0.h: Likewise.
        * src/linux/mips/ioctls_arch0.h: Likewise.
        * src/linux/powerpc/ioctls_arch0.h: Likewise.
        * src/linux/s390/ioctls_arch0.h: Likewise.
        * src/linux/s390x/ioctls_arch0.h: Likewise.
        * src/linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2021-02-10  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Drop leftover duplicate ioctl entry.
        * src/linux/32/ioctls_inc_align16.h (USBDEVFS_SUBMITURB): Remove.

        Complements: 7241233c9 ("maint: remove ioctl duplicates")

2021-02-10  Dmitry V. Levin  <ldv@strace.io>

        xlat: update V4L2_* constants.
        * src/xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_MPEG): Rename to
        V4L2_CTRL_CLASS_CODEC following the change made by Linux kernel commit
        v5.11-rc1~203^2~85.
        (V4L2_CTRL_CLASS_CODEC_STATELESS): New constant introduced by Linux
        kernel commit v5.11-rc1~203^2~85.
        * src/xlat/v4l2_control_id_bases.in (V4L2_CID_MPEG_BASE): Rename to
        V4L2_CID_CODEC_BASE following the change made by Linux kernel commit
        v5.11-rc1~203^2~85.
        (V4L2_CID_USER_CODA_BASE): New constant introduced by Linux kernel
        commit v5.11-rc1~203^2~288.
        (V4L2_CID_CODEC_STATELESS_BASE): New constant introduced by Linux kernel
        commit v5.11-rc1~203^2~82
        * src/xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_H264_SPS,
        V4L2_CTRL_TYPE_H264_PPS, V4L2_CTRL_TYPE_H264_SCALING_MATRIX,
        V4L2_CTRL_TYPE_H264_SLICE_PARAMS, V4L2_CTRL_TYPE_H264_DECODE_PARAMS,
        V4L2_CTRL_TYPE_H264_PRED_WEIGHTS): New constant introduced by Linux
        kernel commit v5.11-rc1~203^2~79.
        (V4L2_CTRL_TYPE_FWHT_PARAMS): New constant introduced by Linux kernel
        commit v5.11-rc1~203^2~72.
        * src/xlat/v4l2_meta_fmts.in (V4L2_META_FMT_RK_ISP1_PARAMS,
        V4L2_META_FMT_RK_ISP1_STAT_3A): New constant introduced by Linux kernel
        commit v5.11-rc1~203^2~269.
        * src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_H264_SLICE): New constant
        introduced by Linux kernel commit v5.11-rc1~203^2~81.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2.c (main): Update expected output.
        * tests/ioctl_v4l2-success.c (main): Likewise.

2021-02-09  Dmitry V. Levin  <ldv@strace.io>

        xlat: update UFFD_* constants.
        * src/xlat/uffd_flags.in (UFFD_USER_MODE_ONLY): New constant introduced
        by Linux kernel commit v5.11-rc1~170^2~21.
        * NEWS: Mention this change.
        * tests/userfaultfd.c: Check it.
        * tests/gen_tests.in (userfaultfd): Update -a option argument.

        xlat: update SCTP_* constants.
        * src/xlat/sock_sctp_options.in (SCTP_REMOTE_UDP_ENCAPS_PORT):
        New constant introduced by Linux kernel commit v5.11-rc1~169^2~420^2~8.
        * NEWS: Mention this change.

        xlat: update RTNH_* constants.
        * src/xlat/route_nexthop_flags.in (RTNH_F_TRAP): New constant introduced
        by Linux kernel commit v5.11-rc1~169^2~322^2~13.
        * NEWS: Mention this change.

        xlat: update PR_* constants.
        * src/xlat/prctl_options.in (PR_SET_SYSCALL_USER_DISPATCH): New constant
        introduced by Linux kernel commit v5.11-rc1~180^2~9.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * src/xlat/kvm_cap.in (KVM_CAP_SYS_HYPERV_CPUID): New constant
        introduced by Linux kernel commit v5.11-rc1~50^2~74.
        (KVM_CAP_DIRTY_LOG_RING): New constant introduced by Linux kernel commit
        v5.11-rc1~50^2~69.
        * src/xlat/kvm_exit_reason.in (KVM_EXIT_DIRTY_RING_FULL): Likewise.
        (KVM_EXIT_AP_RESET_HOLD): New constant introduced by Linux kernel commit
        v5.11-rc3~23^2~2.
        * NEWS: Mention this change.

        xlat: update IORING_* constants.
        * src/xlat/uring_ops.in (IORING_OP_SHUTDOWN): New constant introduced
        by Linux kernel commit v5.11-rc1~111^2~40.
        (IORING_OP_RENAMEAT): New constant introduced by Linux kernel commit
        v5.11-rc1~111^2~36.
        (IORING_OP_UNLINKAT): New constant introduced by Linux kernel commit
        v5.11-rc1~111^2~35.
        * src/xlat/uring_setup_features.in (IORING_FEAT_SQPOLL_NONFIXED):
        New constant introduced by Linux kernel commit v5.11-rc1~111^2~39.
        (IORING_FEAT_EXT_ARG): New constant introduced by Linux kernel commit
        v5.11-rc1~111^2~28.
        * src/xlat/uring_enter_flags.in (IORING_ENTER_EXT_ARG): Likewise.
        * NEWS: Mention this change.
        * tests/io_uring_enter.c (main): Update expected output.
        * tests/io_uring_register.c (main): Likewise.

        xlat: update ETH_* constants.
        * src/xlat/ethernet_protocols.in (ETH_P_CFM): New constant introduced
        by Linux kernel commit v5.11-rc1~169^2~446^2~7.
        * NEWS: Mention this change.

        xlat: update CLOSE_RANGE_* constants.
        * src/xlat/close_range_flags.in (CLOSE_RANGE_CLOEXEC): New constant
        introduced by Linux kernel commit v5.11-rc1~137^2~1.
        * NEWS: Mention this change.
        * tests/close_range.c (main): Update expected output.

        xlat: update BTRFS_* constants.
        * src/xlat/btrfs_features_incompat.in (BTRFS_FEATURE_INCOMPAT_RAID1C34):
        New constant introduced by Linux kernel commit v5.5-rc1~195^2~17.
        (BTRFS_FEATURE_INCOMPAT_ZONED): New constant introduced by Linux kernel
        commit v5.11-rc1~144^2~48.
        * NEWS: Mention this change.

        xlat: update BPF_* constants.
        * src/xlat/bpf_map_types.in (BPF_MAP_TYPE_TASK_STORAGE): New constant
        introduced by Linux kernel commit v5.11-rc1~169^2~259^2~23.
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Update.

        xlat: update SO_* constants.
        * src/xlat/sock_options.in (SO_PREFER_BUSY_POLL): New constant
        introduced by Linux kernel commit v5.11-rc1~169^2~124^2~17^2~9.
        (SO_BUSY_POLL_BUDGET): New constant introduced by Linux kernel commit
        v5.11-rc1~169^2~124^2~17^2~8.
        * NEWS: Mention this change.

        xlat: update SYS_* constants.
        * src/xlat/sigsys_codes.in (SYS_USER_DISPATCH): New constant introduced
        by Linux kernel commit v5.11-rc1~180^2~10.
        * NEWS: Mention this change.

        xlat: update PTRACE_* constants.
        * src/xlat/ptrace_cmds.in (PTRACE_PEEKMTETAGS, PTRACE_POKEMTETAGS): New
        aarch64 constants introduced by Linux kernel commit v5.10-rc1~49^2~9^2~8.
        * NEWS: Mention this change.

        close_range: switch to use bundled <linux/close_range.h>
        * bundled/linux/include/uapi/linux/close_range.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/close_range.h.
        * src/close_range.c: Include <linux/close_range.h> unconditionally.
        * src/xlat/close_range_flags.in: Add #unconditional, remove fallback
        definitions.
        * tests/close_range.c: Include <linux/close_range.h> unconditionally,
        remove fallback definitions.

2021-02-08  Dmitry V. Levin  <ldv@strace.io>

        src/linux: move generic and fallback files into generic subdirectory.
        * configure.ac: Replace linux/signal.h.in with
        linux/generic/signal.h.in, linux/linux/signal.h with
        linux/generic/linux/signal.h.
        [$arch == mips]: Update genstub.sh invocations.
        * src/.gitignore: Replace /linux/linux with /linux/generic/linux.
        * src/linux/*.c: Move to src/linux/generic/.
        * src/linux/*.h: Likewise.
        * src/linux/signal.h.in: Likewise.
        * src/linux/32/subcallent.h: Include "../generic/subcallent.h" instead
        of "../subcallent.h".
        * src/linux/64/subcallent.h: Likewise.
        * src/linux/i386/userent0.h: Include "../generic/userent0.h" instead of
        "../userent0.h".
        * src/linux/s390/userent1.h: Likewise.
        * src/linux/sh/userent0.h: Likewise.
        * src/linux/powerpc/errnoent.h: Include "../generic/errnoent.h" instead
        of "../errnoent.h".
        * src/linux/powerpc64/rt_sigframe.h: Include "../generic/rt_sigframe.h"
        instead of "../rt_sigframe.h".
        * src/linux/x86_64/asm_stat.h: Include "../generic/asm_stat.h" instead
        of "../asm_stat.h".
        * src/Makefile.am (AM_CPPFLAGS): Replace -I$(builddir)/$(OS)
        with -I$(builddir)/$(OS)/generic, -I$(srcdir)/$(OS)
        with -I$(srcdir)/$(OS)/generic.
        (libstrace_a_SOURCES, EXTRA_DIST): Update.
        (DISTCLEANFILES): Replace linux/linux/signal.h with
        linux/generic/linux/signal.h.
        * tests/Makefile.am (AM_CPPFLAGS): Replace -I$(top_builddir)/src/$(OS)
        with -I$(top_builddir)/src/$(OS)/generic, -I$(top_srcdir)/src/$(OS)
        with -I$(top_srcdir)/src/$(OS)/generic.

        src/linux: normalize cross-arch #include.
        Convert include paths automatically using the following command:
        $ git grep -l 'include[[:space:]]*"[[:alnum:]_]*/' src/linux |
        xargs -r sed -ri 's#(include[[:space:]]+")([[:alnum:]_]*/)#\1../\2#' --

        src/linux: include "../asm_stat.h" instead of "linux/asm_stat.h"
        * src/linux/x86_64/asm_stat.h: Include "../asm_stat.h" instead of
        "linux/asm_stat.h".

        src/linux: include "userent0.h" instead of "../userent0.h" where appropriate
        * src/linux/alpha/userent.h: Include "userent0.h" instead of
        "../userent0.h".
        * src/linux/arm/userent.h: Likewise.
        * src/linux/avr32/userent.h: Likewise.
        * src/linux/bfin/userent.h: Likewise.
        * src/linux/ia64/userent.h: Likewise.
        * src/linux/m68k/userent.h: Likewise.
        * src/linux/microblaze/userent.h: Likewise.
        * src/linux/mips/userent.h: Likewise.
        * src/linux/powerpc/userent.h: Likewise.
        * src/linux/sparc/userent.h: Likewise.
        * src/linux/sparc64/userent.h: Likewise.

        src/linux/syscallent-common-32.h: move to src/linux/32/
        * configure.ac [$arch == mips]: Update genstub.sh invocations.
        * src/Makefile.ama (EXTRA_DIST): Replace linux/syscallent-common-32.h
        with linux/32/syscallent-common-32.h.
        * src/linux/syscallent-common-32.h: Move to src/linux/32/,
        all users updated.
        * src/linux/arm/syscallent.h: Include "../32/syscallent-common-32.h"
        instead of "syscallent-common-32.h".
        * src/linux/hppa/syscallent.h: Likewise.
        * src/linux/i386/syscallent.h: Likewise.
        * src/linux/m68k/syscallent.h: Likewise.
        * src/linux/microblaze/syscallent.h: Likewise.
        * src/linux/mips/syscallent-n32.h: Likewise.
        * src/linux/mips/syscallent-o32.h: Likewise.
        * src/linux/powerpc/syscallent.h: Likewise.
        * src/linux/s390/syscallent.h: Likewise.
        * src/linux/sh/syscallent.h: Likewise.
        * src/linux/sparc/syscallent.h: Likewise.
        * src/linux/xtensa/syscallent.h: Likewise.

        src/linux: rename subcall.h, subcall32.h and subcall64.h.
        * src/linux/subcall.h: Rename to src/linux/subcallent.h.
        * src/linux/subcall32.h: Rename to src/linux/32/subcallent.h.
        * src/linux/subcall64.h: Rename to src/linux/64/subcallent.h
        * src/Makefile.am (EXTRA_DIST): Rename linux/subcall.h to
        linux/subcallent.h, linux/subcall32.h to linux/32/subcallent.h,
        linux/subcall64.h to linux/64/subcallent.h.  All users updated.
        (syscallent_names): Replace subcall.h with subcallent.h.

        Merge src/linux/arch_defs_.h into src/arch_defs.h.
        * src/arch_defs.h: Do not include "linux/arch_defs_.h" but import its
        contents.
        * src/linux/arch_defs_.h: Turn into an empty placeholder file.

        src: move linux/dummy.h to top level and rename to syscall_dummy.h.
        * src/linux/dummy.h: Rename to src/syscall_dummy.h.
        * src/Makefile.am (libstrace_a_SOURCES): Add syscall_dummy.h.
        (EXTRA_DIST): Remove linux/dummy.h.
        * src/syscall.h: Include "syscall_dummy.h" instead of "dummy.h".
        * src/linux/mips/syscallent.h: Likewise.

        src: move linux/syscall.h to top level.
        * src/linux/syscall.h: Rename to src/syscall.h.
        * src/Makefile.am (libstrace_a_SOURCES): Add syscall.h.
        (EXTRA_DIST): Remove linux/syscall.h.

        tee: switch to use bundled <linux/tee.h>
        * src/types/tee.h: Remove.
        * src/xlat/tee_ioctl_cmds.in: Likewise.
        * bundled/linux/include/uapi/linux/tee.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/tee.h.
        * src/tee.c: Include <linux/tee.h> instead of "types/tee.h"
        and "xlat/tee_ioctl_cmds.h".
        Replace all struct_tee_* types with corresponding struct tee_*.
        (struct tee_ioctl_shm_register_fd_data): New type.
        (TEE_IOC_SHM_REGISTER_FD): New macro.
        * src/xlat/tee_ioctl_gen_caps.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/tee_ioctl_impl_ids.in: Likewise.
        * src/xlat/tee_ioctl_login_types.in: Likewise.
        * src/xlat/tee_ioctl_max_arg_size.in: Likewise.
        * src/xlat/tee_ioctl_optee_caps.in: Likewise.
        * src/xlat/tee_ioctl_param_attr_types.in: Likewise.
        * tests/ioctl_tee.c: Compile unconditionally, assume all <linux/tee.h>
        types and constants are available, remove fallback definitions for
        types and constants.

2021-02-07  Elvira Khabirova  <lineprinter0@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check new tampering notes.
        * tests/tampering-notes.c: New file.
        * tests/tampering-notes.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add tampering-notes.test.
        * tests/pure_executables.list: Add tampering-notes.
        * tests/.gitignore: Likewise.

        Print tampering notes for delayed and poked syscalls.
        * src/defs.h (TCB_TAMPERED_DELAYED, TCB_TAMPERED_POKED,
        syscall_tampered_delayed, syscall_tampered_poked): New macros.
        * src/delay.c (delay_tcb): Set TCB_TAMPERED_DELAYED flag.
        * src/poke.c (poke_tcb): Set TCB_TAMPERED_POKED flag if a poke was
        performed.
        * src/syscall.c (print_injected_note): New function to print different
        notes depending on whether an error/retval injection, delay injection,
        and/or poke injection were performed.
        (syscall_exiting_trace): Use it.
        (syscall_exiting_finish): Clear TCB_TAMPERED_DELAYED and
        TCB_TAMPERED_POKED flags.
        * tests/poke.c (main): Adjust for the new tampering note format.
        * tests/poke-sendfile.c: Likewise.

        tests: check poke injection functionality.
        * tests/poke.test: New test.
        * tests/poke-ptrace.test: Likewise.
        * tests/poke-range.test: Likewise.
        * tests/poke-unaligned.test: Likewise.
        * tests/poke-range.expected: New file.
        * tests/poke-unaligned.expected: Likewise.
        * tests/poke.c: New file.
        * tests/poke-sendfile.c: Likewise.
        * tests/gen_tests.in (poke-sendfile): New entry.
        (trace_personality_*): Skip poke executable.
        * tests/pure_executables.list: Add poke and poke-sendfile.
        * tests/.gitignore: Likewise.
        (EXTRA_DIST): Add poke-range.expected and poke-unaligned.expected.
        (MISC_TESTS): Add poke.test, poke-ptrace.test, poke-range.test,
        and poke-unaligned.test.
        * tests/qual_inject-syntax.test: Invoke with -efu,
        add checks for inject=SET:poke_{enter,exit} expression syntax.

        Add -e inject=<...>:poke_{enter,exit}=<...> functionality.
        * configure.ac (AC_CHECK_FUNCS): Add process_vm_writev.
        * src/poke.c: New file.
        * src/poke.h: Likewise.
        * src/Makefile.am (libstrace_a_SOURCES): Add poke.c and poke.h.
        * src/defs.h (INJECT_F_POKE_ENTER, INJECT_F_POKE_EXIT,
        TCB_INJECT_POKE_EXIT, inject_poke_exit): New macros.
        (INJECT_ACTION_FLAGS): Add INJECT_F_POKE_ENTER and INJECT_F_POKE_EXIT.
        (struct inject_data): Add poke_idx.
        (upoken): New prototype.
        * src/filter_qualify.c: Include "poke.h".
        (parse_poke_token): New function.
        (parse_inject_token): Use it.
        (qualify_inject_common): Initialize struct inject_opts.data.poke_idx.
        * src/syscall.c: Include "poke.h".
        (tamper_with_syscall_entering): Poke if INJECT_F_POKE_ENTER
        is set, set TCB_INJECT_POKE_EXIT if INJECT_F_POKE_EXIT is set.
        (syscall_exiting_trace): Call tamper_with_syscall_exiting
        if TCB_INJECT_POKE_EXIT is set.
        (tamper_with_syscall_exiting): Poke if INJECT_F_POKE_EXIT is set.
        (syscall_exiting_finish): Clear TCB_INJECT_POKE_EXIT flag.
        * src/ucopy.c (vm_write_mem, upoken_pokedata, upoken): New functions.
        [!HAVE_PROCESS_VM_WRITEV] (strace_process_vm_writev): New function.
        * src/strace.c: Mention poke injection.
        * doc/strace.1.in: Document poke injection.
        * NEWS: Mention the new functionality.

2021-02-07  Dmitry V. Levin  <ldv@strace.io>

        tests: simplify sendfile test.
        * tests/sendfile.c (main): Turn p_off into a constant pointer
        to a kernel_ulong_t object at the end of page.

        Reported-by: Elvira Khabirova <lineprinter@altlinux.org>

2021-02-06  Dmitry V. Levin  <ldv@strace.io>

        v4l2: switch to use bundled <linux/videodev2.h>
        * src/types/v4l2.h: Remove.
        * src/xlat/v4l2_buf_flags_masks.in: Likewise.
        * src/xlat/v4l2_ioctl_cmds.in: Likewise.
        * bundled/linux/include/uapi/linux/v4l2-common.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
        * bundled/linux/include/uapi/linux/videodev2.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * configure.ac (AC_CHECK_MEMBERS): Remove struct v4l2_*.
        * src/kernel_v4l2_types.h: Include <linux/videodev2.h> instead of
        "types/v4l2.h".
        (V4L2_BUF_FLAG_INPUT, V4L2_CID_HCENTER, V4L2_CID_VCENTER,
        V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS,
        V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION): Define.
        (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF,
        VIDIOC_DQEVENT): Redefine.
        * src/v4l2.c: Do not include "static_assert.h",
        "xlat/v4l2_ioctl_cmds.h", and "xlat/v4l2_buf_flags_masks.h", remove
        static_assert checks, assume that all <linux/videodev2.h> constants,
        structures and their fields are available, remove fallback definitions
        for constants, replace all non-mpers struct_v4l2_* with corresponding
        struct v4l2_*.
        * src/xlat/v4l2_buf_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/v4l2_buf_flags_ts_src.in: Likewise.
        * src/xlat/v4l2_buf_flags_ts_type.in: Likewise.
        * src/xlat/v4l2_capture_modes.in: Likewise.
        * src/xlat/v4l2_control_classes.in: Likewise.
        * src/xlat/v4l2_control_flags.in: Likewise.
        * src/xlat/v4l2_control_id_bases.in: Likewise.
        * src/xlat/v4l2_control_ids.in: Likewise.
        * src/xlat/v4l2_control_query_flags.in: Likewise.
        * src/xlat/v4l2_device_capabilities_flags.in: Likewise.
        * src/xlat/v4l2_format_description_flags.in: Likewise.
        * src/xlat/v4l2_frameinterval_types.in: Likewise.
        * src/xlat/v4l2_input_types.in: Likewise.
        * src/xlat/v4l2_meta_fmts.in: Likewise.
        * src/xlat/v4l2_pix_fmts.in: Likewise.
        * src/xlat/v4l2_sdr_fmts.in: Likewise.
        * src/xlat/v4l2_sliced_flags.in: Likewise.
        * src/xlat/v4l2_streaming_capabilities.in: Likewise.
        * src/xlat/v4l2_tuner_audmodes.in: Likewise.
        * src/xlat/v4l2_tuner_capabilities.in: Likewise.
        * src/xlat/v4l2_tuner_rxsubchanses.in: Likewise.
        * src/xlat/v4l2_vbi_flags.in: Likewise.
        * src/xlat/v4l2_buf_types.in: Add #unconditional, remove fallback
        definitions, #enum, and #include.
        * src/xlat/v4l2_colorspaces.in: Likewise.
        * src/xlat/v4l2_control_types.in: Likewise.
        * src/xlat/v4l2_fields.in: Likewise.
        * src/xlat/v4l2_framesize_types.in: Likewise.
        * src/xlat/v4l2_memories.in: Likewise.
        * src/xlat/v4l2_tuner_types.in: Likewise.
        * tests/ioctl_v4l2.c: Do not include "xlat/v4l2_ioctl_cmds.h", assume
        that all <linux/videodev2.h> constants, structures and their fields
        are available, remove fallback definitions for constants.
        * tests/ioctl_v4l2-success.c: Likewise.

        evdev: switch to use bundled <linux/input.h>
        * src/types/evdev.h: Remove.
        * src/xlat/evdev_ioctl_cmds.in: Likewise.
        * bundled/linux/include/uapi/linux/input.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/input-event-codes.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * src/evdev.c: Compile unconditionally, do not include "types/evdev.h"
        and "xlat/evdev_ioctl_cmds.h", assume all <linux/input.h> constants,
        structures and their fields are available, remove fallback definitions
        for constants, replace all struct_input_* with corresponding struct
        input_*.
        * src/evdev_mpers.c: Compile unconditionally.
        * src/ioctl.c (ioctl_decode) [!HAVE_LINUX_INPUT_H]: Remove.
        * src/xlat/evdev_abs.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/evdev_autorepeat.in: Likewise.
        * src/xlat/evdev_ev.in: Likewise.
        * src/xlat/evdev_ff_status.in: Likewise.
        * src/xlat/evdev_ff_types.in: Likewise.
        * src/xlat/evdev_keycode.in: Likewise.
        * src/xlat/evdev_leds.in: Likewise.
        * src/xlat/evdev_misc.in: Likewise.
        * src/xlat/evdev_mtslots.in: Likewise.
        * src/xlat/evdev_prop.in: Likewise.
        * src/xlat/evdev_relative_axes.in: Likewise.
        * src/xlat/evdev_snd.in: Likewise.
        * src/xlat/evdev_switch.in: Likewise.
        * tests/ioctl.c: Include <linux/input.h> unconditionally, assume
        EVIOCGBIT and EV_KEY are defined there.
        * tests/ioctl_evdev.c: Compile unconditionally, assume all
        <linux/input.h> constants are available, remove fallback definitions
        for constants.
        * tests/ioctl_evdev-success.c: Likewise.

        netlink_crypto: switch to use bundled <linux/cryptouser.h>
        * src/types/cryptouser.h: Remove.
        * src/xlat/crypto_msgs.in: Likewise.
        * bundled/linux/include/uapi/linux/cryptouser.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/netlink.c: Include <linux/cryptouser.h> instead of
        "xlat/crypto_msgs.h".
        * src/netlink_crypto.c: Include <linux/cryptouser.h> instead of
        "types/cryptouser.h" and "xlat/crypto_msgs.h".  Replace all
        struct_crypto_* with corresponding struct crypto_*.
        * src/xlat/crypto_nl_attrs.in: Add #unconditional, remove fallback
        definitions.
        * tests/netlink_crypto.c: Include "xlat/netlink_protocols.h" in
        [!HAVE_LINUX_CRYPTOUSER_H]: Remove.
        * tests/nlattr_crypto_user_alg.c: Include "xlat/netlink_protocols.h"
        in XLAT_MACROS_ONLY mode.
        [!HAVE_LINUX_CRYPTOUSER_H, !HAVE_STRUCT_CRYPTO_REPORT_HASH,
        !HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER, !HAVE_STRUCT_CRYPTO_REPORT_AEAD,
        !HAVE_STRUCT_CRYPTO_REPORT_RNG, !HAVE_STRUCT_CRYPTO_REPORT_CIPHER]:
        Likewise.

        io_uring: switch to use bundled <linux/io_uring.h>
        * src/types/io_uring.h: Remove.
        * bundled/linux/include/uapi/linux/io_uring.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/io_uring.c: Include <linux/io_uring.h> instead of "types/io_uring.h",
        Assume all io_uring constants, structures and their fields are available,
        Replace all struct_io_uring_* with corresponding struct io_uring_*.
        * src/xlat/uring_cqring_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/uring_enter_flags.in: Likewise.
        * src/xlat/uring_op_flags.in: Likewise.
        * src/xlat/uring_setup_features.in: Likewise.
        * src/xlat/uring_setup_flags.in: Likewise.
        * src/xlat/uring_ops.in: Add #unconditional, remove #enum, #include,
        and fallback definitions.
        * src/xlat/uring_register_opcodes.in: Likewise.
        * tests/io_uring_register.c [!HAVE_LINUX_IO_URING_H,
        !HAVE_STRUCT_IO_URING_FILES_UPDATE, !HAVE_STRUCT_IO_URING_PROBE]: Remove.
        * tests/io_uring_setup.c [!HAVE_LINUX_IO_URING_H,
        !HAVE_STRUCT_IO_URING_PARAMS_WQ_FD,
        !HAVE_STRUCT_IO_URING_PARAMS_FEATURES,
        !HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS]: Likewise.

        btrfs: switch to use bundled <linux/btrfs.h> and <linux/btrfs_tree.h>
        * src/types/btrfs.h: Remove.
        * bundled/linux/include/uapi/linux/btrfs.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/btrfs.h.
        * src/btrfs.c: Compile unconditionally, include <linux/btrfs_tree.h>
        instead of <linux/btrfs.h> and "types/btrfs.h", assume all btrfs
        constants, structures and their fields are available, remove fallback
        definitions for constants and types, replace
        struct_btrfs_ioctl_logical_ino_args with struct
        btrfs_ioctl_logical_ino_args.
        * tests/btrfs.c: Likewise.  Include "xlat/fsmagic.h" in XLAT_MACROS_ONLY
        mode instead of <linux/magic.h>.
        * src/fs_0x94_ioctl.c (fs_0x94_ioctl) [!HAVE_LINUX_BTRFS_H]: Remove.
        * src/xlat/btrfs_compress_types.in: Remove #enum and #include.
        * src/xlat/btrfs_balance_args.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/btrfs_balance_ctl_cmds.in: Likewise.
        * src/xlat/btrfs_balance_flags.in: Likewise.
        * src/xlat/btrfs_balance_state.in: Likewise.
        * src/xlat/btrfs_cont_reading_from_srcdev_mode.in: Likewise.
        * src/xlat/btrfs_features_compat_ro.in: Likewise.
        * src/xlat/btrfs_key_types.in: Likewise.
        * src/xlat/btrfs_logical_ino_args_flags.in: Likewise.
        * src/xlat/btrfs_qgroup_limit_flags.in: Likewise.
        * src/xlat/btrfs_qgroup_status_flags.in: Likewise.
        * src/xlat/btrfs_scrub_flags.in: Likewise.
        * src/xlat/btrfs_send_flags.in: Likewise.
        * src/xlat/btrfs_space_info_flags.in: Likewise.
        * src/xlat/btrfs_tree_objectids.in: Likewise.
        * src/xlat/btrfs_defrag_flags.in: Add #unconditional.
        * src/xlat/btrfs_dev_replace_cmds.in: Likewise.
        * src/xlat/btrfs_dev_replace_results.in: Likewise.
        * src/xlat/btrfs_dev_replace_state.in: Likewise.
        * src/xlat/btrfs_dev_stats_flags.in: Likewise.
        * src/xlat/btrfs_features_incompat.in: Likewise.
        * src/xlat/btrfs_qgroup_ctl_cmds.in: Likewise.
        * src/xlat/btrfs_qgroup_inherit_flags.in: Likewise.
        * src/xlat/btrfs_snap_flags_v2.in: Likewise.

        fs_x_ioctl: switch to use bundled <linux/fs.h>
        * src/types/fs_x.h: Remove.
        * src/xlat/fs_x_ioctl_cmds.in: Likewise.
        * configure.ac (AC_CHECK_MEMBERS): Remove struct fsxattr.fsx_cowextsize.
        * src/fs_x_ioctl.c: Include <linux/fs.h> instead of "types/fs_x.h"
        and "xlat/fs_x_ioctl_cmds.h".
        (decode_fstrim_range): Replace struct_fstrim_range with struct
        fstrim_range.
        (decode_fsxattr): Replace struct_fsxattr with struct fsxattr.
        * src/xlat/fs_xflags.in: Add #unconditional, remove fallback
        definitions.
        * tests/ioctl_fs_x.c [!FIFREEZE, !HAVE_STRUCT_FSXATTR_FSX_COWEXTSIZE]:
        Remove.

        fs_f_ioctl: switch to use bundled <linux/fs.h>
        * src/xlat/fs_f_ioctl_cmds.in: Remove.
        * src/fs_f_ioctl.c: Do not include "xlat/fs_f_ioctl_cmds.h".
        * src/xlat/fs_ioc_flags.in: Add #unconditional, remove fallback
        definitions.
        * tests/ioctl_fs_f.c [!FS_IOC_GETFLAGS]: Remove.

        fs_0x94_ioctl: switch to use bundled <linux/fs.h>
        * src/types/fs_0x94.h: Remove.
        * src/xlat/fs_0x94_ioctl_cmds.in: Likewise.
        * src/fs_0x94_ioctl.c: Include <linux/fs.h> instead of "types/fs_0x94.h"
        and "xlat/fs_0x94_ioctl_cmds.h".
        (decode_file_clone_range): Replace struct_file_clone_range with
        struct file_clone_range.
        (print_file_dedupe_range_info, decode_file_dedupe_range): Replace
        struct_file_dedupe_range_info and struct_file_dedupe_range with
        struct file_dedupe_range_info and struct file_dedupe_range_info,
        respectively.
        (decode_fslabel): Replace fs_0x94_label_t with char[FSLABEL_MAX].
        * tests/btrfs.c [!FS_IOC_GETFSLABEL, !FS_IOC_SETFSLABEL,
        !FIDEDUPERANGE]: Remove.

        bundled: add <linux/fs.h> and <linux/fscrypt.h>
        * bundled/linux/include/uapi/linux/fs.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/fscrypt.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.

        Switch to use bundled <linux/mount.h>
        * bundled/linux/include/uapi/linux/mount.h: New file, copied from
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/mount.h.
        * src/fsconfig.c: Include <linux/mount.h> unconditionally.
        * src/fsmount.c: Likewise.
        * src/fsopen.c: Likewise.
        * src/fspick.c: Likewise.
        * src/move_mount.c: Likewise.
        * src/open_tree.c: Likewise.  Include "xlat/open_mode_flags.h" in
        XLAT_MACROS_ONLY mode instead of <fcntl.h>.  to make sure O_CLOEXEC
        is properly defined.
        * src/xlat/fsconfig_cmds.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/fsmount_flags.in: Likewise.
        * src/xlat/fsopen_flags.in: Likewise.
        * src/xlat/fspick_flags.in: Likewise.
        * src/xlat/mount_attr_flags.in: Likewise.
        * src/xlat/move_mount_flags.in: Likewise.
        * src/xlat/open_tree_flags.in (OPEN_TREE_CLOEXEC): Define
        unconditionally.
        * tests/fsconfig.c: Include <linux/mount.h> instead of
        "xlat/fsconfig_cmds.h".

        fs_f_ioctl: switch to use bundled <linux/fiemap.h>
        * src/types/fiemap.h: Remove.
        * bundled/linux/include/uapi/linux/fiemap.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/fs_f_ioctl.c: Include <linux/fiemap.h> instead of
        "types/fiemap.h".
        (print_fiemap_extent, decode_fiemap): Replace struct_fiemap_extent and
        struct_fiemap with struct fiemap_extent and struct fiemap, respectively.
        * src/xlat/fs_f_ioctl_cmds.in: Replace struct_fiemap with struct fiemap.
        * src/xlat/fiemap_extent_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/fiemap_flags.in: Likewise.
        * tests/btrfs.c [!HAVE_LINUX_FIEMAP_H]: Remove.
        * tests/ioctl_fiemap.c [!HAVE_LINUX_FIEMAP_H]: Likewise.

2021-02-05  Dmitry V. Levin  <ldv@strace.io>

        loop: switch to use bundled <linux/loop.h>
        * src/types/loop.h: Remove.
        * src/xlat/loop_cmds.in: Likewise.
        * bundled/linux/include/uapi/linux/loop.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * src/loop.c: Include <linux/loop.h> instead of "types/loop.h" and
        "xlat/loop_cmds.h".
        (decode_loop_config): Replace struct_loop_config with struct
        loop_config.
        * src/xlat/loop_crypt_type_options.in: Add #unconditional.
        * tests/ioctl_loop.c: Include <linux/loop.h> instead of "types/loop.h"
        and "xlat/loop_cmds.h".
        (print_loop_config, main): Replace struct_loop_config with struct
        loop_config.

2021-02-05  Dmitry V. Levin  <ldv@strace.io>

        configure.ac: add bundled Linux uapi headers to the compiler headers search path
        Configure checks should use the same Linux uapi headers as the
        subsequent build, so bundled Linux uapi headers should be available
        at configure stage.

        * configure.ac (CPPFLAGS): Add
        -I$srcdir/bundled/linux/arch/$karch/include/uapi and
        -I$srcdir/bundled/linux/include/uapi.

        Complements: v5.10-274-g4122df596 "Add bundled Linux uapi headers to the
        compiler headers search path"

2021-02-05  Dmitry V. Levin  <ldv@strace.io>

        openat2: switch to use bundled <linux/openat2.h>
        * src/types/openat2.h: Remove.
        * bundled/linux/include/uapi/linux/openat2.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/Makefile.am (EXTRA_DIST): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/openat2.h.
        * src/open.c: Include <linux/openat2.h> instead of "types/openat2.h".
        (print_open_how): Replace struct_open_how with struct open_how.
        * src/xlat/open_resolve_flags.in: Add #unconditional, remove fallback
        definitions.
        * tests/openat2.c: Include <linux/openat2.h> unconditionally, use its
        definition of struct open_how.

        gpio: switch to use <linux/gpio.h>
        * src/types/gpio.h: Remove.
        * src/xlat/gpio_ioctl_cmds.in: Likewise.
        * src/gpio_ioctl.c: Include <linux/gpio.h> instead of "types/gpio.h"
        and "xlat/gpio_ioctl_cmds.h".  Replace struct_gpio* with struct gpio*.
        * src/xlat/gpio_event_flags.in: Add #unconditional, remove fallback
        definitions.
        * src/xlat/gpio_handle_flags.in: Likewise.
        * src/xlat/gpio_line_flags.in: Likewise.
        * src/xlat/gpio_v2_line_attr_ids.in: Add #unconditional, remove
        fallback definitions, #enum, and #include.
        * src/xlat/gpio_v2_line_flags.in: Likewise.
        * tests/ioctl_gpio.c: Include <linux/gpio.h> instead of "types/gpio.h"
        and "xlat/gpio_*.h".  Replace struct_gpio* with struct gpio*.

        bundled: add <linux/gpio.h> and <linux/const.h>
        * bundled/linux/include/uapi/linux/gpio.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/const.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.

2021-02-04  Dmitry V. Levin  <ldv@strace.io>

        Replace src/linux/*_diag.h with bundled Linux kernel UAPI header files.
        * src/linux/inet_diag.h: Remove.
        * src/linux/netlink_diag.h: Likewise.
        * src/linux/packet_diag.h: Likewise.
        * src/linux/smc_diag.h: Likewise.
        * src/linux/sock_diag.h: Likewise.
        * src/linux/unix_diag.h: Likewise.
        * src/Makefile.am (EXTRA_DIST): Remove them.
        * bundled/linux/include/uapi/linux/inet_diag.h: New file, copied from
        headers_install'ed Linux kernel v5.11-rc6.
        * bundled/linux/include/uapi/linux/netlink_diag.h: Likewise.
        * bundled/linux/include/uapi/linux/packet_diag.h: Likewise.
        * bundled/linux/include/uapi/linux/smc_diag.h: Likewise.
        * bundled/linux/include/uapi/linux/sock_diag.h: Likewise.
        * bundled/linux/include/uapi/linux/types.h: Likewise.
        * bundled/linux/include/uapi/linux/unix_diag.h: Likewise.
        * bundled/linux/include/uapi/rdma/ib_user_verbs.h: Likewise.
        * bundled/Makefile.am (EXTRA_DIST): Add them.
        * tests/nlattr.c (UNIX_DIAG_FIRST_UNUSED): New enum constant.

        maint: exclude bundled files in update_copyright_years.sh.
        * maint/update_copyright_years.sh: Treat $IGNORED_FILES as regular
        expressions.
        (IGNORED_FILES): Add "bundled/linux/.*" regexp.

        Add bundled Linux uapi headers to the compiler headers search path.
        * src/Makefile.am (AM_CPPFLAGS): Add
        -I$(top_srcdir)/bundled/$(OS)/arch/$(KARCH)/include/uapi
        -I$(top_srcdir)/bundled/$(OS)/include/uapi .
        * tests/Makefile.am: Likewise.

2021-02-04  Dmitry V. Levin  <ldv@strace.io>

        Introduce karch, karch_m32, and karch_mx32 configure variables.
        These configure variables are defined to the names of the corresponding
        arch directories in the Linux kernel tree.

        * configure.ac (karch, karch_m32, karch_mx32): New variables.
        (AC_SUBST): Add them.
        * bootstrap: Substitute @karch@ with @karch_$m@.
        * src/Makefile.am (KARCH): New variable.
        * tests/Makefile.am: Likewise.

2021-02-04  Dmitry V. Levin  <ldv@strace.io>

        Introduce bundled directory.
        This is the first step of adding bundled Linux kernel UAPI headers for
        compatibility purposes.  These headers are going to be copied verbatim
        from the Linux kernel, they are provided by the Linux kernel under the
        terms of the GNU General Public License version 2 only with an explicit
        syscall exception.

        According to analysis made by Kent Gibson at [1], we are allowed to
        re-distribute unmodified Linux kernel UAPI headers under the same terms
        as they are provided by the Linux kernel, and such re-distribution does
        not affect the license of strace itself.

        [1] https://lore.kernel.org/linux-gpio/20210128032641.GA11655@sol/

        * bundled/Makefile.am: New file.
        * configure.ac (AC_CONFIG_FILES): Add bundled/Makefile.
        * Makefile.am (SUBDIRS): Add bundled.
        * bundled/linux/GPL-2.0: New file, copied from Linux kernel
        v5.10:LICENSES/preferred/GPL-2.0 file.
        * bundled/linux/Linux-syscall-note: New file, copied from Linux kernel
        v5.10:LICENSES/exceptions/Linux-syscall-note file.
        * bundled/linux/COPYING: New file.
        * COPYING: Mention it.

        Thanks-to: Kent Gibson <warthog618@gmail.com>

2021-02-03  Dmitry V. Levin  <ldv@strace.io>

        sg_io_v4: fix build with very old kernel headers.
        <linux/bsg.h> before Linux kernel commit v2.6.30-rc1~641^2~9 failed
        to include <linux/types.h>.

        * src/sg_io_v4.c: Include <linux/types.h> before <linux/bsg.h>.
        * tests/ioctl_sg_io_v4.c: Likewise.

        Resolves: https://github.com/strace/strace/issues/161

2021-02-03  Dmitry V. Levin  <ldv@strace.io>

        Move source files into src subdirectory.
        * src/Makefile.am: New file.
        * src/.gitignore: Likewise.
        * scno.am: Move into src subdirectory.
        * scno.head: Likewise.
        * strace-graph: Likewise.
        * strace-log-merge: Likewise.
        * linux/: Likewise.
        * types/: Likewise.
        * xlat/: Likewise.
        * *.awk: Likewise.
        * *.c: Likewise.
        * *.h: Likewise.
        * *.sh: Likewise.
        * .gitignore: Update.
        * Makefile.am: Update.
        * bootstrap: Update.
        * configure.ac: Update.
        * debian/rules: Update.
        * debian/strace-udeb.install: Update.
        * debian/strace.examples: Update.
        * debian/strace.install: Update.
        * debian/strace64.install: Update.
        * m4/gen_bpf_attr_m4.sh: Update.
        * m4/mpers.m4: Update.
        * tests/Makefile.am: Update.
        * tests/init.sh: Update.
        * tests/legacy_syscall_info.test: Update.
        * tests/strace-log-merge-error.test: Update.
        * tests/strace-log-merge-suffix.test: Update.

2021-02-02  Dmitry V. Levin  <ldv@strace.io>

        Move manual pages and some dev documentation into doc subdirectory.
        * doc/.gitignore: New file.
        * HACKING-scripts: Rename to doc/HACKING-scripts.
        * README-linux-ptrace: Rename to doc/README-linux-ptrace.
        * README-mpers: Rename to doc/README-mpers.
        * strace-log-merge.1.in: Rename to doc/strace-log-merge.1.in.
        * strace.1.in: Rename to doc/strace.1.in.
        * .gitignore (/strace-log-merge.1, /strace.1): Remove.
        * Makefile.am (man_MANS, EXTRA_DIST, dist-hook): Update.
        * configure.ac (manpage_date, AC_CONFIG_FILES): Update.
        * debian/rules: Update.
        * debian/strace.manpages: Update.
        * debian/strace64.manpages: Update.
        * strace.spec.in: Update.

        configure.ac: move auxiliary build tools to build-aux.
        * configure.ac (AC_CONFIG_AUX_DIR): Change from "." to build-aux.
        * build-aux/.gitignore: New file.
        * .gitignore: Update.

        Move auxiliary build scripts to build-aux subdirectory.
        * copyright-year-gen: Rename to build-aux/copyright-year-gen.
        * file-date-gen: Rename to build-aux/file-date-gen.
        * git-set-file-times: Rename to build-aux/git-set-file-times.
        * git-version-gen: Rename to build-aux/git-version-gen.
        * gitlog-to-changelog: Rename to build-aux/gitlog-to-changelog.
        * Makefile.am (EXTRA_DIST): Rename copyright-year-gen to
        build-aux/copyright-year-gen, file-date-gen to build-aux/file-date-gen,
        and git-version-gen to build-aux/git-version-gen.
        ($(srcdir)/ChangeLog): Rename gitlog-to-changelog to
        build-aux/gitlog-to-changelog.
        * ci/run-build-and-tests.sh: Rename git-set-file-times to
        build-aux/git-set-file-times.
        * configure.ac: Rename git-version-gen to build-aux/git-version-gen,
        copyright-year-gen to build-aux/copyright-year-gen, and
        file-date-gen to build-aux/file-date-gen.
        * maint/make-dist: Rename git-set-file-times to
        build-aux/git-set-file-times.
        * maint/update_copyright_years.sh: Rename git-set-file-times to
        build-aux/git-set-file-times, gitlog-to-changelog to
        build-aux/gitlog-to-changelog.

        Move outdated files to attic.
        * build_static_example.sh: Move to attic subdirectory.
        * qemu_multiarch_testing: Likewise.
        * test: Likewise.

        generate_mpers_am.sh: do not assume the current directory.
        * generate_mpers_am.sh: Save generated files in the directory where
        this script is located, do not assume it's a current directory.

2021-02-02  Dmitry V. Levin  <ldv@strace.io>

        Do not install strace-graph.
        Apparently, nobody uses this utility, since it barely works, and nobody
        complained.  For example,

        $ strace -qe/exit -o'|./strace-graph' true
        Use of uninitialized value $pid in concatenation (.) or string at ./strace-graph line 207, <> line 1.
        Use of uninitialized value $time in concatenation (.) or string at ./strace-graph line 207, <> line 1.
        Use of uninitialized value $pid in hash element at ./strace-graph line 214, <> line 1.
        Use of uninitialized value $pid in delete at ./strace-graph line 244, <> line 1.
        Use of uninitialized value $startpid in hash element at ./strace-graph line 336, <> line 2.
        Use of uninitialized value $pid in hash element at ./strace-graph line 284, <> line 2.
        Can't use an undefined value as an ARRAY reference at ./strace-graph line 284, <> line 2.

        This is not surprising because downstreams stopped packaging
        strace-graph long time ago.

        * Makefile.am (bin_SCRIPTS): Remove strace-graph.
        * strace.spec.in (%install): Stop removing strace-graph.

2021-02-01  Dmitry V. Levin  <ldv@strace.io>

        treewide: move #include "print_fields.h" to defs.h.
        As print_fields.h is going to be used by virtually every parser,
        include print_fields.h from defs.h, and stop including it in all other
        files except tests.

2021-01-31  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprintf("{name=") and tprintf(", name=")
        ... with tprint_struct_begin() followed by tprints_field_name("name").
        and with tprint_struct_next() followed by tprints_field_name("name"),
        respectively.

        This applies to everything except tests.

2021-01-31  Dmitry V. Levin  <ldv@strace.io>

        sockaddr: use tprints_field_name.
        * sockaddr.c (print_inet_addr, decode_inet_addr): Use
        tprints_field_name instead of open-coding it.

        sockaddr: use print_fields.h interface in print_sockaddr_data_ipx.
        * sockaddr.c (print_sockaddr_data_ipx): Use print_fields.h interface.

        treewide: use tprint_value_changed.
        Replace variations of tprints(" => ") with tprint_value_changed(),
        this applies to everything except tests.

        v4l2: change print_v4l2_format_fmt prefix string argument into a function
        * v4l2.c (tprint_struct_end_value_changed_struct_begin): New function.
        (print_v4l2_format_fmt): Change the prefix string argument into
        a function.  All callers updated.

        print_nonzero_bytes: change prefix string argument into a function.
        * defs.h (print_nonzero_bytes): Change the prefix string argument into a
        function.
        * util.c (print_nonzero_bytes): Likewise.  All callers updated.

        print_sigset_addr: print the structure formatting.
        * signal.c (print_sigset_addr): Print the structure formatting around
        print_sigset_addr_len_limit invocation.
        * rt_sigreturn.c (SYS_FUNC(rt_sigreturn)): Do not print the structure
        formatting around print_sigset_addr invocation.
        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.

        Remove prefix argument from tprintsigmask_addr.
        * defs.h (tprintsigmask_addr): Remove.
        * sigreturn.c: Include "print_fields.h".
        (print_sigmask_addr_size): New function.
        (tprintsigmask_addr): New macro.  All callers updated.

        signal: remove prefix argument from tprintsigmask_val.
        * signal.c (tprintsigmask_val): Remove prefix argument, all callers
        updated.

2021-01-30  Dmitry V. Levin  <ldv@strace.io>

        desc: fix output format of the last argument of pselect6 syscall.
        * desc.c (umove_kulong_array_or_printaddr): Remove.
        (do_pselect6): Use print_kernel_sigset to print the last argument
        of pselect6 syscall.
        * tests/pselect6-common.c (main): Update expected output.

2021-01-30  Dmitry V. Levin  <ldv@strace.io>

        Rename print_aio_sigset to print_kernel_sigset.
        This function is not specific to aio.

        * print_aio_sigset.c: Rename to ...
        * print_kernel_sigset.c: ... this file, rename strace_aio_sigset
        to struct_sigset_addr_size.
        * Makefile.am (libstrace_a_SOURCES): Replace print_aio_sigset.c
        with print_kernel_sigset.c.
        * aio.c (print_io_getevents): Replace print_aio_sigset with
        print_kernel_sigset.

2021-01-30  Dmitry V. Levin  <ldv@strace.io>

        print_msgbuf: fix output format of struct msgbuf.
        * print_msgbuf.c: Include "print_fields.h".
        (tprint_msgbuf): Print fields of struct msgbuf using print_fields.h
        interface.
        * tests/ipc_msgbuf.c (main): Update expected output.

        ipc_sem: fix output format of struct sembuf.
        * ipc_sem.c: Include "print_fields.h".
        (print_sembuf): Print fields of struct sembuf using print_fields.h
        interface.
        * tests/semop-common.c (main): Update expected output.
        * tests/semtimedop-common.c (main): Likewise.

2021-01-30  Dmitry V. Levin  <ldv@strace.io>

        printsiginfo: fix compilation warning when struct siginfo.si_syscall is not available
        * printsiginfo.c (print_si_syscall): Conditionalize on
        HAVE_SIGINFO_T_SI_SYSCALL.

        Fixes: v5.10-126-g2e8078286 "printsiginfo: use print_fields.h macros"

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprints(", name=")
        ... with tprint_struct_next() followed by tprints_field_name("name").

        This applies to all users of print_fields.h macros except tests.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprints("{name=")
        ... with tprint_struct_begin() followed by tprints_field_name("name").

        This applies to all users of print_fields.h macros except tests.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprints("name=") with tprints_field_name("name")
        This applies to all users of print_fields.h macros except tests.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprints(", ...")
        ... with tprint_struct_next()/tprint_array_next() followed by
        tprint_more_data_follows().

        This applies to all users of print_fields.h macros except tests.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprints("...") with tprint_more_data_follows()
        This applies to all users of print_fields.h macros except tests.

        treewide: replace tprints(" => ") with tprint_value_changed()
        This applies to all users of print_fields.h macros except tests.

        treewide: replace tprints("{") with tprint_struct_begin()
        This applies to all users of print_fields.h macros except tests.

        treewide: replace tprints("}") with tprint_struct_end()
        This applies to all users of print_fields.h macros except tests.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        treewide: replace tprintf with tprints for printing static strings.
        This applies to everything except tests.

        * print_syscall_number.c (print_syscall_number): Replace tprintf
        with tprints for printing static strings.
        * tee.c (tee_print_param_fn): Likewise.
        * wait.c (printwaitn): Likewise.

2021-01-29  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: remove prefix argument from all remaining PRINT_FIELD_* macros
        * print_fields.h (PRINT_FIELD_UID, PRINT_FIELD_LEN): Remove.
        (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_ID, PRINT_FIELD_TGID):
        Remove the first argument, all callers updated.
        * net.c (MAYBE_PRINT_FIELD_LEN): New macro, use it instead of
        PRINT_FIELD_LEN.
        * tests/nlattr_smc_diag_msg.c (PRINT_FIELD_SMC_DIAG_CURSOR):
        Remove the first argument, all callers updated.

        net: stop using PRINT_FIELD_LEN.
        * print_fields.h (PRINT_FIELD_LEN): Remove.
        * net.c (MAYBE_PRINT_FIELD_LEN): New macro.
        (print_get_linger, print_get_ucred, print_tpacket_stats): Use it
        instead of PRINT_FIELD_LEN.

        print_fields.h: remove prefix argument from PRINT_FIELD_X macro.
        * print_fields.h (PRINT_FIELD_X): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_XVAL macro.
        * print_fields.h (PRINT_FIELD_XVAL): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_FLAGS macro.
        * print_fields.h (PRINT_FIELD_FLAGS): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_CSTRING macro.
        * print_fields.h (PRINT_FIELD_CSTRING): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_FD macro.
        * print_fields.h (PRINT_FIELD_FD): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_ADDR64 macro.
        * print_fields.h (PRINT_FIELD_ADDR64): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_0X macro.
        * print_fields.h (PRINT_FIELD_0X): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_ARRAY macro.
        * print_fields.h (PRINT_FIELD_ARRAY): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_ARRAY_UPTO macro
        * print_fields.h (PRINT_FIELD_ARRAY_UPTO): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_U_CAST macro.
        * print_fields.h (PRINT_FIELD_U_CAST): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_PTR macro.
        * print_fields.h (PRINT_FIELD_PTR): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_PTR macro.
        * print_fields.h (PRINT_FIELD_OBJ_PTR): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_VAL macro.
        * print_fields.h (PRINT_FIELD_OBJ_VAL): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_TCB_VAL macro
        * print_fields.h (PRINT_FIELD_OBJ_TCB_VAL): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_HEX_ARRAY macro.
        * print_fields.h (PRINT_FIELD_HEX_ARRAY): Remove the first argument,
        all callers updated.

2021-01-28  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: remove prefix argument from PRINT_FIELD_IFINDEX macro.
        * print_fields.h (PRINT_FIELD_IFINDEX): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_DEV macro.
        * print_fields.h (PRINT_FIELD_DEV): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_U64 macro.
        * print_fields.h (PRINT_FIELD_U64): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_SOCKADDR macro.
        * print_fields.h (PRINT_FIELD_SOCKADDR): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_NET_PORT macro.
        * print_fields.h (PRINT_FIELD_NET_PORT): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_UUID macro.
        * print_fields.h (PRINT_FIELD_UUID): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_XVAL_U macro.
        * print_fields.h (PRINT_FIELD_XVAL_U): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_TCB_PTR macro
        * print_fields.h (PRINT_FIELD_OBJ_TCB_PTR): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_U macro.
        * print_fields.h (PRINT_FIELD_OBJ_U): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_STRING macro.
        * print_fields.h (PRINT_FIELD_STRING): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_CSTRING_SZ macro
        * print_fields.h (PRINT_FIELD_CSTRING_SZ): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_{UINT,U,X}_ARRAY and PRINT_FIELD_COOKIE macros
        * print_fields.h (PRINT_FIELD_UINT_ARRAY, PRINT_FIELD_U_ARRAY,
        PRINT_FIELD_X_ARRAY, PRINT_FIELD_COOKIE): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_MAC_SZ and PRINT_FIELD_MAC macros
        * print_fields.h (PRINT_FIELD_MAC_SZ, PRINT_FIELD_MAC): Remove
        the first argument, all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_HWADDR_SZ macro.
        * print_fields.h (PRINT_FIELD_HWADDR_SZ): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_ERR_D macro.
        * print_fields.h (PRINT_FIELD_ERR_D): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_ERR_U macro.
        * print_fields.h (PRINT_FIELD_ERR_U): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_X_CAST macro.
        * print_fields.h (PRINT_FIELD_X_CAST): Remove the first argument,
        all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_UINT_ARRAY2D and PRINT_FIELD_X_ARRAY2D macros
        * print_fields.h (PRINT_FIELD_UINT_ARRAY2D, PRINT_FIELD_X_ARRAY2D):
        Remove the first argument, all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_SINT_ARRAY and PRINT_FIELD_D_ARRAY macros
        * print_fields.h (PRINT_FIELD_SINT_ARRAY, PRINT_FIELD_D_ARRAY): Remove
        the first argument, all callers updated.

        print_fields.h: remove prefix argument from PRINT_FIELD_INET_ADDR macro.
        * print_fields.h (PRINT_FIELD_INET_ADDR): Remove the first argument,
        all callers updated.

2021-01-27  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: remove unused macros.
        * print_fields.h (PRINT_FIELD_ADDR, PRINT_FIELD_AX25_ADDR,
        PRINT_FIELD_X25_ADDR, PRINT_FIELD_NUMERIC_UMODE_T, PRINT_FIELD_TID,
        PRINT_FIELD_PGID, PRINT_FIELD_SID, PRINT_FIELD_STRN, PRINT_FIELD_STR,
        PRINT_FIELD_PATH, PRINT_FIELD_KERNEL_VERSION): Remove.

        Stop using PRINT_FIELD_NUMERIC_UMODE_T.
        * open.c (print_open_how): Use PRINT_FIELD_OBJ_U instead of
        PRINT_FIELD_NUMERIC_UMODE_T.
        * ipc_msgctl.c (print_ipc_perm): Likewise.
        * ipc_semctl.c (print_ipc_perm): Likewise.
        * ipc_shmctl.c (print_ipc_perm): Likewise.

        Stop using PRINT_FIELD_KERNEL_VERSION.
        * bpf.c (BPF_PROG_LOAD): Use PRINT_FIELD_OBJ_VAL instead of
        PRINT_FIELD_KERNEL_VERSION.
        * v4l2.c (print_v4l2_capability): Likewise.

        Stop using PRINT_FIELD_STR and PRINT_FIELD_STRN.
        * aio.c (print_iocb): Use PRINT_FIELD_OBJ_TCB_VAL instead of
        PRINT_FIELD_STRN.
        * keyctl.c (keyctl_dh_compute): Use PRINT_FIELD_OBJ_TCB_VAL instead of
        PRINT_FIELD_STR and PRINT_FIELD_STRN.

        sockaddr: stop using PRINT_FIELD_X25_ADDR.
        * sockaddr.c (print_sockaddr_data_x25): Use PRINT_FIELD_OBJ_PTR instead
        of PRINT_FIELD_X25_ADDR.

        signal: stop using PRINT_FIELD_ADDR.
        * signal.c (decode_old_sigaction, decode_new_sigaction): Use
        PRINT_FIELD_OBJ_VAL instead of PRINT_FIELD_ADDR.

        netlink_sock_diag.h: remove prefix argument from PRINT_FIELD_INET_DIAG_SOCKID macro
        * netlink_sock_diag.h (PRINT_FIELD_INET_DIAG_SOCKID): Remove the first
        argument, all callers updated.

        x86_64/arch_kvm: remove prefix argument from PRINT_FIELD_KVM_SREGS_STRUCT macro
        * linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): Remove
        the first argument, all callers updated.

        v4l2: remove prefix argument from local PRINT_FIELD_* macros.
        * v4l2.c (PRINT_FIELD_FRACT, PRINT_FIELD_PIXFMT,
        PRINT_FIELD_V4L2_FORMAT_FMT, PRINT_FIELD_V4L2_BUFFER_FLAGS,
        PRINT_FIELD_V4L2_TIMEVAL, PRINT_FIELD_V4L2_STREAMPARM_PARM,
        PRINT_FIELD_V4L2_CID, PRINT_FIELD_V4L2_FRMSIZE_TYPE,
        PRINT_FIELD_V4L2_FRMIVAL_STEPWISE): Remove the first argument,
        all callers updated.

        tee: remove prefix argument from PRINT_FIELD_SESSION macro.
        * tee.c (PRINT_FIELD_SESSION): Remove the first argument, all callers
        updated.

        sg_io_v4: remove prefix argument from PRINT_FIELD_SG_IO_BUFFER macro.
        * sg_io_v4.c (PRINT_FIELD_SG_IO_BUFFER): Remove the first argument,
        all callers updated.

        sg_io_v3: remove prefix argument from PRINT_FIELD_SG_IO_BUFFER macro.
        * sg_io_v3.c (PRINT_FIELD_SG_IO_BUFFER): Remove the first argument,
        all callers updated.

        s390: remove prefix argument from PRINT_FIELD_EBCDIC and PRINT_FIELD_WEIGHT macros
        * s390.c (PRINT_FIELD_EBCDIC, PRINT_FIELD_WEIGHT): Remove the first
        argument, all callers updated.

        kcmp: remove prefix argument from PRINT_FIELD_PIDFD macro.
        * kcmp.c (PRINT_FIELD_PIDFD): Remove the first argument, all callers
        updated.

        evdev_mpers: remove prefix argument from PRINT_FIELD_FF_* macros.
        * evdev_mpers.c (PRINT_FIELD_FF_EFFECT, PRINT_FIELD_FF_TYPE_EFFECT):
        Remove the first argument, all callers updated.

        treewide: put braces around PRINT_FIELD_* invocations in conditional statements
        This is going to be needed for removal of the first argument
        from PRINT_FIELD_* macros.

2021-01-27  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce a few tprint_* helper inline functions.
        These functions are going to be needed for removal of the first argument
        from PRINT_FIELD_* macros.

        * Makefile.am (strace_CPPFLAGS): Add -DIN_STRACE=1.
        * print_fields.h (tprint_{struct,array}_{begin,next,end},
        tprint_more_data_follows, tprint_value_changed, tprints_field_name):
        New inline functions.
        (STRACE_PRINTF): New macro.
        * tests/tests.h (STRACE_PRINTF): Remove.

2021-01-27  Dmitry V. Levin  <ldv@strace.io>

        tests: pass an empty string as the first argument to PRINT_FIELD_* macros
        This is a first step on the path of removing the first argument from
        PRINT_FIELD_* macros.

        With a few minor exceptions, this change is the result of
        $ git grep -l '\<PRINT_FIELD_' tests |
          xargs -r sed -ri 's/^([[:space:]]+)(PRINT_FIELD_[^(]+\()("[^"]+")(, .*;)$/\1printf(\3);\n\1\2""\4/' --

2021-01-26  Kent Gibson  <warthog618@gmail.com>

        Add GPIO uAPI realtime clock flag.
        Add decoding of GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag added in
        Linux v5.11.


        * xlat/gpio_v2_line_flags.in (GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME):
        New constant introduced by Linux kernel commit v5.11-rc1~70^2~16.

2021-01-26  Kent Gibson  <warthog618@gmail.com>

        tests: check decoding of GPIO v2 ioctls.
        Add tests for decoding of GPIO v2 ioctls.

2021-01-26  Kent Gibson  <warthog618@gmail.com>

        Add GPIO v2 ioctl decoding.
        Add decoding of GPIO uAPI v2 ioctls added in Linux v5.10.


        * gpio_ioctl.c: Include "xlat/gpio_v2_line_flags.h" and
        "xlat/gpio_v2_line_attr_ids.h".
        (print_gpio_v2_line_attribute_raw, print_gpio_v2_line_attribute,
        print_gpio_v2_line_config_attribute,
        print_gpio_v2_line_attr_array_member,
        print_gpio_v2_line_config_attr_array_member, print_gpio_v2_line_config,
        print_gpio_v2_line_info, print_gpio_v2_line_request,
        print_gpio_v2_line_get_values, print_gpio_v2_line_set_values,
        print_gpio_v2_line_set_config): New functions.
        (gpio_ioctl): Use them.
        * types/gpio.h (GPIO_V2_LINES_MAX, GPIO_V2_LINE_NUM_ATTRS_MAX): New
        macros.
        (struct_gpio_v2_line_values, struct_gpio_v2_line_attribute,
        struct_gpio_v2_line_config_attribute, struct_gpio_v2_line_config,
        struct_gpio_v2_line_request, struct_gpio_v2_line_info): New types.
        * clat/gpio_ioctl_cmds.in (GPIO_V2_GET_LINEINFO_IOCTL,
        GPIO_V2_GET_LINEINFO_WATCH_IOCTL, GPIO_V2_GET_LINE_IOCTL,
        GPIO_V2_LINE_SET_CONFIG_IOCTL, GPIO_V2_LINE_GET_VALUES_IOCTL,
        GPIO_V2_LINE_SET_VALUES_IOCT): New constants.
        * xlat/gpio_v2_line_attr_ids.in: New file.
        * xlat/gpio_v2_line_flags.in: Likewise.

2021-01-26  Kent Gibson  <warthog618@gmail.com>

        tests: check decoding of GPIO ioctls.
        * tests/ioctl_gpio.c: New file.
        * tests/ioctl_gpio-Xabbrev.c: Likewise.
        * tests/ioctl_gpio-Xraw.c: Likewise.
        * tests/ioctl_gpio-Xverbose.c: Likewise.
        * tests/ioctl_gpio-success.c: Likewise.
        * tests/ioctl_gpio-success-Xabbrev.c: Likewise.
        * tests/ioctl_gpio-success-Xraw.c: Likewise.
        * tests/ioctl_gpio-success-Xverbose.c: Likewise.
        * tests/ioctl_gpio-success-v.c: Likewise.
        * tests/ioctl_gpio-success-v-Xabbrev.c: Likewise.
        * tests/ioctl_gpio-success-v-Xraw.c: Likewise.
        * tests/ioctl_gpio-success-v-Xverbose.c: Likewise.
        * tests/ioctl_gpio-v.c: Likewise.
        * tests/ioctl_gpio-v-Xabbrev.c: Likewise.
        * tests/ioctl_gpio-v-Xraw.c: Likewise.
        * tests/ioctl_gpio-v-Xverbose.c: Likewise.
        * tests/gen_tests.in (ioctl_gpio, ioctl_gpio-Xabbrev, ioctl_gpio-Xraw,
        ioctl_gpio-Xverbose, ioctl_gpio-v, ioctl_gpio-v-Xabbrev,
        ioctl_gpio-v-Xraw, ioctl_gpio-v-Xverbose, ioctl_gpio-success,
        ioctl_gpio-success-Xabbrev, ioctl_gpio-success-Xraw,
        ioctl_gpio-success-Xverbose, ioctl_gpio-success-v,
        ioctl_gpio-success-v-Xabbrev, ioctl_gpio-success-v-Xraw,
        ioctl_gpio-success-v-Xverbose): New tests.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_gpio-success,
        ioctl_gpio-success-Xabbrev, ioctl_gpio-success-Xraw,
        ioctl_gpio-success-Xverbose, ioctl_gpio-success-v,
        ioctl_gpio-success-v-Xabbrev, ioctl_gpio-success-v-Xraw,
        and ioctl_gpio-success-v-Xverbose.
        * tests/pure_executables.list: Add ioctl_gpio, ioctl_gpio-Xabbrev,
        ioctl_gpio-Xraw, ioctl_gpio-Xverbose, ioctl_gpio-v,
        ioctl_gpio-v-Xabbrev, ioctl_gpio-v-Xraw, and ioctl_gpio-v-Xverbose.
        * tests/.gitignore: Add ioctl_gpio, ioctl_gpio-success,
        ioctl_gpio-success-Xabbrev, ioctl_gpio-success-Xraw,
        ioctl_gpio-success-Xverbose, ioctl_gpio-success-v,
        ioctl_gpio-success-v-Xabbrev, ioctl_gpio-success-v-Xraw,
        ioctl_gpio-success-v-Xverbose, ioctl_gpio-Xabbrev,
        ioctl_gpio-Xraw, ioctl_gpio-Xverbose, ioctl_gpio-v,
        ioctl_gpio-v-Xabbrev, ioctl_gpio-v-Xraw, and ioctl_gpio-v-Xverbose.

2021-01-26  Kent Gibson  <warthog618@gmail.com>

        Add GPIO ioctl decoding.
        Decode the GPIO character device ioctls first introduced in Linux v4.6,
        as well as those added in subsequent kernel releases up to Linux v5.7.


        * gpio_ioctl.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * types/gpio.h: New file.
        * xlat/gpio_event_flags.in: Likewise.
        * xlat/gpio_handle_flags.in: Likewise.
        * xlat/gpio_ioctl_cmds.in: Likewise.
        * xlat/gpio_line_flags.in: Likewise.
        * defs.h (DECL_IOCTL): Add gpio.
        * ioctl.c (ioctl_decode): Add 0xb4 case.
        * NEWS: Mention this change.

2021-01-26  Dmitry V. Levin  <ldv@strace.io>

        rtc: use PRINT_FIELD_OBJ_TCB_PTR.
        * rtc.c (PRINT_FIELD_RTC_TIME): Remove.
        (decode_rtc_wkalrm): Use PRINT_FIELD_OBJ_TCB_PTR instead of
        PRINT_FIELD_RTC_TIME.

        mmsghdr: use PRINT_FIELD_OBJ_TCB_PTR.
        * mmsghdr.c (print_struct_mmsghdr): Print struct mmsghdr.msg_hdr
        using PRINT_FIELD_OBJ_TCB_PTR.

        loop: use PRINT_FIELD_OBJ_TCB_PTR.
        * loop.c (decode_loop_config): Print struct loop_config.info
        using PRINT_FIELD_OBJ_TCB_PTR.

        s390: use PRINT_FIELD_OBJ_TCB_VAL.
        * s390.c (guard_storage_print_gscb): Print struct
        guard_storage_control_block.gs_epl_a using PRINT_FIELD_OBJ_TCB_VAL.

        netlink: use PRINT_FIELD_OBJ_TCB_VAL.
        * netlink.c (print_nlmsghdr): Print struct nlmsghdr.nlmsg_type
        using PRINT_FIELD_OBJ_TCB_VAL.

        io_uring: use PRINT_FIELD_OBJ_TCB_VAL.
        * io_uring.c (print_io_uring_probe): Print struct io_uring_probe.ops
        using PRINT_FIELD_OBJ_TCB_VAL.

        clone: use PRINT_FIELD_OBJ_TCB_VAL.
        * clone.c (SYS_FUNC(clone3)): Print tls and set_tid fields
        of struct clone_args.tls using PRINT_FIELD_OBJ_TCB_VAL.

        btrfs: use print_fields.h macros in a few more places.
        * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_ino_path_args.fspath
        and struct btrfs_ioctl_logical_ino_args.inodes using
        PRINT_FIELD_OBJ_TCB_VAL.
        Print struct btrfs_ioctl_send_args.clone_sources using PRINT_FIELD_PTR.

        bpf: use PRINT_FIELD_OBJ_TCB_VAL.
        * bpf.c (BPF_PROG_LOAD): Print union bpf_attr.insns using
        PRINT_FIELD_OBJ_TCB_VAL.
        (print_bpf_prog_info): Print struct bpf_prog_info.xlated_prog_insns
        using PRINT_FIELD_OBJ_TCB_VAL.
        * bpf_filter.c (decode_bpf_fprog): Print struct bpf_fprog.filter using
        PRINT_FIELD_OBJ_TCB_VAL.

        print_fields.h: introduce PRINT_FIELD_OBJ_TCB_PTR and PRINT_FIELD_OBJ_TCB_VAL
        * print_fields.h (PRINT_FIELD_OBJ_TCB_PTR, PRINT_FIELD_OBJ_TCB_VAL): New macros.

        print_fields.h: cleanup PRINT_FIELD_LEN.
        * print_fields.h (PRINT_FIELD_LEN): Use STRACE_PRINTF like other
        PRINT_FIELD_* macros do.

        print_fields.h: simplify PRINT_FIELD_XVAL_U.
        * print_fields.h (PRINT_FIELD_XVAL_U): Use printxval64_u
        instead of printxvals_ex to produce a smaller implementation.

        userfaultfd: use PRINT_FIELD_OBJ_PTR.
        * userfaultfd.c (PRINT_FIELD_UFFDIO_RANGE): Remove.
        (uffdio_ioctl): Use PRINT_FIELD_OBJ_PTR instead of
        PRINT_FIELD_UFFDIO_RANGE.

        netlink_smc_diag: use PRINT_FIELD_OBJ_PTR.
        * netlink_smc_diag.c (PRINT_FIELD_SMC_DIAG_CURSOR): Remove.
        (decode_smc_diag_conninfo): Use PRINT_FIELD_OBJ_PTR instead of
        PRINT_FIELD_SMC_DIAG_CURSOR.

        print_timeval: use print_fields.h macros.
        * print_timespec.h: Include "print_fields.h".
        (print_timeval_t_utime, print_timeval32_t_utime): Transform into
        print_array callbacks.
        (print_timeval_utimes, print_timeval32_utimes): Use them along with
        print_local_array.
        (print_itimerval, print_itimerval32): Use "print_fields.h" macros.

        print_timespec: use print_fields.h macros.
        * print_timespec.h: Include "print_fields.h".
        (print_timespec_t_utime): Transform into a print_array callback.
        (PRINT_TIMESPEC_UTIME_PAIR): Use it along with print_local_array.
        (PRINT_ITIMERSPEC): Use "print_fields.h" macros.

        signal: use print_fields.h macros.
        * signal.c: Include "print_fields.h".
        (tprint_old_sigmask_val): Transform into a function.
        (decode_old_sigaction): Print sa_mask, sa_flags, and sa_restorer fields
        of struct sigaction using print_fields.h macros.
        (decode_new_sigaction): Print sa_flags and sa_restorer fields
        of struct sigaction using print_fields.h macros.

        sockaddr: use print_fields.h macros in a few more places.
        * sockaddr.c (print_sockaddr_data_ax25): Print struct
        sockaddr_ax25.sax25_call using PRINT_FIELD_OBJ_PTR.

2021-01-25  Dmitry V. Levin  <ldv@strace.io>

        print_struct_stat: use print_fields.h macros.
        * print_struct_stat.c: Include "print_fields.h".
        Define st_* macros for all fields of struct strace_stat.
        (print_struct_stat): Print fields of struct strace_stat using
        print_fields.h macros.

2021-01-24  Dmitry V. Levin  <ldv@strace.io>

        signal: simplify tprint_old_sigmask_val macro.
        * signal.c (tprint_old_sigmask_val): Drop the first argument,
        all callers updated.

        statx: use print_fields.h macros in a few more places.
        * statx.c (SYS_FUNC(statx)): Print struct statx.stx_mode
        using print_fields.h macros.

        sockaddr: use print_fields.h macros in a few more places.
        * sockaddr.c (print_x25_addr): Print struct x25_address.x25_addr
        using print_fields.h macros.
        (print_sockaddr_data_ll): Print sll_hatype, sll_pkttype, sll_halen
        fields of struct sockaddr_ll using print_fields.h macros.
        (print_bluetooth_l2_psm, print_bluetooth_l2_cid): Drop the 1st argument.
        (print_sockaddr_data_bt): Print struct sockaddr_hci.hci_channel,
        struct sockaddr_rc.rc_channel, struct sockaddr_l2.l2_psm,
        struct sockaddr_l2.l2_cid, and struct sockaddr_l2.l2_bdaddr_type
        using print_fields.h macros.
        (print_sockaddr): Print struct sockaddr.sa_family using print_fields.h
        macros.

        printrusage: use print_fields.h macros in a few more places.
        * printrusage.c (printrusage, printrusage32): Print ru_utime and
        ru_stime fields of struct rusage using print_fields.h macros.

        perf: use print_fields.h macros in a few more places.
        * perf.c (print_perf_event_attr): Print fields of struct perf_event_attr
        using print_fields.h macros.

        open: use print_fields.h macros in a few more places.
        * open.c (print_open_how): Print struct open_how.flags
        using print_fields.h macros.

        netlink: use print_fields.h macros in a few more places.
        * netlink.c (print_nlmsghdr): Print struct nlmsghdr.nlmsg_flags
        using print_fields.h macros.

        keyctl: use print_fields.h macros in a few more places.
        * keyctl.c (print_dh_params): Print fields of struct keyctl_dh_params
        using print_fields.h macros.
        (fetch_print_pkey_params): Print struct keyctl_pkey_params.key_id
        using print_fields.h macros.

        clone: use print_fields.h macros in a few more places.
        * clone.c (SYS_FUNC(clone3)): Print struct clone_args.exit_signal
        using print_fields.h macros.

        btrfs: use print_fields.h macros in a few more places.
        * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_logical_ino_args.flags
        using print_fields.h macros.

        bpf: use print_fields.h macros in a few more places.
        * bpf.c (print_ebpf_insn): Print struct ebpf_insn.code using
        print_fields.h macros.
        (print_bpf_prog_info): Print struct bpf_prog_info.gpl_compatible using
        print_fields.h macros.

        aio: use print_fields.h macros in a few more places.
        * aio.c (print_iocb_header): Print aio_rw_flags and aio_reqprio fields
        of struct iocb using print_fields.h macros.

        resource: use print_fields.h macros.
        * resource.c: Include "print_fields.h".
        (print_rlimit64, print_rlimit32): Print fields of struct rlimit_64
        and struct rlimit_32 using print_fields.h macros.

        poll: use print_fields.h macros.
        * poll.c: Include "print_fields.h".
        (print_pollfd): Print fields of struct pollfd using print_fields.h
        macros.

        file_handle: use print_fields.h macros.
        * file_handle.c: Include "print_fields.h".
        (SYS_FUNC(name_to_handle_at), SYS_FUNC(open_by_handle_at)): Print
        handle_bytes and handle_type fields of struct file_handle using
        print_fields.h macros.

        print_fields.h: introduce PRINT_FIELD_X_CAST and PRINT_FIELD_OBJ_U.
        * print_fields.h (PRINT_FIELD_X_CAST, PRINT_FIELD_OBJ_U): New macros.

        perf: fix the output name of struct perf_event_attr.exclude_user.
        * perf.c (print_perf_event_attr): Fix the output name of struct
        perf_event_attr.exclude_user.
        * tests/perf_event_open.c (print_event_attr): Update expected output.

2021-01-23  Dmitry V. Levin  <ldv@strace.io>

        sysinfo: use print_fields.h macros.
        * defs.h (print_kulong_array_member): New function.
        * sysinfo.c: Include "print_fields.h".
        (SYS_FUNC(sysinfo)): Print fields of struct sysinfo
        using print_fields.h macros.

        rtnl_link: avoid unnecessary string specifications.
        * rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_ARRAY.

        print_timex: avoid unnecessary string specifications.
        * print_timex.c (PRINT_TIMEX_TIME): New macro.
        * print_timex.h (PRINT_TIMEX_TIME): New function.
        (PRINT_TIMEX): Use it via PRINT_FIELD_OBJ_PTR to print TIMEX_T.time.

2021-01-23  Kent Gibson  <warthog618@gmail.com>

        Add print_uint8_array_member() helper.
        Add print_uint8_array_method() helper, to be used by the GPIO ioctl
        decoding, and the corresponding int8 function to match.


        * defs.h (print_int8_array_member, print_uint8_array_member): New
        function declarations.
        * util.c (print_int8_array_member, print_uint8_array_member): New
        functions.

2021-01-22  Dmitry V. Levin  <ldv@strace.io>

        statx: avoid unnecessary string specifications.
        * statx.h (struct_statx_timestamp): Rename "sec" field to "tv_sec",
        rename "nsec" field to "tv_nsec".
        * statx.c (PRINT_FIELD_TIME): Remove.
        (print_statx_timestamp): New function.
        (SYS_FUNC(statx)): Use it instead of PRINT_FIELD_TIME to print
        struct statx_timestamp type fields of struct statx.

        sock: avoid unnecessary string specifications.
        * sock.c (print_ifr_hwaddr, print_ifr_map): New functions.
        (print_ifreq): Use them via PRINT_FIELD_OBJ_PTR to print struct
        ifreq.ifr_hwaddr and struct ifreq.ifr_map.

        v4l2: avoid unnecessary string specifications.
        * v4l2.c (PRINT_FIELD_RECT): Remove.
        (print_v4l2_rect, print_v4l2_create_buffers_format): New functions.
        (print_v4l2_create_buffers): Use print_v4l2_create_buffers_format via
        PRINT_FIELD_OBJ_PTR to print struct v4l2_create_buffers.format field.
        (print_v4l2_clip, print_v4l2_format_fmt_win, print_v4l2_cropcap,
        print_v4l2_crop): Use print_v4l2_rect via PRINT_FIELD_OBJ_PTR
        instead of PRINT_FIELD_RECT.

        quota: avoid unnecessary string specifications.
        * quota.c (print_fs_qfilestat, print_fs_qfilestatv): New functions.
        (decode_cmd_data): Use them via PRINT_FIELD_OBJ_PTR to print struct
        fs_qfilestat fields of struct fs_quota_stat, and struct fs_qfilestatv
        fields of struct fs_quota_statv.

        ptp: enhance printing of struct ptp_clock_time.
        * ptp.c (print_ptp_clock_time): New function.
        (ptp_ioctl): Use it via PRINT_FIELD_OBJ_PTR to print struct
        ptp_clock_time fields of struct ptp_perout_request.
        * tests/ioctl_ptp.c (test_no_device): Update expected output using
        print_time_t_nsec.

        btrfs: avoid unnecessary string specifications.
        * btrfs.c: Include DEF_MPERS_TYPE(struct_btrfs_ioctl_timespec).
        (struct_btrfs_ioctl_timespec): New typedef.
        (btrfs_print_balance_args): Remove the first argument.
        (btrfs_print_balance): Use btrfs_print_balance_args via
        PRINT_FIELD_OBJ_PTR.
        (print_btrfs_timespec): Rewrite.
        (btrfs_ioctl): Use print_btrfs_timespec via PRINT_FIELD_OBJ_PTR.

        statfs: print f_fsid field in a hexadecimal format.
        * statfs.h (struct strace_statfs): Turn f_fsid field from an array
        into a struct containing the array for better representation
        of struct statfs.
        * fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64):
        Update to this change.
        * print_statfs.c: Include "print_fields.h".
        (print_statfs_type, print_statfs_flags, print_statfs_number): Remove.
        (print_f_fsid): New function.
        (print_struct_statfs, print_struct_statfs64): Use it and PRINT_FIELDS_*
        macros.
        * tests/xstatfsx.c (print_statfs): Update expected output.

        ptrace_syscall_info: avoid unnecessary string specifications.
        * ptrace_syscall_info.c (print_psi_entry, print_psi_seccomp,
        print_psi_exit): New functions.
        (print_ptrace_syscall_info): Use them to print fields of struct
        ptrace_syscall_info.

        ptrace_syscall_info: fix output name of args field.
        * ptrace_syscall_info.c (print_ptrace_syscall_info): Fix output name
        of struct ptrace_syscall_info.args field.
        * tests/ptrace_syscall_info.c (test_entry): Update expected output.

        v4l2: use typeof_field-based pointers instead of "void *"
        * v4l2.c (DECL_print_v4l2_format_fmt): New macro.
        (print_v4l2_format_fmt_pix, print_v4l2_format_fmt_pix_mp,
        print_v4l2_format_fmt_win, print_v4l2_format_fmt_vbi,
        print_v4l2_format_fmt_sliced, print_v4l2_format_fmt_sdr,
        print_v4l2_format_fmt_meta): Use it to change the type of pointer
        argument from "void *" to the corresponding pointer type using
        typeof_field.

        btrfs: use typeof_field-based pointers instead of "void *"
        * btrfs.c (print_btrfs_replace_start_params,
        print_btrfs_replace_status_params): Change the type of argument from
        "void *" to the corresponding pointer type using typeof_field.

        defs.h: Introduce MPERS_PTR_ARG macro.
        * defs.h (MPERS_PTR_ARG): New macro for use in mpersified parsers.
        * evdev_mpers.c (print_ff_envelope): Use it.
        * v4l2.c (print_v4l2_timeval, print_v4l2_frmsize_discrete,
        print_v4l2_frmsize_stepwise, print_v4l2_frmival_stepwise): Likewise.

2021-01-21  Dmitry V. Levin  <ldv@strace.io>

        btrfs: cleanup decoding of BTRFS_IOC_TREE_SEARCH and BTRFS_IOC_TREE_SEARCH_V2
        Take the buffer size into account, avoid unnecessary string
        specifications of structure field names.

        * btrfs.c (btrfs_print_tree_search): Remove.
        (print_btrfs_ioctl_search_key, print_btrfs_ioctl_search_header,
        decode_search_arg_buf): New functions.
        (btrfs_ioctl): Use them instead of btrfs_print_tree_search.

2021-01-21  Dmitry V. Levin  <ldv@strace.io>

        printsiginfo: use print_fields.h macros.
        This also fixes formatting of siginfo_t.si_int and siginfo_t.si_ptr.

        * printsiginfo.c (print_si_syscall): New function.
        (print_si_code): Swap arguments.
        (printsigval, print_si_info, printsiginfo): Use print_fields.h macros.
        * tests/ptrace.c (main): Update expected output.
        * tests/pidfd_send_signal.c: Likewise.
        * tests/rt_sigqueueinfo.c: Likewise.
        * tests/rt_tgsigqueueinfo.c: Likewise.

2021-01-21  Dmitry V. Levin  <ldv@strace.io>

        print_sigevent: use print_fields.h macros.
        * print_sigevent.c: Include "print_fields.h"
        (print_sigev_value): New function.
        (print_sigevent): Print fields of struct sigevent using print_fields.h
        macros.

        sigevent.h: turn pointer fields of struct_sigevent into real pointers.
        * sigevent.h (struct_sigevent): Change the type of "sival_ptr",
        "function", and "attribute" fields from "unsigned long" to "void *",
        as they should have been from the very beginning.
        * print_sigevent.c (print_sigevent): Pass these fields to printaddr
        via ptr_to_kulong.
        * tests/mq_sendrecv.c (main): Print these fields using %p format.
        * tests/timer_create.c (main): Likewise.

2021-01-21  Dmitry V. Levin  <ldv@strace.io>

        netlink_smc_diag: fix output format of struct smc_diag_lgrinfo.
        Change {lnk[0]={...}, role=...} into {lnk=[{...}], role=...}.

        * netlink_smc_diag.c (print_smc_diag_linkinfo_array_member): New
        function.
        (decode_smc_diag_lgrinfo): Use it via PRINT_FIELD_ARRAY to print
        struct smc_diag_lgrinfo.lnk
        * tests/nlattr_smc_diag_msg.c (main): Update expected output.

2021-01-20  Dmitry V. Levin  <ldv@strace.io>

        ipc_shmctl: avoid unnecessary string specifications of structure field names
        * ipc_shmctl.c (print_ipc_perm): New function.
        (print_shmid_ds): Use it to print struct shmid_ds.shm_perm.

        ipc_msgctl: avoid unnecessary string specifications of structure field names
        * ipc_msgctl.c (print_ipc_perm): New function.
        (print_msqid_ds): Use it to print struct msqid_ds.msg_perm.

        ipc_semctl: avoid unnecessary string specifications of structure field names
        * ipc_semctl.c (print_ipc_perm): New function.
        (print_semid_ds): Use it to print struct semid_ds.sem_perm.

        io_uring: avoid unnecessary string specifications of structure field names
        * io_uring.c (print_io_sqring_offsets, print_io_cqring_offsets): New
        functions.
        (SYS_FUNC(io_uring_setup)): Use them to print struct io_uring_params
        fields of types struct io_sqring_offsets and struct io_cqring_offsets.

        evdev_mpers: avoid unnecessary string specifications of structure field names
        * evdev_mpers.c (decode_envelope): Remove.
        (print_ff_envelope, print_ff_trigger, print_ff_replay,
        print_ff_constant_effect, print_ff_ramp_effect,
        print_ff_periodic_effect, print_ff_rumble_effect): New functions.
        (PRINT_FIELD_FF_EFFECT, PRINT_FIELD_FF_TYPE_EFFECT): New macros.
        (ff_effect_ioctl): Use them.

        epoll: avoid unnecessary string specifications of structure field names.
        * epoll.c (print_epoll_data): New function.
        (print_epoll_event): Use it via PRINT_FIELD_OBJ_PTR to print
        struct epoll_event.data

        btrfs: avoid unnecessary string specifications of structure field names.
        * btrfs.c (btrfs_print_qgroup_limit): Do not print unrelated prefix.
        (btrfs_print_qgroup_inherit, btrfs_ioctl): Use it via
        PRINT_FIELD_OBJ_PTR.
        (print_btrfs_scrub_progress, print_btrfs_ioctl_dev_replace_start_params,
        print_btrfs_ioctl_dev_replace_status_params): New functions.
        (btrfs_ioctl): Use them via PRINT_FIELD_OBJ_PTR to print fields
        of struct btrfs_ioctl_scrub_args.progress,
        struct btrfs_ioctl_dev_replace_args.start.
        and struct btrfs_ioctl_dev_replace_args.status, respectively.

2021-01-20  Dmitry V. Levin  <ldv@strace.io>

        x86_64/arch_kvm.c: cleanup PRINT_FIELD_KVM_SREGS_STRUCT.
        Change the macro to follow the common practice with other PRINT_FIELD_*
        macros.

        * linux/x86_64/arch_kvm.c (kvm_ioctl_decode_regs_segment,
        kvm_ioctl_decode_regs_dtable): Remove the first argument and the
        corresponding printing.
        (PRINT_FIELD_KVM_SREGS_STRUCT): Print the prefix, change the 2nd
        argument from pointer to the object itself, swap the 3rd and the 4th
        arguments, all callers updated.

2021-01-20  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce PRINT_FIELD_OBJ_PTR and PRINT_FIELD_OBJ_VAL.
        * print_fields.h (PRINT_FIELD_OBJ_PTR, PRINT_FIELD_OBJ_VAL): New macros.

        macros.h: Introduce typeof_field.
        * macros.h (typeof_field): New macro.

2021-01-19  Dmitry V. Levin  <ldv@strace.io>

        configure.ac: remove redundant checks for v4l2 types.
        types/v4l2.h now generates checks for all struct_* types it defines.

        * configure.ac (AC_CHECK_TYPES): v4l2_create_buffers, v4l2_frmsizeenum,
        v4l2_frmivalenum, v4l2_meta_format, v4l2_pix_format_mplane,
        v4l2_plane_pix_format, v4l2_sdr_format): Remove.

2021-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: implement decoding of metadata buffer formats.
        * xlat/v4l2_meta_fmts.in: New file.
        * v4l2.c: Include "xlat/v4l2_meta_fmts.h".
        (print_v4l2_format_fmt_meta): New function.
        (print_v4l2_format_fmt) <case V4L2_BUF_TYPE_META_OUTPUT,
        case V4L2_BUF_TYPE_META_CAPTURE>: Use it.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2.c: Check it.
        * tests/ioctl_v4l2-success.c: Likewise.

2021-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: implement decoding of VIDIOC_QUERY_EXT_CTRL ioctl command.
        * types/v4l2.h (struct_v4l2_query_ext_ctrl): New type.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_QUERY_EXT_CTRL): Uncomment.
        * v4l2.c [HAVE_STRUCT_V4L2_QUERY_EXT_CTRL]: Check v4l2_query_ext_ctrl.
        (print_v4l2_query_ext_ctrl): New function.
        (v4l2_ioctl) <VIDIOC_QUERY_EXT_CTRL>: Use it.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2.c (main) [HAVE_STRUCT_V4L2_QUERY_EXT_CTRL]: Check
        VIDIOC_QUERY_EXT_CTRL decoding.
        * tests/ioctl_v4l2-success.c (main) [HAVE_STRUCT_V4L2_QUERY_EXT_CTRL]:
        Likewise.

        Suggested-by: Philippe De Muyter <phdm@macqel.be>

2021-01-19  Dmitry V. Levin  <ldv@strace.io>

        types: allow ATTRIBUTE_* in definitions of struct_* types.
        These attributes are already used in types/tee.h and types/v4l2.h files.

        * types/find_last_type_fields.awk: Update regular expression
        to recognize struct_* types defined using ATTRIBUTE_*.

2021-01-19  Dmitry V. Levin  <ldv@strace.io>

        types/v4l2.h: tweak the definition of struct_v4l2_ext_control.
        * types/v4l2.h (struct_v4l2_ext_control): Move old members of the union
        to the end of the definition to fix build on old systems that do not
        provide definitions of newer union members yet.

2021-01-18  Dmitry V. Levin  <ldv@strace.io>

        v4l2: use PRINT_FIELD_* macros in print_v4l2_frmivalenum.
        * v4l2.c (print_v4l2_frmival_stepwise): New function.
        (PRINT_FIELD_V4L2_FRMIVAL_STEPWISE): New macro.
        (print_v4l2_frmivalenum): Use it to print fields of struct
        v4l2_frmivalenum.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_frmsizeenum.
        * v4l2.c (print_v4l2_frmsize_discrete, print_v4l2_frmsize_stepwise):
        New functions.
        (PRINT_FIELD_V4L2_FRMSIZE_TYPE): New macro.
        (print_v4l2_frmsizeenum): Use it to print fields of struct
        v4l2_frmsizeenum.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_control and print_v4l2_queryctrl
        * v4l2.c (PRINT_FIELD_V4L2_CID): New macro.
        (print_v4l2_control, print_v4l2_queryctrl): Use it to print fields
        of struct v4l2_control and struct v4l2_queryctrl.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_streamparm.
        * v4l2.c (print_v4l2_streamparm_capture, print_v4l2_streamparm_output):
        New functions.
        (PRINT_FIELD_V4L2_STREAMPARM_PARM): New macro.
        (print_v4l2_streamparm): Use it to print fields of struct
        v4l2_streamparm.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_buffer.
        * v4l2.c: Include DEF_MPERS_TYPE(kernel_v4l2_timeval_t).
        (print_v4l2_timeval): New function.
        (PRINT_FIELD_V4L2_BUFFER_FLAGS, PRINT_FIELD_V4L2_TIMEVAL): New macros.
        (print_v4l2_buffer): Use them to print fields of kernel_v4l2_buffer_t.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_format_fmt.
        * v4l2.c (print_v4l2_format_fmt_pix,
        print_v4l2_plane_pix_format_array_member, print_v4l2_format_fmt_pix_mp,
        print_v4l2_format_fmt_win, print_v4l2_format_fmt_vbi,
        print_v4l2_format_fmt_sliced, print_v4l2_format_fmt_sdr): New functions.
        (PRINT_FIELD_V4L2_FORMAT_FMT): New macro.
        (print_v4l2_format_fmt): Use it to print fields of struct v4l2_format.

        v4l2: use PRINT_FIELD_* macros in print_v4l2_fmtdesc.
        * v4l2.c (print_v4l2_fmtdesc): Print fields of struct v4l2_fmtdesc
        using PRINT_FIELD_* macros.

        v4l2: use print_fields.h macros in print_v4l2_create_buffers.
        * v4l2.c (print_v4l2_create_buffers): Print fields of struct
        v4l2_create_buffers using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_ext_control.
        * v4l2.c (print_v4l2_ext_control): Print fields of struct
        v4l2_ext_control using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_crop.
        * v4l2.c (print_v4l2_crop): Print fields of struct v4l2_crop using
        print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_cropcap.
        * v4l2.c (print_v4l2_cropcap): Print fields of struct v4l2_cropcap
        using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_tuner.
        * v4l2.c (print_v4l2_tuner): Print fields of struct v4l2_tuner
        using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_input.
        * v4l2.c (print_v4l2_input): Print fields of struct v4l2_input
        using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_standard.
        * v4l2.c (print_v4l2_standard): Print fields of struct v4l2_standard
        using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_framebuffer.
        * v4l2.c (print_v4l2_framebuffer): Print fields of struct
        v4l2_framebuffer using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_requestbuffers.
        * v4l2.c (print_v4l2_requestbuffers): Print fields of struct
        v4l2_requestbuffers using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_format.
        * v4l2.c (print_v4l2_format): Print fields of struct v4l2_format
        using print_fields.h macros.

        v4l2: use print_fields.h macros in print_v4l2_capability.
        * v4l2.c (print_v4l2_capability): Print fields of struct v4l2_capability
        using print_fields.h macros.

2021-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: introduce PRINT_FIELD_FRACT macro.
        Replace FMT_FRACT and ARGS_FRACT with PRINT_FIELD_FRACT.

        * v4l2.c (FMT_FRACT, ARGS_FRACT): Remove macros.
        (PRINT_FIELD_FRACT): New macro.
        (print_v4l2_streamparm, print_v4l2_standard, print_v4l2_cropcap,
        print_v4l2_frmivalenum): Use it.

2021-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: introduce PRINT_FIELD_RECT macro.
        Replace FMT_RECT and ARGS_RECT with PRINT_FIELD_RECT.

        * v4l2.c (FMT_RECT, ARGS_RECT): Remove macros.
        (PRINT_FIELD_RECT): New macro.
        (print_v4l2_clip, print_v4l2_format_fmt, print_v4l2_cropcap,
        print_v4l2_crop): Use it.

2021-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: introduce PRINT_FIELD_PIXFMT macro.
        * v4l2.c (PRINT_FIELD_PIXFMT): New macro.

2021-01-18  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce PRINT_FIELD_UINT_ARRAY2D.
        * print_fields.h (PRINT_FIELD_UINT_ARRAY2D): New macro for printing
        2-dimensional array fields.

2021-01-18  Dmitry V. Levin  <ldv@strace.io>

        print_fields.h: introduce PRINT_FIELD_SINT_ARRAY and PRINT_FIELD_D_ARRAY
        PRINT_FIELD_SINT_ARRAY is analogous to PRINT_FIELD_UINT_ARRAY,
        and PRINT_FIELD_D_ARRAY is analogous to PRINT_FIELD_U_ARRAY.

        * print_fields.h (PRINT_FIELD_SINT_ARRAY, PRINT_FIELD_D_ARRAY): New
        macros.

2021-01-18  Dmitry V. Levin  <ldv@strace.io>

        ubi: use PRINT_FIELD_ARRAY_UPTO instead of PRINT_FIELD_ARRAY_SZ.
        * print_fields.h (PRINT_FIELD_ARRAY_SZ): Remove.
        * ubi.c (decode_UBI_IOCRNVOL): Use PRINT_FIELD_ARRAY_UPTO
        instead of PRINT_FIELD_ARRAY_SZ.

2021-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        print_fields.h: Introduce PRINT_FIELD_ARRAY_UPTO.
        * defs.h (print_local_array_upto): New macro.
        * print_fields.h (PRINT_FIELD_ARRAY_UPTO): New macro, a thin wrapper
        around print_local_array_upto.

2021-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields: cleanup whitespace after preprocessor indentation fix.
        * print_fields.h (PRINT_FIELD_0X, PRINT_FIELD_XVAL, PRINT_FIELD_PATH):
        Fix up whitespace.

        Complements: v5.0~98 "Fix preprocessor indentation"

2021-01-18  Dmitry V. Levin  <ldv@strace.io>

        macros.h: tweak CLAMP() definition to avoid -Wtype-limits issues.
        * macros.h (CLAMP): Swap arguments passed to MAX(), to avoid false
        positives reported by gcc -Wtype-limits.

2021-01-17  Dmitry V. Levin  <ldv@strace.io>

        print_local_array_ex: constify the type of the second argument.
        * defs.h (print_local_array_ex): Change the type of start_addr argument
        from "void *" to "const void *".  This is correct since it's being
        passed on to print_array_ex as an integer.

2021-01-17  Dmitry V. Levin  <ldv@strace.io>

        v4l2: mpersify struct v4l2_window.
        It contains a pointer field and therefore has to be mpersified.

        * v4l2.c: Include DEF_MPERS_TYPE(struct_v4l2_window).

2021-01-17  Dmitry V. Levin  <ldv@strace.io>

        v4l2: fix printing of struct v4l2_sliced_vbi_format.
        * v4l2.c (print_v4l2_format_fmt): Print io_size field after
        service_lines field to match the order of fields in the structure.
        * tests/ioctl_v4l2.c (dprint_ioctl_v4l2): Update expected output.
        * tests/ioctl_v4l2-success.c (print_fmt): Likewise.

        v4l2: fix printing of struct v4l2_sliced_vbi_format.service_set.
        * v4l2.c (print_v4l2_format_fmt): Print struct
        v4l2_sliced_vbi_format.service_set as a flag field using printflags
        instead of printxval.
        * tests/ioctl_v4l2-success.c (print_fmt): Update expected output.

        v4l2: fix printing of struct v4l2_rect field of struct v4l2_clip.
        * v4l2.c (print_v4l2_clip): Fix output format of struct v4l2_clip.
        * tests/ioctl_v4l2.c (dprint_ioctl_v4l2): Update expected output.
        * tests/ioctl_v4l2-success.c (print_fmt): Likewise.

        v4l2: fix printing of struct v4l2_rect field of struct v4l2_window.
        * v4l2.c (print_v4l2_format_fmt): Print struct v4l2_window.w using
        FMT_RECT format.
        * tests/ioctl_v4l2.c (dprint_ioctl_v4l2): Update expected output.
        * tests/ioctl_v4l2-success.c (print_fmt): Likewise.

        print_fields.h: introduce PRINT_FIELD_KERNEL_VERSION.
        * print_fields.h (PRINT_FIELD_KERNEL_VERSION): New macro.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Use it.
        * v4l2.c (print_v4l2_capability): Likewise.

        coverage: update genhtml options.
        * Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Add --title, --precision,
        and --missed options, update --prefix option.

2021-01-16  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of UBI ioctl commands.
        * tests/ioctl_ubi.c: New file.
        * tests/ioctl_ubi-success.c: Likewise.
        * tests/gen_tests.in (ioctl_ubi, ioctl_ubi-success): New entries.
        * tests/pure_executables.list: Add ioctl_ubi.
        * tests/.gitignore: Add ioctl_ubi and ioctl_ubi-success.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_ubi-success.

        ubi: add decoding of UBI_IOCRPEB and UBI_IOCSPEB ioctl commands.
        * sock.c (ubi_ioctl): Handle UBI_IOCRPEB and UBI_IOCSPEB ioctl commands
        introduced by Linux kernel commit v5.1-rc1~43^2~2.
        * NEWS: Mention this change.

        ubi: decode struct ubi_mkvol_req.flags.
        * configure.ac (AC_CHECK_MEMBERS): Check for struct ubi_mkvol_req.flags
        in <mtd/ubi-user.h>.
        * xlat/ubi_volume_flags.in: New file.
        * ubi.c: Include "xlat/ubi_volume_flags.h".
        (decode_UBI_IOCMKVOL): Print struct ubi_mkvol_req.flags introduced
        by Linux kernel commit v4.19-rc1~13^2~6.

        ubi: use print_fields.h macros.
        * print_fields.h (PRINT_FIELD_ARRAY_SZ): New macro.
        * xlat/ubi_data_types.in: New file.
        * ubi.c: Include "print_fields.h" and "xlat/ubi_data_types.h".
        (decode_UBI_IOCMKVOL, decode_UBI_IOCRSVOL,
        print_ubi_rnvol_req_ent_array_member, decode_UBI_IOCRNVOL,
        decode_UBI_IOCEBCH, decode_UBI_IOCATT, decode_UBI_IOCEBMAP,
        decode_UBI_IOCSETVOLPROP): New functions.
        (ubi_ioctl): Use them.

2021-01-15  Dmitry V. Levin  <ldv@strace.io>

        tests: extend RTC ioctl decoding checks.
        * tests/ioctl_rtc-success.c: New file.
        * tests/ioctl_rtc.c: Rewrite.
        * tests/gen_tests.in (ioctl_rtc-success): New entry.
        * tests/.gitignore: Add ioctl_rtc-success.
        * tests/Makefile.am (check_PROGRAMS): Likewise.

        rtc: use print_fields.h macros.
        * rtc.c: Include "print_fields.h".
        (print_rtc_time): Print fields of struct rtc_time using
        print_fields.h macros.
        (PRINT_FIELD_RTC_TIME): New macro.
        (decode_rtc_wkalrm): Use it to print fields of struct rtc_wkalrm
        using print_fields.h macros.
        (decode_rtc_pll_info): Print fields of struct rtc_pll_info using
        print_fields.h macros.

        tests: skip ioctl-success tests when their test programs exit status is 77
        * tests/ioctl-success.sh: Invoke the test program to check its exit
        status, skip the test when the exit status equals to 77.

2021-01-14  Dmitry V. Levin  <ldv@strace.io>

        tests: extend MTD ioctl decoding checks.
        * tests/ioctl_mtd-success.c: New file.
        * tests/ioctl_mtd.c: Rewrite.
        * tests/gen_tests.in (ioctl_mtd-success): New entry.
        * tests/.gitignore: Add ioctl_mtd-success.
        * tests/Makefile.am (check_PROGRAMS): Likewise.

        mtd: use print_fields.h macros.
        * mtd.c: Include "print_fields.h".
        (decode_erase_info_user): Print fields of struct erase_info_user
        using print_fields.h macros.
        (decode_erase_info_user64): Print fields of struct erase_info_user64
        using print_fields.h macros.
        (decode_mtd_oob_buf): Print fields of struct mtd_oob_buf using
        print_fields.h macros.
        (decode_mtd_oob_buf64): Print fields of struct mtd_oob_buf64 using
        print_fields.h macros.
        (decode_otp_info): Print fields of struct otp_info using
        print_fields.h macros.
        (decode_mtd_write_req): Print fields of struct mtd_write_req using
        print_fields.h macros.
        (decode_mtd_info_user): Print fields of struct mtd_info_user using
        print_fields.h macros.
        (print_xint32x2_array_member): New function.
        (decode_nand_oobinfo): Use it to print fields of struct nand_oobinfo
        using print_fields.h macros.
        (print_nand_oobfree_array_member): New function.
        (decode_nand_ecclayout_user): Use it to print fields of struct
        nand_ecclayout_user using print_fields.h macros.
        (decode_mtd_ecc_stats): Print fields of struct mtd_ecc_stats using
        print_fields.h macros.
        (mtd_ioctl): Print fields of struct region_info_user using
        print_fields.h macros.

2021-01-13  Dmitry V. Levin  <ldv@strace.io>

        tests: check legacy syscall info code.
        Check legacy code used for obtaining syscall number, arguments,
        and return value when modern ptrace API was not available yet.

        * tests/legacy_syscall_info.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add legacy_syscall_info.test.

2021-01-13  Dmitry V. Levin  <ldv@strace.io>

        disable_ptrace_get_syscall_info, disable_ptrace_getregset: new helper programs
        * disable_ptrace_request.c: New file.
        * disable_ptrace_get_syscall_info.c: Likewise.
        * disable_ptrace_getregset.c: Likewise.
        * Makefile.am (noinst_PROGRAMS, disable_ptrace_get_syscall_info_LDADD,
        disable_ptrace_getregset_LDADD): New variables.
        (EXTRA_DIST): Add disable_ptrace_request.c.
        * .gitignore: Add /disable_ptrace_get_syscall_info and
        /disable_ptrace_getregset.

2021-01-13  Dmitry V. Levin  <ldv@strace.io>

        tests: explicitly check decoding of chdir syscall.
        Decoding of chdir syscall is already tested implicitly by other tests,
        but we need an explicit check as well.

        * tests/chdir.c: New file.
        * tests/gen_tests.in (chdir): New entry.
        * tests/pure_executables.list: Add chdir.
        * tests/.gitignore: Likewise.

2021-01-13  Dmitry V. Levin  <ldv@strace.io>

        tests: cleanup chroot test.
        * tests/chroot.c: Assume that __NR_chroot is defined, use sprintrc.
        * tests/gen_tests.in (chroot): Update.

        print_mq_attr: use print_fields.h macros.
        * print_mq_attr.c: Include "print_fields.h".
        (printmqattr): Print fields of struct mq_attr using print_fields.h
        macros.

        nlattr: use print_fields.h macros.
        * nlattr.c: Include "print_fields.h".
        (print_nlattr): Print struct nlattr.nla_len using print_fields.h macros.

        mmsghdr: use print_fields.h macros.
        * mmsghdr.c: Include "print_fields.h".
        (print_struct_mmsghdr): Print struct mmsghdr.msg_len using
        print_fields.h macros.

        bpf_filter: use print_fields.h macros.
        * bpf_filter.c: Include "print_fields.h".
        (decode_bpf_fprog): Print struct bpf_fprog.len using print_fields.h
        macros.

        epoll: fix printing of field names of struct epoll_event.
        * epoll.c: Include "print_fields.h".
        (print_epoll_event): Print field names of struct epoll_event using
        print_fields.h macros.
        * tests/epoll_ctl.c: Update expected output.

2021-01-13  Dmitry V. Levin  <ldv@strace.io>

        tests: fix use of WORDS_BIGENDIAN.
        WORDS_BIGENDIAN is a preprocessor macro which is defined to 1
        for big-endian systems, and undefined otherwise.

        * tests/tests.h: Replace "if WORDS_BIGENDIAN" with
        "ifdef WORDS_BIGENDIAN".
        * tests/bpf.c: Likewise.
        * tests/clone3.c: Likewise.
        * tests/io_uring_register.c: Likewise.
        * tests/ioctl_v4l2-success.c: Likewise.
        * tests/ioctl_v4l2.c: Likewise.
        * tests/nlattr_ifla_linkinfo.c: Likewise.
        * tests/rt_sigpending.c: Likewise.

2021-01-12  Dmitry V. Levin  <ldv@strace.io>

        rtnl_rule: use print_fields.h macros.
        Do not assume that struct rtmsg and struct fib_rule_hdr are essentially
        the same structure, define and use struct_fib_rule_hdr instead.
        Do not define unnamed structures in the parser, define and use
        struct_fib_rule_uid_range and struct_fib_rule_port_range instead.

        * configure.ac (AC_CHECK_HEADERS): Remove linux/fib_rules.h.
        (AC_CHECK_TYPES): Remove struct fib_rule_uid_range and
        struct fib_rule_port_range.
        * types/fib_rules.h: New file.
        * rtnl_rule.c: Include "types/fib_rules.h" instead of
        <linux/rtnetlink.h> and <linux/fib_rules.h>.
        (decode_rule_addr, decode_fib_rule_hdr): Replace struct rtmsg with
        struct_fib_rule_hdr.
        (decode_fib_rule_uid_range): Use struct_fib_rule_uid_range.
        (decode_rule_port_range): Use struct_fib_rule_port_range.
        (decode_fib_rule_hdr): Print struct_fib_rule_hdr fields using
        print_fields.h macros.

2021-01-12  Dmitry V. Levin  <ldv@strace.io>

        utime: use print_fields.h macros.
        * utime.c: Include "print_fields.h".
        (SYS_FUNC(utime)): Print struct utimbuf fields using print_fields.h
        macros.

        times: use print_fields.h macros.
        * times.c: Include "print_fields.h".
        (SYS_FUNC(times)): Print struct tms fields using print_fields.h macros.

        time: use print_fields.h macros.
        * time.c: Include "print_fields.h".
        (print_timezone): Print struct timezone fields using print_fields.h
        macros.

        sigaltstack: use print_fields.h macros.
        * sigaltstack.c: Include "print_fields.h".
        (print_stack_t): Print stack_t fields using print_fields.h macros.

        scsi: use print_fields.h macros.
        * scsi.c: Include "print_fields.h".
        (decode_sg_scsi_id): Print struct sg_scsi_id fields using print_fields.h
        macros.

        sched: use print_fields.h macros on exiting sched_setattr.
        * sched.c (SYS_FUNC(sched_setattr)): Print struct sched_attr.size
        on exiting syscall using print_fields.h macros.

        process: use print_fields.h macros.
        * process.c: Include "print_fields.h".
        (SYS_FUNC(ptrace)): Print struct ptrace_peeksiginfo_args fields using
        print_fields.h macros.

        print_sg_req_info: use print_fields.h macros.
        * print_sg_req_info.c: Include "print_fields.h".
        (decode_sg_req_info): Print struct sg_req_info fields using
        print_fields.h macros.

2021-01-12  Dmitry V. Levin  <ldv@strace.io>

        configure.ac: fix typo.
        * configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for
        struct fsxattr.fsx_cowextsize in <linux/fs.h>.

        Fixes: v5.10-9-g91447a51d "tests: check decoding of FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR"

2021-01-11  Dmitry V. Levin  <ldv@strace.io>

        capability: use print_fields.h macros.
        * capability.c: Include "print_fields.h".
        (print_cap_header): Print user_cap_header_struct using print_fields.h
        macros.

        netlink: fix printing of field names of struct nlmsghdr.
        * netlink.c (print_nlmsghdr): Print "nlmsg_len" instead of "len",
        "nlmsg_type" instead of "type", "nlmsg_flags" instead of "flags",
        "nlmsg_seq" instead of "seq", and "nlmsg_pid" instead of "pid".
        * tests/netlink_audit.c: Update expected output.
        * tests/netlink_crypto.c: Likewise.
        * tests/netlink_generic.c: Likewise.
        * tests/netlink_netfilter.c: Likewise.
        * tests/netlink_protocol.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/netlink_selinux.c: Likewise.
        * tests/netlink_sock_diag.c: Likewise.
        * tests/netlink_xfrm.c: Likewise.
        * tests/nfnetlink_acct.c: Likewise.
        * tests/nfnetlink_cthelper.c: Likewise.
        * tests/nfnetlink_ctnetlink.c: Likewise.
        * tests/nfnetlink_ctnetlink_exp.c: Likewise.
        * tests/nfnetlink_cttimeout.c: Likewise.
        * tests/nfnetlink_ipset.c: Likewise.
        * tests/nfnetlink_nft_compat.c: Likewise.
        * tests/nfnetlink_nftables.c: Likewise.
        * tests/nfnetlink_osf.c: Likewise.
        * tests/nfnetlink_queue.c: Likewise.
        * tests/nfnetlink_ulog.c: Likewise.
        * tests/nlattr.c: Likewise.
        * tests/nlattr_br_port_msg.c: Likewise.
        * tests/nlattr_crypto_user_alg.c: Likewise.
        * tests/nlattr_dcbmsg.c: Likewise.
        * tests/nlattr_fib_rule_hdr.c: Likewise.
        * tests/nlattr_ifaddrlblmsg.c: Likewise.
        * tests/nlattr_ifaddrmsg.c: Likewise.
        * tests/nlattr_ifinfomsg.c: Likewise.
        * tests/nlattr_ifla.h: Likewise.
        * tests/nlattr_inet_diag_msg.c: Likewise.
        * tests/nlattr_inet_diag_req_compat.c: Likewise.
        * tests/nlattr_inet_diag_req_v2.c: Likewise.
        * tests/nlattr_mdba_mdb_entry.c: Likewise.
        * tests/nlattr_mdba_router_port.c: Likewise.
        * tests/nlattr_ndmsg.c: Likewise.
        * tests/nlattr_ndtmsg.c: Likewise.
        * tests/nlattr_netconfmsg.c: Likewise.
        * tests/nlattr_netlink_diag_msg.c: Likewise.
        * tests/nlattr_nlmsgerr.c: Likewise.
        * tests/nlattr_packet_diag_msg.c: Likewise.
        * tests/nlattr_rtgenmsg.c: Likewise.
        * tests/nlattr_rtmsg.c: Likewise.
        * tests/nlattr_smc_diag_msg.c: Likewise.
        * tests/nlattr_tc_stats.c: Likewise.
        * tests/nlattr_tca_stab.c: Likewise.
        * tests/nlattr_tcamsg.c: Likewise.
        * tests/nlattr_tcmsg.c: Likewise.
        * tests/nlattr_unix_diag_msg.c: Likewise.
        * tests/test_netlink.h: Likewise.

2021-01-10  Dmitry V. Levin  <ldv@strace.io>

        sock: add decoding of a few SIOC* ioctl commands.
        * sock.c (print_ifreq): Handle SIOCADDMULTI, SIOCDELMULTI,
        and SIOCSIFHWBROADCAST.
        (sock_ioctl): Handle SIOCADDMULTI, SIOCDELMULTI, SIOCGIFENCAP,
        SIOCOUTQNSD, SIOCSIFENCAP, and SIOCSIFHWBROADCAST.
        * NEWS: Mention this change.
        * tests/ioctl_sock.c (test_int, test_ifreq): Check it.

        tests: check decoding of SIOC* ioctl commands with struct ifreq argument
        * tests/ioctl_sock.c (test_ifreq): New function.
        (main): Use it.

2021-01-09  Dmitry V. Levin  <ldv@strace.io>

        sock: enhance decoding of SIOCBRADDBR and SIOCBRDELBR commands.
        * sock.c (sock_ioctl): As the kernel does
        copy_from_user(buf, uarg, IFNAMSIZ) for these commands,
        do not print more than IFNAMSIZ symbols either.
        * tests/ioctl_sock.c: Check it.

2021-01-08  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of SIOC* ioctl commands with an integer argument.
        * tests/ioctl_sock.c (test_int): New function.
        (main): Use it.

2021-01-07  Dmitry V. Levin  <ldv@strace.io>

        sock: consistently treat the argument of SIOC* ioctl commands as a pointer
        * sock.c (sock_ioctl): Handle all known SIOC* ioctl commands,
        print their argument using printaddr.
        * tests/ioctl_sock.c: New file.
        * tests/gen_tests.in (ioctl_sock): New entry.
        * tests/pure_executables.list: Add ioctl_sock.
        * tests/.gitignore: Likewise.

        linux/sh*/ioctls_arch0.h: update SIOCGSTAMP* ioctl entries.
        * linux/sh/ioctls_arch0.h (SIOCGSTAMP): Rename to SIOCGSTAMP_OLD.
        (SIOCGSTAMPNS): Rename to SIOCGSTAMPNS_OLD.
        * linux/sh64/ioctls_arch0.h: Likewise.

2021-01-07  Dmitry V. Levin  <ldv@strace.io>

        linux/*/ioctls_arch0.h: remove redundant 0x890[1-7] ioctl entries.
        They are already defined in appropriate ioctls_inc*.h files.

        * linux/alpha/ioctls_arch0.h (0x8906, 0x8907): Remove.
        * linux/mips/ioctls_arch0.h: Likewise.
        * linux/xtensa/ioctls_arch0.h: Likewise.
        * linux/avr32/ioctls_arch0.h (0x890[1-7]): Remove.
        * linux/hppa/ioctls_arch0.h: Likewise.
        * linux/ia64/ioctls_arch0.h: Likewise.
        * linux/sparc/ioctls_arch0.h: Likewise.
        * linux/sparc64/ioctls_arch0.h: Likewise.

2021-01-06  Dmitry V. Levin  <ldv@strace.io>

        alpha, mips, sh, xtensa: fix decoding of FIO[GS]ETOWN, SIOC[GS]PGRP, and SIOCATMARK
        While all other architectures define these ioctl commands using 0x89
        type, these peculiar architectures define FIO{G,S}ETOWN using 'f' type,
        SIOC[GS]PGRP and SIOCATMARK using 's' type.

        * ioctl.c (f_ioctl): New function.
        (ioctl_decode) <case 'f'>: Use it.
        [ALPHA || MIPS || SH || XTENSA]: Handle 's'.
        * NEWS: Mention this change.

2021-01-06  Dmitry V. Levin  <ldv@strace.io>

        sock: fix decoding of SIOCBRADDIF and SIOCBRDELIF commands.
        These ioctl commands have an argument.

        * sock.c (sock_ioctl) <SIOCBRADDIF, SIOCBRDELIF>: Rewrite.
        * NEWS: Mention this change.

        Fixes: v4.11~473 "sock.c: enhance socket ioctl parser"

2021-01-06  Dmitry V. Levin  <ldv@strace.io>

        sock: fix decoding of SIOCGIFINDEX command.
        * sock.c (print_ifreq): Handle SIOCGIFINDEX.
        * NEWS: Mention this change.

        Fixes: v4.11~473 "sock.c: enhance socket ioctl parser"

2021-01-05  Dmitry V. Levin  <ldv@strace.io>

        sock: do not include headers unnecessarily before DEF_MPERS_TYPE and MPERS_DEFS
        * sock.c: Include <sys/socket.h> and <net/if.h> after DEF_MPERS_TYPE.
        Include <linux/ioctl.h>, <linux/sockios.h>, <arpa/inet.h>, and
        "print_fields.h" after MPERS_DEFS.

        sock: sort case labels in switch statements.
        * sock.c (sock_ioctl): Sort case labels.

        sock: simplify decoding of SIOCSIFNAME and SIOCGIFNAME.

        sock: simplify decoding of some ioctl commands.
        * sock.c (sock_ioctl): simplify decoding of ioctl commands that write
        into struct ifreq.

        sock: simplify decoding of FIOGETOWN, SIOCGPGRP, and SIOCATMARK.
        * sock.c (sock_ioctl) <FIOGETOWN, SIOCGPGRP, SIOCATMARK>: Reuse printing
        done for FIOSETOWN and SIOCSPGRP.

        sock: remove redundant ifdefs.
        * sock.c: Include <linux/ioctl.h> unconditionally.
        (sock_ioctl): Handle SIOCBRADDBR, SIOCBRDELBR, FIOSETOWN, FIOGETOWN,
        SIOCSPGRP, SIOCGPGRP, SIOCATMARK, SIOCBRADDIF, and SIOCBRDELIF
        unconditionally.

        sock: avoid printing "ifc_len=0 * sizeof(struct ifreq)"
        * sock.c (print_ifc_len): Simplify output corresponding to zero length.
        * tests/ioctl_sock_gifconf.c (print_ifc_len): Update expected output.

        sock: use print_fields.h macros.
        * sock.c (print_ifname): Remove.
        (print_ifreq, print_ifconf_ifreq, sock_ioctl): Use print_fields.h macros
        instead of print_ifname and direct tprintf calls.

2021-01-04  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of FS_IOC{,32}_{G,S}ETFLAGS ioctl commands.
        * tests/ioctl_fs_f.c: New file.
        * tests/ioctl_fs_f-Xabbrev.c: Likewise.
        * tests/ioctl_fs_f-Xraw.c: Likewise.
        * tests/ioctl_fs_f-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add ioctl_fs_f, ioctl_fs_f-Xabbrev,
        ioctl_fs_f-Xraw, and ioctl_fs_f-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (ioctl_fs_f, ioctl_fs_f-Xabbrev, ioctl_fs_f-Xraw,
        ioctl_fs_f-Xverbose): New entries.

        fs_f_ioctl: implement decoding of FS_IOC{,32}_{G,S}ETFLAGS.
        * xlat/fs_x_ioctl_cmds.in (FS_IOC_GETFLAGS, FS_IOC32_GETFLAGS,
        FS_IOC_SETFLAGS, FS_IOC32_SETFLAGS): New constants introduced
        by Linux kernel commit v2.6.19-rc1~640^2~13.
        * xlat/fs_ioc_flags.in: New file.
        * fs_f_ioctl.c: Include "xlat/fs_ioc_flags.h".
        (decode_fs_ioc_flags): New function.
        (fs_f_ioctl): Use it to handle FS_IOC_GETFLAGS, FS_IOC32_GETFLAGS,
        FS_IOC_SETFLAGS, and FS_IOC32_SETFLAGS.
        * NEWS: Mention this change.

        maint: remove ioctl duplicates.
        * maint/ioctls_sym.awk: If a header file defines several ioctl names
        with the same value, omit those ioctl names that are either substrings
        or equivalents of other ioctl names with the same value.
        * linux/64/ioctls_inc.h: Regenerate.
        * linux/32/ioctls_inc_align16.h: Likewise.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * linux/x32/ioctls_inc0.h: Likewise.

        file_ioctl: rename to fs_f_ioctl.
        * Makefile.am (libstrace_a_SOURCES): Replace file_ioctl.c
        with fs_f_ioctl.c.
        * defs.h (DECL_IOCTL): Replace file with fs_f.
        * file_ioctl.c: Rename to ...
        * fs_f_ioctl.c: ... new file.
        (file_ioctl): Rename to fs_f_ioctl.
        * ioctl.c (ioctl_decode): Replace file_ioctl with fs_f_ioctl.

        file_ioctl: refactor FS_IOC_FIEMAP decoding.
        * file_ioctl.c (decode_fiemap): New function.
        (file_ioctl): Use it.

        file_ioctl: compile unconditionally.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/fiemap.h.
        * types/fiemap.h: New file.
        * xlat/fs_f_ioctl_cmds.in: Likewise.
        * file_ioctl.c: Include "types/fiemap.h" instead of <linux/fiemap.h>.
        Include "xlat/fs_f_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
        (print_fiemap_extentm, file_ioctl): Use struct_fiemap instead of
        struct fiemap, compile unconditionally.

2021-01-03  Sven Schnelle  <svens@linux.ibm.com>

        tests: fix invalid flag testing in userfaultfd test.
        With linux commit 37cd0575b851 ("userfaultfd: add UFFD_USER_MODE_ONLY")
        flag with value 1 is now a valid flag. This commit changes it to 2 as
        that one is the next available. It doesn't implement any testing of
        UFFD_USER_MODE_ONLY though.

2021-01-03  Dmitry V. Levin  <ldv@strace.io>

        Move decoders of FS_IOC_[GS]ETFSLABEL from btrfs.c to fs_0x94_ioctl.c.
        * types/fs_0x94.h (fs_0x94_label_t): New type.
        * xlat/fs_0x94_ioctl_cmds.in (FS_IOC_GETFSLABEL, FS_IOC_SETFSLABEL): New
        constants introduced by Linux kernel commit v4.18-rc1~37^2~66.
        * fs_0x94_ioctl.c (decode_fslabel): New function.
        (fs_0x94_ioctl): Use it to decode FS_IOC_GETFSLABEL
        and FS_IOC_SETFSLABEL.
        * btrfs.c (btrfs_ioctl) <BTRFS_IOC_GET_FSLABEL, BTRFS_IOC_SET_FSLABEL>:
        Remove.

        fs_0x94_ioctl: refactor decoding of FICLONERANGE and FIDEDUPERANGE.
        * fs_0x94_ioctl.c (decode_file_clone_range, decode_file_dedupe_range):
        New functions.
        (fs_0x94_ioctl): Use them.

2021-01-03  Dmitry V. Levin  <ldv@strace.io>

        ioctl: call btrfs_ioctl from fs_0x94_ioctl.
        It used to be the other way around.

        * btrfs.c (btrfs_ioctl) <BTRFS_IOC_CLONE, BTRFS_IOC_CLONE_RANGE,
        BTRFS_IOC_FILE_EXTENT_SAME>: Remove.
        * fs_0x94_ioctl.c (fs_0x94_ioctl) <default> [HAVE_LINUX_BTRFS_H]: Call
        btrfs_ioctl.
        * ioctl.c (ioctl_decode) <0x94>: Call fs_0x94_ioctl instead
        of btrfs_ioctl.

2021-01-03  Dmitry V. Levin  <ldv@strace.io>

        fs_0x94_ioctl: move type definitions to types/fs_0x94.h.
        * types/fs_0x94.h: New file.
        * xlat/fs_0x94_ioctl_cmds.in: Likewise.
        * fs_0x94_ioctl.c Include "types/fs_0x94.h" instead of <linux/fs.h>.
        Include "xlat/fs_0x94_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
        [!FICLONE, !FICLONERANGE, !FIDEDUPERANGE]: Remove.
        (print_file_dedupe_range_info): Replace struct file_dedupe_range_info
        with struct_file_dedupe_range_info.
        (fs_0x94_ioctl): Replace struct file_clone_range,
        struct file_dedupe_range, and struct file_dedupe_range_info with
        struct_file_clone_range, struct_file_dedupe_range, and
        struct_file_dedupe_range_info, respectively.

        file_ioctl: move decoders of linux/fs.h 0x94 commands to a separate file
        * file_ioctl.c: Move decoders of 0x94 ioctl commands  to ...
        * fs_0x94_ioctl.c: ... new file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * btrfs.c (btrfs_ioctl): Replace file_ioctl with fs_0x94_ioctl.
        * defs.h (DECL_IOCTL): Add fs_0x94.

        tests: extend FS_IOC_FIEMAP decoding checks.
        * tests/ioctl_fiemap.c: Rewrite.
        * tests/ioctl_fiemap-Xabbrev.c: New file.
        * tests/ioctl_fiemap-Xraw.c: Likewise.
        * tests/ioctl_fiemap-Xverbose.c: Likewise.
        * tests/ioctl_fiemap-success.c: Likewise.
        * tests/ioctl_fiemap-success-Xabbrev.c: Likewise.
        * tests/ioctl_fiemap-success-Xraw.c: Likewise.
        * tests/ioctl_fiemap-success-Xverbose.c: Likewise.
        * tests/ioctl_fiemap-success-v.c: Likewise.
        * tests/ioctl_fiemap-success-v-Xabbrev.c: Likewise.
        * tests/ioctl_fiemap-success-v-Xraw.c: Likewise.
        * tests/ioctl_fiemap-success-v-Xverbose.c: Likewise.
        * tests/gen_tests.in (ioctl_fiemap-Xabbrev, ioctl_fiemap-Xraw,
        ioctl_fiemap-Xverbose, ioctl_fiemap-success,
        ioctl_fiemap-success-Xabbrev, ioctl_fiemap-success-Xraw,
        ioctl_fiemap-success-Xverbose, ioctl_fiemap-success-v,
        ioctl_fiemap-success-v-Xabbrev, ioctl_fiemap-success-v-Xraw,
        ioctl_fiemap-success-v-Xverbose): New entries.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_fiemap-success,
        ioctl_fiemap-success-Xabbrev, ioctl_fiemap-success-Xraw,
        ioctl_fiemap-success-Xverbose, ioctl_fiemap-success-v,
        ioctl_fiemap-success-v-Xabbrev, ioctl_fiemap-success-v-Xraw,
        and ioctl_fiemap-success-v-Xverbose.
        * tests/pure_executables.list: Add ioctl_fiemap-Xabbrev,
        ioctl_fiemap-Xraw, and ioctl_fiemap-Xverbose.
        * tests/.gitignore: Add ioctl_fiemap-Xabbrev, ioctl_fiemap-Xraw,
        ioctl_fiemap-Xverbose, ioctl_fiemap-success,
        ioctl_fiemap-success-Xabbrev, ioctl_fiemap-success-Xraw,
        ioctl_fiemap-success-Xverbose, ioctl_fiemap-success-v,
        ioctl_fiemap-success-v-Xabbrev, ioctl_fiemap-success-v-Xraw,
        and ioctl_fiemap-success-v-Xverbose.

2021-01-03  Dmitry V. Levin  <ldv@strace.io>

        tests: rename file_ioctl to ioctl_fiemap.
        Since the only ioctl being tested by file_ioctl test is FS_IOC_FIEMAP,
        rename the test.

        * tests/file_ioctl.c: Rename to tests/ioctl_fiemap.c
        * tests/gen_tests.in (file_ioctl): Rename to ioctl_fiemap.
        * tests/pure_executables.list (file_ioctl): Likewise.
        * tests/.gitignore (file_ioctl): Likewise.

2021-01-02  Dmitry V. Levin  <ldv@strace.io>

        tests: check decoding of FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR.
        * configure.ac (AC_CHECK_MEMBERS): Check for
        struct fsxattr.fsx_cowextsize in <linux/fs.h>.
        * tests/ioctl_fs_x-success.c: New file.
        * tests/ioctl_fs_x-success-Xabbrev.c: Likewise.
        * tests/ioctl_fs_x-success-Xraw.c: Likewise.
        * tests/ioctl_fs_x-success-Xverbose.c: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_fs_x-success,
        ioctl_fs_x-success-Xabbrev, ioctl_fs_x-success-Xraw,
        and ioctl_fs_x-success-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (ioctl_fs_x-success, ioctl_fs_x-success-Xabbrev,
        ioctl_fs_x-success-Xraw, ioctl_fs_x-success-Xverbose): New entries.

        fs_x_ioctl: implement decoding of FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR
        * types/fs_x.h (struct_fsxattr): New typedef.
        * xlat/fs_x_ioctl_cmds.in (FS_IOC_FSGETXATTR, FS_IOC_FSSETXATTR): New
        constants introduced by Linux kernel commit v4.5-rc1~23^2~1^2~2.
        * xlat/fs_xflags.in: New file.
        * fs_x_ioctl.c: Include "xlat/fs_xflags.h".
        (decode_fsxattr): New function.
        (fs_x_ioctl): Use it to handle FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR.
        * NEWS: Mention this change.

2021-01-01  Dmitry V. Levin  <ldv@strace.io>

        Update copyright year number range.
        * COPYING: Update copyright year number range.
        * tests/COPYING: Likewise.
        * debian/copyright: Likewise.
        * maint/README-release: Update.

2020-12-31  Dmitry V. Levin  <ldv@strace.io>

        fs_x_ioctl: refactor FITRIM decoding.
        * fs_x_ioctl.c (decode_fstrim_range): New function.
        (fs_x_ioctl): Use it.

        tests: check decoding of linux/fs.h 'X' ioctl commands.
        * tests/ioctl_fs_x.c: New file.
        * tests/ioctl_fs_x-Xabbrev.c: Likewise.
        * tests/ioctl_fs_x-Xraw.c: Likewise.
        * tests/ioctl_fs_x-Xverbose.c: Likewise.
        * tests/gen_tests.in (ioctl_fs_x, ioctl_fs_x-Xabbrev, ioctl_fs_x-Xraw,
        ioctl_fs_x-Xverbose): New entries.
        * tests/pure_executables.list: Add ioctl_fs_x, ioctl_fs_x-Xabbrev,
        ioctl_fs_x-Xraw, and ioctl_fs_x-Xverbose.
        * tests/.gitignore: Likewise.

        fs_x_ioctl: compile unconditionally.
        * types/fs_x.h: New file.
        * xlat/fs_x_ioctl_cmds.in: Likewise.
        * fs_x_ioctl.c: Include "types/fs_x.h" instead of <linux/fs.h>.
        Include "xlat/fs_x_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
        (fs_x_ioctl): Use struct_fstrim_range instead of struct fstrim_range,
        compile unconditionally.

        fs_x_ioctl: decode FITRIM using print_fields.h macros.
        * fs_x_ioctl.c: Include "print_fields.h".
        (fs_x_ioctl): Use PRINT_FIELD_X and PRINT_FIELD_U to decode fields
        of struct fstrim_range.

        Change my email address.

2020-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.10-1.
        * strace.spec.in: Likewise.

2020-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.10 release.
        * NEWS: Update for 5.10 release.

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Update .mailmap.
        * .mailmap: Add both email addresses of Sven Schnelle to avoid
        duplication in CREDITS file.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

        tests: check decoding of clock_gettime64, clock_settime64, and clock_getres_time64 syscalls
        * tests/clock_xettime-common.c: New file.
        * tests/clock_xettime64.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add clock_xettime-common.c.
        * tests/clock_xettime.c: Turn into a wrapper around
        clock_xettime-common.c.
        * tests/pure_executables.list: Add clock_xettime64.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (clock_xettime64): New entry.
        * tests/clock.in (clock_xettime64): Likewise.
        * tests/trace_clock.in (clock_xettime64): Likewise.
        * tests/trace_personality_regex_32.in (clock_xettime64): Likewise.
        * tests/trace_personality_regex_64.in (clock_xettime64): Likewise.
        * tests/trace_personality_regex_x32.in (clock_xettime64): Likewise.

        tests: check decoding of clock_adjtime64 syscall.
        * tests/clock_adjtime-common.c: New file.
        * tests/clock_adjtime64.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add clock_adjtime-common.c.
        * tests/clock_adjtime.c: Turn into a wrapper around
        clock_adjtime-common.c.
        * tests/pure_executables.list: Add clock_adjtime64.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (clock_adjtime64): New entry.
        * tests/clock.in (clock_adjtime64): Likewise.
        * tests/trace_clock.in (clock_adjtime64): Likewise.
        * tests/trace_personality_regex_32.in (clock_adjtime64): Likewise.
        * tests/trace_personality_regex_64.in (clock_adjtime64): Likewise.
        * tests/trace_personality_regex_x32.in (clock_adjtime64): Likewise.

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix %clock trace class.
        Four syscalls (clock_gettime64, clock_settime64, clock_adjtime64, and
        clock_getres_time64) were missed when the %clock trace class was
        introduced.

        * linux/syscallent-common-32.h (clock_gettime64, clock_settime64,
        clock_adjtime64, clock_getres_time64): Add TCL flag.
        * NEWS: Mention this change.

        Fixes: v5.7~72 "Add %clock trace class"

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite pselect6 test.
        Starting with glibc commit glibc-2.32.9000-132-g2433d39b69, pselect
        function in glibc is implemented on top of pselect6_time64 syscall
        on 32-bit architectures, which makes it unsuitable for the test of
        pselect6 decoder.

        Resolve this issue by creating two tests that check decoding
        of __NR_pselect6 and __NR_pselect6_time64 syscalls.

        * tests/pselect6-common.c: New file.
        * tests/pselect6_time64.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add pselect6-common.c.
        * tests/pselect6.c: Rewrite using __NR_pselect6.
        * tests/pure_executables.list: Add pselect6_time64.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (pselect6_time64): New entry.

2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite semtimedop test.
        Starting with glibc commit glibc-2.32.9000-105-g7c437d3778, semtimedop
        function in glibc is implemented on top of semtimedop_time64 syscall on
        32-bit architectures, which makes it unsuitable for the test of
        semtimedop decoder.

        Resolve this issue by creating three tests that check decoding
        of __NR_semtimedop, __NR_semtimedop_time64, and __NR_ipc SEMTIMEDOP.

        * tests/semtimedop-common.c: New file.
        * tests/semtimedop-syscall.c: Likewise.
        * tests/semtimedop-ipc.c: Likewise.
        * tests/semtimedop_time64.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add semtimedop-common.c and
        semtimedop-syscall.c.
        * tests/semtimedop.c: Rewrite using __NR_semtimedop.
        * tests/pure_executables.list: Add semtimedop-ipc and semtimedop_time64.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (semtimedop-ipc, semtimedop_time64): New entries.

2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: set true_scno in decode_syscall_subcall.
        This change makes the strace-n test pass on mips o32.

        * linux/mips/get_syscall_args.c [SYS_syscall_subcall]
        (decode_syscall_subcall): Set tcp->true_scno.

        Fixes: v5.9~55 "strace: add an option for printing syscall numbers"

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround -Wall regressions in Red Hat gcc.
        The version of gcc packaged into Rawhide erroneously produces false
        positive diagnostics in dozens of strace tests.

        Check at configure stage whether the C compiler is broken, and
        enable workarounds in tests when the broken C compiler is detected.

        Tested with:
        $ gcc --version |head -1
        gcc (GCC) 11.0.0 20201204 (Red Hat 11.0.0-0)

        * m4/st_broken_cc.m4: New file.
        * configure.ac: Call st_BROKEN_CC after st_WARN_CFLAGS.
        * tests/tests.h (tail_alloc, tail_memdup) [HAVE_BROKEN_CC]: Do not
        add ATTRIBUTE_ALLOC_SIZE.
        * NEWS: Mention this change.

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use direct __NR_write invocation instead of C function in pc.test
        gcc-11 -Werror=stringop-overread along with glibc >= 2.32 are not happy
        about our use of write function, so replace it with a direct syscall
        invocation.

        * tests/pc.c: Include "scno.h".
        (main): Call syscall(__NR_write) instead of write().

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround inline optimization in strace -k tests.
        Try to disable unwanted inline optimization that breaks these tests.

        * tests/stack-fcall.h: Include "gcc_compat.h".
        (f0, f1, f2, f3): Add ATTRIBUTE_NOINLINE.

2020-12-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.10.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.10-rc7
        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/i386/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: adapt to the future versions of readelf.
        * maint/ioctls_sym.awk: Update DW_AT_type regexp.

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        Update the number of arguments of membarrier syscall.
        Apply the following change:
        $ git grep -Fl 'SEN(membarrier)' |xargs sed -i '/SEN(membarrier)/ s/2,/3,/'

        * linux/*/syscallent*.h (membarrier): Change nargs from 2 to 3.

        Fixes: 176cbdc69 "membarrier: implement decoding of cpu_id argument"

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        mmsghdr: workaround -Warray-bounds regression in Red Hat gcc.
        The version of gcc packaged into Rawhide erroneously produces
        the following false positive diagnostics:

        mmsghdr.c: In function 'do_recvmmsg':
        mmsghdr.c:87:23: error: array subscript 'struct mmsgvec_data[0]' is partly outside array bounds of 'unsigned char[4108]' [-Werror=array-bounds]
           87 |         data->timeout = xstrdup(timeout);
              |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

        Tested with:
        $ gcc --version |head -1
        gcc (GCC) 11.0.0 20201204 (Red Hat 11.0.0-0)

        * mmsghdr.c (struct mmsgvec_data): Change namelen[IOV_MAX] to an array
        of zero length.

2020-12-11  Elvira Khabirova  <lineprinter0@gmail.com>

        membarrier: implement decoding of cpu_id argument.
        Introduced by Linux kernel commit v5.10-rc1~203^2~5.

        * membarrier.c: Decode cpu_id argument.
        * tests/membarrier.c: Add MEMBARRIER_CMD_FLAG_CPU cases.
        * xlat/membarrier_flags.in: New file.
        * NEWS: Mention the change.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: annotate uring_register_opcodes with #enum.
        Starting with Linux kernel commit v5.10-rc1~167^2~52, <linux/io_uring.h>
        uses an enumeration to define io_uring_register(2) opcodes.

        * xlat/uring_register_opcodes.in: Add #enum, include <linux/io_uring.h>.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: annotate uring_ops with #enum.
        Starting with Linux kernel commit v5.5-rc2~24^2, <linux/io_uring.h>
        uses an enumeration to define io_uring_enter(2) opcodes.

        * xlat/uring_ops.in: Add #enum, include <linux/io_uring.h>.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of process_madvise syscall.
        Introduced by Linux kernel commit v5.10-rc1~87^2~14.

        * mem.c (SYS_FUNC(process_madvise)): New function.
        * linux/syscallent-common.h [BASE_NR + 440]: Wire up process_madvise.
        * NEWS: Mention this change.
        * tests/process_madvise.c: New file.
        * tests/process_madvise-y.c: Likewise.
        * tests/process_madvise-yy.c: Likewise.
        * tests/gen_tests.in (process_madvise, process_madvise-y,
        process_madvise-yy): New entries.
        * tests/pure_executables.list: Add process_madvise, process_madvise-y,
        and process_madvise-yy.
        * tests/.gitignore: Likewise.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        pidfd_open: decode flags argument.
        Starting with Linux kernel commit v5.10-rc1~141^2~3, pidfd_open syscall
        supports PIDFD_NONBLOCK flag.

        * xlat/pidfd_open_flags.in: New file.
        * pidfd_open.c: Include <fcntl.h> and "xlat/pidfd_open_flags.h".
        (SYS_FUNC(pidfd_open)): Print flags argument using printflags.
        * tests/pidfd_open.c (main): Check it.
        * NEWS: Mention this change.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable tests for invalid shmctl commands on glibc >= 2.32.
        Starting with commit glibc-2.32.9000-207-g9ebaabeaac1a96b0d91f,
        glibc skips shmctl syscall invocations and returns EINVAL
        for invalid shmctl commands.

        * tests/ipc_shm.c [GLIBC_PREREQ_GE(2, 32)] (TEST_SHMCTL_BOGUS_CMD):
        Define to 0.
        [!TEST_SHMCTL_BOGUS_CMD] (TEST_SHMCTL_BOGUS_CMD): Define to 1.
        (main) [!TEST_SHMCTL_BOGUS_CMD] (bogus_cmd): Do not define and do not
        use.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable tests for invalid msgctl commands on glibc >= 2.32.
        Starting with commit glibc-2.32.9000-149-gbe9b0b9a012780a403a2,
        glibc skips msgctl syscall invocations and returns EINVAL
        for invalid msgctl commands.

        * tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 32)] (TEST_MSGCTL_BOGUS_CMD):
        Define to 0.
        [!TEST_MSGCTL_BOGUS_CMD] (TEST_MSGCTL_BOGUS_CMD): Define to 1.
        (main) [!TEST_MSGCTL_BOGUS_CMD] (bogus_cmd): Do not define and do not
        use.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable tests for invalid semctl commands on glibc >= 2.32.
        Starting with commit glibc-2.32.9000-147-ga16d2abd496bd974a882,
        glibc skips semctl syscall invocations and returns EINVAL
        for invalid semctl commands.

        * tests/ipc_sem.c [GLIBC_PREREQ_GE(2, 32)] (TEST_SEMCTL_BOGUS_CMD):
        Define to 0.
        [!TEST_SEMCTL_BOGUS_CMD] (TEST_SEMCTL_BOGUS_CMD): Define to 1.
        (main) [!TEST_SEMCTL_BOGUS_CMD] (bogus_semid, bogus_semnum, bogus_cmd,
        bogus_arg): Do not define and do not use.

2020-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: mark some of #unconditional files with #value_indexed.
        * xlat/btrfs_dev_stats_values.in: Prepend #value_indexed.
        * xlat/cap.in: Likewise.
        * xlat/inet_diag_attrs.in: Likewise.
        * xlat/inet_diag_bytecodes.in: Likewise.
        * xlat/inet_diag_req_attrs.in: Likewise.
        * xlat/mtd_file_mode_options.in: Likewise.
        * xlat/mtd_mode_options.in: Likewise.
        * xlat/netlink_diag_attrs.in: Likewise.
        * xlat/packet_diag_attrs.in: Likewise.
        * xlat/smc_diag_attrs.in: Likewise.
        * xlat/unix_diag_attrs.in: Likewise.

        xlat: update V4L2_* constants.
        * xlat/v4l2_format_description_flags.in (V4L2_FMT_FLAG_CSC_COLORSPACE,
        V4L2_FMT_FLAG_CSC_XFER_FUNC, V4L2_FMT_FLAG_CSC_YCBCR_ENC,
        V4L2_FMT_FLAG_CSC_QUANTIZATION): New constants introduced
        by Linux kernel commit v5.10-rc1~175^2~172.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2-success.c (main): Update expected output.

        xlat: update STATX_* constants.
        * xlat/statx_attrs.in (STATX_ATTR_DAX): New constant introduced
        by Linux kernel commit v5.8-rc1~51^2~9 and updated by Linux kernel
        commit v5.10-rc6-63-g72d1249e2ffd.
        * NEWS: Mention this change.

        xlat: update NLMSGERR_* constants.
        * xlat/nlmsgerr_attrs.in (NLMSGERR): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~33^2.
        * NEWS: Mention this change.

        xlat: update MS_* constants.
        * xlat/mount_flags.in (MS_NOSYMFOLLOW): New constant introduced
        by Linux kernel commit v5.10-rc1~19^2~9.
        * NEWS: Mention this change.
        * tests/mount.c (str_unknown, main): Update.

        xlat: update MEMBARRIER_CMD_* constants.
        * xlat/membarrier_cmds.in (MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ,
        MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ): New constants
        introduced by Linux kernel commit v5.10-rc1~203^2~5.
        * NEWS: Mention this change.
        * tests/membarrier.c (main): Update expected output.

        xlat: update KVM_* constants.
        * xlat/kvm_exit_reason.in (KVM_EXIT_X86_RDMSR, KVM_EXIT_X86_WRMSR): New
        constants introduced by Linux kernel commit v5.10-rc1~21^2~62.
        * xlat/kvm_cap.in (KVM_CAP_X86_USER_SPACE_MSR): Likewise.
        (KVM_CAP_X86_MSR_FILTER): New constant introduced by Linux kernel
        commit v5.10-rc1~21^2~57.
        (KVM_CAP_ENFORCE_PV_FEATURE_CPUID): New constant introduced
        by Linux kernel commit v5.10-rc1~21^2~42.
        * NEWS: Mention this change.

        xlat: update IORING_* constants.
        * xlat/uring_enter_flags.in (IORING_ENTER_SQ_WAIT): New constant
        introduced by Linux kernel commit v5.10-rc1~167^2~39.
        * xlat/uring_register_opcodes.in (IORING_REGISTER_RESTRICTIONS): New
        constant introduced by Linux kernel commit v5.10-rc1~167^2~51.
        (IORING_REGISTER_ENABLE_RINGS): New constant introduced by Linux kernel
        commit v5.10-rc1~167^2~50.
        * xlat/uring_setup_flags.in (IORING_SETUP_R_DISABLED: New constant
        introduced by Linux kernel commit v5.10-rc1~167^2~50.
        * NEWS: Mention this change.
        * tests/io_uring_enter.c (main): Update expected output.
        * tests/io_uring_setup.c (main): Likewise.

        xlat: update KEY* constants.
        * xlat/evdev_keycode.in (KEY_NOTIFICATION_CENTER, KEY_PICKUP_PHONE,
        KEY_HANGUP_PHONE): New constants introduced by Linux kernel commit
        v5.10-rc1~36^2^2~27.
        (KEY_FN_RIGHT_SHIFT): New constant introduced by Linux kernel commit
        v5.10-rc1~36^2^2~26.
        * NEWS: Mention this change.

        xlat: update INET_DIAG_* constants.
        * linux/inet_diag.h (INET_DIAG_SOCKOPT): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~376.
        * xlat/inet_diag_attrs.in (INET_DIAG_SOCKOPT): Likewise.
        * xlat/inet_diag_extended_flags.in (1<<(INET_DIAG_SOCKOPT-1)): Likewise.
        * NEWS: Mention this change.

        xlat: update MDBA_* constants.
        * xlat/mdb_flags.in (MDB_FLAGS_STAR_EXCL): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~166^2~3.
        (MDB_FLAGS_BLOCKED): New constant introduced by Linux kernel commit
        v5.10-rc1~107^2~166^2~2.
        * xlat/rtnl_mdba_mdb_eattr_attrs.in (MDBA_MDB_EATTR_SRC_LIST,
        MDBA_MDB_EATTR_GROUP_MODE): New constants introduced by Linux kernel
        commit v5.10-rc1~107^2~359^2~11.
        (MDBA_MDB_EATTR_SOURCE): New constant introduced by Linux kernel commit
        v5.10-rc1~107^2~166^2~8.
        (MDBA_MDB_EATTR_RTPROT): New constant introduced by Linux kernel commit
        v5.10-rc1~107^2~166^2~6.
        * NEWS: Mention this change.

        xlat: update ALG_* constants.
        * xlat/sock_alg_options.in (ALG_SET_DRBG_ENTROPY): New constant
        introduced by Linux kernel commit v5.10-rc1~181^2~51.
        * NEWS: Mention this change.

        xlat: update NT_* constants.
        * xlat/nt_descriptor_types.in (NT_ARM_TAGGED_ADDR_CTRL): New constant
        introduced by Linux kernel commit v5.10-rc1~49^2~9^2~7.
        * NEWS: Mention this change.

        xlat: update BPF_* constants.
        * xlat/bpf_commands.in (BPF_PROG_BIND_MAP): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~169^2~20^2~3.
        * xlat/bpf_map_flags.in (BPF_F_PRESERVE_ELEMS): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~96^2^2~1.
        (BPF_F_INNER_MAP): New constant introduced by Linux kernel commit
        v5.10-rc1~107^2~16^2~5^2~3.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_INODE_STORAGE): New constant
        introduced by Linux kernel commit v5.10-rc1~107^2~394^2~51.
        * xlat/bpf_prog_flags.in (BPF_F_SLEEPABLE): New constant introduced
        by Linux kernel commit v5.10-rc1~107^2~394^2~21^2~3.
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
        print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update.

        xlat: update SEGV_* constants.
        * xlat/sigsegv_codes.in (SEGV_MTEAERR, SEGV_MTESERR): New constants
        introduced by Linux kernel commit v5.10-rc1~49^2~9^2~25.
        * NEWS: Mention this change.

2020-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        README.md: remove the reference to Travis CI builds.
        Apparently, Travis CI no longer welcomes building on public repositories:
        strace builds "have been temporarily disabled for public repositories
        due to a negative credit balance".

        Link: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing

2020-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: consistently use readelf --wide.
        * mpers.sh: Pass --wide to readelf.
        * mpers.awk: Update DW_AT_type regexp.

2020-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        .github: partially migrate from ubuntu-18.04 to ubuntu-20.04.
        * .github/workflows/ci.yml (runs-on): Stick gcc7 jobs with ubuntu-18.04,
        switch all the rest from ubuntu-latest to ubuntu-20.04.

        Fix various typos found using codespell tool.
        * defs.h: Replace "namepace" with "namespace".
        * pidns.c: Replace "Paramters" with "Parameters".
        * strace.1.in: Replace "descritors" with "descriptors",
        replace "asociated" with "associated".
        * strace.c: Replace "descritor" with "descriptor".
        * tests/pidns.c: Replace "Wheather" with "Whether".
        * tests/pidns.h: Replace "succesful" with "successful".
        * maint/README-release: Add spellcheck.

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        st_libunwind.m4: fix --with-libunwind=path.
        * m4/st_libunwind.m4 (st_LIBUNWIND): Move initialization of
        libunwind_CPPFLAGS, libunwind_LDFLAGS, and libunwind_LIBS variables ...
        (st_ARG_LIBUNWIND): ... here.

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        st_demangle.m4: fix --with-libiberty=path.
        * m4/st_demangle.m4 (st_DEMANGLE): Clear libiberty_CPPFLAGS and
        libiberty_LDFLAGS variables prior to their initialization in
        --with-libiberty=path.

        Reported-by: Renaud Métrich <rmetrich@redhat.com>

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: remove IPPROTO_MAX.
        * xlat/inet_protocols.in (IPPROTO_MAX): Remove.

        Reported-by: Khem Raj <raj.khem@gmail.com>
        Suggested-by: Eugene Syromiatnikov <esyr@redhat.com>
        Resolves: https://github.com/strace/strace/issues/164

2020-11-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable TEST_MSGCTL_BOGUS_ADDR in ipc_msg test on glibc >= 2.31.
        Starting with commit glibc-2.31~358, on every architecture where
        __ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify the
        data provided in the third argument of msgctl call.  This results
        to segfaults inside glibc if TEST_MSGCTL_BOGUS_ADDR is enabled.

        * tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 31) && (__m68k__ || __s390__ ||
        (WORDS_BIGENDIAN && (__arm__ || __microblaze__ || __sh__)))]
        (TEST_MSGCTL_BOGUS_ADDR): Define to 0.

        Reported-by: Sven Schnelle <svens@linux.ibm.com>

2020-11-10  Sven Schnelle  <svens@stackframe.org>

        tests: fix execve test with fresh linux kernels.
        Starting with Linux commit v5.9-rc1~164^2^2~2, execve copies syscall
        arguments before trying to find the executable, failing with EFAULT
        in case of a faulty address.  Adjust the test to handle both variants
        of execve behaviour.

        * tests/execve.c (errstr): New variable.
        (call_execve): New function.
        (main): Use it instead of execve.  Do not hardcode ENOENT in expected
        output of tests, use errstr instead.

2020-11-09  Sven Schnelle  <svens@linux.ibm.com>

        tests: remove close_range* executables from pure_executables.list.
        close_range* executables rely on /dev/full being opened on fd 7,
        so remove them from pure_executable.list.


        * tests/pure_executables.list: Move close_range, close_range-P,
        close_range-y, and close_range-yy ...
        * tests/Makefile.am (check_PROGRAMS): ... here.

        Fixes: v5.9~44 "Implement decoding of close_range syscall"

2020-10-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Enable stack tracing with libdw for non-native personality tracees.
        libdw can handle compat processes, so it makes little sense to have
        stack tracing disabled when it is used.

        * syscall.c [!defined(USE_LIBUNWIND) && ENABLE_STACKTRACE]
        (update_personality): Re-initialise unwinder on personality change.
        * unwind.c [!defined(USE_LIBUNWIND) && (SUPPORTED_PERSONALITIES > 1)]
        (unwind_tcb_print, unwind_tcb_capture): Do not return early.
        * tests/Makefile.am (STACKTRACE_XFAIL_TESTS): New variable, initialise
        it to $(STACKTRACE_TESTS) if ENABLE_STACKTRACE and USE_LIBUNWIND
        are true, otherwise make it empty.
        (XFAIL_TESTS_m32, XFAIL_TESTS_mx32): Initialise
        it to $(STACKTRACE_XFAIL_TESTS) and not $(STACKTRACE_TESTS).
        * NEWS: Mention the change.

        Closes: https://github.com/strace/strace/issues/162

2020-10-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mmap_cache: remove personality check.
        mmap_cache is detached from the unwinder code now, and it has other
        users, so it makes little sense to keep it here.

        * mmap_cache.c (mmap_cache_invalidate): Remove conditional avoidance
        of mmap_cache_generation increment for non-native mpers.

2020-10-21  Dmitry V. Levin  <ldv@altlinux.org>

        Revert "types/v4l2.h: update definition of struct_v4l2_create_buffers"
        The change introduced by Linux commit v5.9-rc1~94^2~295 was reverted
        later by Linux commit v5.9-rc7~25^2~1.

        This reverts commit e877fe48187eea9c24ec539fe7875bdc0de74b86.

        * types/v4l2.h (struct_v4l2_create_buffers): Remove "flags" field and
        update "reserved" field to sync with changes introduced by Linux kernel
        commit v5.9-rc7~25^2~1.

2020-10-21  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.9-1.
        * strace.spec.in: Likewise.

2020-09-24  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.9 release.
        * NEWS: Update for 5.9 release.

2020-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2020-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        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

2020-09-23  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.9.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.9-rc6
        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.
        * NEWS: Mention this.
        * tests/ioctl_v4l2.c (main): Skip conflicting ioctl command
        VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES.

        maint: update for linux v5.9.
        * maint/ioctls_gen.sh: Add arch/<arch>/include/generated/uapi and
        arch/<arch>/include/generated directories to INCLUDES.
        * maint/ioctls_sym.sh: Add workaround definitions of
        __no_kasan_or_inline and __no_sanitize_or_inline macros.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: mention --seccomp-bpf in "A traced process runs slowly" bug
        As it is worth mentioning here, probably.

        * strace.1.in (.SH BUGS): Refer to --seccomp-bpf option description in
        "A traced process runs slowly" bug.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        NEWS: provide a Fedora bug number for the --pidns-translation entry.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tee: use types/ directory for the type definitions header.
        Also, switch ioctl_tee test to system header usage, to double-check
        things.

        * tee.h: Rename to...
        * types/tee.h: ...this.  Remove "xlat/tee_ioctl_cmds.h",
        "xlat/tee_ioctl_gen_caps.h", "xlat/tee_ioctl_impl_ids.h",
        "xlat/tee_ioctl_login_types.h", "xlat/tee_ioctl_max_arg_size.h",
        "xlat/tee_ioctl_origins.h", "xlat/tee_ioctl_optee_caps.h",
        "xlat/tee_ioctl_param_attr_types.h", "xlat/tee_ioctl_shm_flags.h"
        includes.  Add header guard.
        [!HAVE_STRUCT_TEE_IOCTL_BUF_DATA, !HAVE_STRUCT_TEE_IOCTL_CANCEL_ARG,
        !HAVE_STRUCT_TEE_IOCTL_CLOSE_SESSION_ARG,
        !HAVE_STRUCT_TEE_IOCTL_SHM_ALLOC_DATA,
        !HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_FD_DATA,
        !HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_DATA,
        !HAVE_STRUCT_TEE_IOCTL_VERSION_DATA, !HAVE_STRUCT_TEE_IOCTL_PARAM,
        !HAVE_STRUCT_TEE_IOCTL_INVOKE_ARG, !HAVE_STRUCT_TEE_IOCL_SUPP_RECV_ARG,
        !HAVE_STRUCT_TEE_IOCL_SUPP_SEND_ARG,
        !HAVE_STRUCT_TEE_IOCTL_OPEN_SESSION_ARG]: Remove ifdefs.
        (struct tee_ioctl_buf_data): Change to...
        (typedef struct_tee_ioctl_buf_data): ...this.
        (struct tee_ioctl_cancel_arg): Change to...
        (typedef struct_tee_ioctl_cancel_arg): ...this.
        (struct tee_ioctl_close_session_arg): Change to...
        (typedef struct_tee_ioctl_close_session_arg): ...this.
        (struct tee_ioctl_shm_alloc_data): Change to...
        (typedef struct_tee_ioctl_shm_alloc_data): ...this.
        (struct tee_ioctl_shm_register_fd_data): Change to...
        (typedef struct_tee_ioctl_shm_register_fd_data): ...this.
        (struct tee_ioctl_shm_register_data): Change to...
        (typedef struct_tee_ioctl_shm_register_data): ...this.
        (struct tee_ioctl_version_data): Change to...
        (typedef struct_tee_ioctl_version_data): ...this.
        (struct tee_ioctl_param): Change to...
        (typedef struct_tee_ioctl_param): ...this.
        (struct tee_ioctl_invoke_arg): Change to...
        (typedef struct_tee_ioctl_invoke_arg): ...this.  Change params field
        type from struct tee_ioctl_param to struct_tee_ioctl_param.
        (struct tee_iocl_supp_recv_arg): Change to...
        (typedef struct_tee_iocl_supp_recv_arg): ...this.  Change params field
        type from struct tee_ioctl_param to struct_tee_ioctl_param.
        (struct tee_iocl_supp_send_arg): Change to...
        (typedef struct_tee_iocl_supp_send_arg): ...this.  Change params field
        type from struct tee_ioctl_param to struct_tee_ioctl_param.
        (struct tee_ioctl_open_session_arg): Change to...
        (typedef struct_tee_ioctl_open_session_arg): ...this.  Change params
        field type from struct tee_ioctl_param to struct_tee_ioctl_param.
        [TEE_IOCTL_PARAM_SIZE]: Move to tee.c.
        * Makefile.am (libstrace_a_SOURCES): Remove tee.h.
        * configure.ac (AC_CHECK_HEADERS([linux/tee.h])): Remove in favour of
        auto-generated checks courtesy of types/tee.h.
        * tee.c: Remove "tee.h" include.  Add "types/tee.h",
        "xlat/tee_ioctl_cmds.h" (under XLAT_MACROS_ONLY definition),
        "xlat/tee_ioctl_gen_caps.h", "xlat/tee_ioctl_impl_ids.h",
        "xlat/tee_ioctl_login_types.h", "xlat/tee_ioctl_max_arg_size.h",
        "xlat/tee_ioctl_origins.h", "xlat/tee_ioctl_optee_caps.h",
        "xlat/tee_ioctl_param_attr_types.h", "xlat/tee_ioctl_shm_flags.h"
        includes.
        [TEE_IOCTL_PARAM_SIZE]: Move from tee.h.
        (tee_print_buf, tee_fetch_buf_data): Change the buf argument type
        from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
        (tee_print_param_fn): Change the param variable type from
        struct tee_ioctl_param to struct_tee_ioctl_param.
        (tee_print_params): Change the param_buffer variable type from
        struct tee_ioctl_param to struct_tee_ioctl_param.
        (tee_version): Change the version variable type from
        struct tee_ioctl_version_data to struct_tee_ioctl_version_data.
        (tee_open_session): Change the buf_data variable type from
        struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
        the open_session variable type from struct tee_ioctl_open_session_arg
        to struct_tee_ioctl_open_session_arg.
        (tee_invoke): Change the buf_data variable type from
        struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
        the invoke variable type from struct tee_ioctl_invoke_arg to
        struct_tee_ioctl_invoke_arg.
        (tee_cancel): Change the cancel variable type from
        struct tee_ioctl_cancel_arg to struct_tee_ioctl_cancel_arg.
        (tee_close_session): Change the close_session variable type from
        struct tee_ioctl_close_session_arg to
        struct_tee_ioctl_close_session_arg.
        (tee_suppl_recv): Change the buf_data variable type from
        struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
        the supp_recv variable type from struct tee_iocl_supp_recv_arg
        to struct_tee_iocl_supp_recv_arg.
        (tee_suppl_send): Change the buf_data variable type from
        struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
        the supp_send variable type from struct tee_iocl_supp_send_arg
        to struct_tee_iocl_supp_send_arg.
        (tee_shm_alloc): Change the shm_alloc variable type from
        struct tee_ioctl_shm_alloc_data to struct_tee_ioctl_shm_alloc_data.
        (tee_shm_register_fd): Change the shm_register_fd variable type from
        struct tee_ioctl_shm_register_fd_data to
        struct_tee_ioctl_shm_register_fd_data.
        (tee_shm_register): Change the shm_register variable type from
        struct tee_ioctl_shm_register_data to
        struct_tee_ioctl_shm_register_data.
        * tests/ioctl_tee.c: Put the contents under HAVE_LINUX_TEE_H ifdef.
        Remove "tee.h" include.  Add <linux/tee.h> include.
        [!TEE_IOCTL_PARAM_ATTR_META] (TEE_IOCTL_PARAM_ATTR_META): New
        definition.
        [!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_FD_DATA] (struct
        tee_ioctl_shm_register_fd_data): New type definition.
        [!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_DATA] (struct
        tee_ioctl_shm_register_data): Likewise.
        [!TEE_IOC_SHM_REGISTER_FD] (TEE_IOC_SHM_REGISTER_FD): New definition.
        [!TEE_IOC_SHM_REGISTER] (TEE_IOC_SHM_REGISTER): Likewise.
        * xlat/tee_ioctl_cmds.in (TEE_IOC_VERSION): Change type in the _IOR
        macro argument from struct tee_ioctl_version_data to
        struct_tee_ioctl_version_data.
        (TEE_IOC_SHM_ALLOC): Change the type in the _IOWR macro argument from
        struct tee_ioctl_shm_alloc_data to struct_tee_ioctl_shm_alloc_data.
        (TEE_IOC_OPEN_SESSION): Change the type in the _IOR macro argument from
        struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
        (TEE_IOC_INVOKE): Change the type in the _IOR macro argument from
        struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
        (TEE_IOC_CANCEL): Change the type in the _IOR macro argument from
        struct tee_ioctl_cancel_arg to struct_tee_ioctl_cancel_arg.
        (TEE_IOC_CLOSE_SESSION): Change the type in the _IOR macro argument
        from struct tee_ioctl_close_session_arg
        to struct_tee_ioctl_close_session_arg.
        (TEE_IOC_SUPPL_RECV): Change the type in the _IOR macro argument
        from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
        (TEE_IOC_SUPPL_SEND): Change the type in the _IOR macro argument
        from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
        (TEE_IOC_SHM_REGISTER_FD): Change the type in the _IOWR macro argument
        from struct tee_ioctl_shm_register_fd_data
        to struct_tee_ioctl_shm_register_fd_data.
        (TEE_IOC_SHM_REGISTER): Change the type in the _IOWR macro argument
        from struct tee_ioctl_shm_register_data
        to struct_tee_ioctl_shm_register_data.

2020-09-23  Elvira Khabirova  <lineprinter0@gmail.com>

        Implement decoding of TEE_* ioctls.
        * tee.c: New file.
        * tee.h: Likewise.
        * Makefile.am (libstrace_a_SOURCES): Add them.
        * configure.ac (AC_CHECK_HEADERS): Add linux/tee.h.
        * defs.h (DECL_IOCTL): Add tee.
        * ioctl.c (ioctl_decode): Add 0xa4 (tee) case.
        * xlat/tee_ioctl_cmds.in: New file.
        * xlat/tee_ioctl_gen_caps.in: Likewise.
        * xlat/tee_ioctl_impl_ids.in: Likewise.
        * xlat/tee_ioctl_login_types.in: Likewise.
        * xlat/tee_ioctl_max_arg_size.in: Likewise.
        * xlat/tee_ioctl_optee_caps.in: Likewise.
        * xlat/tee_ioctl_origins.in: Likewise.
        * xlat/tee_ioctl_param_attr_types.in: Likewise.
        * xlat/tee_ioctl_shm_flags.in: Likewise.
        * tests/gen_tests.in (ioctl_tee): New entry.
        * tests/ioctl_tee.c: New file.
        * tests/.gitignore: Add ioctl_tee.
        * tests/pure_executables.list: Likewise.
        * NEWS: Mention the change.

2020-09-20  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update KVM_* constants.
        * xlat/kvm_cap.in (KVM_CAP_STEAL_TIME): New constant introduced by Linux
        kernel commit v5.9-rc5~6^2~16^2~3.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        semctl: decode struct arguments of IPC_* and SEM_* commands.
        * ipc_semctl.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * ipc_defs.h (NAME_OF_STRUCT_SEMID_DS): New macro.
        * ipc_sem.c: Stop including "xlat/semctl_flags.h".
        (SYS_FUNC(semctl)): Remove.
        * tests/ipc_sem.c (str_ipc_info): New macro.
        (print_semid_ds, print_sem_info): New functions.
        (main): Use them to check decoding IPC_INFO, SEM_INFO, IPC_SET,
        IPC_STAT, SEM_STAT, and SEM_STAT_ANY semctl syscall commands.
        * NEWS: Mention this change.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable shmctl IPC_STAT test with a bogus address on glibc >= 2.32
        Starting with commit glibc-2.32~80, on every 32-bit architecture where
        32-bit time_t support is enabled, glibc tries to retrieve the data
        provided in the third argument of shmctl call.  This results to
        segfaults inside glibc when shmctl is called with a bogus address.

        * tests/ipc_shm.c [GLIBC_PREREQ_GE(2, 32) && __TIMESIZE != 64]
        (TEST_SHMCTL_BOGUS_ADDR): Define to 0.
        (main): Conditionalize on TEST_SHMCTL_BOGUS_ADDR the shmctl IPC_STAT
        invocation with a bogus address.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        shmctl: decode some commands on entering syscall.
        * ipc_shmctl.c (SYS_FUNC(shmctl)): Handle all commands except IPC_INFO,
        IPC_STAT, SHM_INFO, SHM_STAT, and SHM_STAT_ANY on entering syscall.

        shmctl: decode struct shminfo argument of IPC_INFO command.
        * ipc_defs.h (NAME_OF_STRUCT_SHMINFO): New macro.
        * ipc_shmctl.c (struct_shm_ipc_info_t): New typedef.  Mpersify it.
        (print_ipc_info): New function.
        (SYS_FUNC(shmctl)): Use it to decode struct shminfo argument
        of IPC_INFO command.
        * tests/ipc_shm.c (str_ipc_info): New macro.
        (print_ipc_info): New function.
        (main): Use it to check decoding of IPC_INFO command.
        * NEWS: Mention this change.

        shmctl: decode struct shm_info argument of SHM_INFO command.
        * ipc_shmctl.c (struct_shm_info_t): New typedef.  Mpersify it.
        (print_shm_info): New function.
        (SYS_FUNC(shmctl)): Use it to decode struct shm_info argument
        of SHM_INFO command.
        * tests/ipc_shm.c (print_shm_info): New function.
        (main): Use it to check decoding of SHM_INFO command.
        * NEWS: Mention this change.

        shmctl: fix printing of struct shmid_ds argument of IPC_SET command.
        * ipc_shmctl.c (print_shmid_ds) <cmd == IPC_SET>: Do not print
        misleading ellipsis.
        * tests/ipc_shm.c (main): Update expected output.

        shmctl: decode struct shmid_ds argument of SHM_STAT and SHM_STAT_ANY commands
        * ipc_shmctl.c (print_shmid_ds): Handle SHM_STAT and SHM_STAT_ANY.
        * tests/ipc_shm.c (print_shmid_ds): New function.
        (main): Use it to update expected output.
        * NEWS: Mention this change.

        shmctl: consistently use macros from print_fields.h.
        * ipc_shmctl.c (key): Define.
        (print_shmid_ds): Use PRINT_FIELD_U instead of tprintf.

        msgctl: decode some commands on entering syscall.
        * ipc_msgctl.c (SYS_FUNC(msgctl)): Handle all commands except IPC_INFO,
        IPC_STAT, MSG_INFO, MSG_STAT, and MSG_STAT_ANY on entering syscall.

        msgctl: decode struct msginfo argument of IPC_INFO and MSG_INFO commands
        * ipc_msgctl.c (print_msginfo): New function.
        (SYS_FUNC(msgctl)): Use it to decode struct msginfo argument of IPC_INFO
        and MSG_INFO commands.
        * tests/ipc_msg.c (print_msginfo): New function.
        (main): Use it to check decoding of IPC_INFO and MSG_INFO commands.
        * NEWS: Mention this change.

        msgctl: print struct msqid_ds.msg_qbytes of IPC_SET command.
        * ipc_msgctl.c (print_msqid_ds) <cmd == IPC_SET>: Print
        struct msqid_ds.msg_qbytes.
        * tests/ipc_msg.c (main): Update expected output.

        msgctl: decode struct msqid_ds argument of MSG_STAT and MSG_STAT_ANY commands
        * ipc_msgctl.c (print_msqid_ds): Handle MSG_STAT and MSG_STAT_ANY.
        * tests/ipc_msg.c (print_msqid_ds): New function.
        (main): Use it to update expected output.
        * NEWS: Mention this change.

        msgctl: consistently use macros from print_fields.h.
        * ipc_msgctl.c (key): Define.
        (print_msqid_ds): Use PRINT_FIELD_U instead of tprintf.

2020-09-18  Dmitry V. Levin  <ldv@altlinux.org>

        ci: add a git status check.
        * ci/run-build-and-tests.sh: Check that "git status" does not report
        any differences or untracked files.
        [$CHECK == coverage]: Remove ./codecov.bash after use.
        * .gitignore: Add "/travis_wait_*.log".

        .gitignore: ignore files generated by gcov.
        * .gitignore: Add *.gcov.

2020-09-18  Elvira Khabirova  <lineprinter0@gmail.com>

        xlat: fix file descriptor closing typo.
        * xlat/gen.sh (gen_header): Replace 3>- with 3>&-.

        Fixes: v5.7~28 "xlat: generate m4 checks for enumerations"

2020-09-14  Elvira Khabirova  <lineprinter0@gmail.com>

        .gitignore: add missing files that should be ignored.
        ar-lib is an autotools helper script.
        tags, TAGS, cscope.* and ncscope.* are files generated by ctags and cscope,
        source code analysers and navigation tools.

        * .gitignore: Add /ar-lib, /cscope.*, /ncscope.*, /tags and /TAGS.

2020-09-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ipc_msg.c: disable TEST_MSGCTL_BOGUS_ADDR on glibc >= 2.32.
        Starting with commit glibc-2.32~83, on every 32-bit architecture where
        32-bit time_t support is enabled, glibc tries to retrieve the data
        provided in the third argument of msgctl call.  This results to
        segfaults inside glibc if TEST_MSGCTL_BOGUS_ADDR is enabled.

        * tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 32) && __TIMESIZE != 64]
        (TEST_MSGCTL_BOGUS_ADDR): Define to 0.

        Reported-by: Ruinland ChuanTzu Tsai <ruinland@andestech.com>

2020-09-12  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce GLIBC_PREREQ_GE and GLIBC_PREREQ_LT macros.
        * gcc_compat.h (GLIBC_PREREQ_GE, GLIBC_PREREQ_LT): New macros.
        * tests/ipc_msg.c: Use GLIBC_PREREQ_LT instead of manual checking
        for __GLIBC__ and __GLIBC_MINOR__.
        * tests/readahead.c: Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

        ci: re-enable testing with the latest mainline kernel headers.
        There should be no issues with v5.9-rc4.
        This reverts commit 1c84f0b04d0fd8d37afd29a4c959fb8c863bcfdb.

        * .github/workflows/ci.yml (env): Remove KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

        types/v4l2.h: update definition of struct_v4l2_create_buffers.
        * types/v4l2.h (struct_v4l2_create_buffers): Add "flags" field and
        update "reserved" field to sync with changes introduced by Linux kernel
        commit v5.9-rc1~94^2~295.

        xlat: update V4L2_FMT_FLAG_* constants.
        * xlat/v4l2_format_description_flags.in
        (V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL): New constant introduced by Linux
        kernel commit v5.9-rc1~94^2~283.
        * NEWS: Mention this change.
        * tests/ioctl_v4l2-success.c (fmtdesc_flags): Update expected output.

        xlat: update RTPROT_* constants.
        * xlat/routing_protocols.in (RTPROT_KEEPALIVED): New constant introduced
        by Linux kernel commit v5.9-rc1~133^2~449.
        * NEWS: Mention this change.

        xlat: update PTP_PEROUT_* constants.
        * xlat/rtnl_neigh_attrs.in (PTP_PEROUT_DUTY_CYCLE): New constant
        introduced by Linux kernel commit v5.9-rc1~133^2~199^2~2.
        (PTP_PEROUT_PHASE): New constant introduced by Linux kernel commit
        v5.9-rc1~133^2~199^2~1.
        * NEWS: Mention this change.

        xlat: update NDA_* constants.
        * xlat/rtnl_neigh_attrs.in (NDA_FDB_EXT_ATTRS): New constant introduced
        by Linux kernel commit v5.9-rc1~133^2~430^2~2.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * xlat/kvm_cap.in (KVM_CAP_LAST_CPU): New constant introduced by Linux
        kernel commit v5.9-rc1~121^2~108.
        (KVM_CAP_SMALLER_MAXPHYADDR): New constant introduced by Linux kernel
        commit v5.9-rc1~121^2~15.
        (KVM_CAP_S390_DIAG318): New constant introduced by Linux kernel commit
        v5.9-rc1~121^2^2.
        * NEWS: Mention this change.

        xlat: update IORING_FEAT_* constants.
        * xlat/uring_setup_features.in (IORING_FEAT_POLL_32BITS): New constant
        introduced by Linux kernel commit v5.9-rc1~212^2~116.
        * NEWS: Mention this change.

        xlat: update INET_DIAG_REQ_* constants.
        * linux/inet_diag.h (INET_DIAG_REQ_SK_BPF_STORAGES): New constant
        introduced by Linux kernel commit v5.7-rc1~146^2~287^2^2.
        (INET_DIAG_REQ_PROTOCOL): New constant introduced by Linux kernel commit
        v5.9-rc1~133^2~292^2~3.
        * xlat/inet_diag_req_attrs.in: Likewise.
        * NEWS: Mention this change.

        xlat: update IFLA_* constants.
        * xlat/rtnl_link_attrs.in (IFLA_PROTO_DOWN_REASON): New constant
        introduced by Linux kernel commit v5.9-rc1~133^2~77.
        * NEWS: Mention this change.

        xlat: update IPV6_* constants.
        * xlat/sock_ip_options.in (IPV6_RECVERR_RFC4884): New constant
        introduced by Linux kernel commit v5.9-rc1~133^2~130^2.
        * NEWS: Mention this change.

        xlat: update IP_* constants.
        * xlat/sock_ip_options.in (IP_RECVERR_RFC4884): New constant introduced
        by Linux kernel commit v5.9-rc1~133^2~200.
        * NEWS: Mention this change.

        xlat: update FAN_* constants.
        * xlat/fan_init_flags.in (FAN_REPORT_DIR_FID): New constant introduced
        by Linux kernel commit v5.9-rc1~110^2~6.
        (FAN_REPORT_NAME): New constant introduced by Linux kernel commit
        v5.9-rc1~110^2~4.
        * NEWS: Mention this change.
        * tests/fanotify_init.c (main): Update expected output.

        xlat: update CAP_* constants.
        * caps1.h (CAP_CHECKPOINT_RESTORE): New constant introduced
        by Linux kernel commit v5.9-rc1~161^2~6.
        * xlat/cap.in (CAP_CHECKPOINT_RESTORE): Likewise.
        * xlat/cap_mask1.in (1<<CAP_CHECKPOINT_RESTORE): Likewise.
        * NEWS: Mention this change.
        * tests/caps.awk: Update expected output.
        * tests/caps-abbrev.awk: Likewise.

        xlat: update BPF_* constants.
        * xlat/bpf_attach_type.in (BPF_CGROUP_INET_SOCK_RELEASE): New constant
        introduced by Linux kernel commit v5.9-rc1~133^2~259^2~18.
        (BPF_XDP_CPUMAP): New constant introduced by Linux kernel commit
        v5.9-rc1~133^2~164^2~22.
        (BPF_SK_LOOKUP): New constant introduced by Linux kernel commit
        v5.9-rc1~133^2~164^2~14^2~13.
        (BPF_XDP): New constant introduced by Linux kernel commit
        v5.9-rc1~133^2~23^2~28^2~5.
        * xlat/bpf_commands.in (BPF_LINK_DETACH): New constant introduced
        by Linux kernel commit v5.9-rc1~133^2~23^2~6^2~4.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_LOOKUP): New constant
        introduced by Linux kernel commit v5.9-rc1~133^2~164^2~14^2~13.
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of close_range syscall.
        Introduced by Linux kernel commit v5.9-rc1~160.

        * close_range.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/close_range.h.
        * xlat/close_range_flags.in: New file.
        * pathtrace.c (pathtrace_match_set): Handle SEN_close_range.
        * linux/syscallent-common.h [BASE_NR + 436]: Wire up close_range.
        * NEWS: Mention this change.
        * tests/close_range.c: New file.
        * tests/close_range-P.c: Likewise.
        * tests/close_range-y.c: Likewise.
        * tests/close_range-yy.c: Likewise.
        * tests/gen_tests.in (close_range. close_range-P, close_range-y,
        close_range-yy): New entries.
        * tests/pure_executables.list: Add close_range, close_range-P,
        close_range-y, and close_range-yy.
        * tests/.gitignore: Likewise.

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: reduce looping_threads iteration duration to 1/16th of TIMEOUT_DURATION
        * tests/looping_threads.test (timeout_8): Rename to...
        (timeout_16): ...this, reduce value by half.
        Use $timeout_16 instead of $timeout_8.

        Complements: v5.7~4 "tests: increase default TIMEOUT_DURATION"

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Tom Stellard  <tstellar@redhat.com>

        strace.spec.in: use %make_build/%make_install macros.
        As suggested in [1][2].

        [1] https://src.fedoraproject.org/fork/tstellar/rpms/strace/c/c7358b588cb5f2893dec3b7daa84e63d9389773a.patch
        [2] https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro

        * strace.spec.in [?!__make] (%__make): New definition.
        [?!__install] (%__install): Likewise.
        [?!make_build] (%make_build): Likewise.
        [?!make_install] (%make_install): Likewise.
        (%build, %check): Use %make_build.
        (%install): Use %make_install.

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mpers_test.sh: check proper handling of sized integer types.
        The commit v5.6~62 ("v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl
        commands") unraveled a possibility of buggy handling of sized integer
        types in some libc implementations[1][2].  Add checks for these types
        to mpers_test.sh to catch such issues early.

        [1] https://strace.io/logs/strace/2020-04-22#17477;
        [2] https://lists.strace.io/pipermail/strace-devel/2020-August/010213.html

        * mpers_test.sh: Add checks for (u)int{8,16,32,64}_t types.

        Complements: v5.6~62 "v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands"

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Add tests for PID namespace translation.
        * Makefile.am (CODE_COVERAGE_IGNORE_PATTERN): Add test directories.
        * tests/.gitignore: Add new test executables.
        * tests/Makefile.am (check_PROGRAMS): Add new test executables.
        (DECODER_TESTS) Add new test files.
        (libtests_a_SOURCES): Add trie_for_tests.c, xmalloc_for_tests.c.
        * tests/gen_tests.in: Add new tests.
        * tests/trie_test.c: New file.
        * tests/trie_for_tests.c: New file.
        * tests/xmalloc_for_tests.c: New file.
        * tests/pidns-cache.c: New file.
        * tests/pidns-cache.test: New file.
        * tests/fcntl--pidns-translation.c: New file.
        * tests/fcntl64--pidns-translation.c: New file.
        * tests/fork--pidns-translation.awk: New file.
        * tests/fork--pidns-translation.c: New file.
        * tests/fork--pidns-translation.test: New file.
        * tests/getpgrp--pidns-translation.c: New file.
        * tests/getpid--pidns-translation.c: New file.
        * tests/getsid--pidns-translation.c: New file.
        * tests/gettid--pidns-translation.c: New file.
        * tests/gettid--pidns-translation.test: New file.
        * tests/ioctl_block--pidns-translation.c: New file.
        * tests/ioctl_block--pidns-translation.test: New file.
        * tests/ioprio--pidns-translation.c: New file.
        * tests/kill--pidns-translation.c: New file.
        * tests/migrate_pages--pidns-translation.c: New file.
        * tests/move_pages--pidns-translation.c: New file.
        * tests/net-sockaddr--pidns-translation.c: New file.
        * tests/netlink_audit--pidns-translation.c: New file.
        * tests/netlink_audit--pidns-translation.test: New file.
        * tests/pidfd_open--pidns-translation.c: New file.
        * tests/pidfd_send_signal--pidns-translation.c: New file.
        * tests/prlimit64--pidns-translation.c: New file.
        * tests/process_vm_readv--pidns-translation.c: New file.
        * tests/process_vm_writev--pidns-translation.c: New file.
        * tests/rt_sigqueueinfo--pidns-translation.c: New file.
        * tests/rt_tgsigqueueinfo--pidns-translation.c: New file.
        * tests/sched_xetaffinity--pidns-translation.c: New file.
        * tests/sched_xetattr--pidns-translation.c: New file.
        * tests/sched_xetparam--pidns-translation.c: New file.
        * tests/sched_xetscheduler--pidns-translation.c: New file.
        * tests/signal_receive--pidns-translation.c: New file.
        * tests/so_peercred--pidns-translation.c: New file.
        * tests/tkill--pidns-translation.c: New file.
        * tests/tgkill--pidns-translation.c: New file.
        * tests/xet_robust_list--pidns-translation.c: New file.
        * tests/xetpgid--pidns-translation.c: New file.
        * tests/xetpriority--pidns-translation.c: New file.
        * tests/fcntl-common.c: Print PID translation string after PIDs.
        * tests/fcntl.c: Likewise.
        * tests/fcntl64.c: Likewise.
        * tests/getpgrp.c: Likewise.
        * tests/getpid.c: Likewise.
        * tests/getsid.c: Likewise.
        * tests/gettid.c: Likewise.
        * tests/ioctl_block.c: Likewise.
        * tests/ioprio.c: Likewise.
        * tests/kcmp.c: Likewise.
        * tests/kill.c: Likewise.
        * tests/migrate_pages.c: Likewise.
        * tests/move_pages.c: Likewise.
        * tests/net-sockaddr.c: Likewise.
        * tests/netlink_audit.c: Likewise.
        * tests/pidfd_open.c: Likewise.
        * tests/pidfd_send_signal.c: Likewise.
        * tests/prlimit64.c: Likewise.
        * tests/process_vm_readv_writev.c: Likewise.
        * tests/rt_sigqueueinfo.c: Likewise.
        * tests/rt_tgsigqueueinfo.c: Likewise.
        * tests/sched_xetaffinity.c: Likewise.
        * tests/sched_xetattr.c: Likewise.
        * tests/sched_xetparam.c: Likewise.
        * tests/sched_xetscheduler.c: Likewise.
        * tests/signal_receive.c: Likewise.
        * tests/so_peercred.c: Likewise.
        * tests/tgkill.c: Likewise.
        * tests/tkill.c: Likewise.
        * tests/xet_robust_list.c: Likewise.
        * tests/xetpgid.c: Likewise.
        * tests/xetpriority.c: Likewise.

        Implement testing framework for pidns.
        * tests/pidns.c: New file.
        * tests/pidns.h: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add pidns.c, pidns.h.
        * tests/init.sh (test_pidns, test_pidns_run_strace): New functions.

        Use get_proc_pid for /proc paths.
        * mmap_cache.c (mmap_cache_rebuild_if_invalid): Use proc pid instead of
        tcp->pid for /proc path.
        * util.c (getfdproto): Likewise.
        (pidfd_get_pid): Likewise.
        * pathtrace.c (getfdpath_pid): Likewise.
        * strace.c (attach_tcb): Likewise.

        Use printpid in decoders.
        * getpid.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * linux/dummy.h (sys_getpid, sys_getppid, sys_gettid,
        sys_setpgid, sys_setpgrp): Remove.
        * util.c (printfd_pid_tracee_ns): Implement using translate_pid.
        * defs.h (printnum_pid): New function definition.
        (printfd_pid_tracee_ns): Update documentation
        * util.c: (printnum_pid): New function.
        * print_fields.h (PRINT_FIELD_TID): New macro.
        (PRINT_FIELD_TGID): Likewise.
        (PRINT_FIELD_PGID): Likewise.
        (PRINT_FIELD_SID): Likewise.
        * affinity.c: Print PIDs with printpid.
        * block.c: Likewise.
        * bpf.c: Likewise.
        * capability.c: Likewise.
        * clone.c: Likewise.
        * fcntl.c: Likewise.
        * get_robust_list.c: Likewise.
        * ioprio.c: Likewise.
        * kcmp.c: Likewise.
        * msghdr.c: Likewise.
        * net.c: Likewise.
        * netlink.c: Likewise.
        * numa.c: Likewise.
        * pidfd_open.c: Likewise.
        * printsiginfo.c: Likewise.
        * process.c: Likewise.
        * process_vm.c: Likewise.
        * resource.c: Likewise.
        * sched.c: Likewise.
        * signal.c: Likewise.
        * sockaddr.c: Likewise.
        * wait.c: Likewise.
        * kcmp.c (SYS_FUNC(kcmp)): Fix KCMP_FILE pid arguments.
        * tests/kcmp.c (printpidfd): Print path if VERBOSE_FD.
        (main): Use our real pid if real fds are used.

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        PID namespace translation support.
        * defs.h (pidns_translation): New variable.
        (tcb): Add pid_ns field.
        (RVAL_MASK): Change value from 013 to 017.
        (RVAL_TID, RVAL_SID, RVAL_TGID, RVAL_PGID): New definitions.
        (pid_type): New enum.
        (pidns_init, translate_pid, get_proc_pid, printpid, printpid_tgid_pgid):
        New function declarations.
        * largefile_wrappers.h (fstat_fd): New macro.
        * pidns.c: New file.
        * trie.c: New file.
        * trie.h: New file.
        * Makefile.am (libstrace_a_SOURCES): Add trie.c, trie.h, pidns.c.
        * strace.c (pidns_translation): New variable.
        (init): Add --pidns-translation option.
        * syscall.c (syscall_exiting_trace): Handle RVAL_* return values.
        * NEWS: Mention this.
        * strace.1.in: Add description for new option.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        tests/mknod.c: add workaround for ppc bug in travis.
        On ppc travis builds syscall(mknod) sometimes does not fail with EEXISTS
        as expected, but returns successfully. This commit uses sprintrc for
        errno printing, which handles successful return values too.

        * tests/mknod.c (main): Use sprintrc for printing errno.

2020-08-21  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: check -n/--syscall-number option.
        * tests/strace-n.c: New file.
        * tests/gen_tests.in (strace-n): New entry.
        * tests/pure_executables.list: Add strace-n.
        * tests/.gitignore: Likewise.

        strace: add an option for printing syscall numbers.
        * print_syscall_number.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * defs.h (struct tcb): Add true_scno field.
        (print_syscall_number): New function declaration.
        * strace.c: Add -n/--syscall-number option.
        (printleader): Call print_syscall_number.
        * syscall.c (get_scno): Assign tcp->true_scno.
        * tests/options-syntax.test: Check with -c/--summary-only.
        * strace.1.in: Document new option.
        * NEWS: Mention the new option.

2020-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.8-1.
        * strace.spec.in: Likewise.

        Prepare for 5.8 release.
        * NEWS: Update for 5.8 release.

2020-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use kernel headers from Linux kernel v5.8.
        When Linux kernel merge window opens, changes of all sorts start to pour
        down, breaking UAPI in various ways.  This does not work for strace,
        we need a stable UAPI.

        * .github/workflows/ci.yml (env): Add KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2020-08-03  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2020-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of tgkill syscall.
        * tests/tgkill.c: New file.
        * tests/gen_tests.in (tgkill): New entry.
        * tests/pure_executables.list: Add tgkill.
        * tests/.gitignore: Likewise.

        tests: check decoding of tkill syscall.
        * tests/tkill.c: New file.
        * tests/gen_tests.in (tkill): New entry.
        * tests/pure_executables.list: Add tkill.
        * tests/.gitignore: Likewise.

2020-08-01  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Introduce SYS_FUNC(tkill)
        This is going to be needed to implement pidns support
        in tkill syscall decoder.

        syscallent*.h files are updated automatically by:
          git grep -l 'SEN(kill).*"tkill"' |
          xargs sed -i '/"tkill"/ s/SEN(kill)/SEN(tkill)/'

        * signal.c (SYS_FUNC(tkill)): New syscall decoder.
        * linux/32/syscallent.h: Use SEN(tkill) for "tkill" syscall.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2020-08-01  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Add "struct tcb *" parameters to various functions.
        This is going to be needed to implement pidns support.

        * defs.h (print_sockaddr): Add a "struct tcb *" parameter.
        * printsiginfo.h (printsiginfo): Likewise.
        * fcntl.c (print_struct_flock64): Likewise.  All callers updated.
        * print_fields.h (PRINT_FIELD_SOCKADDR): Likewise.   All callers updated.
        * printsiginfo.c (printsigsource, print_si_info, printsiginfo): Likewise.
        All callers updated.
        * sockaddr.c (print_sockaddr_data_un, print_sockaddr_data_in,
        print_sockaddr_data_in6, print_sockaddr_data_ax25,
        print_sockaddr_data_ipx, print_sockaddr_data_x25,
        print_sockaddr_data_nl, print_sockaddr_data_ll,
        print_sockaddr_data_bt, sockaddr_printer, print_sockaddr): Likewise.
        All callers updated.

2020-07-30  Dmitry V. Levin  <ldv@altlinux.org>

        Use tprints instead of tprintf in a few more places.
        * bpf.c (BPF_PROG_LOAD, BPF_OBJ_PIN, BPF_OBJ_GET_INFO_BY_FD,
        BPF_RAW_TRACEPOINT_OPEN, BPF_TASK_FD_QUERY, BPF_MAP_LOOKUP_BATCH,
        BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH): Replace tprintf
        with tprints for printing strings without format specifiers.
        * btrfs.c (btrfs_ioctl): Likewise.
        * ioctl.c (evdev_decode_number): Likewise.
        * perf_ioctl.c (perf_ioctl): Likewise.
        * rtnl_addr.c (decode_ifa_cacheinfo): Likewise.
        * v4l2.c (print_v4l2_capability, print_v4l2_requestbuffers,
        print_v4l2_streamparm): Likewise.

2020-07-24  Janosch Frank  <frankja@linux.ibm.com>

        s390x: sthyi: Fix section size requirement and error.
        Some old z/VM instances report only 40 bytes for the partition
        section, as they don't report the last three struct members.

        Let's lower the size check of that section to 40 to accommodate them.

        Also we expect a section to be at least x bytes, so we should make
        that clear in the error message.

        Reviewed-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2020-07-21  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Remove tcb parameter of read_int_from_file.
        * defs.h (read_int_from_file): Remove tcb parameter.
        * util.c (read_int_from_file): Likewise.
        * msghdr.c (get_optmem_max): Remove tcb parameter of read_int_from_file.

2020-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently print process ids as signed integers.
        * block.c (block_ioctl): Print struct_blk_user_trace_setup.pid using
        PRINT_FIELD_D instead of PRINT_FIELD_U.
        * bpf.c (BPF_TASK_FD_QUERY): Print task_fd_query.pid using PRINT_FIELD_D
        instead of PRINT_FIELD_U.
        * ipc_msgctl.c (print_msqid_ds): Print msqid_ds.msg_lspid
        and msqid_ds.msg_lrpid using PRINT_FIELD_D.
        * ipc_shmctl.c (print_shmid_ds): Print shmid_ds.shm_cpid and shm_lpid
        using PRINT_FIELD_D.
        * msghdr.c (print_scm_creds): Print ucred.pid using PRINT_FIELD_D
        instead of PRINT_FIELD_U.
        * netlink.c (print_nlmsghdr): Print nlmsghdr.nlmsg_pid using %d format
        instead of %u.
        * tests/bpf.c (BPF_TASK_FD_QUERY_checks): Update expected output.
        * tests/ioctl_block.c (main): Update expected output.
        * tests/ipc_msg.c (main): Likewise.
        * tests/ipc_shm.c (main): Likewise.
        * tests/net-yy-netlink.c (main): Likewise.
        * tests/netlink_protocol.c (test_nlmsgerr): Likewise.

        Introduce PRINT_FIELD_NUMERIC_UMODE_T.
        * print_fields.h (PRINT_FIELD_NUMERIC_UMODE_T): New macro.
        * ipc_msgctl.c (print_msqid_ds): Use it instead of print_numeric_umode_t.
        * ipc_shmctl.c (print_shmid_ds): Likewise.
        * open.c (print_open_how): Use it instead of print_numeric_ll_umode_t.

        Fix printing of syscall return value in octal mode.
        * defs.h (print_numeric_long_umask): Remove.
        * printmode.c (print_numeric_long_umask): Likewise.
        * syscall.c (syscall_exiting_trace) <case RVAL_OCTAL>: Fix printing
        of tcp->u_rval when sizeof(tcp->u_rval) > sizeof(long) or when
        sizeof(tcp->u_rval) > current_klongsize.

        Rename print_numeric_umode_t_64 to print_numeric_ll_umode_t.
        * printmode.c (print_numeric_umode_t_64): Rename
        to print_numeric_ll_umode_t, change the type of its argument
        to unsigned long long.
        * defs.h: Likewise.
        * open.c (print_open_how): Use print_numeric_ll_umode_t instead of
        print_numeric_umode_t_64.

2020-07-17  Dmitry V. Levin  <ldv@altlinux.org>

        Use PRINT_FIELD_UID instead of printuid where appropriate.
        * ipc_msgctl.c: Include "print_fields.h".
        (print_msqid_ds): Use PRINT_FIELD_UID instead of printuid.
        * ipc_shmctl.c: Include "print_fields.h".
        (print_shmid_ds): Use PRINT_FIELD_UID instead of printuid.
        * statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_UID instead of printuid.

        printsiginfo: fix printing of siginfo_t.si_pid and siginfo_t.si_uid.
        * printsiginfo.c (printsigsource): Print siginfo_t.si_pid using
        PRINT_FIELD_D, print siginfo_t.si_uid using PRINT_FIELD_UID.
        * tests/clone_ptrace.c (main): Update expected output.
        * tests/orphaned_process_group.c (main): Likewise.
        * tests/pidfd_send_signal.c (main): Likewise.
        * tests/ptrace.c (test_peeksiginfo): Likewise.
        * tests/rt_sigqueueinfo.c (main): Likewise.
        * tests/rt_tgsigqueueinfo.c (main): Likewise.
        * tests/siginfo.c (main): Likewise.
        * tests/waitid.c (sprint_siginfo): Likewise.

        statx: use PRINT_FIELD_FLAGS.
        * statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_FLAGS instead of
        printflags.

2020-07-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        kcmp: fix KCMP_FILE decoding.
        * kcmp.c (SYS_FUNC(kcmp)): Fix KCMP_FILE pid arguments.

        Fixes: v4.20~66 ("kcmp: output fds using a separate function")

2020-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        fcntl: use print_fields.h macros.
        * fcntl.c: Include "print_fields.h".
        (print_struct_flock64, print_f_owner_ex): Use PRINT_FIELD_* macros
        from print_fields.h.

        evdev_mpers: use print_fields.h macros.
        * evdev_mpers.c: Include "print_fields.h".
        (decode_envelope, ff_effect_ioctl): Use PRINT_FIELD_* macros
        from print_fields.h.
        * tests/ioctl_evdev.c (print_ffe_common): Update expected output.

2020-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        ustat: use print_fields.h macros.
        * ustat.c: Include "print_fields.h".
        (SYS_FUNC(ustat)): Use PRINT_FIELD_* macros from print_fields.h.

        file_ioctl: use print_fields.h macros.
        * file_ioctl.c: Include "print_fields.h".
        (print_file_dedupe_range_info, print_fiemap_extent, file_ioctl): Use
        PRINT_FIELD_* macros from print_fields.h.

        evdev: use print_fields.h macros.
        * evdev.c (abs_ioctl, keycode_V2_ioctl): Use PRINT_FIELD_* macros
        from print_fields.h.

        evdev: fix formatting of struct input_id.
        * evdev.c (getid_ioctl): Use PRINT_FIELD_U.
        * tests/ioctl_evdev.c (main): Update expected output.

        btrfs: use PRINT_FIELD_X_ARRAY.
        * types/btrfs.h: New file.
        * btrfs.c: Include "types/btrfs.h".
        (btrfs_ioctl): Use struct_btrfs_ioctl_logical_ino_args and
        PRINT_FIELD_X_ARRAY.
        * configure.ac (AC_CHECK_MEMBERS): Remove
        struct btrfs_ioctl_search_args_v2.buf_size and
        struct btrfs_ioctl_logical_ino_args.flags.

2020-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        travis: reintroduce ppc64le and s390x builds.
        Let's give travis another chance.
        This reverts commits 86a53f791ad34a825b8633eb0272d954647ce705
        and 36f32a255db09886f7f9ba08ec712b8742f0c312.

        * .travis.yml (arch: ppc64le, arch: s390x): New entries.

2020-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        README.md: migrate from travis-ci.org to travis-ci.com.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        evdev: fix formatting of struct input_keymap_entry.scancode.
        * evdev.c (keycode_V2_ioctl): Use PRINT_FIELD_X_ARRAY.
        * tests/ioctl_evdev.c (main): Update expected output.

        x86_64/arch_kvm: use PRINT_FIELD_X_ARRAY.
        * linux/x86_64/arch_kvm.c (arch_print_kvm_sregs): Use PRINT_FIELD_X_ARRAY.

        loop: implement decoding of LOOP_CONFIGURE ioctl command.
        * types/loop.h: New file.
        * loop.c: Include it instead of <linux/ioctl.h> and <linux/loop.h>.
        (ecode_loop_config): New function.
        (loop_ioctl): Use it to decode LOOP_CONFIGURE ioctl command.
        * NEWS: Mention this change.
        * tests/ioctl_loop.c: Check it.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        loop: factor out print_loop_info64.
        It is going to be used to implement LOOP_CONFIGURE decoding.

        * loop.c (print_loop_info64): New function.
        (decode_loop_info64): Use it.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        loop: use print_fields.h macros.
        * loop.c (decode_loop_info, decode_loop_info64): Use PRINT_FIELD_*
        macros from print_fields.h.

        print_fields: introduce PRINT_FIELD_U_ARRAY and PRINT_FIELD_X_ARRAY.
        * print_fields.h: Include "static_assert.h".
        (PRINT_FIELD_UINT_ARRAY, PRINT_FIELD_U_ARRAY, PRINT_FIELD_X_ARRAY):
        New macros.
        (PRINT_FIELD_COOKIE): Rewrite using PRINT_FIELD_U_ARRAY.

2020-07-06  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.8.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.8-rc4
        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/powerpc/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.
        * tests/ioctl_loop.c (main): Update.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of faccessat2 syscall.
        Introduced by Linux kernel commit v5.8-rc1~203^2.

        * xlat/faccessat_flags.in: New file.
        * access.c: Include "xlat/faccessat_flags.h".
        (decode_access): Change return type to void.
        (SYS_FUNC(access)): Return RVAL_DECODED.
        (decode_faccessat): New function.
        (SYS_FUNC(faccessat)): Use it.
        (SYS_FUNC(faccessat2)): New function.
        * pathtrace.c (pathtrace_match_set): Handle SEN_faccessat2.
        * linux/syscallent-common.h [BASE_NR + 439]: Wire up faccessat2.
        * NEWS: Mention this change.
        * tests/faccessat2.c: New file.
        * tests/faccessat2-P.c: Likewise.
        * tests/faccessat2-y.c: Likewise.
        * tests/faccessat2-yy.c: Likewise.
        * tests/faccessat2.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add faccessat2.test.
        * tests/gen_tests.in (faccessat2-P, faccessat2-y, faccessat2-yy): New
        entries.
        * tests/pure_executables.list: Add faccessat2, faccessat2-P,
        faccessat2-y, and faccessat2-yy.
        * tests/.gitignore: Likewise.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename access_flags to access_modes.
        Since faccessat2 syscall has both "mode" and "flags" arguments,
        rename access_flags to access_modes to avoid confusion.

        * xlat/access_flags.in: Rename to ...
        * xlat/access_modes.in: ... this file, add fallback definitions.
        (EFF_ONLY_OK, EX_OK): Remove non-Linux constants.
        * access.c: Include "xlat/access_modes.h" instead of
        "xlat/access_flags.h".
        (decode_access): Replace access_flags woth access_modes.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of faccessat syscall in -P, -y, and -yy modes.
        * tests/faccessat.c: Rewrite.
        * tests/faccessat-P.c: New file.
        * tests/faccessat-y.c: Likewise.
        * tests/faccessat-yy.c: Likewise.
        * tests/faccessat.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add faccessat.test.
        * tests/gen_tests.in (faccessat): Remove.
        (faccessat-P, faccessat-y, faccessat-yy): New entries.
        * tests/pure_executables.list: Add faccessat-P, faccessat-y,
        and faccessat-yy.
        * tests/.gitignore: Likewise.

2020-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update BPF_* constants.
        * xlat/bpf_attach_type.in (BPF_TRACE_ITER): New constant introduced
        by Linux kernel commit v5.8-rc1~165^2~185^2~16^2~19.
        (BPF_CGROUP_INET4_GETPEERNAME, BPF_CGROUP_INET6_GETPEERNAME,
        BPF_CGROUP_INET4_GETSOCKNAME, BPF_CGROUP_INET6_GETSOCKNAME): New
        constants introduced by Linux kernel commit v5.8-rc1~165^2~130^2~8^2~3.`
        (BPF_XDP_DEVMAP): New constant introduced by Linux kernel commit
        v5.8-rc1~165^2~6^2~9^2~3.
        * xlat/bpf_commands.in (BPF_LINK_GET_FD_BY_ID, BPF_LINK_GET_NEXT_ID):
        New constants introduced by Linux kernel commit
        v5.8-rc1~165^2~343^2~16^2~7.
        (BPF_ENABLE_STATS): New constant introduced by Linux kernel commit
        v5.8-rc1~165^2~343^2~3^2~2.
        (BPF_ITER_CREATE): New constant introduced by Linux kernel commit
        v5.8-rc1~165^2~185^2~16^2~15.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_RINGBUF): New constant introduced
        by Linux kernel commit v5.8-rc1~165^2~6^2~12^2~4.
        * NEWS: Mention this change.
        * tests/bpf.c: Update.

2020-06-29  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        .gitignore: add missing files that should be ignored.
        * .gitignore: Add .dirstamp.
        * tests/.gitignore: Add setpgrp-exec and stack-fcall-attach.

2020-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update STATX_* constants.
        * xlat/statx_attrs.in (STATX_ATTR_MOUNT_ROOT): New constant introduced
        by Linux kernel commit v5.8-rc1~203^2~4.
        * xlat/statx_masks.in (STATX_MNT_ID): New constant introduced by Linux
        kernel commit v5.8-rc1~203^2~5.
        * NEWS: Mention this change.
        * tests/xstatx.c (main): Update expected output.

        xlat: update TCA_* constants.
        * xlat/rtnl_tc_attrs.in (TCA_DUMP_FLAGS): New constant introduced
        by Linux kernel commit v5.8-rc1~165^2~183^2~3.
        * rtnl_tc.c (tcmsg_nla_decoders): Add TCA_DUMP_FLAGS.
        * NEWS: Mention this change.

        xlat: update RTC_* constants.
        * xlat/rtc_vl_flags.in (RTC_VL_BACKUP_SWITCH): New constant introduced
        by Linux kernel commit v5.8-rc1~100^2~23.
        * NEWS: Mention this change.

2020-06-28  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update NDA_* constants.
        * xlat/rtnl_neigh_attrs.in (NDA_NH_ID): New constant introduced by Linux
        kernel commit v5.8-rc1~165^2~141^2~3.
        * rtnl_neigh.c (ndmsg_nla_decoders): Add NDA_NH_ID.
        * NEWS: Mention this change.

        xlat: update *_MAGIC constants.
        * xlat/fsmagic.in (DEVMEM_MAGIC): New constant introduced by Linux
        kernel commit v5.8-rc1~104^2~8.
        * NEWS: Mention this change.

        xlat: update LOOP_* constants.
        * xlat/loop_cmds.in (LOOP_CONFIGURE): New constant introduced by Linux
        kernel commit v5.8-rc1~191^2~11.
        * NEWS: Mention this change.

        xlat: update KVM_* constants.
        * xlat/kvm_cap.in (KVM_CAP_HALT_POLL): New constant introduced by Linux
        kernel commit v5.8-rc1~168^2~136.
        (KVM_CAP_ASYNC_PF_INT): New constant introduced by Linux kernel commit
        v5.8-rc1~168^2~14.
        * NEWS: Mention this change.

        xlat: update KEYCTL_* constants.
        * xlat/keyctl_commands.in (KEYCTL_WATCH_KEY): New constant introduced
        by Linux kernel commit v5.8-rc1~22^2~6.
        * xlat/keyctl_caps1.in (KEYCTL_CAPS1_NOTIFICATIONS): Likewise.
        * NEWS: Mention this change.

        xlat: update IORING_* constants.
        * xlat/uring_ops.in (IORING_OP_TEE): New constant introduced by Linux
        kernel commit v5.8-rc1~190^2~14.
        * tests/io_uring_register.c: Update expected output.

        xlat: update INET_DIAG_* constants.
        * linux/inet_diag.h (INET_DIAG_MD5SIG): New constant introduced
        by Linux kernel commit v4.14-rc1~130^2~39^2.
        (INET_DIAG_ULP_INFO): New constant introduced by Linux kernel commit
        v5.4-rc1~131^2~103^2~1.
        (INET_DIAG_SK_BPF_STORAGES): New constant introduced by Linux kernel
        commit v5.7-rc1~146^2~287^2^2.
        (INET_DIAG_CGROUP_ID): New constant introduced by Linux kernel commit
        v5.8-rc1~165^2~383^2~1.
        (INET_DIAG_BC_CGROUP_COND): New constant introduced by Linux kernel
        commit v5.8-rc1~165^2~383^2.
        * xlat/inet_diag_attrs.in (INET_DIAG_MD5SIG, INET_DIAG_ULP_INFO,
        INET_DIAG_SK_BPF_STORAGES, INET_DIAG_CGROUP_ID): Likewise.
        * xlat/inet_diag_bytecodes.in (INET_DIAG_BC_CGROUP_COND): Likewise.
        * xlat/inet_diag_extended_flags.in (1<<(INET_DIAG_MD5SIG-1),
        1<<(INET_DIAG_ULP_INFO-1), 1<<(INET_DIAG_SK_BPF_STORAGES-1),
        1<<(INET_DIAG_CGROUP_ID-1)): Likewise.
        * NEWS: Mention this change.

        xlat: update ETH_* constants.
        * xlat/ethernet_protocols.in (ETH_P_MRP): New constant introduced
        by Linux kernel commit v5.8-rc1~165^2~412^2~10.
        * NEWS: Mention this change.

        xlat: update CAP_* constants.
        * caps1.h (CAP_PERFMON): New constant introduced by Linux kernel commit
        v5.8-rc1~224^2~14^2~55.
        (CAP_BPF): New constant introduced by Linux kernel commit
        v5.8-rc1~165^2~181^2^2~2.
        * xlat/cap.in (CAP_PERFMON, CAP_BPF): Likewise.
        * xlat/cap_mask1.in (1<<CAP_PERFMON, 1<<CAP_BPF): Likewise.
        * NEWS: Mention this change.
        * tests/caps.awk: Update expected output.
        * tests/caps-abbrev.awk: Likewise.

        xlat: update AUDIT_* constants.
        * xlat/nl_audit_types.in (AUDIT_EVENT_LISTENER): New constant introduced
        by Linux kernel commit v5.8-rc1~188^2~5.
        * NEWS: Mention this change.

2020-06-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround LTO in strace -k tests.
        Link time optimization in gcc 10 became too smart, resulting to most
        of function calls in strace -k tests being optimized out,
        subsequently breaking these tests.

        Make the functions more complex to bypass unwanted side effects
        of link time optimization in strace -k tests.

        * tests/stack-fcall.h: Include <unistd.h> and "scno.h".
        (COMPLEX_BODY): New macro.
        * tests/stack-fcall-0.c (f0): Use it.
        * tests/stack-fcall-1.c (f1): Likewise.
        * tests/stack-fcall-2.c (f2): Likewise.
        * tests/stack-fcall-3.c (f3): Likewise.  Rewrite switch.
        * tests/stack-fcall.c (main): Call f0 in a loop.

2020-06-16  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Modify %process class: trace syscalls associated with process lifecycle.
        The description is rephrased as:
        "Trace system calls associated with process lifecycle
        (creation, exec, termination)."

        kill, tkill, tgkill, pidfd_send_signal and rt_sigqueueinfo are added,
        arch_prctl and unshare are removed from the %process class.

        syscallent*.h files are updated automatically by:
        find linux -name syscallent*.h -exec \
        sed -i -r -e '
            /(arch_prctl|unshare)/ {
                s/(\{[^,]*,\t[^,]*)TP\|/\1/
                s/(\{[^,]*,\t[^,]*)\|TP/\1/
                s/(\{[^,]*,\t[^,]*)TP,/\10,/
            }
        ' -e '
            /(kill|pidfd_send_signal|rt_sigqueueinfo)/ {
                s/(\{[^,]*,\t[^0][^,]*)/\1|TP/
                s/(\{[^,]*,\s*)0/\1TP/
            }
        ' {} +

        [ldv: document this change in NEWS.]

        * strace.1.in: Rephrase %process description.
        * linux/32/syscallent.h: Add TP flag to *kill, pidfd_send_signal and
        rt_sigqueueinfo; remove TP flag from arch_prctl and unshare.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-compat.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/syscallent-common.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * NEWS: Mention this change.

2020-06-16  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        tests/inject-nf.test: replace getpid with geteuid.
        Since we treat PIDs as signed integers, large values (>=2^31) will
        cause overflow when we use printpid.
        UIDs are treated as unsigned integers, so geteuid is a good alternative.
        (getuid would be problematic, as it does not exists on alpha).
        Also, on systems where geteuid32 exists, geteuid returns maximum 16 bit
        values, so we have to use geteuid32 in this case.

        [ldv: geteuid syscall was introduced on Alpha by Linux kernel commit
        v5.1-rc1~160^2~3^2~1, so this test will not work on old Alpha kernels.]

        * tests/inject-nf.c: Replace getpid with either geteuid32 or geteuid.
        [__alpha__]: Remove.
        [__NR_geteuid32]: New condition.
        * tests/inject-nf.test (SYSCALL): Replace getpid with '/^geteuid(32)?$'.
        Remove alpha workaround.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        travis: remove s390x builds.
        They are currently unusable, permanently failing without any reason
        whatsoever.

        * .travis.yml (arch: s390x): Remove.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        ci: re-enable testing with the latest mainline kernel headers.
        There should be no issues with v5.8-rc1.
        This reverts commit 734066585ba865740ab45651bc6e3e8ab249927f.

        * .github/workflows/ci.yml (env): Remove KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2020-06-16  Chris Packham  <chris.packham@alliedtelesis.co.nz>
            Dmitry V. Levin  <ldv@altlinux.org>

        io_uring: Add io_cqring_offset flags.
        Add support for displaying struct io_cqring_offsets.flags introduced
        by Linux kernel commits v5.8-rc1~190^2~22 and v5.8-rc1~190^2~21.

        * types/io_uring.h (struct_io_cqring_offsets): Replace resv array
        with flags, resv1, and resv2 fields.
        * xlat/uring_cqring_flags.in: New file.
        * configure.ac (AC_CHECK_MEMBERS): Check struct io_cqring_offsets.flags.
        * io_uring.c: Include "xlat/uring_cqring_flags.h".
        (SYS_FUNC(io_uring_setup)): Replace printing of the resv array
        of struct io_cqring_offsets with flags, resv1, and resv2 fields.
        * tests/io_uring_setup.c: Check it.

        Resolves: https://github.com/strace/strace/issues/138

2020-06-16  Chris Packham  <chris.packham@alliedtelesis.co.nz>

        io_uring: Remove struct io_cqring_offsets compile time asserts.
        The generated types/check-io_uring.c already checks the kernel's struct
        io_cqring_offsets for compatibility with the strace definition so
        there's no need for manual checks.

        * io_uring.c [HAVE_STRUCT_IO_CQRING_OFFSETS]: Remove static_asserts.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        types: skip field lines that start with comments.
        This allows to exclude certain fields from type checks by placing
        comments at the beginning of the corresponding lines.

        * types/find_last_type_fields.awk: Skip lines starting with spaces
        followed by "/".

2020-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        Add statx syscall to %fstat trace class.
        statx syscall with AT_EMPTY_PATH flag is similar to newfstatat/fstatat64
        syscall with AT_EMPTY_PATH flag.

        * linux/32/syscallent.h (statx): Add TFST flag.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * strace.1.in (.SS Filtering): Document it.
        * NEWS: Mention this fix.
        * tests/trace_fstat.in (statx): New entry.

2020-06-13  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Move ilog* functions from util.c to defs.h.
        * util.c (ILOG2_ITER_, ilog2_klong, ilog2_64, ilog2_32): Move ...
        * defs.h: ... here.

        print_fields.h: add PRINT_FIELD_LEN macro.
        * print_fields.h (PRINT_FIELD_LEN): New macro.
        * net.c: (print_get_linger, print_get_ucred, print_tpacket_stats):
        Rewrite using PRINT_FIELD_LEN.

2020-06-10  Dmitry V. Levin  <ldv@altlinux.org>

        Move make-dist and make-dsc scripts to maint/
        * make-dsc: Rename to maint/make-dsc.
        * make-dist: Rename to maint/make-dist.
        * maint/README-release: Update.
        * dist/INSTALL: Likewise.

2020-06-07  Sven Schnelle  <svens@stackframe.org>

        tests: clone3 might return EBADF with invalid cgroup.
        Both on s390 and x86 linux-5.7 return EBADF when an invalid cgroup
        is supplied, so add that to the list of possible return values.


        * tests/clone3.c (main): Add EBADF to the list of possible
        CLONE_INTO_CGROUP return values.

2020-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use kernel headers from Linux kernel v5.7.
        When Linux kernel merge window opens, changes of all sorts start to pour
        down, breaking UAPI in various ways.  This does not work for strace,
        we need a stable UAPI.

        * .github/workflows/ci.yml (env): Add KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        s390: use a more appropriate regset type.
        * linux/s390/arch_regs.c (s390_regset): Change the type from
        struct user_regs_struct to s390_regs, the latter is the subset of
        struct user_regs_struct used by the kernel, it's also the type
        used on s390x.

2020-06-02  Steve Langasek  <steve.langasek@ubuntu.com>

        tests/perf_event_open: avoid unaligned access on ARM.
        The test suite already handles alignment requirements on POWER and
        Sparc, add ARM to the list as well.  Not all ARM environments raise
        SIGBUS on unaligned access, but some do.

        * tests/perf_event_open.c (ATTR_REC) [ARM]: Use aligned access.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests/wait4: invoke wait4 syscall directly instead of using libc wait4.
        glibc-2.31.9000-312-g600f00b747ff42eb0aa778536d3ef602e8bcd550 introduced
        a change in its wait4 implementation that makes it unsuitable for the
        wait4 test.

        * tests/wait4.c: Include "kernel_rusage.h" instead of <sys/resource.h>.
        (sprint_rusage): Replace struct rusage with kernel_rusage_t,
        cast member values from kernel_long_t to unsigned long long
        using zero_extend_signed_to_ull, update format strings.
        (k_wait4): New function.
        (do_wait4, main): Use it instead of wait4.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.7-1.
        * strace.spec.in: Likewise.

2020-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.7 release.
        * NEWS: Update for 5.7 release.

        .mailmap: add more entries to avoid duplication in CREDITS.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2020-06-01  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.7.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.7
        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/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x32/ioctls_inc0.h: Likewise.
        * NEWS: Mention this.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: increase default TIMEOUT_DURATION.
        * tests/init.sh (TIMEOUT_DURATION): Increase from 600 to 1500.
        * .travis.yml (matrix): Remove TIMEOUT_DURATION.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: robustify linux headers checks.
        Some linux headers used to require other headers to be included
        beforehand.  While these linux headers are no longer insufficient
        nowadays, configure checks need to handle old headers properly.

        * configure.ac (AC_CHECK_TYPES): Include <sys/socket.h> before
        <linux/fib_rules.h>.
        (AC_CHECK_HEADERS): Include <sys/socket.h> and <linux/types.h>
        before linux/if_addr.h, linux/if_link.h, linux/neighbour.h.
        Include <linux/types.h> before other linux headers.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

        Include <linux/types.h> before <linux/fiemap.h> and <linux/hiddev.h>
        <linux/fiemap.h> and <linux/hiddev.h> used to require <linux/types.h>
        to be included beforehand.

        * file_ioctl.c [HAVE_LINUX_FIEMAP_H]: Include <linux/types.h>
        before <linux/fiemap.h>.
        * tests/file_ioctl.c: Likewise.
        * tests/ioctl.c: Include <linux/types.h> before <linux/hiddev.h>.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

        debian/rules: fix build-udeb/Makefile target.
        * debian/rules (build-udeb/Makefile): Rename --without-stacktrace
        to --disable-stacktrace.

2020-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        Turn getfdpath and printfd functions into static inline wrappers.
        * defs.h (printfd): Copy here from util.c, turn into an inline wrapper.
        (getfdpath): Copy here from pathtrace.c, turn into an inline wrapper.
        * pathtrace.c (getfdpath): Remove.
        * util.c (printfd): Remove.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        tests/pidfd_getfd.c: test decoding of targetfd.
        * tests/pidfd_getfd.c (k_pidfd_getfd): Rename pid argument to pidfd.
        (main): Test decoding of targetfd.
        * tests/gen_tests.in: Add "-e signal=none" argument to pidfd_getfd
        tests.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        pidfd_getfd: fix decoder.
        The decoder incorrectly assumed the first argument being a pid,
        but actually it is a pidfd.

        The patch also makes the decoder be able to decode the targetfd
        (-y and -yy options).

        * pidfd_getfd.c: Include "number_set.h".
        (SYS_FUNC(pidfd_getfd)): Rewrite using pidfd_get_pid.

        Fixes: v5.6~46 "Implement pidfd_getfd syscall decoding"

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        util.c: add pidfd_get_pid.
        * defs.h (pidfd_get_pid): New function declaration.
        * utils.c (pidfd_get_pid): New function, returns the pid of a pidfd.
        (printpidfd): Rewrite using pidfd_get_pid.
        (printfd_pid): Change printpidfd arguments.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Rename print_pid_fd to printfd_pid_tracee_ns.
        To avoid confusion with the new printfd_pid fucntion.

        defs.h (print_pid_fd): Rename to printfd_pid_tracee_ns.
        util.c: Likewise.  All users updated.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        util.c: add printfd_pid.
        defs.h (printfd_pid): New function definition.
        util.c (printfd_pid): New function printing the fd of an other process.
        (printfd): Rewritten using printfd_pid.

        pathtrace.c: add getfdpath_pid.
        * defs.h (getfdpath_pid): New function definition.
        * pathtrace.c (getfdpath_pid): New function, returns the path
        associated with fd of the process with pid.
        (getfdpath): Rewrite using getfdpath_pid.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: annotate btrfs_compress_types with #enum.
        * xlat/btrfs_compress_types.in: Add #enum, #include <stdio.h>,
        and #include <linux/btrfs.h>
        * configure.ac (AC_CHECK_DECL(BTRFS_COMPRESS_*)): Remove.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: annotate rtnl_ifla_xdp_attached_mode with #enum.
        And use proper checks in tests/nlattr_ifla_xdp.c.

        * xlat/rtnl_ifla_xdp_attached_mode.in: Add #enum, #include <netinet/in.h>,
        and #include <linux/rtnetlink.h> annotations.
        * tests/nlattr_ifla_xdp.c [!XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE):
        Remove.
        [!XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Remove.
        [!HAVE_DECL_XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE): New enum definition.
        [!HAVE_DECL_XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Likewise.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: support IFLA_XDP_EXPECTED_FD attribute decoding.
        Introduced by Linux commit v5.7-rc1~146^2~10^2~13^2~3.

        * xlat/rtnl_ifla_xdp_attrs.in: Add #enum, #include <netlink/in.h>,
        and #include <linux/rtnetlink.h> annotations.
        (IFLA_XDP_EXPECTED_FD): New constant.
        * rtnl_link.c (ifla_xdp_nla_decoders): Add [IFLA_XDP_EXPECTED_FD], set
        value to decode_nla_fd.
        * tests/nlattr_ifla_xdp-y.c: New file.
        * tests/.gitignore: Add nlattr_ifla_xdp-y.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in: Add nlattr_ifla_xdp-y test.
        * tests/nlattr_ifla_xdp.c: Include "xlat/rtnl_ifla_xdp_attrs.h" under
        XLAT_MACROS_ONLY definition.
        (IFLA_XDP_FD, IFLA_XDP_ATTACHED, IFLA_XDP_PROG_ID, IFLA_XDP_DRV_PROG_ID,
        IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): Remove.
        [!FD9_PATH] (FD9_PATH): New macro, define to empty string.
        (main): Add checks for IFLA_XDP_EXPECTED_FD.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: support -y mode for sockfd printing.
        * tests/test_nlattr.h [!PRINT_SOCK] (PRINT_SOCK): New macro, define to 0.
        (print_sockfd): New function.
        (TEST_NLATTR_EX_): Call print_sockfd for sock fd printing.

        rtnl_tc_action: implement TCA_ACT_HW_STATS and TCA_ACT_USED_HW_STATS decoding
        * xlat/rtnl_tca_act_hw_stats.in: New file.
        * rtnl_tc_action.c: Include "xlat/rtnl_tca_act_hw_stats.h".
        (decode_tca_act_hw_stats): New function.
        (tcamsg_nla_decoders): Add [TCA_ACT_HW_STATS]
        and [TCA_ACT_USED_HW_STATS], set them to decode_tca_act_hw_stats.
        * tests/nlattr_tcamsg.c: Add checks, update expected output.
        * xlat/rtnl_tc_action_attrs.in (TCA_ACT_HW_STATS): New constant,
        introduced by Linux commit v5.7-rc1~146^2~230^2 and renamed in Linux
        commit v5.7-rc1~146^2~101.
        (TCA_ACT_USED_HW_STATS): New constant, introduced by Linux commit
        v5.7-rc1~146^2~25^2.

        xlat: annotate rtnl_tca_stab_attrs with #enum.
        * xlat/rtnl_tca_stab_attrs.in: Add #enum, #include <linux/types.h>,
         #include <linux/pkt_sched.h>.
        * configure.ac (AC_CHECK_DECLS(TCA_STAB_DATA)): Remove.

        xlat: annotate rtnl_tca_stats_attrs with #enum.
        * xlat/rtnl_tca_stats_attrs.in: Add #enum, #include <linux/gen_stats.h>.
        * configure.ac (AC_CHECK_DECL(TCA_STATS_PKT64)): Remove.

        xlat: add #enum to v4l2 xlats.
        * xlat/v4l2_buf_types.in: Add #enum, #include <sys/time.h>, #include
        <linux/ioctl.h>, #include <linux/types.h>, and #include
        <linux/videodev2.h>.
        * xlat/v4l2_colorspaces.in: Likewise.
        * xlat/v4l2_control_types.in: Likewise.
        * xlat/v4l2_fields.in: Likewise.
        * xlat/v4l2_framesize_types.in: Likewise.
        * xlat/v4l2_memories.in: Likewise.
        * xlat/v4l2_tuner_types.in: Likewise.
        * configure.ac (AC_CHECK_DECL(V4L2_*)): Remove.

        xlat: annotate rtnl_link_attrs with #enum.
        * xlat/rtnl_link_attrs.in: Add #enum, #include <sys/socket.h>, #include
        <linux/rtnetlink.h>.
        * configure.ac (AC_CHECK_DECL(IFLA_*)): Remove.

        xlat: annotate rtnl_tc_action_attrs with #enum.
        * xlat/rtnl_tc_action_attrs.in: Add #enum, #include <linux/pkt_cls.h>
        * configure.ac (AC_CHECK_DECL(TCA_ACT_*)): Remove.

        xlat: annotate sysctl xlats with #enum.
        * configure.ac (AC_CHECK_DECL(CTL_* KERN_* NET_* VM_*)): Remove.
        * xlat/sysctl_kern.in: Add #enum, #include <sys/types.h>, #include
        <linux/sysctl.h> descriptors.
        * xlat/sysctl_net.in: Likewise.
        * xlat/sysctl_net_core.in: Likewise.
        * xlat/sysctl_net_ipv4.in: Likewise.
        * xlat/sysctl_net_ipv4_conf.in: Likewise.
        * xlat/sysctl_net_ipv4_route.in: Likewise.
        * xlat/sysctl_net_ipv6.in: Likewise.
        * xlat/sysctl_net_ipv6_route.in: Likewise.
        * xlat/sysctl_net_unix.in: Likewise.
        * xlat/sysctl_root.in: Likewise.
        * xlat/sysctl_vm.in: Likewise.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        configure: annotate waitid_types with #enum.
        This also syncs up the configure checks with the actual list of xlat
        values.

        * xlat/waitid_types.in: Add #enum, #include <sys/types.h>, and #include
        <sys/wait.h>.
        * configure.ac (AC_CHECK_DECL(P_*)): Remove.

        Complements: v5.4~82 "xlat: update waitid_types"

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: mark loop_flags_options as #enum.
        * xlat/loop_flags_options.in: Add #enum and #include <linux/loop.h>
        descriptors.
        * configure.ac (AC_CHECK_DECLS(LO_FLAGS_*)): Remove.

        xlat: generate m4 checks for enumerations.
        * xlat/gen.sh (print_m4_record, gen_m4_entry): New functions.
        (print_xlat_pair): Accept macro name in the third argument.
        (print_xlat, print_xlat_pair): Call print_m4_record.
        (cond_xlat): Pass $m to print_xlat_pair call. Set first_enum to 0.
        (gen_header, gen_make, gen_git): Output the "generating ..." line
        to stderr.
        (gen_header): Get output_m4 as the fourth parameter, redirect fd 3
        to stdout, set enum to 1 if #enum is present and $output_m4 is set,
        append #include argument to includes, generate $output_m4 is $enum
        is set to 1, pass macro name to print_xlat_pair call, close fd 3.
        (gen_git): Add st_check_enums.m4 and "/*.m4".
        (main): Allow passing $output_m4 as the third argument, pass m4 file
        name as the fourth argument to gen_header calls, pipe gen_header output
        to gen_m4_entry in case of no-argument invocation, redirect gen_header
        output to /dev/null in case of single-file invocation.
        * Makefile.am (ACLOCAL_AMFLAGS): Add "-I xlat".
        * configure.ac: Add st_CHECK_ENUMS.

2020-05-30  Pierre Marsais  <pierre.marsais@lse.epita.fr>

        configure.ac: remove unused checks.
        Those unused configure.ac checks were found with the following commands:

        $ ./bootstrap
        $ ./configure
        $ grep '^#undef HAVE' config.h.in | cut -d' ' -f2 | sort >in_configure
        $ find -iname '*.[ch]' -exec ifnames \{\} + | grep ^HAVE | \
          cut -d' ' -f1 | sort >in_source
        $ comm -23 in_configure in_source | grep -vE '^HAVE_(UNION|STRUCT)'

        * configure.ac (AC_CHECK_FUNCS): Remove utimensat, the last user was
        removed by commit 589cff6.  Remove strsignal, the last user was
        removed by commit 2c4fb90.
        (AC_CHECK_HEADERS): Remove sys/conf.h, the last user was removed by
        commit 811bda6.  Remove inttypes.h, the last user was removed by commit
        a6d91de.  Remove stropts.h, the last user was removed by commit a56a81c.
        (AC_CHECK_DECLS): remove P_PPID, P_PGID, P_SID, P_CID, P_UID, P_GID,
        P_ALL, and P_LWPID, the last user was removed by commit 7da9d19.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        maint: remove ioctl duplicates generated from linux/dma-buf.h.
        Starting with commit v5.7-rc4~13^2~2^2~7, linux/dma-buf.h defines
        DMA_BUF_SET_NAME_A and DMA_BUF_SET_NAME_B constants, and
        DMA_BUF_SET_NAME equals to one of them.

        * maint/ioctls_sym.sh: Edit linux/dma-buf.h to omit DMA_BUF_SET_NAME.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        maint: force time64 based definitions in linux/videodev2.h.
        Starting with commit v5.6-rc1~93^2~103, linux/videodev2.h provides either
        time32 or time64 based definitions depending on the flavour provided by
        libc headers.  While media/v4l2-ioctl.h already provides time32 based
        definitions, linux/videodev2.h has to be twisted to force time64 based
        definitions.

        * maint/ioctls_sym.sh: Edit linux/videodev2.h to force time64 based API.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add 1<<_UFFDIO_WRITEPROTECT to uffd_register_ioctl_flags.
        * xlat/uffd_register_ioctl_flags.in (1<<_UFFDIO_WRITEPROTECT): New
        constant introduced by Linux kernel commit v5.7-rc1~58^2~113.

2020-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        Replace struct v4l2_event with a reliable alternative definition.
        Since the definition of struct v4l2_event provided by the kernel depends
        on the flavour of struct timespec provided by libc, we cannot use the
        definition provided by the kernel, neither in the decoder nor in tests.

        * kernel_v4l2_types.h: Include "kernel_timespec.h".
        (kernel_v4l2_event_t): New type.
        * linux/32/ioctls_inc_align16.h (VIDIOC_DQEVENT): Update.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_DQEVENT): Redefine.
        * v4l2.c (kernel_v4l2_event_t): Mpersify.

2020-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: move redefinitions of v4l2_buffer based constants to xlat.
        * kernel_v4l2_types.h: Include "types/v4l2.h".
        * v4l2.c (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF,
        VIDIOC_PREPARE_BUF): Move redefinitions ...
        * xlat/v4l2_ioctl_cmds.in: ... here.
        * tests/ioctl_v4l2.c: Include "xlat/v4l2_ioctl_cmds.h"
        in XLAT_MACROS_ONLY mode.
        (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Remove.
        (main): Check for HAVE_STRUCT_V4L2_FRMSIZEENUM,
        HAVE_STRUCT_V4L2_FRMIVALENUM, and HAVE_STRUCT_V4L2_CREATE_BUFFERS
        instead of VIDIOC_ENUM_FRAMESIZES, VIDIOC_ENUM_FRAMEINTERVALS, and
        VIDIOC_CREATE_BUFS as the latter are always defined now.
        * tests/ioctl_v4l2-success.c: Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

        tests: robustify strace-D.test against personality mismatch issues.
        * tests/print_ppid_tracerpid.c: New file.
        * tests/.gitignore: Add print_ppid_tracerpid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/strace-D.test: Use print_ppid_tracerpid instead of
        "sed -r -n '/^(P|Tracer)Pid:/p' /proc/self/status" to avoid
        unrelated issues caused by potential personality mismatch.

        tests: robustify pc.test against personality mismatch issues.
        * tests/pc.test: Pass --quiet=attach,personality option to strace
        to suppress some unrelated diagnostics that can confuse scripts
        that parse strace output.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        ci: re-enable testing with the latest mainline kernel headers.
        There should be no issues with v5.7-rc7.
        This reverts commit dc6a196f3a83103e8ba21b6809246d37356ffd3d.

        * .github/workflows/ci.yml (env): Remove KBRANCH.
        * .gitlab-ci.yml (variables): Likewise.
        * .travis.yml (env:global): Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        clone: implement decoding of cgroup field in struct clone_args.
        * configure.ac (AC_CHECK_MEMBERS): Check for struct clone_args.cgroup
        instead of struct clone_args.set_tid_size.
        * clone.c (struct strace_clone_args): Add cgroup field.
        (SYS_FUNC(clone3)): Decode cgroup field of struct clone_args introduced
        by Linux kernel commit v5.7-rc1~107^2~9.
        * NEWS: Mention this change.
        * tests/clone3.c: Check HAVE_STRUCT_CLONE_ARGS_CGROUP instead of
        HAVE_STRUCT_CLONE_ARGS_SET_TID_SIZE.
        (struct test_clone_args): Add cgroup field.
        (main): Check decoding of cgroup field.

        xlat: update CLONE_* constants.
        * xlat/clone3_flags.in (CLONE_INTO_CGROUP): New constant, introduced
        by Linux kernel commit v5.7-rc1~107^2~9.
        * NEWS: Mention this.
        * tests/clone3.c (main): Update the expected output.

        x32: workaround syscall(2) limitations in PTRACE_GET_SYSCALL_INFO check.
        * ptrace_syscall_info.c (test_ptrace_get_syscall_info)
        [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]: Cast elements of info.entry.args
        array to (unsigned long).
        * tests/ptrace_syscall_info.c (test_entry): Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: silence compilation warnings in pc.test.
        Silence the following compilation warnings produced by fresh gcc+glibc:

        In file included from pc.c:9:
        pc.c: In function 'main':
        pc.c:30:9: warning: argument 2 is null but the corresponding size argument 3 value is 16 [-Wnonnull]
           30 |  assert(write(-1, NULL, 2 * sizeof(void *)) < 0);
              |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        In file included from pc.c:12:
        /usr/include/unistd.h:367:16: note: in a call to function 'write' declared with attribute 'read_only (2, 3)'
          367 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
              |                ^~~~~

        * tests/pc.c (main): Use 8UL instead of NULL as a marker.
        * tests/pc.test: Update expected output.

2020-05-26  Dmitry V. Levin  <ldv@altlinux.org>

        Replace struct v4l2_buffer with a reliable alternative definition.
        Starting with Linux kernel commit v5.6-rc1~93^2~102, the definition
        of struct v4l2_buffer provided by the kernel depends on the flavour
        of struct timeval provided by libc.  This effectively means that we
        cannot use the definition provided by the kernel, neither in the decoder
        nor in tests.

        * kernel_v4l2_types.h: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * types/v4l2.h (struct_v4l2_buffer): Remove.
        * v4l2.c: Include "kernel_v4l2_types.h".
        Replace struct_v4l2_buffer with kernel_v4l2_buffer_t.
        (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF):
        Redefine.
        (print_v4l2_buffer): Use print_timeval64_data_size to print timestamp
        field.
        * linux/32/ioctls_inc_align16.h (VIDIOC_QUERYBUF, VIDIOC_QBUF,
        VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Update.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_QUERYBUF, VIDIOC_QBUF,
        VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Comment out.
        * tests/ioctl_v4l2.c: Include "kernel_v4l2_types.h".
        (main): Replace struct_v4l2_buffer with kernel_v4l2_buffer_t.
        (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF):
        Redefine.
        * tests/ioctl_v4l2-success.c: Likewise.

        Resolves: https://github.com/strace/strace/issues/133

2020-05-26  Dmitry V. Levin  <ldv@altlinux.org>

        configure: move AM_PROG_AR after AC_USE_SYSTEM_EXTENSIONS.
        This fixes the following autoreconf warning:
        configure.ac:41: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS

        * configure.ac: Move AM_PROG_AR after AC_USE_SYSTEM_EXTENSIONS.

        Fixes: v5.6-65-g81e11a9b8 "configure: check AR variable for 'ar' tool"

2020-05-02  Mike Gilbert  <floppym@gentoo.org>

        configure: check AR variable for 'ar' tool.
        Without this, automake always hardcodes 'AR = ar' in Makefile.in

        Bug: https://bugs.gentoo.org/720712

2020-05-02  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: do not check for perl.
        The last user of this check was removed by commit v4.7~160.

        * configure.ac (AC_PATH_PROG): Remove perl.

        Complements: v4.7~160 "Manual removal of non-Linux source, documentation, etc."

2020-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: fix dladdr check.
        * configure.ac: Check for the library providing dladdr using
        AC_SEARCH_LIBS instead of AC_CHECK_LIB to handle the case when dladdr
        is a part of libc.

2020-04-24  Dmitry V. Levin  <ldv@altlinux.org>

        Rewrite decoders of dup, dup2, and dup3 syscalls.
        * dup.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * desc.c (do_dup2, SYS_FUNC(dup), SYS_FUNC(dup2), SYS_FUNC(dup3)):
        Remove.

        tests: check decoding of dup3 syscall in -y, -yy, and -P modes.
        * tests/dup3.c: Rewrite.
        * tests/dup3-P.c: New file.
        * tests/dup3-y.c: Likewise.
        * tests/dup3-yy.c: Likewise.
        * tests/gen_tests.in (dup3): Add 7>>/dev/full.
        (dup3-P, dup3-y, dup3-yy): New entries.
        * tests/pure_executables.list: Add dup3-P, dup3-y, and dup3-yy.
        * tests/.gitignore: Likewise.

        tests: check decoding of dup2 syscall in -y, -yy, and -P modes.
        * tests/dup2.c: Rewrite.
        * tests/dup2-P.c: New file.
        * tests/dup2-y.c: Likewise.
        * tests/dup2-yy.c: Likewise.
        * tests/gen_tests.in (dup2): Add 9>>/dev/full.
        (dup2-P, dup2-y, dup2-yy): New entries.
        * tests/pure_executables.list: Add dup2-P, dup2-y, and dup2-yy.
        * tests/.gitignore: Likewise.

        tests: check decoding of dup syscall in -y, -yy, and -P modes.
        * tests/dup.c: Rewrite.
        * tests/dup-P.c: New file.
        * tests/dup-y.c: Likewise.
        * tests/dup-yy.c: Likewise.
        * tests/gen_tests.in (dup): Add 9>>/dev/full.
        (dup-P, dup-y, dup-yy): New entries.
        * tests/pure_executables.list: Add dup-P, dup-y, and dup-yy.
        * tests/.gitignore: Likewise.

2020-04-24  Niklas Cathor  <niklas.cathor@gmx.de>

        strace.1: fix description of "open" example.
        * strace.1.in (DESCRIPTION): In the example of "open" syscall with three
        arguments, the rest of the sentence talks about the `flag` and the
        `mode` arguments, not just about the `mode`.

        Resolves: https://gitlab.com/strace/strace/merge_requests/1

2020-04-24  Dmitry V. Levin  <ldv@altlinux.org>

        github: add gcc-10 jobs.
        * .github/workflows/ci.yml (gcc10-x86_64-kheaders, gcc10-x86_64-dw,
        gcc10-x86_64-unwind, gcc10-x32-kheaders, gcc10-x32-nostacktrace,
        gcc10-x86-kheaders, gcc10-x86-nostacktrace): New jobs.

2020-04-23  Maxim Akhmedov  <max42@yandex-team.ru>
            Dmitry V. Levin  <ldv@altlinux.org>

        Implement interval specification in syscall tampering expressions.
        Before this change, strace allows syscall tampering only for syscalls
        with 1) fixed invocation index or 2) all invocations starting from n-th
        (possibly with some step).

        These two options do not cover a useful scenario of testing
        retrying/backoffing policy of traced program, which may be done by
        introducing delays/errors on first n invocations, and then stopping
        tampering.

        This change adds possibility to invoke strace like the following:

          strace -e inject=recvfrom:delay_exit=100000:when=3,100 ./bin

        which results in invocations from third to hundredth (inclusive) being
        tampered.  Formally, syntax now looks like `when=first[..last][+step]`.

        This change does not affect the existing behavior.

        * defs.h (INJECT_LAST_INF): New macro.
        (struct inject_opts): Add "last" field.
        * filter_qualify.c (parse_inject_token) <when>: Add interval support.
        (qualify_inject_common): Initialize struct inject_opts.last.
        * syscall.c (tamper_with_syscall_entering): Handle
        struct inject_opts.last.
        * strace.1.in (Tampering): Document the new feature.
        * strace.c (usage): Likewise.
        * NEWS: Mention this change.
        * tests/qual_fault-syntax.test: Check handling of invalid "when"
        intervals.
        * tests/qual_inject-syntax.test: Likewise.
        * tests/qual_fault.c (last): New variable.
        (main): Take "last" argument, handle it.
        * tests/qual_fault.test: Check handling of valid "when" intervals.

        Resolves: https://github.com/strace/strace/pull/136

2020-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        pathtrace: fix matching of openat2 syscall.
        * pathtrace.c (pathtrace_match_set): Handle SEN_openat2.

        Fixes: v5.6~48 "open: implement openat2 syscall decoding"

2020-04-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add BTRFS_COMPRESS_ZSTD to btrfs_compress_types.
        * xlat/btrfs_compress_types.in (BTRFS_COMPRESS_ZSTD): New constant,
        introduced by Linux commit v4.14-rc1~22^2~1.
        * tests/btrfs.c (BTRFS_COMPRESS_TYPES): Change value to 3.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/xetitimer: Use syscalls instead of libc functions.
        The new glibc implementation for y2038 safe arches (32-bit arch with
        64-bit time_t) will set the itimerval struct inside libc instead of
        inside the kernel. This is because the kernel expects a 32-bit version
        of timeval while libc exposes a 64-bit version. As libc sets this, when
        we pass a faulting pointer we will get a segfault instead of the kernel
        reporint EFAULT back.

        To avoid a seg fault let's use the kernel's equivalent of struct
        __kernel_old_itimerval in the tests and call the syscall directly
        instead of using libc. This way we can trigger the kernels EFAULT
        response correctly.


        * tests/xetitimer.c: Include "kernel_timeval.h"
        (kernel_old_itimerval_t): New type.
        (main): Use it instead of struct itimerval, replace getitimer with
        syscall(__NR_getitimer), replace setitimer with syscall(__NR_setitimer).

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests/semtimedop: Skip tests if semtimedop syscall is not available.
        New y2038 safe 32-bit architectures don't have the __NR_semtimedop
        syscall, so let's skip the test.


        * tests/semtimedop.c: Include "scno.h".
        [!(__NR_semtimedop || __NR_socketcall)]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/xettimeofday: Skip tests if __NR_gettimeofday syscall is not defined
        New y2038 safe 32-bit architectures don't have the
        __NR_gettimeofday/__NR_settimeofday syscalls, so let's skip the test.


        * tests/xettimeofday.c: Include "scno.h".
        [!__NR_gettimeofday]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/wait4: Skip tests if __NR_wait4 syscall is not defined.
        New y2038 safe 32-bit architectures don't have the __NR_wait4 syscall,
        so let's skip the test.


        * tests/wait4.c: Include "scno.h".
        [!__NR_wait4]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/msg_control: Use old time structures for old timestamps.
        The SO_TIMESTAMP_OLD returns a timeval that matches the struct
        kernel_old_timeval_t instead of the struct timeval. This is different
        on new 32-bit architectures (like RV32) where timeval uses 64-bit time_t
        while kernel_old_timeval_t uses 32-bit.

        To fix overflow errors let's use kernel_old_timeval_t instead of
        the libc struct timeval.


        Likewise, SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD return
        kernel_old_timespec_t.

        * tests/msg_control.c: Include "kernel_timeval.h" and
        "kernel_old_timespec.h".
        (test_scm_timestamp_old): Replace struct timeval with
        kernel_old_timeval_t.
        (test_scm_timestampns_old, test_scm_timestamping_old): Replace
        struct timespec with kernel_old_timespec_t.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/sockopt-timestamp: Use old time structures for old timestamps.
        The SO_TIMESTAMP_OLD returns a timeval that matches the struct
        kernel_old_timeval_t instead of the struct timeval. This is different
        on new 32-bit architectures (like RV32) where timeval uses 64-bit time_t
        while kernel_old_timeval_t uses 32-bit.

        To fix overflow errors let's use kernel_old_timeval_t instead of
        the libc struct timeval.


        Likewise, SO_TIMESTAMPNS_OLD returns kernel_old_timespec_t.

        * tests/sockopt-timestamp.c: Include "kernel_timeval.h" and
        "kernel_old_timespec.h".
        (print_timestamp_old): Replace struct timeval with kernel_old_timeval_t.
        (print_timestampns_old): Replace struct timespec with
        kernel_old_timespec_t.

2020-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        Rework printing of SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD timestamps
        On architectures with 32-bit kernel_long_t the kernel sends 32-bit
        timespecs in SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD messages.
        Unfortunately, this applies to all 32-bit architectures including
        those (like RV32) that do not define __ARCH_WANT_TIME32_SYSCALLS.

        * print_timespec.c: Remove.
        * Makefile.am (libstrace_a_SOURCES): Remove it.
        * linux/arch_defs_.h (ARCH_TIMESIZE): Remove.
        (MIN_KLONGSIZE, HAVE_ARCH_TIMESPEC32): New macros.
        * linux/x32/arch_defs_.h (ARCH_TIMESIZE): Remove.
        * defs.h (print_timespec32_data_size, print_timespec32_array_data_size):
        Declare for [HAVE_ARCH_TIMESPEC32].
        * kernel_timespec.h (kernel_timespec32_t): Define for
        [HAVE_ARCH_TIMESPEC32].
        * print_timespec32.c (TIMESPEC_T, PRINT_TIMESPEC_DATA_SIZE,
        PRINT_TIMESPEC_ARRAY_DATA_SIZE): Define for [HAVE_ARCH_TIMESPEC32].
        * msghdr.c (PRINT_TIMESPEC_DATA_SIZE, PRINT_TIMESPEC_ARRAY_DATA_SIZE):
        Define.
        (print_scm_timestampns_old): Use PRINT_TIMESPEC_DATA_SIZE
        instead of print_struct_timespec_data_size.
        (print_scm_timestamping_old): Use PRINT_TIMESPEC_ARRAY_DATA_SIZE
        instead of print_struct_timespec_array_data_size.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

        tests/waitid: Correctly use the long types from the rusage struct.
        The kernel's rusage struct uses the kernel's __kernel_old_timeval which
        means that even for 32-bit archs with 64-bit time_t (like RV32) the time
        values are 32-bit.

        We can fix this by making sure we don't use libc's rusage struct and
        instead use our own with the kernel's old timeval.


        * configure.ac (AC_CHECK_MEMBERS): Do not check for members of struct
        rusage.
        * tests/waitid.c: Include "kernel_rusage.h" instead of <sys/resource.h>.
        (RU_MAXRSS, RU_IXRSS, RU_IDRSS, RU_ISRSS, RU_MINFLT, RU_MAJFLT,
        RU_NSWAP, RU_INBLOCK, RU_OUBLOCK, RU_MSGSND, RU_MSGRCV, RU_NSIGNALS,
        RU_NVCSW, RU_NIVCSW): Remove.
        (sprint_rusage): Replace struct rusage with kernel_rusage_t.
        Use the respective ru_* field names instead of removed macros.
        (do_waitid, main): Replace struct rusage with kernel_rusage_t.

        This partially reverts commit v5.6~192.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests/getrusage: Correctly use the long types from the rusage struct.
        The kernel's rusage struct uses the kernel's __kernel_old_timeval which
        means that even for 32-bit archs with 64-bit time_t (like RV32) the time
        values are 32-bit.

        We can fix this by making sure we don't use libc's rusage struct and
        instead use our own with the kernel's old timeval.


        * tests/getrusage.c: Include "kernel_rusage.h".
        (invoke_print): Replace struct rusage with kernel_rusage_t,
        cast member values from kernel_long_t to unsigned long long
        using zero_extend_signed_to_ull, update format strings.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        kernel_rusage.h: introduce kernel_rusage_t.

        * printrusage.c: Include "kernel_rusage.h" instead of "kernel_timeval.h".
        (rusage_t): Rename to kernel_rusage_t, move the definition to ...
        * kernel_rusage.h: ... new file.
        * Makefile.am (libstrace_a_SOURCES): Add it.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        time: Protect the print_timezone() function.
        To avoid the following error:
        time.c:17:1: error: 'print_timezone' defined but not used [-Werror=unused-function]

        ensure that print_timezone is only defined if we are going to use it.


        * time.c (print_timezone): Place under
        [HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] guard.

        Complements: v5.6~28 "linux/32: move wait4 and [gs]ettimeofday from syscallent.h to syscallent-time32.h"

2020-04-18  Kemeng Shi  <shikemeng@huawei.com>

        tests: correct error message in io_uring_register test.
        * tests/io_uring_register.c (main): If path_full failed to open,
        print its name instead of mistakenly used path_null.

2020-04-18  Paul Chaignon  <paul@cilium.io>

        bpf: support new commands BPF_LINK_{CREATE,UPDATE}
        * xlat/bpf_commands.in (BPF_LINK_CREATE): New constant introduced by Linux
        commit v5.7-rc1~146^2~10^2^2~3.
        (BPF_LINK_UPDATE): New constant introduced by Linux commit
        v5.7-rc1~146^2~10^2^2~2.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE),
        BEGIN_BPF_CMD_DECODER(BPF_LINK_UPDATE)): Decode the new commands.
        (SYS_FUNC(bpf)): Decode the new commands.
        * bpf_attr.h (BPF_LINK_CREATE_struct): New structure introduced by Linux
        commit v5.7-rc1~146^2~10^2^2~3.
        (BPF_LINK_UPDATE_struct): New structure introduced by Linux commit
        v5.7-rc1~146^2~10^2^2~2.
        (BPF_LINK_CREATE_struct_size, BPF_LINK_UPDATE_struct_size): New macros.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_LINK_CREATE_checks, BPF_LINK_UPDATE_checks): Tests for
        the new commands.

2020-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        types: do not generate TYPES_M4_FILES variable.
        * types/gen.sh (gen_makefile): Do not generate TYPES_M4_FILES variable,
        it isn't used anywhere.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Add test for %clock trace class.
        * tests/Makefile.am (EXTRA_DIST): Add trace_clock.in.
        * tests/gen_tests.in (trace_clock): New entry.
        * tests/trace_clock.in: New file.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        Add %clock trace class.
        The %clock class includes the syscalls that read or modify system clock.

        linux/*/syscallent*.h part is updated automatically by:
        sed -i -r '
            /"(.*adjtime.*|.*clock_([gs]et|adj).*|.*[gs]ettimeofday.*|time)"/ {
                s/(\{[^,]*,\t[^0][^,]*)/\1|TCL/
                s/(\{[^,]*,\s*)0/\1TCL/
            }
        ' linux/*/syscallent*.h

        * basic_filters.c (loopup_class): Add %clock member to syscall_class[].
        * linux/32/syscallent-time32.h: Add TCL flag to clock related syscalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-compat.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * strace.1.in: Add %clock description.
        * strace.c (usage): Add %clock group to help message.
        * sysent.h (TRACE_CLOCK): New definition.
        * sysent_shorthand_defs.h (TC): Likewise.
        * sysent_shorthand_undefs.h (TC): Add undef.
        * NEWS: Mention this.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

        sysent_shorthand_undefs.h: add missing undefs.
        Add undefs that were missing from sysent_shorthand_undefs.h
        (mirroring defs in sysent_shorthand_defs.h).

        * sysent_shorthand_undefs.h (PU): Add undef.
        (TSD): Likewise.
        (TC): Likewise.

        Fixes: v4.21~29 "Add pure syscall flag"
        Fixes: v5.3~36 "Add seccomp filter syscall flag"
        Fixes: v5.5~100 "Implement %creds trace class"

2020-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use create_tmpfile.
        * tests/fchmod.c (main): Use create_tmpfile instead of open+unlink.
        * tests/preadv.c: Likewise.
        * tests/sendfile.c: Likewise.
        * tests/sendfile64.c: Likewise.
        * tests/fcntl-common.c (create_sample): Use create_tmpfile instead of
        mkstemp.

2020-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: introduce create_tmpfile function.
        There are few cases in tests where a file is created and immediately
        unlinked.  Add a function to perform this action in a more systematic
        way.

        * tests/tests.h (create_tmpfile): New prototype.
        * tests/create_tmpfile.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add create_tmpfile.c.

2020-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        Extend memory caching of umove* functions.
        * ucopy.c (cached_raddr): Double the size.
        (get_next_unused_idx, lookup_cached_raddr_idx, set_cached_raddr_idx):
        New functions.
        (vm_read_mem): Use them.  When the data to be fetched resides in
        up to 4 adjacent memory pages, fetch these pages and cache them.
        * tests/umovestr_cached_adjacent.c: New file.
        * tests/pure_executables.list: Add umovestr_cached_adjacent.
        * tests/.gitignore: Likewise.
        * tests/umovestr_cached.test: Handle the first argument.
        * tests/gen_tests.in (umovestr_cached_adjacent): New test.

2020-04-15  Dmitry V. Levin  <ldv@altlinux.org>

        filter_seccomp: implement on systems without <linux/seccomp.h>
        Provide fallback definitions required to implement seccomp-assisted
        syscall filtering.

        * filter_seccomp.c [!HAVE_LINUX_SECCOMP_H]: Include
        "xlat/prctl_options.h", "xlat/seccomp_mode.h" and
        "xlat/seccomp_ret_action.h" in XLAT_MACROS_ONLY mode, remove #warning.
        [!HAVE_LINUX_SECCOMP_H] (struct seccomp_data): Define.
        [!HAVE_LINUX_SECCOMP_H] (check_seccomp_filter_properties,
        init_seccomp_filter, seccomp_filter_restart_operator): Remove stubs.

        Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2020-04-15  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: provide a fallback definition of __X32_SYSCALL_BIT.
        Make sure __X32_SYSCALL_BIT is defined on __x86_64__,
        move fallback definitions from various files to x86_64/arch_defs_.h.

        * linux/x86_64/arch_defs_.h [!__X32_SYSCALL_BIT] (__X32_SYSCALL_BIT):
        Define.
        * linux/x86_64/arch_get_personality.c [!__X32_SYSCALL_BIT]
        (__X32_SYSCALL_BIT): Remove.
        * linux/x86_64/get_scno.c: Likewise.
        * tests/filter_seccomp-flag.c [__x86_64__]: Likewise.

        Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add UFFDIO_COPY_MODE_WP to uffd_copy_flags.
        * xlat/uffd_copy_flags.in (UFFDIO_COPY_MODE_WP): New constant,
        introduced by Linux commit v5.7-rc1~58^2~121.
        (UFFDIO_COPY_MODE_DONTWAKE): Add fall-back value.
        * tests/ioctl_uffdio.c: Add a check for the new flag.

        xlat: update mremap_flags.
        * xlat/mremap_flags.in: Add fallback values.
        (MREMAP_DONTUNMAP): New constant, introduced by Linux commit
        v5.7-rc1~124^2~49.

        xlat: update lwtunnel_encap_types.
        * xlat/lwtunnel_encap_types.in (LWTUNNEL_ENCAP_SEG6_LOCAL): New
        constant, introduced by Linux commit v4.14-rc1~130^2~348^2~2.
        (LWTUNNEL_ENCAP_RPL): New constant, introduced by Linux commit
        v5.7-rc1~146^2~38^2.

        xlat: add XDP_FLAGS_REPLACE to xdp_flags.
        * xlat/xdp_flags.in: Add leading zeroes to fallback values.
        (XDP_FLAGS_REPLACE): New constant, introduced by Linux commit
        v5.7-rc1~146^2~10^2~13^2~3.

        xlat: add FAN_DIR_MODIFY to fan_event_flags.
        * xlat/fan_event_flags.in (FAN_DIR_MODIFY): New constant, introduced
        by Linux commit v5.7-rc1~72^2~5.
        * tests/fanotify_mark.c: Update expected output.

        xlat: update v4l2_pix_fmts.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SBGGR14, V4L2_PIX_FMT_SGBRG14,
        V4L2_PIX_FMT_SGRBG14, V4L2_PIX_FMT_SRGGB14): New constants, introduced
        by Linux commit v5.7-rc1~193^2~35.
        (V4L2_PIX_FMT_Y14): New constant, introduced by Linux commit
        v5.7-rc1~193^2~34.

        xlat: update uring_ops.
        * xlat/uring_ops.in (IORING_OP_SPLICE): New constant, introduced
        by Linux commit v5.7-rc1~201^2~46.
        (IORING_OP_PROVIDE_BUFFERS): New constant, introduced by Linux commit
        v5.7-rc1~201^2~23.
        (IORING_OP_REMOVE_BUFFERS): New constant, introduced by Linux commit
        v5.7-rc1~201^2~18.
        * tests/io_uring_register.c: Update expected output.

        xlat: add SECCOMP_FILTER_FLAG_TSYNC_ESRCH to seccomp_filter_flags.
        * xlat/seccomp_filter_flags.in: Use (1<<BIT) syntax.
        (SECCOMP_FILTER_FLAG_TSYNC_ESRCH): New constant, introduced by Linux
        commit v5.7-rc1~198^2~1.
        * tests/seccomp-filter.c: Update expected output.
        * tests/seccomp-filter-v.c: Likewise.

        xlat: add IORING_FEAT_FAST_POLL to uring_setup_features.
        * xlat/uring_setup_features.in (IORING_FEAT_FAST_POLL): New constant,
        introduced by Linux commit v5.7-rc1~201^2~36.

        xlat: add V4L2_CID_USER_ATMEL_ISC_BASE to v4l2_control_id_bases.
        * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ATMEL_ISC_BASE): New
        constant, introdued by Linux commit v5.7-rc1~193^2~219.

        xlat: add KVM_CAP_S390_PROTECTED and KVM_CAP_PPC_SECURE_GUEST to kvm_cap
        * xlat/kvm_cap.in (KVM_CAP_S390_PROTECTED): New constant, introduced
        by Linux commit v5.7-rc1~121^2~15^2~4.
        (KVM_CAP_PPC_SECURE_GUEST): New constant, introduced by Linux commit
        v5.7-rc1~121^2~12^2.

        xlat: add PERF_SAMPLE_BRANCH_HW_INDEX to perf_branch_sample_type.
        * xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_HW_INDEX): New
        constant, introduced by Linux commit v5.7-rc1~180^2~23.
        * tests/perf_event_open.c: Update expected output.

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: allow passing arguments to netlink_sock_diag.test.
        And remove netlink_sock_diag-v.sh, since it is no longer needed.

        * tests/netlink_sock_diag.test: Pass script's arguments to
        run_strace_match_diff call.
        * tests/gen_tests.in (nlattr_packet_diag_msg): Call
        netlink_sock_diag.test with -v instead of netlink_sock_diag-v.sh..
        * tests/netlink_sock_diag-v.sh: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove netlink_sock_diag-v.sh.

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use the FLAG macro instead of a locally defined one in clone3 test
        * tests/clone3.c (_): Remove.
        (enum validity_flags): Use FLAG() instead of _().

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: add more elaborate comments for struct strace_clone_args field.
        Try to capture field semantics and type.

        * clone.c (struct strace_clone_args): Add/extend comments for the
        fields.

2020-04-14  Fabrice Fontaine  <fontaine.fabrice@gmail.com>

        ptrace_syscall_info.c: fix build without fork.
        Build without fork fails on:

        ptrace_syscall_info.c:33:27: error: 'expected_entry_size' defined but not used [-Werror=unused-const-variable=]
         static const unsigned int expected_entry_size =
                                   ^~~~~~~~~~~~~~~~~~~
        ptrace_syscall_info.c:31:27: error: 'expected_none_size' defined but not used [-Werror=unused-const-variable=]
         static const unsigned int expected_none_size =
                                   ^~~~~~~~~~~~~~~~~~
        ptrace_syscall_info.c:24:1: error: 'kill_tracee' defined but not used [-Werror=unused-function]
         kill_tracee(pid_t pid)
         ^~~~~~~~~~~

        Fixes:
         - http://autobuild.buildroot.org/results/ffc81d3798379a9c34c7a708ebbdea27409f755d


        * ptrace_syscall_info.c (kill_tracee, expected_none_size,
        expected_entry_size): Move definitions under [HAVE_FORK] guard.

        Resolves: https://github.com/strace/strace/pull/135

2020-04-13  Paul Chaignon  <paul@cilium.io>

        bpf: update BPF_* constants.
        * xlat/bpf_attach_types.in (BPF_MODIFY_RETURN): New constant introduced by
        Linux kernel commit v5.7-rc1~146^2~174^2~45^2~4.
        (BPF_LSM_MAC): New constant introduced by Linux kernel commit
        v5.7-rc1~146^2~10^2~9^2~7.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_LSM): New constant introduced by
        Linux kernel commit v5.7-rc1~146^2~10^2~9^2~7.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update checks
        and their expected output.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        Makefile.am: move almost all of strace_SOURCES to libstrace_a_SOURCES.
        There is no need to track files that are used conditionally.

        * Makefile.am (strace_SOURCES): Move all except strace.c ...
        (libstrace_a_SOURCES): ... here.

2020-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        Rewrite decoders of getdents, getdents64, and readdir syscalls.
        The old approach of allocating memory for all dentries returned by
        getdents/getdents64 was problematic, fix it by fetching and printing
        dentries sequentially.

        * dirent_types.c: New file.
        * xgetdents.c: Likewise.
        * xgetdents.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * dirent.c: Include "xgetdents.h" and "print_fields.h".
        (header_size): New variable.
        (print_dentry_head, decode_dentry_head, decode_dentry_tail): New
        functions.
        (print_old_dirent): Rewrite using print_dentry_head.
        (SYS_FUNC(getdents)): Rewrite using xgetdents, decode_dentry_head,
        and decode_dentry_tail.
        * dirent64.c: Include "xgetdents.h", "kernel_dirent.h"
        and "print_fields.h" instead of "defs.h", <dirent.h>
        and "xlat/dirent_types.h".
        (decode_dentry_head, decode_dentry_tail): New functions.
        (SYS_FUNC(getdents64)): Rewrite using xgetdents, decode_dentry_head,
        and decode_dentry_tail.

        Resolves: https://github.com/strace/strace/issues/19
        Resolves: https://github.com/strace/strace/pull/20

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Guard against invalid return values of getdents/getdents64 syscalls.
        The kernel is not expected to return more bytes than requested.
        If this ever happens, treat it as an error.

        * dirent.c (SYS_FUNC(getdents)): Treat the return value greater than
        the third argument of syscall as an error.
        * dirent64.c (SYS_FUNC(getdents64)): Likewise.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Print the second argument of getdents/getdents64 syscalls in abbrev mode
        * dirent.c (SYS_FUNC(getdents)) [!abbrev(tcp)]: Print u_arg[1] along
        with the number of entries.
        * dirent64.c (SYS_FUNC(getdents64)) [!abbrev(tcp)]: Likewise.
        * tests/xgetdents.c (ls): Update expected output.

        tests: check abbreviated decoding of getdents and getdents64 syscalls.
        * tests/getdents-v.c: New file.
        * tests/getdents64-v.c: Likewise.
        * tests/pure_executables.list: Add getdents-v and getdents64-v.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (getdents-v, getdents64-v): New entries.
        (getdents, getdents64): Update.
        * tests/getdents.c (print_dirent): Define only if [VERBOSE].
        * tests/getdents64.c (print_dirent): Likewise.
        * tests/xgetdents.c (str_d_type): Likewise.
        (ls): Handle [!VERBOSE] case.
        (main) [VERBOSE]: Add "-v" to dname.

        tests: refactor getdents and getdents64 tests.
        * tests/xgetdents.c: New file.
        * tests/Makefile.am (EXTRA_DIST): Add xgetdents.c.
        * tests/getdents.c: Rewrite using xgetdents.c.
        * tests/getdents64.c: Likewise.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Move kernel_dirent64 definition to kernel_dirent.h.
        ... and rename kernel_dirent64 type to kernel_dirent64_t

        * tests/getdents64.c: Include "kernel_dirent.h", rename kernel_dirent64
        to kernel_dirent64_t.
        (kernel_dirent64_t): Move ...
        * kernel_dirent.h: ... here.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Move kernel_dirent definition from kernel_types.h to a separate header.
        ... and rename kernel_dirent type to kernel_dirent_t

        * kernel_types.h (kernel_dirent): Rename to kernel_dirent_t, move ...
        * kernel_dirent.h: ... to new file.
        * Makefile.am (strace_SOURCES): Add it.
        * dirent.c: Include "kernel_dirent.h", rename kernel_dirent
        to kernel_dirent_t.
        * tests/getdents.c: Likewise.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        strace: fix -E/--env options affecting strace environment.
        The current approach with putenv() during parsing has a problem:
        it changes strace's own environment which may affect its behaviour
        in an unacceptable way.

        As a solution, let's apply an approach similar to path tracing option
        parsing: collect the provided optarg's in an array, then construct
        a new environment and pass it to startup_child().

        * strace.c (struct exec_params): Add env field.
        (exec_or_die): Call execve() instead of execv(); pass params->env
        as the third argument.
        (startup_child): Add env parameter, set params_for_tracee.env to it.
        (remove_from_env, add_to_env, update_env, make_env): New functions.
        (init): Add env_changes, env_change_size, env_change_count local
        variables; store optarg in env_changes array on -E option occurrence;
        construct new environment using make_env and pass it to startup_child
        in the second argument.
        * tests/strace-E-override.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add strace-E-override.test.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        xmalloc: add xallocarray.
        Add a wrapper around malloc with calloc interface.

        * xmalloc.h (xallocarray): New function declaration.
        * xmalloc.c (xallocarray): New function.

2020-04-09  Eugene Syromiatnikov  <esyr@redhat.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        strace: move pathtrace_select calls to a later initialisation stage.
        Since path name resolution is specific to the tracing backend
        (especially when tracees are remote), let's first collect the list
        of paths to trace in a temporary array and add it later during the
        initialisation.

        * strace.c (init): Add pathtrace_paths temporary array, with its
        element count stored in pathtrace_count and size in pathtrace_size.
        (init) <case 'P'>: Store argument in pathtrace_paths, grow it if needed.
        (init): Iterate over pathtrace_paths and call pathtrace_select for each
        element.  Free the array.
        * tests/options-syntax.test: Check that path name resolution happens
        but not too early.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check -E/--env unset behaviour.
        * tests/strace-E-unset.test: Likewise.
        * tests/strace-E-unset.expected: New file.
        * tests/Makefile.am (MISC_TESTS): Add strace-E-unset.test.
        (EXTRA_DIST): Add strace-E-unset.expected.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: add support for negative match patterns to match_grep.
        For the cases when we want that some patterns do not appear in the
        output.

        * tests/init.sh (match_grep): Add rc and negated local variables; set
        negated to 1 if pattern starts with "!", otherwise to 0; fail if negated
        pattern has been matched.

2020-04-09  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.6-1.
        * strace.spec.in: Likewise.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.6 release.
        * NEWS: Update for 5.6 release.

        .mailmap: add more entries to avoid duplication in CREDITS.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup temporary files left by read-write test executable.
        This test executable is invoked by 19 tests, leaving about 100M
        of data in temporary files.

        In each of these tests read-write is invoked twice: the first time by
        run_prog and the second time by run_strace.  Since the temporary file
        created during the first invocation is used by strace during the second
        invocation, this file can only be cleaned up at the end of the second
        invocation.

        * tests/read-write.c (main): If the temporary file was not created,
        unlink it before the exit.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite redirect.test without a busy loop.
        * tests/redirect.test: Invoke $SLEEP_A_BIT while waiting
        for synchronization with the tracer.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        README.md: add github CI status badge.

2020-04-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: make -yy equivalent to --decode-fds=all.
        With inclusion of device file and, later, pidfd decoding into -yy
        semantics, it is clear that one cannot rely on stability of set
        of file descriptor decoding features enabled by -yy.  State that
        formally by aliasing -yy to --decode-fds=all.  Those who want only
        specific FD decoding capabilities being enabled know that they need
        it and can resort to --decode-fds=SET syntax.

        * strace.1.in (.SS Output formatting): Change -yy alias
        to --decode-fds=all, update the -yy option description.
        * strace.c (usage): Likewise; expand --decode-fds description.
        (init): Change yyflag_qual value to "all".

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        travis: remove build jobs covered by github actions.
        * .travis.yml: Remove all bionic build jobs on x86_64, x86, and x32 except
        the first one which is probably the fasted and is kept for reference.
        Remove all gcc-8 and gcc-9 jobs since the corresponding repositories
        are broken.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        github: add CI action.
        Somewhat similar to Travis CI, this runs "make distcheck" on Ubuntu
        18.04 using gcc-9, gcc-7, clang-9, and clang-6 on x86_64, x86, and x32
        architectures.

        Compared with Travis CI, GitHub Actions service currently provides
        a significantly better parallelism as well as (unsurprisingly)
        better integration with github.

        However, GitHub Actions cannot replace Travis CI completely as
        the latter can build on aarch64, s390x, and ppc64le architectures.

        * .github/workflows/source-code-check.yml: Remove.
        * .github/workflows/ci.yml: New file.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix poll-P.test.
        All invocations of poll-P executable must have a properly created
        descriptor 9.

        * tests/poll-P.test: Fix run_prog invocations.

        Fixes: v4.21~122 "tests: check path tracing of poll syscall"

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove poll-P and ppoll-P from pure_executables.list.
        Since these executables have to be invoked in a special way,
        it was not correct to include them into pure_executables.list.

        * tests/pure_executables.list: Move poll-P and ppoll-P ...
        * tests/Makefile.am (check_PROGRAMS): ... here.

        Fixes: v4.21~122 "tests: check path tracing of poll syscall"
        Fixes: v4.21~121 "tests: check path tracing of ppoll syscall"

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround clang compilation warning.
        Silence the following incorrect compilation warning produced by clang:

        tests/io_uring_register.c:271:10: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                                probe->ops[i].flags & (typeof(probe->ops[i].flags)) ~1,
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        * tests/io_uring_register.c (main): Cast the whole
        struct io_uring_probe_op.flags based expression
        to the type of the first operand.

        Complements: v5.5-183-g8b6487f9a "tests: fix clang compilation warning"

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        travis: update coverage configuration.
        * .travis.yml [$CHECK == coverage]: Change dist from trusty to bionic,
        change the compiler from gcc to gcc-9, change STACKTRACE from libunwind
        to libdw.
        * ci/run-build-and-tests.sh [$CHECK == coverage] (GCOV): New variable,
        pass its value to ./codecov.bash.

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        ci: workaround unusable codecov-python.
        As codecov-python, starting with commit
        v2.0.15-44-g9f50cca7e5c5e0bb5e2859db238da08e3195e105 released almost
        a month ago, became an utterly unusable pile of garbage, switch to
        codecov-bash that still works.

        * ci/install-dependencies.sh [$CHECK == coverage]: Do not install
        lcov, python-pip, python-setuptools, and codecov.  Download
        https://codecov.io/bash and save it as codecov.bash.
        * ci/run-build-and-tests.sh [$CHECK == coverage] (ac_cv_prog_LCOV,
        ac_cv_prog_GENHTML): New variables, export them.
        [[$CHECK == coverage]: Invoke codecov.bash instead of codecov.

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use twice as many cpus for tests.
        Since many tests sleep a lot, running more of them in parallel
        increases overall performance.

        * ci/run-build-and-tests.sh (j2): New variable.
        Use it instead of $j for "make check" and "make distcheck".

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use -Og instead of -O0 for coverage builds.
        Also, do not apply this debugging optimization level to tests.

        * ci/run-build-and-tests.sh [$CHECK == coverage] (CFLAGS,
        CFLAGS_FOR_BUILD): Remove.
        [$CHECK == coverage]: Specify CFLAGS='-g -Og' to "make all".

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch from clang 7 to clang-9.
        * .travis.yml (matrix): Switch all clang 7 builds to clang-9.

2020-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        NEWS: mention libdw symbol-to-address cache introduction.
        Complements: v5.5-178-g2101456 "unwind-libdw: add caching"

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix clang compilation warning.
        Silence the following compilation warning produced by clang:

        tests/io_uring_register.c:271:10: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                                probe->ops[i].flags & ~1,
                                ^~~~~~~~~~~~~~~~~~~~~~~~

        * tests/io_uring_register.c (main): Cast the second operand
        of struct io_uring_probe_op.flags based expression to the type
        of the first operand.

2020-04-05  Paul Chaignon  <paul.chaignon@gmail.com>

        bpf: support new commands BPF_MAP_*_BATCH.
        * xlat/bpf_commands.in (BPF_MAP_LOOKUP_BATCH): New constant introduced
        by Linux commit v5.6-rc1~151^2~46^2~23^2~7.
        (BPF_MAP_LOOKUP_AND_DELETE_BATCH): New constant introduced by Linux
        commit v5.6-rc1~151^2~46^2~23^2~4.
        (BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH): New constants introduced
        by Linux commit v5.6-rc1~151^2~46^2~23^2~6.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_BATCH),
        BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_BATCH),
        BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_BATCH)): Decode the new commands.
        (decode_BPF_MAP_LOOKUP_AND_DELETE_BATCH): New macro.
        (SYS_FUNC(bpf)): Decode the new commands.
        * bpf_attr.h (BPF_MAP_LOOKUP_BATCH_struct,
        BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct, BPF_MAP_UPDATE_BATCH_struct,
        BPF_MAP_DELETE_BATCH_struct): New structs introduced by Linux commit
        v5.6-rc1~151^2~46^2~23^2~7.
        (BPF_MAP_LOOKUP_BATCH_struct_size,
        BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct_size,
        BPF_MAP_UPDATE_BATCH_struct_size, BPF_MAP_DELETE_BATCH_struct_size): New
        macros.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_MAP_LOOKUP_BATCH_checks, BPF_MAP_UPDATE_BATCH_checks,
        BPF_MAP_DELETE_BATCH_checks): Tests for the new commands.

2020-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print PIDs associated with pidfds.
        * number_set.h (decode_fd_bits): Add DECODE_FD_PIDFD to enum.
        * filter_qualify.c (decode_fd_str_to_uint) <decode_fd_strs>: Add pidfd
        argument name and value.
        * util.c (printpidfd): New function.
        (printfd): Call printpidfd if DECODE_FD_PIDFD is set.
        * strace.c (init) <yyflag_qual>: Add pidfd.
        (usage): Document pidfd option argument.
        * strace.1.in (.SS Output format): Likewise.
        * tests/pidfd_getfd-yy.c: New file.
        * tests/pidfd_open--decode-fd-pidfd.c: Likewise.
        * tests/pidfd_open--decode-fd-socket.c: Likewise.
        * tests/pidfd_open-yy.c: Likewise.
        * tests/.gitignore: Add pidfd_getfd-yy, pidfd_open--decode-fd-pidfd,
        pidfd_open--decode-fd-socket, and pidfd_open-yy.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in: Add pidfd_getfd-yy, pidfd_open--decode-fd-pidfd,
        pidfd_open--decode-fd-socket, and pidfd_open-yy tests.
        * tests/pidfd_getfd.c [!PRINT_PIDFD] (PRINT_PIDFD): New macro, define
        to 0.
        (main) [PRINT_PIDFD]: New variable pidfd_str, print expected pidfd
        string to it.
        (main) [!PRINT_PIDFD]: New variable pidfd_str, set it to PIDFD_PATH.
        (main): Print pidfd_str instead of PIDFD_PATH.
        * tests/pidfd_open.c (main) [PRINT_PIDFD]: Print pidfd using "<pid:%d>"
        format.
        * NEWS: Mention the change.

2020-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2020-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        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

2020-04-03  Jann Horn  <jannh@google.com>

        unwind-libdw: add caching.
        libdw's address-to-symbol logic is quite slow. Since when stracing a
        process, it is normal to see the same call sites over and over again,
        let's address that by adding a straightforward N-way associative cache
        in front of libdw.

        The cache parameters could probably use some fine-tuning,
        but ought to be good enough for now.

        The resulting performance improvement:

        $ time ./strace-orig -o /dev/null -k bash -c 'for i in {0..10000}; do echo; done' >/dev/null

        real    0m12,014s
        user    0m11,512s
        sys     0m0,575s
        $ time ./strace-cache -o /dev/null -k bash -c 'for i in {0..10000}; do echo; done' >/dev/null

        real    0m0,765s
        user    0m0,451s
        sys     0m0,371s

        Reviewed-By: Masatake YAMATO <yamato@redhat.com>

        * unwind-libdw.c: Include "static_assert.h".
        (STRACE_UW_CACHE_SIZE, STRACE_UW_CACHE_ASSOC): New macros.
        (struct cache_entry): New type.
        (struct ctx): Add "cache" field, extend the type of "last_proc_updating"
        field.
        (mapping_generation): Extend the type, initialize to 1.
        (uwcache_clock): New variable.
        (tcb_init): Initialize struct ctx.cache.
        (truct frame_user_data): Add "ctx" field.
        (find_bucket): New function.
        (frame_callback): Use it.
        (tcb_walk): Initialize user_data.ctx.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: wire up former vserver syscall.
        ... because Linux kernel arch/sparc/kernel/syscalls/syscall.tbl
        still lists it.

        * linux/sparc/syscallent.h [267]: Add vserver entry.
        * linux/sparc64/syscallent.h [267]: Add vserver entry.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: wire up kexec_file_load syscall.
        ... introduced on hppa by Linux kernel commit v5.4-rc1~188^2~3.

        * linux/hppa/syscallent.h [355]: Add kexec_file_load entry.
        * NEWS: Mention this.

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        hdio: implement HDIO_DRIVE_CMD ioctl command decoding.
        * xlat/hdio_drive_cmds.in: New file.
        * hdio.c: Include "xlat/hdio_drive_cmds.h".
        (print_hdio_drive_cmd): New function.
        (hdio_ioctl): Call print_hdio_drive_cmd if code is HDIO_DRIVE_CMD.
        * tests/ioctl_hdio.c (main) <unsupp_cmds>: Remove HDIO_DRIVE_CMD.
        (main): Add HDIO_DRIVE_CMD checks.

        Closes: https://github.com/strace/strace/issues/83

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        hdio: factor out the HDIO_GETGEO handler into a separate function.
        And update it up to the current coding style.

        * hdio.c: Include "print_fields.h".
        (print_hdio_getgeo): New function.
        (hdio_ioctl) <case HDIO_GETGEO>: Call print_hdio_getgeo instead
        of decoding in place.

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of HDIO_* ioctls.
        * tests/.gitignore: Add ioctl_hdio, ioctl_hdio-success,
        ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
        ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
        ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
        ioctl_hdio-success-v-Xverbose, ioctl_hdio-Xabbrev,
        ioctl_hdio-Xraw, ioctl_hdio-Xverbose, ioctl_hdio-v,
        ioctl_hdio-v-Xabbrev, ioctl_hdio-v-Xraw, and ioctl_hdio-v-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_hdio-success,
        ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
        ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
        ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
        and ioctl_hdio-success-v-Xverbose.
        * tests/gen_tests.in (ioctl_hdio, ioctl_hdio-Xabbrev, ioctl_hdio-Xraw,
        ioctl_hdio-Xverbose, ioctl_hdio-v, ioctl_hdio-v-Xabbrev,
        ioctl_hdio-v-Xraw, ioctl_hdio-v-Xverbose, ioctl_hdio-success,
        ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
        ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
        ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
        ioctl_hdio-success-v-Xverbose): New tests.
        * tests/ioctl_hdio.c: New file.
        * tests/ioctl_hdio-Xabbrev.c: Likewise.
        * tests/ioctl_hdio-Xraw.c: Likewise.
        * tests/ioctl_hdio-Xverbose.c: Likewise.
        * tests/ioctl_hdio-success.c: Likewise.
        * tests/ioctl_hdio-success-Xabbrev.c: Likewise.
        * tests/ioctl_hdio-success-Xraw.c: Likewise.
        * tests/ioctl_hdio-success-Xverbose.c: Likewise.
        * tests/ioctl_hdio-success-v.c: Likewise.
        * tests/ioctl_hdio-success-v-Xabbrev.c: Likewise.
        * tests/ioctl_hdio-success-v-Xraw.c: Likewise.
        * tests/ioctl_hdio-success-v-Xverbose.c: Likewise.
        * tests/ioctl_hdio-v.c: Likewise.
        * tests/ioctl_hdio-v-Xabbrev.c: Likewise.
        * tests/ioctl_hdio-v-Xraw.c: Likewise.
        * tests/ioctl_hdio-v-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add ioctl_hdio, ioctl_hdio-Xabbrev,
        ioctl_hdio-Xraw, ioctl_hdio-Xverbose, ioctl_hdio-v,
        ioctl_hdio-v-Xabbrev, ioctl_hdio-v-Xraw, and ioctl_hdio-v-Xverbose.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

        linux/32: move wait4 and [gs]ettimeofday from syscallent.h to syscallent-time32.h
        According to Linux kernel include/uapi/asm-generic/unistd.h, starting
        with commit v5.1-rc1~160^2~1^2~3 __NR_wait4, __NR_gettimeofday, and
        __NR_settimeofday are placed under __ARCH_WANT_TIME32_SYSCALLS and
        therefore should belong to syscallent-time32.h along with other 32-bit
        time_t based syscalls.

        * linux/32/syscallent.h [169, 170, 260]: Move entries ...
        * linux/32/syscallent-time32.h: ... here.
        * time.c (SYS_FUNC(gettimeofday), SYS_FUNC(settimeofday)): Place under
        [HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] guard.
        * wait.c (SYS_FUNC(wait4)): Likewise.

        Complements: v5.5-39-gcc7e89011 "linux/32: Split 32-bit time_t based syscalls into a separate header"

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix another race condition in strace-DD.test.
        Apparently, timeout(1) utility first sends its signal to the child
        process, then installs a signal handler, and finally sends its signal to
        the process group.  This creates a race between timeout(1) and strace,
        the latter can manage to handle tracee syscall exit trap before a signal
        to the process group is delivered.

        * tests/setpgrp-exec.c: New file.
        * tests/strace-DD.test: Rewrite without use of timeout(1).
        * tests/strace-DD.expected: Remove.
        * tests/Makefile.am (check_PROGRAMS): Add setpgrp-exec.
        (EXTRA_DIST): Remove strace-DD.expected.

        Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a workaround for trace_creds test on mips o32.
        Since every mips o32 executable used by trace_creds test invokes
        prctl(PR_GET_FP_MODE) on their own and these calls are not filtered out
        by %creds, they have to be filtered out manually before comparison.

        * tests/init.sh (test_pure_prog_set) [$STRACE_ARCH == mips &&
        $MIPS_ABI == o32 && $NAME == *creds]: Filter out prctl(PR_GET_FP_MODE)
        from the strace log before comparison.

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        Lift experimental status from --seccomp-bpf feature.
        * strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Remove " (experimental)".

        strace.1: enhance --seccomp-bpf description.
        * strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Reword for clarity.

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix --seccomp-bpf description.
        * strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Remove the claim that this
        option implies -f, document that --seccomp-bpf has no effect unless
        -f/--follow-forks is also specified.

        Complements: v5.5-38-g2a7ba2a97 "strace: disable seccomp-bpf instead of enabling following forks"

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use kernel headers from Linux kernel v5.6.
        When Linux kernel merge window opens, changes of all sorts start to pour
        down, breaking UAPI in various ways.  This does not work for strace,
        we need a stable UAPI.

        * .gitlab-ci.yml (variables): Add KBRANCH.
        * .travis.yml (env:global): Likewise.

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix get*id-creds tests on mips.
        Apparently, mips executables may invoke prctl(PR_GET_FP_MODE) on their
        own.  Since these calls are not filtered out by %creds, they have to be
        dealt with before comparison.

        * tests/getuid.test [$STRACE_ARCH == mips]: Filter out
        prctl(PR_GET_FP_MODE) from the log of %creds tests.

2020-03-31  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.6.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.6
        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/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.6.
        * maint/ioctls_sym.sh: Add workarounds for media/v4l2-ioctl.h and
        sound/pcm.h headers.

2020-03-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix race condition in strace-D.test.
        * tests/strace-D.test (test_parent_tracer_pid): Wait for the tracer
        completion before checking its log.

        Fixes: v5.4~110 "tests: check -D option"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix race condition in strace-DDD.test.
        * tests/tracer_ppid_pgid_sid.c (main): Print tracer pid.
        * tests/strace-DDD.test: Check tracer pid, wait for the tracer
        completion before checking its log.

        Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>
        Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix race condition in strace-DD.test.
        Apparently, $SLEEP_A_BIT might be insufficient for the tracer
        to complete.

        * tests/strace-DD.test: Find out the tracer pid and wait for the tracer
        completion before checking its log.

        Suggested-by: Eugene Syromyatnikov <evgsyr@gmail.com>
        Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: split getxxid test.
        getxxid used to test alpha-specific getxgid, getxuid, and getxgid
        syscalls.  Now each of these syscalls has its own test.
        This hopefully fixes trace_creds test on alpha.

        * tests/getxxid.c: Split into getxpid.c, getxuid.c, and getxgid.c.
        * tests/gen_tests.in (getxxid): Remove.
        (getxgid, getxpid, getxuid): New tests.
        * tests/pure_executables.list: Replace getxxid with getxgid, getxpid,
        and getxuid.
        * tests/.gitignore: Likewise.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: rename getpagesize syscall entry to old_getpagesize.
        ... to match the Linux kernel that introduced __NR_old_getpagesize
        by commit v5.0-rc1~164^2~4.

        * linux/ia64/syscallent.h [BASE_NR + 147]: Rename "getpagesize"
        to "old_getpagesize".

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable umovestr_cached.test on mips o32 unless PTRACE_GET_SYSCALL_INFO works
        If PTRACE_GET_SYSCALL_INFO does not work, then the test has to be
        skipped on mips o32 because only the first four syscall arguments are
        obtained from registers on that architecture, remaining syscall
        arguments have to be fetched from the tracee memory.

        * tests/umovestr_cached.test [$STRACE_ARCH == mips && $MIPS_ABI == o32]:
        Skip the test if PTRACE_GET_SYSCALL_INFO does not work.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: re-enable umovestr_cached.test on ia64 if PTRACE_GET_SYSCALL_INFO works
        If PTRACE_GET_SYSCALL_INFO works, then the exception made for ia64
        earlier is not relevant.

        * tests/umovestr_cached.test [$STRACE_ARCH == ia64]: Do not skip
        the test if PTRACE_GET_SYSCALL_INFO works.

        Complements: v5.3~23 "tests: disable umovestr_cached.test on ia64"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement pidfd_getfd syscall decoding.
        Introduced by Linux commit v5.6-rc1~122^2~4 and wired up in Linux commit
        v5.6-rc1~122^2~3.

        * pidfd_getfd.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/syscallent-common.h ([BASE_NR + 438]): Wire up pidfd_getfd.
        * tests/pidfd_getfd.c: New file.
        * tests/pidfd_getfd-y.c: Likewise.
        * tests/.gitignore: Add pidfd_getfd and pidfd_getfd-y.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in: Add pidfd_getfd and pidfd_getfd-y tests.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move printpidfd from kcmp.c to util.c.
        And rename it to print_pid_fd in an attempt to minimise confusion with
        the kernel's pidfd concept.

        * kcmp (PRINT_FIELD_PIDFD, SYS_FUNC(kcmp)): Change printpidfd calls to
        print_pid_fd.
        (printpidfd): Move it...
        * util.c (print_pid_fd): ...here. Drop the static qualifier, update
        the comment describing why this is a stub.
        * defs.h (print_pid_fd): New declaration.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        open: implement openat2 syscall decoding.
        Introduced by Linux commit v5.6-rc1~133^2~2.

        * configure.ac (AC_CHECK_HEADERS): Check for linux/openat2.h.
        * defs.h (print_numeric_umode_t_64): New declaration.
        * linux/syscallent-common.h ([BASE_NR + 437]): Wire up openat2.
        * types/openat2.h: New file.
        * open.c: Include "print_fields.h", "types/openat2.h",
        and "xlat/open_resolve_flags.h".
        (sprint_open_modes64): Rename from sprint_open_modes, change argument
        type to uint64_t.
        (sprint_open_modes): New function, a wrapper for sprint_open_modes64
        with argument type of unsigned int.
        (tprint_open_modes64): Rename from tprint_open_modes, change argument
        type to uint64_t, call sprint_open_modes64 instead of sprint_open_modes.
        (tprint_open_modes): New function, a wrapper for tprint_open_modes64
        with an argument of type unsigned int.
        (print_open_how): New function.
        (SYS_FUNC(openat2)): New decoder.
        * printmode.c (print_numeric_umode_t_64): New function.
        * tests/openat2.c: New file.
        * tests/openat2-Xabbrev.c: Likewise.
        * tests/openat2-Xraw.c: Likewise.
        * tests/openat2-Xverbose.c: Likewise.
        * tests/openat2-v.c: Likewise.
        * tests/openat2-v-y.c: Likewise.
        * tests/openat2-v-y-Xabbrev.c: Likewise.
        * tests/openat2-v-y-Xraw.c: Likewise.
        * tests/openat2-v-y-Xverbose.c: Likewise.
        * tests/openat2-y.c: Likewise.
        * tests/.gitignore: Add openat2, openat2-Xabbrev, openat2-Xraw,
        openat2-Xverbose, openat2-v, openat2-v-y, openat2-v-y-Xabbrev,
        openat2-v-y-Xraw, openat2-v-y-Xverbose, openat2-y.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in: Add openat2, openat2-Xabbrev, openat2-Xraw,
        openat2-Xverbose, openat2-v, openat2-v-y, openat2-v-y-Xabbrev,
        openat2-v-y-Xraw, openat2-v-y-Xverbose, openat2-y tests.
        * xlat/open_resolve_flags.in: New file.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move print_nonzero_bytes from clone.c to util.c.
        As it is to be used elsewhere.

        * clone.c (print_nonzero_bytes): Move it...
        * util.c (print_nonzero_bytes): ...here.  Remove static qualifier.
        * defs.h (print_nonzero_bytes): New declaration.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        travis: remove ppc64le builds.
        They are currently unusable, permanently failing with
        "Disk quota exceeded" error diagnostics.

        * .travis.yml (arch: ppc64le): Remove.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        xtensa: switch to PTRACE_GETREGS API.
        Implement PTRACE_GETREGS API introduced on xtensa by Linux kernel commit
        v2.6.13-rc1~68^2~366.

        * configure.ac [xtensa]: Remove arch_enable_Werror=no.
        * linux/xtensa/get_syscall_result.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * linux/xtensa/arch_regs.c (xtensa_regs): New variable.
        (ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
        (xtensa_a2, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
        * linux/xtensa/get_error.c (arch_get_error): Use xtensa_regs.a[2].
        * linux/xtensa/get_syscall_args.c (arch_get_syscall_args): Use
        xtensa_regs.a.
        * linux/xtensa/set_error.c (arch_set_error, arch_set_success): Use
        xtensa_regs.a[2].
        * NEWS: Mention this change.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        sh64: switch to PTRACE_GETREGS API.
        Implement PTRACE_GETREGS API introduced on sh64 by Linux kernel commit
        v2.6.28-rc1~99^2~56.

        * configure.ac [sh64]: Remove arch_enable_Werror=no.
        * linux/sh64/arch_regs.h: Remove.
        * linux/sh64/get_syscall_result.c: Likewise.
        * Makefile.am (EXTRA_DIST): Remove them.
        * linux/sh64/arch_regs.c (sh64_regs): New variable.
        (ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
        (sh64_r9, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
        * linux/sh64/get_error.c (arch_get_error): Use sh64_regs.regs[9].
        * linux/sh64/get_scno.c (arch_get_scno): Use sh64_regs.regs[9].
        * linux/sh64/get_syscall_args.c (arch_get_syscall_args): Use sh64_regs.regs.
        * linux/sh64/set_error.c (arch_set_error, arch_set_success): Use
        sh64_regs.gr[9].
        * linux/sh64/set_scno.c (arch_set_scno): Use sh64_regs.regs[9].
        * NEWS: Mention this change.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        sh: switch to PTRACE_GETREGS API.
        Implement PTRACE_GETREGS API introduced on sh by Linux kernel commit
        v2.6.28-rc1~99^2~56.

        * configure.ac [sh]: Remove arch_enable_Werror=no.
        * linux/sh/get_syscall_result.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * linux/sh/arch_regs.c (sh_regs): New variable.
        (ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
        (sh_r0, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
        * linux/sh/arch_getrval2.c (getrval2): Use sh_regs.regs[1].
        * linux/sh/get_error.c (arch_get_error): Use sh_regs.regs[0].
        * linux/sh/get_scno.c (arch_get_scno): Use sh_regs.regs[3].
        * linux/sh/get_syscall_args.c (arch_get_syscall_args): Use sh_regs.regs.
        * linux/sh/set_error.c (arch_set_error, arch_set_success): Use
        sh_regs.gr[0].
        * linux/sh/set_scno.c (arch_set_scno): Use sh_regs.regs[3].
        * NEWS: Mention this change.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: use PRINT_FIELD_* macros, add abbreviating in print_v4l2_queryctrl
        * v4l2.c (print_v4l2_queryctrl): Use PRINT_FIELD_XVAL for the type field
        printing; use PRINT_FIELD_D for minimum, maximum, step, and
        default_value fields printing; use PRINT_FIELD_FLAGS for the flags field
        printing; print minimum, maximum, step, default_value, and flags fields
        only if abbrev(tcp) is not set.
        * tests/ioctl_v4l2-success.c: Update expected output.

        Suggested-by: Philippe De Muyter <phdm@macqel.be>
        References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: simplify print_v4l2_queryctrl and use print_v4l2_cid.
        Instead of fragile hacks aroung V4L2_CTRL_FLAG_NEXT_CTRL flag, (always)
        save the id field on entering, restore it later on exiting, and print it
        second time only if it has changed.  That also simplifies the flow
        with clear entering/exiting code parts separation.

        The usage of print_v4l2_cid for id field printing has introduced several
        (anticipated) output formatting changes, hence the changes in expected
        output.

        * v4l2.c (print_v4l2_queryctrl): Save c.id on entering, print it using
        print_v4l2_cid with next_flags set to true, and return 0; remove
        "entering(tcp) || get_tcb_priv_ulong(tcp)" logic; restore the entering
        id value  into entry_id variable on exiting, compare it to the exiting
        c.id value and print c.id again if it is different; do not check if tcp
        is exiting; always return RVAL_IOCTL_DECODED at the end of the function.
        * tests/ioctl_v4l2.c: Update expected output.
        * tests/ioctl_v4l2-success.c: Likewise.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: add support for V4L2_CTRL_FLAG_NEXT_* flags printing to print_v4l2_cid
        * v4l2.c: Move "xlat/v4l2_control_query_flags.h" inclusion before
        print_v4l2_cid.
        (print_v4l2_cid): Remove const qualifier from cid, add bool next_flags
        argument; print v4l2_control_query_flags and NAND them from cid if they
        are present.
        (print_v4l2_control): Pass false as next_flags to the print_v4l2_cid
        call.

        References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add generation of flags-related fields.
        Generate known flags mask and maximum string length.

        * xlat.h (struct xlat): Add fields flags_strsz and flags_mask.
        * xlat/gen.sh (print_xlat, print_xlat_pair): Add generation of
        XLAT_VAL_n and XLAT_STR_n macros.
        (gen_header): Generate flags_strsz and flags_mask fields' values using
        the generated XLAT_VAL_n and XLAT_STR_n macros, undefine them
        afterwards.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: handle -Xraw in print_v4l2_cid.
        Print class ID as simple hex value in that case.

        * v4l2.c (print_v4l2_cid): Print cid as hex and return if
        xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: use xsprintf instead of asprintf in print_v4l2_cid.
        Avoid an allocation and steamline code a bit.

        * v4l2.c (print_v4l2_cid): Change tmp_str to a stack-allocated char array,
        print to it with xsprintf, eliminate no longer needed free() call.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: provide V4L2_CTRL_FLAG_NEXT_CTRL in an xlat.
        * xlat/v4l2_control_query_flags.in: New file.
        * v4l2.c: Include "xlat/v4l2_control_query_flags.h".
        (print_v4l2_queryctrl): Remove "ifdef V4L2_CTRL_FLAG_NEXT_CTRL" guard.
        * tests/ioctl_v4l2.c [!V4L2_CTRL_FLAG_NEXT_CTRL]
        (V4L2_CTRL_FLAG_NEXT_CTRL): New macro.
        (main) [!V4L2_CTRL_FLAG_NEXT_CTRL]: Remove.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: decode frame intervals/sizes unconditionally.
        * configure.ac (AC_CHECK_TYPES): Check for struct v4l2_frmsizeenum
        and struct v4l2_frmivalenum.
        * types/v4l2.h (struct_v4l2_frmsize_discrete, struct_v4l2_frmsize_stepwise,
        struct_v4l2_frmsizeenum, struct_v4l2_frmival_stepwise,
        struct_v4l2_frmivalenum): New type definitions.
        v4l2.c: Remove "ifdef VIDIOC_ENUM_FRAMESIZES" guards.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_ENUM_FRAMESIZES,
        VIDIOC_ENUM_FRAMEINTERVALS): Uncomment.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands.
        * types/v4l2.h (struct_v4l2_area, struct_v4l2_ext_control,
        struct_v4l2_ext_controls): New type definitions.
        * v4l2.c (print_v4l2_ext_control, print_v4l2_ext_controls): Do not guard
        with VIDIOC_S_EXT_CTRLS anymore.
        (v4l2_ioctl) <case VIDIOC_S_EXT_CTRLS, case VIDIOC_TRY_EXT_CTRLS, case
        VIDIOC_G_EXT_CTRLS>: Likewise.
        (print_v4l2_ext_control): Do not guard size and string field printing
        with HAVE_STRUCT_V4L2_EXT_CONTROL_STRING.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
        VIDIOC_TRY_EXT_CTRLS): Uncomment.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: bundle struct v4l2_format and related types.
        * configure.ac (AC_CHECK_TYPES): Check for struct v4l2_meta_format,
        struct v4l2_pix_format_mplane, struct v4l2_plane_pix_format,
        and struct v4l2_sdr_format.
        * types/v4l2.h (struct_v4l2_clip, struct_v4l2_format): Typedef to an anonymous
        type definition.
        (struct_v4l2_pix_format, struct_v4l2_plane_pix_format,
        struct_v4l2_pix_format_mplane, struct_v4l2_window,
        struct_v4l2_vbi_format, struct_v4l2_sliced_vbi_format,
        struct_v4l2_sliced_vbi_cap, struct_v4l2_sdr_format,
        struct_v4l2_meta_format): New typedefs.
        * v4l2.c (print_v4l2_format_fmt): Remove guard macros, decode
        fmt.win.global_alpha and fmt.sdr.buffersize only when they are non-zero.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: provide struct v4l2_capability definition.
        * types/v4l2.h (struct_v4l2_capability): New typedef.
        * v4l2.c: Check struct v4l2_capability
        with CHECK_V4L2_STRUCT_RESERVED_SIZE.
        (print_v4l2_capability): Change type of caps variable
        to struct_v4l2_capability; drop HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS
        guard; print device_caps field only if it's non-zero.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: bundle struct v4l2_create_buffers definition.
        * configure.ac (AC_CHECK_TYPES): Add a check for
        struct v4l2_create_buffers definition.
        * types/v4l2.h: New file.
        * v4l2.c (DEF_MPERS_TYPE(struct_v4l2_create_buffers)): Remove
        VIDIOC_CREATE_BUFS guard.
        (struct_v4l2_create_buffers): Remove typedef.
        (struct_v4l2_buffer, struct_v4l2_clip, struct_v4l2_ext_control,
        struct_v4l2_ext_controls, struct_v4l2_format, struct_v4l2_framebuffer,
        struct_v4l2_input, struct_v4l2_standard): Move to types/v4l2.h.
        [HAVE_STRUCT_V4L2_CREATE_BUFFERS]: Check struct v4l2_create_buffers
        with CHECK_V4L2_STRUCT_RESERVED_SIZE.
        * xlat/v4l2_ioctl_cmds.in (VIDIOC_CREATE_BUFS): Uncomment.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: add V4L2 ioctl command constant macros.
        For now, only those that we support, and only for those we don't
        conditionalise in code, since the fall-back definitions require
        the relevant type definitions, and not all of them are always
        available.

        * xlat/v4l2_ioctl_cmds.in: New file.
        * v4l2.c: Include "xlat/v4l2_ioctl_cmds.h" under XLAT_MACRO_ONLY
        definition.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: add shorthand macros for v4l2 type checks.
        Some wrappers for common static_assert checks.

        * v4l2.c (CHECK_V4L2_STRUCT_SIZE, CHECK_V4L2_RESERVED_SIZE.
        CHECK_V4L2_STRUCT_RESERVED_SIZE): New macros.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: improve buffer flag decoding.
        * xlat/v4l2_buf_flags.in: Add fallback values.
        * xlat/v4l2_buf_flags_masks.in: New file.
        * xlat/v4l2_buf_flags_ts_src.in: Likewise.
        * xlat/v4l2_buf_flags_ts_type.in: Likewise.
        * v4l2.c: Include xlat/v4l2_buf_flags_ts_type.h,
        xlat/v4l2_buf_flags_ts_src.h, xlat/v4l2_buf_flags_masks.h.
        (print_v4l2_buffer_flags): New function.
        (print_v4l2_buffer): Call print_v4l2_buffer_flags for printing flags field.
        * tests/ioctl_v4l2-success.c: Update expected output.

        References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: use standard kernel version printing routine.
        The way kernel version is printed in print_v4l2_capability was
        non-standard, didn't respect xlat styles, and was incorrect for major
        values 256 and greater.  Moreover, there is a routine that exists
        specifically for this purpose now.  Let's use it and solve all
        the aforementioned issues.

        * v4l2.c (print_v4l2_capability): Use print_kernel_version for the
        kernel version printing.
        * tests/ioctl_v4l2-success.c: Update the expected output.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add v4l2 ioctl success injection-based tests.
        * tests/ioctl_v4l2-success.c: New file.
        * tests/ioctl_v4l2-success-Xabbrev.c: Likewise.
        * tests/ioctl_v4l2-success-Xraw.c: Likewise.
        * tests/ioctl_v4l2-success-Xverbose.c: Likewise.
        * tests/ioctl_v4l2-success-v.c: Likewise.
        * tests/ioctl_v4l2-success-v-Xabbrev.c: Likewise.
        * tests/ioctl_v4l2-success-v-Xraw.c: Likewise.
        * tests/ioctl_v4l2-success-v-Xverbose.c: Likewise.
        * tests/.gitignore: Add ioctl_v4l2-success,
        ioctl_v4l2-success-Xabbrev, ioctl_v4l2-success-Xraw,
        ioctl_v4l2-success-Xverbose, ioctl_v4l2-success-v,
        ioctl_v4l2-success-v-Xabbrev, ioctl_v4l2-success-v-Xraw,
        ioctl_v4l2-success-v-Xverbose.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in: Add ioctl_v4l2-success,
        ioctl_v4l2-success-Xabbrev, ioctl_v4l2-success-Xraw,
        ioctl_v4l2-success-Xverbose, ioctl_v4l2-success-v,
        ioctl_v4l2-success-v-Xabbrev, ioctl_v4l2-success-v-Xraw tests,
        * tests/tests.h (struct strval32): New type, similar to struct strval64.

        tests: use ioctl-success.sh for ioctl_perf-success test.
        * tests/ioctl_perf-success.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove it.
        * tests/gen_tests.in: Add ioctl_perf-success test.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: always check ioctl_perf-success.
        It makes little sense to conditionalise this test, since it bundles
        all the required definitions and types in case of absense of them
        in the kernel headers.

        * tests/ioctl_perf-success.c: Remove HAVE_LINUX_PERF_EVENT_H guard,
        update directives' indentation.
        (include <linux/perf_event.h>): Put under HAVE_LINUX_PERF_EVENT_H guard.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add a runner for ioctl decoder tests that use success injection.
        * tests/ioctl-success.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.

        v4l2: print capability and rxsubchans fields of struct v4l2_tuner as flags
        * v4l2.c (print_v4l2_tuner): Use printflags instead of printxval
        for printing capability and rxsubchans fields of struct v4l2_tuner.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: comment unknown tuner types with "V4L2_TUNER_???" and not "V4L2_TUNER_TYPE_???"
        All the xlat constants include only "V4L2_TUNER_" part.

        * v4l2.c (print_v4l2_tuner) <printxval(v4l2_tuner_types, ...)>: Change
        the last argument from V4L2_TUNER_TYPE_???" to "V4L2_TUNER_???"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: do not print struct v4l2_control.value field name second time on exiting
        To conform the output formatting in other places.

        * v4l2.c (print_v4l2_control): Do not print "value=" on exiting to
        prefix the changed value.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print exiting structure fields as a separate structure.
        To conform with the output formatting in other places.

        * v4l2.c (print_v4l2_format, print_v4l2_streamparm): Close the structure
        with "}" before the arrow and open it again with "{".

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print struct v4l2_standard.framelines as unsigned.
        Since it is defined that way.

        * v4l2.c (print_v4l2_standard): Print framelines as unsigned.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print struct v4l2_outputparm.outputmode using v4l2_capture_modes flags
        As it is treated the same way as struct v4l2_captureparm.capturemode.

        * v4l2.c (print_v4l2_streamparm): Print struct
        v4l2_outputparm.outputmode using v4l2_capture_modes flags.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print struct v4l2_{capture,output}parm.extendedmode as hex.
        As it is likely to be treated similarly to capturemode/outputmode, which
        are bit sets.

        * v4l2.c (print_v4l2_streamparm): Print extendedmode field as hex.
        * tests/ioctl_v4l2.c: Update expected output.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/fill_memory: add 16-bit-wide and 32-bit-wide memory-filling routines
        * tests/tests.h (fill_memory16_ex, fill_memory16, fill_memory32_ex,
        fill_memory32): New declarations.
        * tests/fill_memory.c (fill_memory16_ex, fill_memory16,
        fill_memory32_ex, fill_memory32): New functions.

        tests: move struct strval64 definition to tests.h.
        * tests/fanotify_mark.c (struct strval64): Move it...
        * tests/tests.h: ...here. Include <stdint.h>.

        v4l2: remove spaces around "=" in struct v4l2_buffer.timestamp output.
        * v4l2.c (print_v4l2_buffer): Remove spaces around equality sign
        in ", timestamp = ".

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print struct v4l2_vbi_format.flags as flags.
        Since V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED are treated as independent
        bits in code.

        * v4l2.c (print_v4l2_format_fmt): Use printflags instead of printxval
        for f->fmt.vbi.flags printing.

        Fixes: v4.17~103 "v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: print struct v4l2_vbi_format.start elements as signed integers.
        Since they are defined in videodev2.h that way.

        * v4l2.c (dprint_ioctl_v4l2): Print struct v4l2_vbi_format.start
        elements using %d and not %u.
        * tests/ioctl_v4l2.c (print_v4l2_format_fmt): Likewise.

        Fixes: v4.17~103 "v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_v4l2: add checks for decoding unknown/unsupported commands.
        * tests/ioctl_v4l2.c: Include <stdint.h>.
        (main): Add checks for decoding of unknown and unsupported ioctl
        commands that have 'V' command type.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: re-define broken _IOC_SIZE on sparc.
        _IOC_SIZE macro definition on sparc breaks the invariant

             _IOC_SIZE(_IOC(dir, type, nr, size)) == size

        for _IOC_DIR(val) that contains neither _IOC_READ nor _IOC_WRITE,
        so it is unsuitable for strace's purposes. Re-define it in a way
        that preserves the aforementioned invariant.

        * ioctl.c [SPARC || SPARC64] (_IOC_SIZE): Re-define.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: short-circuit handling of unknown buffer types.
        We do not need to call print_v4l2_format_fmt on exiting to get empty
        output again.

        * v4l2.c (print_v4l2_format_fmt): Add a default branch that returns
        false.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_v4l2: increase coverage a bit.
        Try to hit some previously missed branches.

        * tests/ioctl_v4l2.c (init_v4l2_format): Set num_planes to 1 if buffer
        type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; set clipcount to 3 if
        buffer type is V4L2_BUF_TYPE_VIDEO_OVERLAY.
        (dprint_ioctl_v4l2): Update expected output.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add KEY_SELECTIVE_SCREENSHOT to evdev_keycode.
        * xlat/evdev_keycode.in (KEY_SELECTIVE_SCREENSHOT): New constant,
        introduced by Linux commit v5.5-rc5-51-g3b059da9835c and updated
        in Linux commit v5.5-rc5-55-gfbf66796a0ae.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        debian/control: remove ppc64el from gcc-multilib architectures.
        Little-endian POWER ISA has no 32-bit compat on Linux (and strace has
        no mpers support on ppc64le), so gcc-multilib package is not needed
        there.

        * debian/control (Build-Depends): Remove ppc64el from the list
        of gcc-multilib architectures.

        Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
        Fixes: v4.23~364 "debian: enable mpers support for ppc64el and s390x"

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: warn about -S option uselessness in absence of -c/-C.
        * strace.c (init): Add sortby_set local variable.
        (init) <case 'S'>: Set sortby_set to true.
        (init): Warn if sortby_set is set and cflag is not.
        * tests/options-syntax.test: Add a check.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: add support for IORING_{UN,}REGISTER_PERSONALITY commands.
        Introduced by Linux commit v5.6-rc1~123^2~5.

        * xlat/uring_register_opcodes.in (IORING_REGISTER_PERSONALITY,
        IORING_UNREGISTER_PERSONALITY): New constants.
        * tests/io_uring_register.c: Update expected output.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: support IORING_REGISTER_PROBE io_uring_register command.
        Introduced by Linux commit v5.6-rc1~123^2~22.

        * xlat/uring_op_flags.in: New file.
        * xlat/uring_ops.in: Likewise.
        * xlat/uring_register_opcodes.in (IORING_REGISTER_PROBE): New constant.
        * types/io_uring.h (struct_io_uring_probe_op, struct_io_uring_probe):
        New type definitions.
        * io_uring.c: Include "xlat/uring_op_flags.h", "xlat/uring_ops.h".
        (print_io_uring_probe_op, print_io_uring_probe): New functions.
        (SYS_FUNC(io_uring_register)): Add rc variable; print fd and opcode
        on entering only, call print_io_uring_probe if opcode
        is IORING_REGISTER_PROBE; print nargs if rc is non-zero or if it is
        exiting; return rc in the end.
        * tests/io_uring_register.c [HAVE_STRUCT_IO_URING_PROBE]: Add checks.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: de-indent some code in io_uring_setup decoder.
        * io_uring.c (SYS_FUNC(io_uring_setup)): De-indent code in the exiting
        path.

2020-03-28  Dmitry V. Levin  <ldv@altlinux.org>

        Fix various typos found using codespell tool.
        * NEWS: Replace "Enchanced" with "Enhanced".
        * list.h: Replace "embedded withing" with "embedded within".
        * maint/gen-contributors-list.sh: Replace "contributer"
        with "contributor".
        * tests/futex.c: Replace "succeedes" with "succeeds".
        * tests/nsyscalls-d.test: Replace "debug ouput" with "debug output".
        * tests/s390_sthyi.c: Replace "descriptior" with "descriptor".

2020-03-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix strace-DDD.test for the case when strace has a process subreaper
        The test used to assume that the process reaper has pid 1, which is not
        necessarily the case, e.g. there might be a process subreaper different
        from pid 1.

        * tests/get_process_reaper.c: New file.
        * tests/Makefile.am (check_PROGRAMS): Add get_process_reaper.
        * tests/.gitignore: Likewise.
        * tests/strace-DDD.test: Invoke get_process_reaper to find out
        the process reaper id, use the latter in subsequent checks
        instead of pid 1.

        References: https://bugs.debian.org/947396
        Resolves: https://github.com/strace/strace/issues/129

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_v4l2.c: whitespace fix.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add ARG_XLAT_KNOWN and ARG_XLAT_UNKNOWN macros.
        An amalgam of ARG_STR and XLAT_KNOWN/XLAT_UNKNOWN.

        * tests/tests.h (ARG_XLAT_KNOWN, ARG_XLAT_UNKNOWN): New macros.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add v4l2 ioctl -v tests.
        * tests/ioctl_v4l2-v.c: New file.
        * tests/ioctl_v4l2-v-Xabbrev.c: Likewise.
        * tests/ioctl_v4l2-v-Xraw.c: Likewise.
        * tests/ioctl_v4l2-v-Xverbose.c: Likewise.
        * tests/.gitignore: Add ioctl_v4l2-v, ioctl_v4l2-v-Xabbrev,
        ioctl_v4l2-v-Xraw, ioctl_v4l2-v-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_v4l2-v, ioctl_v4l2-v-Xabbrev,
        ioctl_v4l2-v-Xraw, ioctl_v4l2-v-Xverbose): New tests.

        v4l2: do not fancy-print fourcc if -Xraw is set.
        * v4l2.c (print_pixelformat): Print fourcc as a hexadecimal value and
        return.
        * tests/ioctl_v4l2.c (dprint_ioctl_v4l2, main): Update expected output.

        tests: add ioctl_v4l2 xlat style tests.
        * tests/ioctl_v4l2-Xabbrev.c: New file.
        * tests/ioctl_v4l2-Xraw.c: Likewise.
        * tests/ioctl_v4l2-Xverbose.c: Likewise.
        * tests/.gitignore: Add ioctl_v4l2-Xabbrev, ioctl_v4l2-Xraw,
        ioctl_v4l2-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_v4l2-Xabbrev, ioctl_v4l2-Xraw,
        ioctl_v4l2-Xverbose): New tests.
        * tests/tests.h: (XLAT_SEL, ABBR, RAW, VERB, NABBR, NRAW, NVERB): New
        macros.
        * tests/ioctl_v4l2.c (dprint_ioctl_v4l2): Change request
        to XLAT_SEL(reqval, reqstr); use XLAT_SEL(buf_type, buf_type_string)
        in printed strings.
        (print_ioctl_v4l2): Pass XLAT_SEL(request, #request) instead of the
        second argument.
        (main): Update expected output.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move XLAT_FMT and XLAT_ARGS macros from sock_filter-v.c to tests.h
        In preparation of using elsewhere.

        * tests/sock_filter-v.c (XLAT_FMT, XLAT_ARGS): Move ...
        * tests/tests.h: ... here, replacing HEX_FMT with "%#x".

2020-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: switch to PTRACE_GETREGS API.
        Implement PTRACE_GETREGS API introduced on hppa by Linux kernel commit
        v4.7-rc1~58^2~10.

        * configure.ac [hppa]: Remove arch_enable_Werror=no.
        * linux/hppa/get_syscall_result.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * linux/hppa/arch_regs.c (hppa_regs): New variable.
        (ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
        (hppa_r28, PT_GR20, PT_GR28, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR):
        Remove.
        * linux/hppa/get_error.c (arch_get_error): Use hppa_regs.gr[28].
        * linux/hppa/get_scno.c (arch_get_scno): Use hppa_regs.gr[20].
        * linux/hppa/get_syscall_args.c (arch_get_syscall_args): Use
        hppa_regs.gr.
        * linux/hppa/set_error.c (arch_set_error, arch_set_success): Use
        hppa_regs.gr[28].
        * linux/hppa/set_scno.c (arch_set_scno): Use hppa_regs.gr[20].
        * NEWS: Mention this change.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        build: enable compiler -Werror option by default.
        If gcc is 4.8+ or clang is 6.0+, and the architecture implements either
        PTRACE_GETREGS or PTRACE_GETREGSET, enable compiler -Werror option
        by default.

        * configure.ac: Call st_WARN_CFLAGS and AX_PROG_CC_FOR_BUILD after
        architecture checks.
        (arch_enable_Werror): New variable, defined to "yes" on all architectures
        except alpha, bfin, hppa, microblaze, sh, sh64, and xtensa.
        * m4/st_warn_cflags.m4 (st_cv_cc_enable_Werror, st_cv_enable_Werror):
        Compute new cached variables.
        (AC_ARG_ENABLE(gcc-Werror)): Default to $st_cv_enable_Werror
        if no option was given, do not add -Werror to WARN_CFLAGS.
        [enable_gcc_Werror == yes]: Add -Werror to WARN_CFLAGS.
        * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect
        st_cv_enable_Werror and st_cv_cc_enable_Werror using pushdef/popdef.
        * ci/run-build-and-tests.sh (DISTCHECK_CONFIGURE_FLAGS): Add
        --enable-gcc-Werror unconditionally.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround clang compilation warnings.
        Silence the following incorrect compilation warnings produced by clang:

        tests/filter_seccomp-flag.c:39:28: warning: variable 'sysent1' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        static const struct_sysent sysent1[] = {
        tests/filter_seccomp-flag.c:45:28: warning: variable 'sysent2' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        static const struct_sysent sysent2[] = {

        * tests/filter_seccomp-flag.c (sysent1, sysent2): Remove static
        qualifier.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix musl compilation warnings.
        Silence the following types of compilation warnings generated by gcc
        with musl system headers:

        tests/net-sockaddr.c: In function 'check_x25':
        tests/net-sockaddr.c:430:19: warning: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
          rc = connect(-1, x25, sizeof(c_x25) - 1);
                           ^~~
        In file included from tests/net-sockaddr.c:16:0:
        /opt/musl/include/sys/socket.h:332:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_x25 *'
         int connect (int, const struct sockaddr *, socklen_t);
             ^~~~~~~

        tests/so_error.c: In function 'reserve_ephemeral_port':
        tests/so_error.c:40:16: warning: passing argument 2 of 'bind' from incompatible pointer type [-Wincompatible-pointer-types]
           if (bind(sd, &addr, sizeof(addr)) == 0)
                        ^
        In file included from /opt/musl/include/netinet/in.h:10:0,
                         from tests/so_error.c:14:
        /opt/musl/include/sys/socket.h:331:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in *'
         int bind (int, const struct sockaddr *, socklen_t);
             ^~~~

        * tests/net-sockaddr.c (check_x25): Pass a pointer of type 'void *' as
        the second argument of connect() call.
        * tests/so_error.c (main): Likewise.
        (reserve_ephemeral_port): Pass a pointer of type 'void *' as the second
        argument of bind() call.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: store average time as struct timespec.
        * count.c (struct call_counts): Change the type of time_avg field
        to struct timespec, all users updated.

        util: change the integer type in ts_mul and ts_div to uint64_t.
        * defs.h (ts_mul, ts_div): Change the type of the last argument
        to uint64_t.
        * util.c (ts_mul, ts_div): Likewise.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: use dashes in option argument names.
        Dashes are more common among long optiona arguments, so let's support
        (and prefer) them.

        * count.c (column_aliases): Add variants with dashes for aliases with
        underscores.
        * strace.1.in (.SS Statistics): Use dashes in column names in -S and -U
        option descriptions.
        * strace.c (usage): Likewise.
        * tests/options-syntax.test: Add checks.
        * tests/strace-S.test: Use dashes in some column names.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: add information about minimum and maximum call duration.
        * count.c (struct call_counts): Add time_min, time_max fields.
        (max_ts): New constant.
        (enum count_summary_columns): Add CSC_TIME_MIN, CSC_TIME_MAX.
        (count_syscall): Fill time_min field with max_ts in counts
        initialisation, update time_min and time_max.
        (min_time_cmp, max_time_cmp): New functions.
        (set_sortby): Add keys for them.
        (set_count_summary_columns): Add support for time_min and time_max
        fields printing.
        * strace.1.in (.SH OPTIONS) <-S, -U>: Document it.
        * strace.c (usage): Likewise.
        * tests/strace-S.test: Add checks.
        * tests/options-syntax.test: Likewise.

        Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=240945
        Closes: https://github.com/strace/strace/issues/32

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        count: add ability to select columns being shown.
        * count.c (set_count_summary_columns): New function.
        * defs.h (set_count_summary_columns): New declaration.
        * strace.c (init) <columns_set>: New local variable.
        (init) <optstring>: Add "U:".
        (init) <longopts>: Add "summary-columns" long option.
        (init) <case 'U'>: Pass option argument to set_count_summary_columns.
        (usage): Document it. Add missing -O/-S options to synopsis.
        * strace.1.in (.SS Statistics): Likewise.
        * strace.c (usage): Likewise.
        * tests/options-syntax.test: Add option syntax checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: factor out column alias names.
        Since any column can be sorted now, we can maintain just an alias
        to column mapping, which is also going to be used for column selection
        functionality.

        * count.c (column_aliases): New static constant array.
        (sort_func): New typedef.
        (sortfun): Change type to sort_func.
        (set_sortby): Replace alias to sort function mapping with an
        column-indexed array of sorting functions in sort_fns, ajust the code
        accordingly.
        * tests/options-syntax.test: Add checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: add ability to sort on avg_time field.
        For completeness.

        * count.c (avg_time_cmp): New function.
        (set_sortby): Add sort keys for avg_time sorting.
        * strace.1.in (.SH OPTIONS) <-S>: Document it.
        * strace.c (usage): Likewise.
        * tests/strace-S.test: Add check.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: refactor statistics calculation/output.
        In preparation to extension.

        * count.c (enum count_summary_columns): New enumeration type.
        (struct call_counts): Add time_avg field.
        (DEF_COLUMNS): New macro.
        (columns, visible): New variables.
        (num_chars): New function.
        (call_summary_pers): Calculate aggregate data first, then output table
        based on columns configuration.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: wire up PR_SET_IO_FLUSHER and PR_GET_IO_FLUSHER prctl options.
        * xlat/prctl_options.in (PR_SET_IO_FLUSHER, PR_GET_IO_FLUSHER): New
        constants, introduced by Linux kernel commit v5.6-rc1~122^2.
        * prctl.c (SYS_FUNC(prctl)): Wire up PR_SET_IO_FLUSHER
        and PR_GET_IO_FLUSHER options.

        xlat: sort prctl_options entries, add #sorted.
        * xlat/prctl_options.in: Sort the entries, align the values, add #sorted,
        add comments about PR_SET_VMA and PR_SET_PTRACER.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtc: decode RTC Voltage Low value as flags.
        Introduced by Linux kernel commit v5.6-rc1~71^2~57

        * xlat/rtc_vl_flags.in: New file.
        * rtc.c (decode_rtc_vl): New function.
        (rtc_ioctl) <case RTC_VL_READ>: Call it instead of printnum_int.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtc: bundle ioctl number definitions.
        This makes decoding more reliable as it no longer depends
        on definitions of these ioctl commands the kernel headers.

        * xlat/rtc_ioctl_cmds.in: New file.
        * rtc.c: Include <xlat/rtc_ioctl_cmds.h>.
        (rtc_ioctl): Remove RTC_VL_READ and RTC_VL_CLR guards.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sched: implement utilisation clamping fields decoding.
        And also handle the piggybacked SCHED_FLAG_KEEP_PARAMS flag
        introduced by Linux kernel commit v5.3-rc1~201^2~5.

        * xlat/sched_flags.in (SCHED_FLAG_KEEP_PARAMS,
        SCHED_FLAG_UTIL_CLAMP_MIN, SCHED_FLAG_UTIL_CLAMP_MAX): New constants.
        * sched_attr.h (struct sched_attr): Add sched_util_min and
        sched_util_max fields.
        (SCHED_ATTR_SIZE_VER1): New macro.
        * sched.c (print_sched_attr): Do not print sched_policy field if
        SCHED_FLAG_KEEP_PARAMS flag is set in sched_setattr; do not print
        sched_nice, sched_priority, sched_runtime, sched_deadline,
        and sched_period fields if SCHED_FLAG_KEEP_PARAMS flag is set
        in sched_setattr; print sched_util_min and sched_util_max field if
        size is at least PRINT_FIELD_U; use attr.size instead of usize in
        sched_getattr for determining whether ellipsis is needed to be printed.
        * tests/sched_xetattr.c: Update expected output, add checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        sched: add SCHED_FLAG_KEEP_POLICY flag support.
        Introduced by Linux kernel commit v5.3-rc1~201^2~6.

        * xlat/sched_flags.in (SCHED_FLAG_KEEP_POLICY): New constant.
        * sched.c (print_sched_attr): Add is_set variable, set it to true
        if passed usize is zero, print policy if it is sched_getattr,
        it is negative, or if SCHED_FLAG_KEEP_POLICY is not set.
        * tests/sched_xetattr.c: Update expected output, add a check.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sched: refactor print_sched_attr.
        Steamline it a bit and convert to PRINT_FIELD_* macros usage,
        in anticipation of the upcoming changes.

        * sched.c: Include "print_fields.h".
        (PRINT_SCHED_FIELD): Remove macro.
        (print_sched_attr): Use PRINT_FIELD_* macros for printing fields, use
        goto instead of size-checking condition block.

2020-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        github: check source code for whitespace errors on every push and pull request
        * .github/workflows/source-code-check.yml: New file.

2020-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: decode IFLA_PERM_ADDRESS attribute.
        Introduced by Linux commit v5.6-rc1~151^2~262^2~4.

        * configure.ac (AC_CHECK_DECLS): Check for IFLA_PERM_ADDRESS.
        * rtnl_link.c (ifinfomsg_nla_decoders): Wire up IFLA_PERM_ADDRESS
        attribute using decode_nla_hwaddr.
        * xlat/rtnl_link_attrs.in (IFLA_PERM_ADDRESS): New constant.

2020-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: use the family from ifinfomsg.
        * rtnl_link.c (decode_ifla_hwaddr): New function,
        decode_nla_hwaddr_family wrapper that passes the value from
        struct ifinfomsg (passed in opaque data) to it.
        (ifinfomsg_nla_decoders) <IFLA_ADDRESS, IFLA_BROADCAST>: Use
        decode_ifla_hwaddr as decoder.
        (decode_ifinfomsg): Pass ifinfo as opaque_data in decode_nlattr call.

        nlattr: implement generic hardware address nlattr decoder.
        * nlattr.c (decode_nla_hwaddr): New function.
        * nlattr.h (DECL_NLA(hwaddr)): New declaration.
        (NLA_HWADDR_FAMILY_OFFSET): New macro.
        (decode_nla_hwaddr_family, decode_nla_hwaddr_nofamily): New functions.
        * rtnl_link.c (ifla_info_data_bridge_nla_decoders) <IFLA_BR_GROUP_ADDR>:
        Use nlattr_hwaddr_nofamily.
        * rtnl_neigh.c (decode_neigh_lladdr): Remove.
        (ndmsg_nla_decoders) <NDA_LLADDR>: Change decoder
        from decode_neigh_lladdr to decode_nla_hwaddr_nofamily.
        * tests/nlattr_ifla_linkinfo.c: Update expected output.
        * tests/nlattr_ndmsg.c: Likewise.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_mac: avoid passing sizes greater than MAX_ADDR_LEN to sprint_mac_addr
        As sprint_mac_addr (rightfully) bails out on those, simply print those
        as strings.

        * print_mac.c (print_mac_addr, print_hwaddr): Print address raw and
        avoid calling sprint_mac_addr if the size is greater than MAX_ADDR_LEN.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_mac: do not limit address length for hwaddr families 806..819.
        It seems that it has been overlooked.

        * print_mac.c (hwaddr_sizes): Initialise array with default value of 255
        up to ARPHRD_VSOCKMON.

        Fixes: v4.23~129 "sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR"

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: add IFLA_PROP_LIST and IFLA_ALT_IFNAME attribute type support
        Introduced by Linux commit v5.5-rc1~174^2~448^2~4.

        * configure.ac (AC_CHECK_DECLS): Check for IFLA_PROP_LIST
        and IFLA_ALT_IFNAME.
        * rtnl_link.c (decode_ifla_prop_list_attr, decode_ifla_prop_list): New
        functions.
        (ifinfomsg_nla_decoders): Decode IFLA_PROP_LIST with
        decode_ifla_prop_list, decode IFLA_ALT_IFNAME with decode_nla_str.
        * tests/nlattr_ifinfomsg.c: Add checks.
        * xlat/rtnl_link_attrs.in (IFLA_PROP_LIST, IFLA_ALT_IFNAME): New
        constants.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: use QUOTE_EXPECT_TRAILING_0 in decode_nla_str.
        In order to signify the absence of the trailing \0 in string
        and print embedded \0 at the same time.

        * nlattr.c (decode_nla_str): Provide
        QUOTE_OMIT_TRAILING_0 | QUOTE_EXPECT_TRAILING_0 flags instead
        of QUOTE_0_TERMINATED flag to printstr_ex call.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add a separate flag for printing ellipsis in absence of \0 in strings
        In cases where we know the size of the string to be printed
        (for example, in decode_nla_str and likely somewhere else),
        it is probably better to print embedded \0's (so, do not pass
        QUOTE_0_TERMINATED).  Unfortunately, printstr_ex doesn't have a separate
        flag for printing ellipsis in case no \0 occurred at all, so let's
        introduce it.

        * defs.h (QUOTE_EXPECT_TRAILING_0): New macro.
        (QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES,
        QUOTE_OMIT_TRAILING_0): Document.
        (QUOTE_FORCE_HEX, QUOTE_EMIT_COMMENT): Update values, document.
        * util.c (printstr_ex): Print ellipsis not only on QUOTE_0_TERMINATED,
        but also on QUOTE_EXPECT_TRAILING_0.

2020-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add IPPROTO_ETHERNET to inet_protocols.
        * xlat/inet_protocols.in (IPPROTO_ETHERNET): New constant, introduced
        by Linux commit v5.6-rc6~23^2~9.

2020-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify read-write test.
        * tests/read-write.c (main): Explicitly close descriptors 4 and 5 that
        might be inherited from the parent process.

2020-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        Robustify <linux/if_bridge.h> configure checks.
        Prior to Linux kernel commit v3.18-rc5~22^2~32 <linux/if_bridge.h> was
        incomplete: it used struct in6_addr but didn't include a header with a
        definition.  Apply the same workaround in configure checks as in other
        parts of strace: include <netinet/in.h> before <linux/if_bridge.h>.

        * configure.ac: Include <netinet/in.h> before <linux/if_bridge.h>.
        * types/gen.sh (gen_m4_check): Specify INCLUDES parameter in the
        generated AC_CHECK_HEADERS invocation.

2020-03-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: change style argument type of print_xlat_ex to uint32_t.
        ...and add some documentation. Otherwise, clang complains about it:

            warning: implicit conversion from enumeration type
            'enum xlat_style_private_flags' to different enumeration type
            'enum xlat_style' [-Wenum-conversion]
                            print_xlat_ex(cid, "V4L2_CID_???", PXF_DEFAULT_STR);
                            ~~~~~~~~~~~~~                      ^~~~~~~~~~~~~~~

        * defs.h (print_xlat_ex): Change the type of style argument to uint32_t,
        add doxydoc.
        * xlat.c (print_xlat_ex): Change the type of style argument to uint32_t.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        util: define either ilog2_64 or ilog2_32.
        Depending on the value of SIZEOF_KERNEL_LONG_T, either ilog2_64 or
        ilog2_32 is used as an implementation of ilog2_klong.  Do not define
        the other one to pacify clang that otherwise complains with either

          util.c:1060:1: warning: unused function 'ilog2_32' [-Wunused-function]
          ilog2_32(uint32_t val)

        or

          util.c:1038:1: warning: unused function 'ilog2_64' [-Wunused-function]
          ilog2_64(uint64_t val)

        * util.c (ilog2_64): Define only for [SIZEOF_KERNEL_LONG_T > 4].
        (ilog2_32): Define only for [SIZEOF_KERNEL_LONG_T == 4].

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: include <signal.h> instead of <sys/signal.h>
        <sys/signal.h> is an old stub that exists for compatibility with some
        ancient systems, it just includes <signal.h>.

        * tests/prctl-pdeathsig.c: Include <signal.h> instead of <sys/signal.h>.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that prctl() and <sys/prctl.h> are always available.
        They were introduced in the GNU libc back in 1997,
        so we can safely use them without further checks.

        * configure.ac (AC_CHECK_FUNCS): Remove prctl.
        * strace.c: Include <sys/prctl.h> unconditionally.
        (startup_child): Do not test for HAVE_PRCTL.
        * tests/prctl-name.c: Include <sys/prctl.h> unconditionally, do not test
        for HAVE_PRCTL.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/printpath-umovestr-undumpable.c: Likewise.
        * tests/printstrn-umoven-undumpable.c: Likewise.
        * tests/set_ptracer_any.c: Likewise.
        * tests/seccomp-filter-v.c: Include <sys/prctl.h> unconditionally.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix typo.
        * strace.1.in (.SH HISTORY): Fix spelling of OpenRISC.

        Resolves: https://github.com/strace/strace/issues/128

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        print_timeval: do not use struct timeval provided by libc.
        Use kernel_old_timeval_t provided by our kernel_timeval.h instead of
        struct timeval provided by libc to avoid potential issues if libc
        changes the definition of struct timeval to use 64-bit types on 32-bit
        systems.

        * print_timeval.c: Include "kernel_timeval.h".
        (timeval_t): Change from struct timeval to kernel_old_timeval_t.

        Complements: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        Move kernel_old_timeval definition to kernel_timeval.h.
        It's going to be used later in print_timeval.c

        * kernel_timeval.h: Include "kernel_types.h".
        (kernel_old_timeval_t): New type.
        * printrusage.c: Include "kernel_timeval.h".
        (struct kernel_old_timeval): Remove.
        (rusage_t): Replace struct kernel_old_timeval with kernel_old_timeval_t.

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        printrusage: fix kernel_old_timeval definition to match the kernel.
        The type of struct kernel_old_timeval.tv_usec field is the same
        kernel_long_t as the type of tv_sec field, with one notable exception:
        sparc64 is the only 64-bit architecture where tv_usec field is 32-bit.

        * printrusage.c (struct kernel_old_timeval) [__sparc__ && __arch64__]:
        Change the type of tv_usec field from long to int.
        [!(__sparc__ && __arch64__)]: Change the type of tv_usec field
        from long to kernel_long_t.

        Fixes: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-06  Alistair Francis  <alistair.francis@wdc.com>

        printrusage: fix kernel_old_timeval typo.
        The timeval struct should contain a tv_sec and tv_usec type,
        fix the typo to indicate that it's usec and not nsec.

        This member is never directly accessed here so there are no other
        changes required.


        * printrusage.c (struct kernel_old_timeval): Rename tv_nsec to tv_usec.

        Fixes: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-02  Paul Chaignon  <paul.chaignon@gmail.com>
            Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        bpf: implement decoding of BPF_PROG_ATTACH replace_bpf_fd field.
        * bpf_attr.h (BPF_PROG_ATTACH_struct): Add replace_bpf_fd field
        introduced by Linux kernel commit v5.6-rc1~151^2~199^2~7^2~3.
        (expected_BPF_PROG_ATTACH_struct_size): Update.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)): Decode the new field.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_PROG_ATTACH_checks): Check it.

        bpf: update BPF_* constants.
        * xlat/bpf_attach_flags.in (BPF_F_REPLACE): New constant introduced
        by Linux kernel commit v5.6-rc1~151^2~199^2~7^2~3.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_STRUCT_OPS): New constant
        introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_STRUCT_OPS): New constant
        introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~6.
        (BPF_PROG_TYPE_EXT): New constant introduced by Linux kernel commit
        v5.6-rc1~151^2~46^2~1^2~2.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
        BPF_PROG_QUERY_checks): Update checks and their expected output.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests/bpf: add a guard against untested bpf_map_types updates.
        * tests/bpf.c: Include "xlat/bpf_map_types.h", add a static_assert
        for bpf_map_types_xdata.
        (BPF_MAP_CREATE_checks): Update the first check.

        bpf: implement decoding of struct bpf_map_info.btf_vmlinux_value_type_id field
        * bpf_attr.h (struct bpf_map_info_struct): Insert
        btf_vmlinux_value_type_id field between ifindex and netns_dev fields
        introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
        * bpf.c (print_bpf_map_info): Print btf_vmlinux_value_type_id field.
        * tests/bpf-obj_get_info_by_fd.c [VERBOSE] (main): Print
        btf_vmlinux_value_type_id field if the structure is big enough.

2020-03-02  Paul Chaignon  <paul.chaignon@gmail.com>
            Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        bpf: implement decoding of BPF_MAP_CREATE btf_vmlinux_value_type_id field
        * bpf_attr.h (BPF_MAP_CREATE_struct): Add btf_vmlinux_value_type_id
        field introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
        (expected_BPF_MAP_CREATE_struct_size): Update.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode the new field.
        * NEWS: Mention this.
        * tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
        output.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Add a check that includes
        btf_vmlinux_value_type_id field.

2020-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: add HIDIOCGRAWUNIQ ioctl number decoding.
        * ioctl.c (hiddev_decode_number): Decode HIDIOCGRAWUNIQ introduced
        by Linux kernel commit v5.6-rc1~198^2~1^2.

        ioctl: fix indentation in switch clauses.
        * ioctl.c: Fix indentation in switch clauses, no code changes.

        xlat: update AUDIT_* constants.
        * xlat/nl_audit_types.in: Add #sorted.
        (AUDIT_BPF): New constant, introduced by Linux kernel commit
        v5.6-rc1~151^2~199^2~47.

        xlat: update CLONE_* constants.
        * xlat/clone3_flags.in (CLONE_NEWTIME): New constant, introduced
        by Linux kernel commit v5.6-rc1~177^2~41.
        * xlat/setns_types.in (CLONE_NEWTIME): Likewise.
        * xlat/unshare_flags.in (CLONE_NEWTIME): Likewise.
        * tests/clone3.c (main): Update the expected output.
        * tests/unshare.c (main): Likewise.

        xlat/unshare_flags: reorder and provide fallback definitions for constants
        * xlat/unshare_flags.in: Provide fallback definitions for constants,
        reorder in the ascending order, add #sorted.
        * tests/unshare.c (main): Update the expected output.

        xlat: update GRND_* constants.
        * xlat/getrandom_flags.in (GRND_INSECURE): New constant, introduced
        by Linux kernel commit v5.6-rc1~91^2~20.

        xlat: update IPPROTO_* constants.
        * xlat/inet_protocols.in (IPPROTO_MPTCP): New constant, introduced
        by Linux kernel commit v5.6-rc1~151^2~118^2~8.

        xlat: update RTM_F_* constants.
        * xlat/routing_flags.in: Add #sorted.
        (RTM_F_NOTIFY, RTM_F_CLONED, RTM_F_EQUALIZE, RTM_F_PREFIX,
        RTM_F_LOOKUP_TABLE): Add fallback definitions.
        (RTM_F_FIB_MATCH): New constant, introduced by Linux kernel commit
        v4.13-rc1~157^2~364^2~2.
        (RTM_F_OFFLOAD, RTM_F_TRAP): New constants, introduced by Linux kernel
        commit v5.6-rc1~151^2~91^2~7.

        io_uring: decode IORING_REGISTER_EVENTFD_ASYNC io_uring_reginster command
        * xlat/uring_register_opcodes.in (IORING_REGISTER_EVENTFD_ASYNC): New
        constant introduced by Linux kernel commit v5.6-rc1~123^2~28.
        * io_uring.c (io_uring_register): Handle IORING_REGISTER_EVENTFD_ASYNC
        along with IORING_REGISTER_FILES and IORING_REGISTER_EVENTFD.
        * tests/io_uring_register.c (main): Check it, update expected output.

        xlat: update KVM_* constants.
        * xlat/kvm_cap.in (KVM_CAP_S390_VCPU_RESETS): New constant, introduced
        by Linux kernel commit v5.6-rc1~39^2~3^2~3.

        xlat: add ZONEFS_MAGIC to fsmagic.
        * xlat/fsmagic.in (ZONEFS_MAGIC): New constant, introduced by Linux
        kernel commit v5.6-rc1~2^2~1.

2020-02-26  Alistair Francis  <alistair.francis@wdc.com>

        tests/clock_nanosleep: Skip test if __NR_clock_nanosleep isn't defined.
        Modern (added since Linux kernel 5.1+) 32-bit architectures don't have
        the __NR_clock_nanosleep syscall, if we don't have the syscall let's
        skip the test.


        * tests/clock_nanosleep.c [!__NR_clock_nanosleep]: Skip the test.

2020-02-26  Alistair Francis  <alistair.francis@wdc.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        linux/32: Split 32-bit time_t based syscalls into a separate header.

        Starting with Linux kernel v5.1, new 32-bit architectures
        do not implement old 32-bit time_t based system calls, so
        they should not have the corresponding syscallent records.

        * linux/32/syscallent-time32.h: New file, generated using the following
        command: grep 'timex\?32)' linux/32/syscallent.h
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/32/syscallent.h: Replace entries for 32-bit time_t based
        syscalls with stub comments using the following command:
        sed -i '/timex\?32)/ s/\(^\[[^]]\+\]\)[^"]*"\([^"]\+\)".*/\/\* \1 \2 \*\//'
        [HAVE_ARCH_TIME32_SYSCALLS]: Include "32/syscallent-time32.h".

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: disable seccomp-bpf instead of enabling following forks.
        It is in line with the rest of the checks that disable seccomp-bpf
        usage if it is impossible.

        * strace.c (init) <if (seccomp_filtering)>: Rephrase the error
        if followfork is not set; set seccomp_filtering to false; do not set
        followfork to true.
        * tests/options-syntax.test: Update the expected output.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: warn about uselessness of -A/--output-separately in absence of -o
        * strace.c (init) <if (!outfname)>: Print warnings if output_separately
        and/or open_append.
        * tests/options-syntax.test: Check this.

        Update NEWS.

        strace: add a long option alias for -t.
        * strace.c (tflag): Remove.
        (tflag_scale, tflag_width, tflag_format): New static variables.
        (printleader): Rewrite time stamp printing to allow custom format
        and precision.
        (printleader) <if (rflag)>: Use tflag_format instead of tflag
        as an indicator for presence of absolute timestamps.
        (parse_ts_arg): New function.
        (init) <tflag_str, ttflag_str, tttflag_str>: New static constants.
        (init) <tflag_long_set, tflag_short>: New variables.
        (init) <enum>: Add GETOPT_TS.
        (init) <longopts>: Add "absolute-timestamps" and "timestamps" long
        options.
        (init) <case 't'>: Increment tflag_short instead of tflag.
        (init) <case GETOPT_TS>: Handle the new option using parse_ts_arg.
        (init): Check if tflag_short is set; if tflag_long_set is set as well,
        then bail out, otherwise call parse_ts_arg with the appropriate
        argument; update the message that mentions -t.
        (usage): Document it.
        * strace.1.in (.SS Output format): Likewise.
        * tests/gen_tests.in (strace--absolute-timestamps,
        strace--absolute-timestamps-format-time,
        strace--absolute-timestamps-format-time-precision-s,
        strace--absolute-timestamps-format-time-precision-ms,
        strace--absolute-timestamps-format-time-precision-us,
        strace--absolute-timestamps-format-time-precision-ns,
        strace--absolute-timestamps-format-unix-precision-s,
        strace--absolute-timestamps-format-unix-precision-ms,
        strace--absolute-timestamps-format-unix-precision-us,
        strace--absolute-timestamps-format-unix-precision-ns,
        strace--relative-timestamps, strace--relative-timestamps-s,
        strace--relative-timestamps-ms, strace--relative-timestamps-us,
        strace--relative-timestamps-ns, strace--timestamps,
        strace--timestamps-time, strace--timestamps-time-s,
        strace--timestamps-time-ms, strace--timestamps-time-us,
        strace--timestamps-time-ns, strace--timestamps-unix-s,
        strace--timestamps-unix-ms, strace--timestamps-unix-us,
        strace--timestamps-unix-ns): New tests.
        * tests/options-syntax.test: Add new checks.
        * tests/strace-t.test: Get the option to check via command-line
        arguments.
        * tests/strace-tt.test: Get the precision and option to check
        via command-line arguments.
        * tests/strace-ttt.test: Get the precision and option to check
        via command-line arguments, generate subsec_re appropriately.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: establish -qqq as an alias for --quiet=all.
        Addition of thread-execve and path-resolution quiet flags introduced
        discrepancy between the -qq and --quiet=all settings; let's establish
        that -qqq is the ultimate quietness setting and leave the more
        fine-grained control to the -e quiet/--quiet option.

        * strace.c (init) <qqqflag_qual>: New static constant.
        (init) Supply qqqflag_qual to qualify_quiet if qflag_short is set to 3
        or higher.
        (usage): Document it.
        * strace.1.in: Likewise.
        * tests/threads-execve--quiet-thread-execve.c: New file.
        * tests/threads-execve-q.c: Likewise.
        * tests/threads-execve-qq.c: Likewise.
        * tests/threads-execve-qqq.c: Likewise.
        * tests/.gitignore: Add threads-execve--quiet-thread-execve,
        threads-execve-q, threads-execve-qq, threads-execve-qqq.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (threads_execve__quiet_thread_execve_LDADD, threads_execve_q_LDADD,
        threads_execve_qq_LDADD, threads_execve_qqq_LDADD): New variables.
        * tests/gen_tests.in (threads-execve--quiet-thread-execve,
        threads-execve-q, threads-execve-qq, threads-execve-qqq): New tests.
        * tests/threads-execve.c [!PRINT_EXITED] (PRINT_EXITED): New macro.
        [!PRINT_SUPERSEDED] (PRINT_SUPERSEDED): Likewise.
        (thread): Put "superseded by execve in pid"... message printing under
        PRINT_SUPERSEDED.
        (main): Put "+++ exited with 0 +++" message printing under PRINT_EXITED.
        * tests/threads-execve.test: Inject the arguments supplied to the tests
        into the strace's arguments.

2020-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix require_min_nproc on systems without nproc.
        * tests/init.sh (require_min_nproc): Fix typo in the check for nproc
        that manifests itself in "set -e" mode.

        Fixes: v5.4~59 "tests: skip a few tests on systems with nproc == 1"

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add a long option alias for -y.
        Provide a new qualifier, decode-fds, and add (hopefully) sensible
        handling for it.

        * defs.h (show_fd_path): Remove declaration.
        (qualify_decode_fd): New declaration.
        * filter_qualify.c (decode_fd_set, decode_fd_set_updated): New
        variables.
        (decode_fd_str_to_uint, qualify_decode_fd): New functions.
        (qual_options): Add "decode-fd" and "decode-fds" that are handled
        by qualify_decode_fd.
        * number_set.h (enum decode_fd_bits): New enumeration.
        (decode_fd_set_updated, decode_fd_set): New declarations.
        * strace.c (show_fd_path): Remove.
        (init) <yflag_qual, yyflag_qual>: New static constants.
        (init) <yflag_short>: New local variable.
        (init) <enum>: Add GETOPT_QUAL_FD.
        (init) <longopts>: Add "decode-fds" long option.
        (init) <case 'y'>: Increment yflag_short instead of show_fd_path.
        (init) <case GETOPT_QUAL_FD>: Call qualify_decode_fd with either optarg
        or yflag_qual is the former is NULL.
        (init): Check if yflag_short is set, if decode_fd_set_updated is set
        as well, bail out, call qualify_decode_fd with the appropriate set
        otherwise; update the message that mentions -y.
        (usage): Document it.
        * strace.1.in (.SS Output format): Likewise.
        * util.c: Include "number_set.h".
        (printfd): Rewrite using appropriate is_number_in_set checks.
        * tests/dev--decode-fds-dev.c: New file.
        * tests/dev--decode-fds-path.c: Likewise.
        * tests/dev--decode-fds-socket.c: Likewise.
        * tests/net--decode-fds-dev-netlink.c: Likewise.
        * tests/net--decode-fds-none-netlink.c: Likewise.
        * tests/net--decode-fds-path-netlink.c: Likewise.
        * tests/net--decode-fds-socket-netlink.c: Likewise.
        * tests/pidfd_open--decode-fd-path.c: Likewise.
        * tests/.gitignore: Add dev--decode-fds-dev, dev--decode-fds-path,
        dev--decode-fds-socket, net--decode-fds-dev-netlink,
        net--decode-fds-none-netlink, net--decode-fds-path-netlink,
        net--decode-fds-socket-netlink, and pidfd_open--decode-fd-path.
        * tests/pure_executables.list: Likewise.
        * tests/dev-yy.c [!PRINT_DEVNUM] (PRINT_DEVNUM): New macro, define to 1.
        (DEV_FMT): New macro.
        (main): Parametrize the output using DEV_FMT in accordance with
        PRINT_DEVNUM value.
        * tests/gen_tests.in (dev--decode-fds-dev, dev--decode-fds-path,
        dev--decode-fds-socket, net--decode-fds-dev-netlink,
        net--decode-fds-none-netlink, net--decode-fds-path-netlink,
        net--decode-fds-socket-netlink, pidfd_open--decode-fd-path): New tests.
        (open_tree-P): Use the long option.
        * tests/net-yy-netlink.c [!PRINT_SOCK] (PRINT_SOCK): New macro, define
        to 2.
        (FMT_UNBOUND, FMT_BOUND, ARG_UNBOUND, ARG_BOUND): New macros, defined
        based on PRINT_SOCK value.
        (main): Parametrize the output using FMT_UNBOUND, FMT_BOUND,
        ARG_UNBOUND, and ARG_BOUND.
        * tests/net-yy-netlink.test: Append options passed to the test instead
        of "-yy".
        * tests/options-syntax.test: Add checks, update expected output.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add a long option aliases for -f and -ff.
        Introduce a new option, --output-separately, and make -ff an alias
        for a combination of -f and this new option.

        * defs.h (followfork): Change type to bool.
        (output_separately): New declaration.
        * strace.c (followfork): Change type to bool.
        (output_separately): New variable.
        (outf_perror, printleader, after_successful_attach, droptcb, init,
        print_event_exit, print_syscall_resume): Use output_separately
        instead of followfork check.
        (init) <followfork_short>: New local variable.
        (init) <enum>: Add GETOPT_FOLLOWFORKS and GETOPT_OUTPUT_SEPARATELY.
        (init) <longopts>: Add "follow-forks" and "output-separately" long
        options.
        (init) <case 'f'>: Increase followfork_short instead of followfork.
        (init) <case GETOPT_FOLLOWFORKS>: Set followfork to true.
        (init) <case GETOPT_OUTPUT_SEPARATELY>: Set output_separately to true.
        (init): Fail if either both followfork_short and followfork are set,
        or followfork_short >= 2 and output_separately is set;
        set followfork/output_separately appropriately otherwise;
        update the error messages that mention -f/-ff options with the aliases.
        (init) <if (seccomp_filtering)>: Set followfork to true and not 1.
        (usage): Document it.
        * strace.1.in (.SS Tracing): Likewise.
        * tests/strace--follow-forks-output-separately.expected: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/delay.test: Use --follow-forks instead of -f.
        * tests/gen_tests.in: Add strace--follow-forks-output-separately test.
        * tests/looping_threads.test: Use --follow-forks instead of -f.
        * tests/options-syntax.test: Add --follow-forks-related syntax checks,
        update the expected output.
        * tests/strace-ff.test: Add -efu as the interpreter argument; set the
        arguments to ff_opt variable ("-ff" being the default) and use it
        instead of -ff in the strace call; put set +f before "set -- "$LOG".*".

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/syntax: add suffixes to produced log/exp files.
        In order to enable inspection of them.

        * tests/syntax.sh (log_sfx): New functions.
        (check_exit_status_and_stderr, check_exit_status_and_stderr_using_grep):
        Get suffix from the first argument, append it to LOG/EXP usage instances;
        open-code dump_log_and_fail_with in order to print the file with the
        suffix.
        check_e, check_e_using_grep, check_h): Assign log_sfx result to sfx,
        append it to LOG/EXP usage instances, pass it to
        check_exit_status_and_stderr/check_exit_status_and_stderr_using_grep.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add arguments to --syscall-times and --relative-timestamps.
        * defs.h (Tflag_scale, Tflag_width): New declarations.
        * strace.c (Tflag_scale, Tflag_width, rflag_scale, rflag_width): New
        variables.
        (printleader): Parametrise relative timestamp printing with rflag_width
        and rflag_scale.
        (init) <longopts>: Change second field of "relative-timestamps" and
        "syscall-times" from no_argument to optional_argument.
        (init) <case 'r', case 'T'>: Handle optarg, fail if the scale variable
        is set to -1.
        (usage): Document it.
        * strace.1.in (.SS Output format): Likewise.
        * syscall.c (syscall_exiting_trace): Parametrise syscall time printing
        * with Tflag_width and Tflag_scale.
        * tests/gen_tests.in (strace--relative-timestamps-s,
        strace--relative-timestamps-ms, strace--relative-timestamps-us,
        strace--relative-timestamps-ns): New tests.
        * tests/options-syntax.test: New checks for --relative-timestamps and
        --syscall-times option syntax.
        * tests/strace--relative-timestamps-ms.expected: New file.
        * tests/strace--relative-timestamps-ns.expected: Likewise.
        * tests/strace--relative-timestamps-s.expected: Likewise.
        * tests/strace--relative-timestamps-us.expected: Likewise.
        * tests/strace--syscall-times-ms.expected: Likewise.
        * tests/strace--syscall-times-ns.expected: Likewise.
        * tests/strace--syscall-times-s.expected: Likewise.
        * tests/strace--syscall-times-us.expected: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: factor out time scale parsing.
        In preparation of using elsewhere.

        * defs.h (str2timescale_ex): New declaration.
        (str2timescale_optarg, str2timescale_sfx): New macros.
        * util.c (str2timescale_ex): New function.
        (parse_ts): Remove units, unit, assign str2timescale_sfx result to a new
        variable scale and use it instead of unit->val.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pathtrace: add a quiet flag for path resolution messages.
        And also quote the paths.

        * number_set.h (enum quiet_bits): Add QUIET_PATH_RESOLVE.
        * filter_qualify.c (quietstr_to_uint) <quiet_strs>: Add a string
        representation for QUIET_PATH_RESOLVE.
        * pathtrace.c (pathtrace_select_set): Put "Requested path"... message
        under QUIET_PATH_RESOLVE flag check; process path and rpath with
        string_quote.
        * strace.c (usage): Document it.
        * strace.1.in (.SS Output format) <-e quiet>: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add a quiet flag for "superseded by execve" messages.
        * filter_qualify.c (quietstr_to_uint) <quiet_strs>: Add
        a string representation for QUIET_THREAD_EXECVE,
        * number_set.h (enum quiet_bits): Add QUIET_THREAD_EXECVE.
        * strace.c (maybe_switch_tcbs): Put message printing under
        QUIET_THREAD_EXECVE flag check.
        (usage): Document it.
        * strace.1.in (.SS Output format) <-e quiet>: Likewise.
        * tests/maybe_switch_current_tcp--quiet-thread-execve.c: New file.
        * tests/.gitignore: Add maybe_switch_current_tcp--quiet-thread-execve.
        * tests/pure_executables.list: Likewise.
        * tests/Makefile.am (maybe_switch_current_tcp__quiet_thread_execve_LDADD):
        New variable.
        * tests/gen_tests.in (maybe_switch_current_tcp--quiet-thread-execve):
        New test.
        * tests/maybe_switch_current_tcp.c [!QUIET_MSG] (QUIET_MSG): New macro.
        (thread): Print "superseded"... message only is QUIET_MSG is 0.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall: print personality switch messages in tcb's output.
        Personality switch is a rather normal event, it's unclear why it has
        been always treated as a diagnostics/error information.  Having it under
        qflag makes even less sense, as it was impossible to get
        this information when the -o option was used.  With this change,
        it is at least possible to get it with something like

            strace -f -o out --quiet=none PROG

        One caveat, though, is its rather odd format, with square brackets,
        "PID=", and a dot, but it seems that we're stuck with it forever, as it
        traces back for decades, albeit with a prefix change in commit
        v4.11~509 ("Consistently use error_msg instead of fprintf(stderr)").

        * syscall.c (update_personality): Use printleader/tprintf/line_ended
        instead of error_msg.
        * tests/bexecve.test: Add --quiet=personality to strace invocations.
        * tests/strace-ff.test: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: respect quietness setting when reporting unknown tracees.
        Since the situations where these processes can appear are relatively
        normal, it makes little sense to print them irrespective of quietness
        setting.

        * strace.c (maybe_allocate_tcb): Put the message about exit of unknown
        process under QUIET_EXIT check; put message about detach of unknown
        process under QUIET_ATTACH check.
        * tests/clone_parent--quiet-exit.c: New file.
        * tests/clone_parent-q.c: Likewise.
        * tests/clone_parent-qq.c: Likewise.
        * tests/clone_ptrace--quiet-attach.c: Likewise.
        * tests/clone_ptrace--quiet-exit.c: Likewise.
        * tests/clone_ptrace-q.c: Likewise.
        * tests/clone_ptrace-qq.c: Likewise.
        * tests/.gitignore: Add clone_parent--quiet-exit, clone_parent-q,
        clone_parent-qq, clone_ptrace--quiet-attach, clone_ptrace--quiet-exit,
        clone_ptrace-q, and clone_ptrace-qq.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in: Add clone_parent--quiet-exit, clone_parent-q,
        clone_parent-qq, clone_ptrace--quiet-attach, clone_ptrace--quiet-exit,
        clone_ptrace-q, and clone_ptrace-qq tests.
        * tests/clone_parent.c [!QUIET_MSG] (QUIET_MSG): New macro.
        (main): Print exit messages only if QUIET_MSG set to zero.
        * tests/clone_ptrace.c [!QUIET_ATTACH] (QUIET_ATTACH): New macro.
        [!QUIET_EXIT] (QUIET_EXIT): Likewise.
        (main): Print information about unknown pid detach only if QUIET_ATTACH
        is 0; print information about process exiting only if QUIET_EXIT is 0.
        * tests/clone_ptrace.test: Add the first argument to args, add
        "--quiet=personality" if it is empty.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add long option aliases for -r, -T, and -O.
        The last trivial ones.

        * strace.c (init) <longopts>: Add "summary-syscall-overhead" as an alias
        for 'O', "relative-timestamps" as an alias for 'r', and "syscall-times"
        as an alias for 'T'.
        (usage): Document it.
        * strace.1.in: Likewise.
        * tests/count.test: Add --summary-syscall-overhead checks.
        * tests/gen_tests.in: Add strace--relative-timestamps and
        strace--syscall-times tests.
        * tests/strace-T.test: Allow passing option to check as the first
        * argument.
        * tests/strace-r.test: Likewise.
        * tests/strace--relative-timestamps.expected: New file.
        * tests/strace--syscall-times.expected: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: document possible quialifier aliases.
        * strace.1.in (.SS General) <-e expr>: Document possible aliases
        for quialifiers.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add long option aliases for -q.
        Provide a new qualifier, quiet, and add a (hopefully) sensible handling
        for it.

        * defs.h (qflag): Remove declaration.
        (qualify_quiet): New declaration.
        * filter_qualify.c (quiet_set, quiet_set_updated): New variables.
        (quietstr_to_uint, qualify_quiet): New functions.
        (qual_options): Add "quiet", "silence", "silent", "q" that are handled
        by qualify_quiet.
        * number_set.h (enum quiet_bits): New enumeration.
        (quiet_set_updated, quiet_set): New declarations.
        * strace.c (qflag): Remove.
        (detach, attach_tcb, maybe_allocate_tcb): Change qflag check to
        is_number_in_set(QUIET_ATTACH, quiet_set).
        (init) <qflag_qual, qqflag_qual>: New static constants.
        (init) <enum>: Add GETOPT_QUAL_QUIET.
        (init) <longopts>: Add "quiet", "silent", "silence".
        (init) <case 'q'>: Increment qflag_short instead of qflag.
        (init) <case GETOPT_QUAL_QUIET>: Call qualify_quiet with either optarg
        or qflag_qual is the former is NULL.
        (init) <if (outfname && argc)>: Check qflag_short and quiet_set_updated
        instead of qflag for changing the default quietness setting.
        (init): Check if qflag_short is set, if quiet_set_updated is set as well,
        bail out, call qualify_quiet with the appropriate set otherwise.
        (print_exited): Change qflag check to
        is_number_in_set(QUIET_EXIT, quiet_set).
        (usage): Document it.
        * strace.1.in: Likewise.
        * syscall.c (update_personality): Change qflag check to
        is_number_in_set(QUIET_PERSONALITY, quiet_set).
        * tests/clone-flags.test: Use --silence=exits instead of -qq.
        * tests/count-f.test: Use -e silent=attach instead of -q.
        * tests/options-syntax.test: Add checks.
        * tests/strace-D.test: Use -e q=attach instead of -q.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add long option aliases for -x.
        * defs.h (enum xflag_opts): New enumeration.
        * strace.c (xflag_str): New static variable.
        (init) <xflag_long>: New variable.
        (init) <enum>: Add GETOPT_HEX_STR.
        (init) <longopts>: Add "string-in-hex" long option.
        (init) <case GETOPT_HEX_STR>: Parse the argument using find_arg_val.
        (init): Fail if both xflag_long and xflag are set; copy xflag_long
        to xflag if only the former is set.
        (usage): Document it.
        * strace.1.in: Likewise.
        * tests/gen_tests.in (strace--strings-in-hex,
        strace--strings-in-hex-all, strace--strings-in-hex-non-ascii, strace-x,
        strace-xx): New tests.
        * tests/pure_executables.list: Add them.
        * tests/.gitignore: Likewise.
        * tests/options-syntax.test: Add checks.
        * tests/strace--strings-in-hex-all.c: New file.
        * tests/strace--strings-in-hex-non-ascii.c: Likewise.
        * tests/strace--strings-in-hex.c: Likewise.
        * tests/strace-x.c: Likewise.
        * tests/strace-xx.c: Likewise.

        strace: add long option aliases for -z and -Z.
        * strace.c (init) <longopts>: Add "successful-only" and "failed-only"
        long options for -z and -Z, respectively.
        (init): Update the related error message.
        (usage): Document it.
        * strace.1.in: Likewise.
        * tests/options-syntax.test: Add checks, update expected output.
        * tests/status-failed-long.c: New file.
        * tests/status-failed-status.c: Likewise.
        * tests/status-successful-long.c: Likewise.
        * tests/status-successful-status.c: Likewise.
        * tests/.gitignore: Add them.
        * tests/pure_executables.list: Likewise
        * tests/gen_tests.in (status-failed-long, status-failed-status,
        status-successful-long, status-successful-status): New tests.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add --daemonize long option alias for -D.
        Don't fail those who provide --daemonise or --daemonized as well.

        Since multiple -D instances change behaviour and with long options
        the last instance wins, it is better just to forbid the simultaneous
        usage of the short and long option variants.

        * strace.c (daemonize_str): New static constant.
        (init) <daemonized_tracer_long>: New variable.
        (init) <enum>: Add GETOPT_DAEMONIZE.
        (init) <longopts>: Add "daemonize" long option variants.
        (init) <case GETOPT_DAEMONIZE>: Use find_arg_val for argument parsing.
        (init): Fail if both daemonized_tracer_long and daemonized_tracer are
        set; copy daemonized_tracer_long to daemonized_tracer if only the former
        is set; update the error messages that mention -D option with the alias.
        (usage): Document it.
        * strace.1.in: Likewise.
        * tests/options-syntax.test: Add checks, update existing ones.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: mention long option aliases in error messages.
        If a user has provided a long option alias, current error messages could
        be confusing otherwise.

        * strace.c (init): Augment error messages with long option aliases where
        appropriate.
        * tests/options-syntax.test: Update expected output.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: print long options in the option error message.
        If a long option alias is used with incorrect argument, it's better show it
        in the error message instead of the short option equivalent.

        * strace.c (error_opt_arg): Add lopt argument, print its name
        if it is non-NULL.
        (init): Add lopt_idx variable, pass it to getopt_long, set loop-local
        lopt variable to an option pointer based on lopt_idx; pass lopt
        in error_opt_arg calls.
        * tests/options-syntax.test: Update expected output.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: add a long option alias for -I.
        And add more human-comprehensible values for it.

        * strace.c (parse_interruptible_arg): New function.
        (init) <longopts>: Add "interruptible" long option alias for 'I'.
        (init) <case 'I'>: Call parse_interruptible_arg.
        (usage): Document new long option alias and values.
        * strace.1.in (parse_interruptible_arg): Likewise.
        * tests/options-syntax.test: Add checks for the new syntax.
        * tests/sigblock.test: Introduce -I syntax variety.
        * tests/sigign.test: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        filter_qualify: rewrite statusstr_to_uint using find_xlat_val.
        * filter_qualify.c (*statuses): Move inside statusstr_to_uint, change
        the type to const struct xlat_data[], change the initialisation
        accordingly.
        (statusstr_to_uint): Call find_arg_val instead of open-coding search
        in a string array.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: rewrite parse_ts suffix matching using find_xlat_val.
        A known behavioural change is that suffix can have any case, which
        matches other places of option argument parsing.

        * util.c (parse_ts): Change type of units to struct xlat_data[]; move
        definition of units variable to its first usage, change its type
        to const struct xlat_data *; use find_xlat_val instead of open-coding
        search in units array.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: introduce find_xlat_val and find_arg_val.
        The commonly open-coded snippet throughout the code, especially in the
        argument parsing code, is searching in a string-value pair array of
        string, so let's provide a function (or, more precisely, two functions,
        one generic and another one that targets specifically argument parsing)
        that does precisely that, on top of existing string-value pair
        struct xlat_data type.

        * defs.h (enum find_xlat_flag_bits, enum find_xlat_flags): New
        enumerations.
        (find_xlat_val_ex, find_arg_val_): New declarations.
        (find_xlat_val, find_xlat_val_case, find_arg_val): New macros.
        * util.c (find_xlat_val_ex, find_arg_val_): New functions.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall: handle fd printing regardless of show_fd_path setting.
        As of now, the way the higher 32 bits of the syscall return value
        are printed depends on the show_fd_path (-y) setting: if it is set,
        they are trimmed, which is pretty inconsistent.

        * syscall.c (syscall_exiting_trace) <case RVAL_FD>: Check if tcp->u_rval
        fits in int before passing it to printfd instead of a (redundant) show_fd_path
        check (that is also done inside printfd itself).
        * tests/bpf-success-long-y.c: New file.
        * tests/bpf-success-long-y.test: New test.
        * tests/.gitignore: Add bpf-success-long-y.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add bpf-success-long-y.test.
        * tests/bpf.c [!FD0_PATH] (FD0_PATH): New macro.
        [INJECT_RETVAL] (sys_bpf): Print INJECT_RETVAL as long.
        (BPF_MAP_CREATE_checks, BPF_OBJ_PIN_checks, BPF_OBJ_PIN_checks,
        BPF_PROG_ATTACH_checks, BPF_RAW_TRACEPOINT_OPEN_checks,
        BPF_TASK_FD_QUERY_checks): Append FD0_PATH to places where fd 0
        is printed.
        (print_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr5): Do not
        conditionalise part of the strings with INJECT_RETVAL > 0, as we always
        inject positive values so far.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/io_uring_register: properly handle big endian architectures.
        tests/io_uring_register.c (BE_LE): New macro.
        (main): Use BE_LE to select the address to print based on endianness.

        Fixes: v5.5~41 "io_uring: add support for IORING_REGISTER_FILES_UPDATE"

2020-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: typo in usage (s/milliseconds/microseconds/)
        * strace.c (usage): s/milliseconds/microseconds/

        Fixes: v5.5~14 "strace: describe -e options in the help message"

2020-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printrusage: bundle rusage_t definition.
        * printrusage.c (struct kernel_old_timeval, rusage_t): New type
        definitions.
        * configure.ac (AC_CHECK_MEMBERS): Check for __ru_maxrss_word,
        __ru_ixrss_word, __ru_idrss_word, __ru_isrss_word, __ru_minflt_word,
        __ru_majflt_word, __ru_nswap_word, __ru_inblock_word, __ru_oublock_word,
        __ru_msgsnd_word, __ru_msgrcv_word, __ru_nsignals_word, __ru_nvcsw_word,
        and __ru_nivcsw_word members of struct rusage.
        * tests/waitid.c (RU_MAXRSS, RU_IXRSS, RU_IDRSS, RU_ISRSS, RU_MINFLT,
        RU_MAJFLT, RU_NSWAP, RU_INBLOCK, RU_OUBLOCK, RU_MSGSND, RU_MSGRCV,
        RU_NSIGNALS, RU_NVCSW, RU_NIVCSW): New macros.
        (sprint_rusage): Use them instead of the respective ru_* field names.

        Resolves: https://github.com/strace/strace/issues/122

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: fail if patterns file is not readable in match_grep.
        Otherwise, the test will not fail if the patterns file is missing.

        * tests/init.sh (match_grep): Fail in case of non-zero exit status
        of the read loop.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: turn clone_parent into a generated test.
        clone_parent.tests does nothing, only sources clone_ptrace.

        * tests/clone_parent.test: Remove.
        * tests/Makefile.am (MISC_TESTS): Remove clone_parent.test.
        * tests/gen_tests.in (clone_parent): New entry.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: support --trace syntax in run_strace_match_{diff,grep}
        * tests/init.sh (run_strace_match_diff, run_strace_match_grep): Do not
        add -e trace option if --trace is provided already.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace --help: document long option aliases of -w and -X options.
        * strace.c (usage): Document --summary-wall-clock as the long option
        alias of -w option; document --const-print-style as the long option
        alias of -X option.

        Fixes: v5.5~11 "Add long option aliases to some options"

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace --help: add missing newline before "Miscellaneous:"
        * strace (usage): Add newline before "Miscellaneous:".

        Fixes: v5.5~14 "strace: describe -e options in the help message"

2020-02-10  MaJun  <majun258@linux.alibaba.com>

        csky abiv1: fix compilation error.
        struct pt_regs has no member r1, only a1.

        * linux/csky/get_scno.c (arch_get_scno) [!__CSKYABIV2__]: Replace
        csky_regs.r1 with csky_regs.a1.
        * linux/csky/set_scno.c (arch_set_scno) [!__CSKYABIV2__]: Likewise.
        * NEWS: Mention this fix.

        Fixes: v5.1~99 "Add C-SKY architecture support"

2020-02-10  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.5-1.
        * strace.spec.in: Likewise.

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.5 release.
        * NEWS: Update for 5.5 release.

        Update copyright year number range.
        * COPYING: Update copyright year number range.
        * tests/COPYING: Likewise.
        * debian/copyright: Likewise.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        maint/update_copyright_years.sh: fix concurrent execution.
        * maint/update_copyright_years.sh (process_file): Replace "continue"
        with "return".

        Fixes: v4.21~318 "maint/update_copyright_years.sh: implement concurrent execution"

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        maint/update_copyright_years.sh: fix "integer expression expected" error
        * maint/update_copyright_years.sh: Check $copyright_year before use
        in arithmetic operations.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: produce a sensible error if -k option is used but not compiled in
        * strace.c (init) <optstring>: Do not put "k" option under
        ENABLE_STACKTRACE.
        (init) <longopts>: Do not put "stack-traces" option under
        ENABLE_STACKTRACE.
        (init) <case 'k'> [!ENABLE_STACKTRACE]: Print an error message.
        * tests/options-syntax.test: Check that the expected error message
        is printed if -k is not compiled in.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move getstr/getoption from strace-V.test to init.sh.
        And rename to more generic get_config_str/get_config_option.

        * tests/strace-V.test (getstr, getoption): Rename to get_config_str
        and get_config_option, respectively.  All users updated.
        (get_config_str, get_config_option): Move ...
        * tests/init.sh: ... here.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/syntax: fix incorrect match_diff/macth_grep usage.
        match_diff and match_grep take the error message as the third argument
        and pass it on to fail_, while the calling code expects that they simply
        return non-zero in case of error.

        * tests/syntax.sh (check_exit_status_and_stderr,
        check_exit_status_and_stderr_using_grep): Specify the error message as
        the third argument to match_diff/match grep instead of trying to handle
        the erroneous status code.

2020-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace: use qualify_*
        * strace.c (init): Use qualify_trace, qualify_abbrev, qualify_verbose,
        qualify_status, and qualify_signals instead of qualify.

        Complements: v5.4-100-g490bfd465 "Add long options for qualifiers"

2020-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace: rename *_OPTION to GETOPT_*
        * strace.c (init) <enum>: Rename *_OPTION to GETOPT_*.  All users
        updated.

2020-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add tests for new long options.
        * tests/gen_tests.in (access): Check --trace-path.
        (fstatat64, lstat, lstat64, newfstatat, stat, stat64, statx): Check
        --no-abbrev and --trace-path.
        * tests/options-syntax.test: Check --attach, --detach-on, --output,
        --summary, --summary-only, --summary-wall-clock, --string-limit,
        --const-print-style, --user, and --instruction-pointer.
        * tests/qual_syscall.test: Check --columns.
        * tests/strace-E.test: Check --env.
        * tests/strace-S.test: Check --summary-sort-by.
        * tests/strace-k.test: Check --stack-trace.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add long option aliases to some options.
        * strace.c (init) <longopts>: Add "columns" for "a",
        "detach-on" for "b", "summary-only" for "c", "summary" for "C",
        "env" for "E", "instruction-pointer" for "i", "stack-traces" for "k",
        "output" for "o", "attach" for "p", "trace-path" for "P", "string-limit"
        for "s", "summary-sort-by" for "S", "user" for "u", "no-abbrev" for "v",
        "summary-wall-clock" for "w", and "const-print-style" for "X".
        (usage): Document it.
        * strace.1.in: Likewise.

2020-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add tests for new long options.
        * tests/filtering_fd-syntax.test: Check --read and --write.
        * tests/filtering_syscall-syntax.test: Check --trace, --abbrev,
        --verbose, --raw, --inject, and --fault.
        * tests/gen_tests.in: Check --status.
        * tests/options-syntax.test: Check --kvm.
        * tests/qual_signal.test: Check --signal.
        * tests/qual_syscall.test: Check --trace, --abbrev, --raw,
        and --verbose.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add long options for qualifiers.
        Add a long option for each respective -e qualifier.

        * defs.h (qualify_trace, qualify_abbrev, qualify_verbose, qualify_raw,
        qualify_signals, qualify_status, qualify_read, qualify_write,
        qualify_fault, qualify_inject, qualify_kvm): Add declarations.
        * filter_qualify.c (qualify_trace, qualify_abbrev, qualify_verbose,
        qualify_raw, qualify_signals, qualify_status, qualify_read,
        qualify_write, qualify_fault, qualify_inject, qualify_kvm): Remove
        static qualifier.
        * strace.1.in: Document long option aliases.
        * strace.c (usage): Likewise.
        (init) <enum>: Add QUAL_TRACE_OPTION, QUAL_ABBREV_OPTION,
        QUAL_VERBOSE_OPTION, QUAL_RAW_OPTION, QUAL_SIGNAL_OPTION,
        QUAL_STATUS_OPTION, QUAL_READ_OPTION, QUAL_WRITE_OPTION,
        QUAL_FAULT_OPTION, QUAL_INJECT_OPTION, QUAL_KVM_OPTION.
        (init) <longopts>: Add items for qualifiers.
        (init): Handle new *_OPTION options.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: describe -e options in the help message.
        So it is a bit more clear how to use them (especially such elaborate
        ones as -e inject).

        * strace.c (usage): Add -e trace, -e signal, and -e status option
        descriptions to the Filtering section; add -e abbrev, -e verbose,
        -e raw, -e read, -e write, and -e kvm option descriptions to the Output
        format section; add Tampering section with description of -e inject
        and -e fault options.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: document supported constant formats in the usage message.
        * strace.c (usage): Provide the list of supported formats
        for the -X option.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: capitalise placeholders in option declarations in usage.
        It is already capitalised in descriptions (rather inconsistently,
        however), the capitalisation is already used for "PROG" and "ARGS",
        and it allows consistently distinguish placeholders from literals.
        The manual page does not need the same treatment, it seems,
        as the italic script is used there for that purpose.

        Capitalise the "usage:" part, as it is often capitalised in the usage
        messages of some other programs.

        * strace.c (usage): Capitalise "expr", "column", "interruptible",
        "path", "file", "var", "val", "strsize", "pid", "format", "overhead",
        "sortby" placeholders where appropriate. Capitalise the first letter
        in "usage:".

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: sync up help message with the manual page.
        They had discrepancies in section/optoin order for no reason.

        * strace.c (usage): Move -e option in a separate General section,
        put the rest of the sections in Startup, Tracing, Filtering, Output
        format, Statistics, Miscellaneous order, as it is in the manual page;
        add -ttt option description, swap -E var=val and -E var options, put
        -A option description after -o, put --seccomp-bpf option description
        after -h.
        * NEWS: Mention this change.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: use .UR macro for the link to the mailing list.
        * strace.1.in (.SH REPORTING BUGS): Use .UR for the mailing list link.

        strace.1: s/PERSONALITY/PERSONALITIES/
        * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Change to...
        (.SH "MULTIPLE PERSONALITIES SUPPORT"): ...this.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: remove commas between option variants.
        Comma is not historically used in strace.1 to separate option aliases.

        * strace.1.in (.SS Miscellaneous): Remove comma after -d, -h, and -V
        declarations.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: re-factor -e trace description.
        Moreover, -e features description was incorrect ("?" option
        is applicable only to -e trace)

        * strace.1.in: Re-factor -e trace description.
        * NEWS: Mention this change.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printrusage: use PRINT_FIELD_U instead of PRINT_RUSAGE_MEMBER.
        As the former is standard.

        * printrusage.c (printrusage, printrusage32): Use PRINT_FIELD_U instead
        of PRINT_RUSAGE_MEMBER.
        (printrusage, printrusage32) <PRINT_RUSAGE_MEMBER>: Remove.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        filter_qualify.c: make statuses definition a bit more explicit.
        Avoid imlicit relying on the same ordering of statuses in the enum
        and in the string array.

        * filter_qualify.c (statuses): Add index designators to initialisers.

2020-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        strace: add --debug alias for -d.
        * strace.1.in (.SH OPTIONS): Document --debug option.
        * strace.c (usage): Likewise.
        (longopts): Add "debug" as an alias to "d".
        * tests/options-syntax.test: Check -d and --debug options.

2020-02-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: add support of wq_fd field decoding to io_uring_setup.
        Introduced by Linux commit v5.5-rc7-74-g24369c2e3bb0.

        * configure.ac (AC_CHECK_HEADERS([linux/io_uring.h])): Add
        struct io_uring_params.wq_fd field check.
        * io_uring.c (io_uring_setup): Print wq_fd field.
        * tests/io_uring_setup.c: Update expected output.
        * types/io_uring.h (struct_io_uring_params): Add wq_fd field.
        * xlat/uring_setup_flags.in (IORING_SETUP_ATTACH_WQ): New constant.

2020-02-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add IORING_SETUP_CLAMP to uring_setup_flags.
        * xlat/uring_setup_flags.in (IORING_SETUP_CLAMP): New constant,
        introduced by Linux commit v5.5-rc7-43-g8110c1a6212e.
        * tests/io_uring_setup.c: Update expected output.

        xlat: update uring_setup_features constants.
        * xlat/uring_setup_features.in (IORING_FEAT_RW_CUR_POS): New constant,
        introduced by Linux commit v5.5-rc7-35-gba04291eb66e.
        (IORING_FEAT_CUR_PERSONALITY): New constant, introduced by Linux commit
        v5.5-rc7-72-gcccf0ee83455.

2020-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2020-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide values to ptrace_cmds.
        Use the output of maint/gen_xlat_defs.sh and perform some re-ordering.

        * xlat/ptrace_cmds.in: Provide values to constants.
        (PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
        PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, PTRACE_GETHBPREGS,
        PTRACE_SETHBPREGS, PTRACE_GETREGS64, PTRACE_SETREGS64, PTRACE_SYSEMU,
        PTRACE_SYSEMU_SINGLESTEP): Move to arch-specific section.
        (PTRACE_SET_SYSCALL): Move to arm section.
        (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Move to powerpc section.
        (PPC_PTRACE_POKEUSR_3264, PPC_PTRACE_PEEKUSR_3264,
        PPC_PTRACE_POKEDATA_3264, PPC_PTRACE_POKETEXT_3264,
        PPC_PTRACE_PEEKDATA_3264, PPC_PTRACE_PEEKTEXT_3264): Add constants.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-01-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint: gen_xlat_defs.sh updates.
        Allow whitespace between "#" and "define" and allow passing glob
        expressions to the -a option.

        * maint/gen_xlat_defs.sh: Add "[[:space:]]*" between "#" and "define"
        in regular expressions; match "[^:]*" instead of "$ARCH_DEFS_FILE".

2020-01-28  Dmitry V. Levin  <ldv@altlinux.org>

        .mailmap: add more entries to avoid duplication in CREDITS.

2020-01-27  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.5.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.5
        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/powerpc/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.5.
        * maint/ioctls_sym.sh: Define UL and ULL macros for every processed
        file.  Add a workaround for linux/platform_data/cros_ec_chardev.h file.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        keyctl: implement KEYCTL_CAPABILITIES operation decoding.
        Introduced by Linux kernel commit v5.3-rc1~189^2.

        * xlat/keyctl_caps0.in: New file.
        * xlat/keyctl_caps1.in: Likewise.
        * keyctl.c: Include "xlat/keyctl_caps0.h" and "xlat/keyctl_caps1.h".
        (print_keyctl_caps, keyctl_capabilities): New functions.
        (SYS_FUNC(keyctl)) <case KEYCTL_CAPABILITIES>: Call keyctl_capabilities.
        * tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: implement KEYCTL_MOVE operation decoding.
        Introduced by Linux kernel commit v5.3-rc1~189^2.

        * xlat/keyctl_move_flags.in: New file.
        * keyctl.c: Include "xlat/keyctl_move_flags.h".
        (keyctl_move): New function.
        (SYS_FUNC(keyctl)) <case KEYCTL_MOVE>: Call it.
        * tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        keyctl: implement KEYCTL_PKEY_* operations decoding.
        Introduced by Linux kernel commit v5.0-rc1~453^2~20.

        * configure.ac (AC_CHECK_TYPES): Check for struct keyctl_pkey_params
        and struct keyctl_pkey_query.
        * keyctl.c: Include "xlat/keyctl_pkey_ops.h".
        (struct keyctl_pkey_query, struct keyctl_pkey_params): New type
        definitions.
        (print_pkey_query, keyctl_pkey_query, fetch_print_pkey_params,
        keyctl_pkey_op): New functions.
        (SYS_FUNC(keyctl)) <case KEYCTL_PKEY_QUERY>: Call keyctl_pkey_query.
        (case KEYCTL_PKEY_ENCRYPT, case KEYCTL_PKEY_DECRYPT, case
        KEYCTL_PKEY_SIGN, case KEYCTL_PKEY_VERIFY): Call keyctl_pkey_op.
        * xlat/keyctl_pkey_ops.in: New file.
        * tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: do not open-code struct keyctl_kdf_params.__spare printing.
        * keyctl.c (keyctl_dh_compute): Replace open-coded printing of
        struct keyctl_kdf_params.__spare with a pair of IS_ARRAY_ZERO and
        PRINT_FIELD_ARRAY calls.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: consolidate xlat headers in the beginning of the file.
        This gives a better overview of the xlat usage.

        * keyctl.c: Move "xlat/key_perms.h", "xlat/key_reqkeys.h", and
        "xlat/keyctl_commands.h" includes to the beginning of the file.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_tc: add support for TCA_STATS_PKT64 attribute decoding.
        Introduced by Linux kernel commit v5.5-rc1~174^2~219^2.

        * configure.ac (AC_CHECK_DECLS): Check for TCA_STATS_PKT64.
        * rtnl_tc.c (tca_stats_nla_decoders) <[TCA_STATS_PKT64]>: New array
        item, call decode_nla_u64.
        * xlat/rtnl_tca_stats_attrs.in (TCA_STATS_PKT64): New constant.
        * tests/nlattr_tc_stats.c: Add TCA_STATS_PKT64 attribute decoding check.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_tc_action: add support for TCA_ACT_FLAGS attribute decoding.
        Introduced by Linux kernel commit v5.5-rc1~174^2~265^2~2.

        * xlat/rtnl_tca_act_flags.in: New file.
        * xlat/rtnl_tc_action_attrs.in (TCA_ACT_FLAGS): New constant.
        * configure.ac (AC_CHECK_DECLS): Check for TCA_ACT_PAD, TCA_ACT_COOKIE,
        and TCA_ACT_FLAGS.
        * rtnl_tc_action.c: Include <linux/pkt_cls.h> and
        "xlat/rtnl_tca_act_flags.h".
        (decode_tca_act_flags): New function.
        (tcamsg_nla_decoders) <[TCA_ACT_FLAGS]>: New array element, use
        decode_tca_act_flags as a decoder.
        * tests/nlattr_tcamsg.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: add support for IORING_REGISTER_FILES_UPDATE.
        Introduced by Linux kernel commits v5.5-rc1~204^2~61 and v5.5~1^2~2.

        * io_uring.c (print_io_uring_files_update): New function.
        (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES_UPDATE>: Call
        it.
        * types/io_uring.h (struct_io_uring_files_update): New type definition.
        * xlat/uring_register_opcodes.in (IORING_REGISTER_FILES_UPDATE): New
        constant.
        * tests/io_uring_register.c (main): Update invalid op check.
        [HAVE_STRUCT_IO_URING_FILES_UPDATE]: Add checks.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        io_uring: check struct io_* types automatically.
        Move definitions of struct_io_sqring_offsets, struct_io_cqring_offsets,
        and struct_io_uring_params to a separate types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct io_sqring_offsets,
        struct io_cqring_offsets, and struct io_uring_params.
        (AC_CHECK_MEMBERS): Remove struct io_cqring_offsets.resv.
        * io_uring.c: Include "types/io_uring.h" instead of <linux/io_uring.h>.
        [HAVE_STRUCT_IO_CQRING_OFFSETS]: Remove static_assert checks of
        sizeof(struct io_sqring_offsets).
        (struct_io_sqring_offsets, struct_io_cqring_offsets,
        struct_io_uring_params): Move to ...
        * types/io_uring.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        evdev: check struct input_* types automatically.
        Move definitions of struct_input_absinfo, struct_input_keymap_entry,
        and struct_input_mask to a separate types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct input_keymap_entry and
        struct input_mask.
        (AC_CHECK_MEMBERS): Remove struct input_absinfo.resolution.
        * evdev.c: Include "types/evdev.h" instead of <linux/input.h>.
        Remove static_assert checks.
        (struct_input_absinfo, struct_input_keymap_entry, struct_input_mask):
        Move to ...
        * types/evdev.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_route: check struct rta_mfc_stats and struct rtvia automatically.
        Move definitions of struct_rta_mfc_stats and struct_rtvia to a separate
        types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct rta_mfc_stats and
        struct rtvia.
        * rtnl_route.c: Include "types/rtnl_route.h" instead of "netlink.h" and
        <linux/rtnetlink.h>.
        [HAVE_STRUCT_RTA_MFC_STATS, HAVE_STRUCT_RTVIA]: Remove static_assert checks.
        (struct_rta_mfc_stats, struct_rtvia): Move to ...
        * types/rtnl_route.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_mdb: check struct br_mdb_entry and struct br_port_msg automatically
        Move definitions of struct_br_mdb_entry and struct_br_port_msg
        to a separate types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct br_mdb_entry and
        struct br_port_msg.
        * rtnl_mdb.c: Include "types/rtnl_mdb.h" instead of <netinet/in.h> and
        <linux/if_bridge.h>.
        [HAVE_STRUCT_BR_PORT_MSG, HAVE_STRUCT_BR_NDB_ENTRY]: Remove static_assert checks.
        (struct_br_mdb_entry, struct_br_port_msg): Move to ...
        * types/rtnl_mdb.h: ... new file.
        * tests/nlattr_mdba_router_port.c: Include <netinet/in.h> before
        <linux/if_bridge.h> to obtain a definition of struct in6_addr needed
        for struct br_mdb_entry.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_neightbl: check all struct ndt_* types automatically.
        Move definitions of struct_ndt_* types to a separate types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct ndt_config and
        struct ndt_stats.
        (AC_CHECK_MEMBERS): Remove struct ndt_stats.ndts_table_fulls.
        * rtnl_neightbl.c: Include "types/rtnl_neightbl.h".
        [HAVE_LINUX_NEIGHBOUR_H]: Remove.
        [HAVE_STRUCT_NDT_CONFIG, HAVE_STRUCT_NDT_STATS]: Remove static_assert
        checks.
        (struct_ndt_config, struct_ndt_stats): Move to ...
        * types/rtnl_neightbl.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_link: check all struct rtnl_link_stats* and struct ifla_port_vsi types automatically
        Move definitions of struct_rtnl_link_stats* and struct_ifla_port_vsi
        types to a separate types/ header file.

        * configure.ac (AC_CHECK_TYPES): Remove struct ifla_bridge_id,
        struct ifla_port_vsi and struct rtnl_link_stats64.
        (AC_CHECK_MEMBERS): Remove struct rtnl_link_stats.rx_nohandler and
        struct rtnl_link_stats64.rx_nohandler.
        * rtnl_link.c: Include "types/rtnl_link.h".
        [HAVE_LINUX_IF_LINK_H]: Remove.
        [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER,
        HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER, HAVE_STRUCT_IFLA_PORT_VSI]:
        Remove static_assert checks.
        (struct_rtnl_link_stats, struct_rtnl_link_stats64,
        struct_ifla_port_vsi): Move to ...
        * types/rtnl_link.h: ... new file.
        (struct_ifla_bridge_id): New typedef.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_crypto: check all struct crypto_* types automatically.
        Move definitions of struct_crypto_* types to a separate types/ header
        file.

        * configure.ac (AC_CHECK_TYPES): Remove struct crypto_*.
        * netlink_crypto.c: Include "types/cryptouser.h".
        [HAVE_LINUX_CRYPTOUSER_H, !CRYPTO_MAX_NAME]: Remove.
        [HAVE_STRUCT_CRYPTO_USER_ALG, HAVE_STRUCT_CRYPTO_REPORT_HASH,
        HAVE_STRUCT_CRYPTO_REPORT_CIPHER, HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER,
        HAVE_STRUCT_CRYPTO_REPORT_AEAD, HAVE_STRUCT_CRYPTO_REPORT_RNG]: Remove
        static_assert checks.
        (struct_crypto_user_alg, struct_crypto_report_hash,
        struct_crypto_report_cipher, struct_crypto_report_blkcipher,
        struct_crypto_report_aead, struct_crypto_report_rng): Move to ...
        * types/cryptouser.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        types: new infrastructure for automatic checking of structure types.
        * types/gen.sh: New file.
        * bootstrap: Invoke it.
        * types/find_last_type_fields.awk: New file.
        * configure.ac: Invoke st_CHECK_TYPES.
        (AM_INIT_AUTOMAKE): Add subdir-objects.
        * Makefile.am: Include types/Makemodule.am.
        (ACLOCAL_AMFLAGS): Add -I types.
        (strace_SOURCES): Add $(TYPES_HEADER_FILES).
        (strace_SOURCES_check): Add $(TYPES_CHECK_FILES).
        (EXTRA_DIST): Add types/find_last_type_fields.awk and types/gen.sh.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add strace-k-p test.
        Add a check of the stack unwinding for attached processes.

        * tests/stack-fcall-attach.c: New file.
        * tests/strace-k-p.expected: Likewise.
        * tests/strace-k-p.test: New test.
        * tests/Makefile.am (EXTRA_DIST): Add strace-k-p.expected and strace-k-p.test.
        (STACKTRACE_TESTS): Add strace-k-p.test
        (check_PROGRAMS): Add stack-fcall-attach.
        (stack_fcall_attach_SOURCES): New variable.
        * tests/stack-fcall.c: Include "tests.h" and <unistd.h>.
        [!ATTACH_MODE] (ATTACH_MODE): Define to 0.
        (main) [ATTACH_MODE]: Wait a bit.
        * tests/strace-k.test: Add attach mode.

        Complements: v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache"

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ci: enable building for x32 and x86 targets with the latest gcc and headers

        xlat: add KEY_PRIVACY_SCREEN_TOGGLE and KEY_KBD_LCD_MENU* to evdev_keycode
        * xlat/evdev_keycode.in (KEY_PRIVACY_SCREEN_TOGGLE): New constant,
        introduced by Linux commit v5.5-rc1~6^2^2~3.
        (KEY_KBD_LCD_MENU1, KEY_KBD_LCD_MENU2, KEY_KBD_LCD_MENU3,
        KEY_KBD_LCD_MENU4, KEY_KBD_LCD_MENU5): New constants, introduced by
        Linux commit v5.5-rc1~6.

        xlat: add STATX_ATTR_VERITY to statx_attrs.
        * xlat/statx_attrs.in (STATX_ATTR_VERITY): New constant, introduced
        by Linux commit v5.5-rc1~192^2~3.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf: decode PERF_SAMPLE_AUX flag and aux_sample_size field.
        Introduced by Linux commit v5.5-rc1~152^2~9.

        * configure.ac (AC_CHECK_MEMBERS): Check
        for struct perf_event_attr.__reserved_2
        and struct perf_event_attr.aux_sample_size.
        * perf.c (print_perf_event_attr): Print __reserved_2 field if non-zero;
        print aux_sample_size field.
        * perf_event_struct.h (struct perf_event_attr): Add aux_sample_size
        and __reserved_3 fields.
        * tests/perf_event_open.c: Add checks for nrw struct sizes, fields,
        and PERF_SAMPLE_AUX flag.
        * xlat/perf_attr_size.in (PERF_ATTR_SIZE_VER6): New constant.
        * xlat/perf_event_sample_format.in (PERF_SAMPLE_AUX): Likewise.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PPC_CMM_MAGIC to fsmagic.
        * xlat/fsmagic.in (PPC_CMM_MAGIC): New constant, introduced by Linux
        commit v5.5-rc1~110^2~59.

        xlat: update sock_sctp_options constants.
        * xlat/sock_sctp_options.in (SCTP_PEER_ADDR_THLDS_V2): New constant,
        introduced by Linux commit v5.5-rc1~174^2~159^2.
        (SCTP_EXPOSE_POTENTIALLY_FAILED_STATE): New constant, introduced
        by Linux commit v5.5-rc1~174^2~159^2~2.

        xlat: add TIPC_NODELAY to sock_tipc_options.
        * xlat/sock_tipc_options.in (TIPC_NODELAY): New constant, introduced
        by Linux commit v5.5-rc1~174^2~274.

        xlat: add IORING_SETUP_CQSIZE to uring_setup_flags.
        * xlat/uring_setup_flags.in (IORING_SETUP_CQSIZE): New constant,
        introduced by Linux commit v5.5-rc1~204^2~60.
        * tests/io_uring_setup.c (main): Update expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: implement decoding of struct io_uring_params.features.
        Introduced by Linux commit v5.4-rc1~28^2~17.

        * xlat/uring_setup_features.in: New file.
        * io_uring.c: Include "xlat/uring_setup_features.h".
        (struct_io_uring_params): Add features field, decrease resv field size.
        [HAVE_STRUCT_IO_URING_PARAMS]: Add checks for the
        struct io_uring_params.resv field.
        (SYS_FUNC(io_uring_setup)): Decode struct io_uring_params.features
        field.
        * tests/io_uring_setup.c: Update the expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: add support for IORING_REGISTER_EVENTFD and IORING_UNREGISTER_EVENTFD
        Introduced by Linux commit v5.2-rc1~148^2~3.

        * xlat/uring_register_opcodes.in (IORING_REGISTER_EVENTFD,
        IORING_UNREGISTER_EVENTFD): New constants.
        * io_uring.c (SYS_FUNC(io_uring_register)): Wire up
        IORING_REGISTER_EVENTFD.
        * tests/io_uring_register.c (main): Add checks for the new operations.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: print io_sqring_offsets and io_cqring_offsets reserved fields.
        * io_uring.c (SYS_FUNC(io_uring_setup)): Print
        struct io_sqring_offsets.resv1, struct io_sqring_offsets.resv2, and
        struct io_cqring_offsets.resv if non-zero.
        * tests/io_uring_setup.c (main): Update expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: decode io_uring_params.resv with IS_ARRAY_ZERO and PRINT_FIELD_ARRAY
        That also makes struct io_uring_params.resv printing in line with
        the rest of array printing formatting.

        * io_uring.c (SYS_FUNC(io_uring_setup)): Replace open-coded resv field
        non-zeroeness check/printing with IS_ARRAY_ZERO and PRINT_FIELD_ARRAY
        macro invocations.
        * tests/io_uring_setup.c (main): Use square brackets instead of curly
        braces for enclosing struct io_uring_params.resv elements.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Rework interface for printing local arrays.
        As it should be simpler to get it used.  In order to make the common
        case as simple as possible, split it into print_local_array_ex with all
        the arguments and convert print_local_array to a macro wrapper that gets
        the element count and size from the provided array argument itself,
        along with dropping all the arguments that are not expected to be
        commonly used.

        * defs.h (print_local_array_ex): Rename from print_local_array,
        remove elem_buf argument, add index_xlat and index_dflt arguments.
        (print_local_array): New macro wrapper from print_local_array_ex.
        * evdev.c (decode_bitset): Remove unused elem variable, update the
        print_local_array call.
        * print_fields.h (PRINT_FIELD_ARRAY): New macro wrapper for printing
        array fields.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io_uring: de-indent the switch case statements.
        * io_uring.c (SYS_FUNC(io_uring_register)): Decrease indentation for
        switch case labels and the related code.

        io_uring: do not depend on kernel header definitions.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/io_uring.h.
        (AC_CHECK_HEADERS): Add a separate check for linux/io_uring.h header
        that additionally performs AC_CHECK_TYPES on struct io_sqring_offsets,
        struct io_cqring_offsets, and struct io_uring_params, and
        AC_CHECK_MEMBERS on struct io_cqring_offsets.resv, struct
        io_uring_params.features, and struct io_uring_params.resv.
        * io_uring.c [!HAVE_LINUX_IO_URING_H]: Include "print_fields.h".
        (struct_io_sqring_offsets, struct_io_cqring_offsets,
        struct_io_uring_params): New struct type definitions.
        [HAVE_STRUCT_IO_SQRING_OFFSETS]: Check struct_io_sqring_offsets size
        against struct io_sqring_offsets.
        [HAVE_STRUCT_IO_CQRING_OFFSETS]: Check struct_io_cqring_offsets size
        against struct io_cqring_offsets.
        [HAVE_STRUCT_IO_CQRING_OFFSETS][HAVE_STRUCT_IO_CQRING_OFFSETS_RESV]:
        Check struct_io_cqring_offsets.resv offset and size against
        struct io_cqring_offsets.resv.
        [HAVE_STRUCT_IO_CQRING_OFFSETS][!HAVE_STRUCT_IO_CQRING_OFFSETS_RESV]:
        Fail unconditionally.
        [HAVE_STRUCT_IO_URING_PARAMS]: Check struct_io_cqring_offsets size
        against struct io_cqring_offsets.
        (SYS_FUNC(io_uring_setup)): Remove HAVE_LINUX_IO_URING_H guard.
        * tests/io_uring_setup.c: Add a workaround for kernel headers where
        struct io_uring_params.features is defined.

2020-01-21  Chunmei Xu  <xuchunmei@linux.alibaba.com>
            Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: properly fix printing errno in modify_ldt test.
        The fix in commit v5.4-40-g2939bbd is incorrect, as it leads to errno
        information not being expected by the test:

            modify_ldt(0, NULL, 0) = -1
            modify_ldt(-629534633, 0xffffffffffffffff, 16045756814261206767) = -1
            modify_ldt(-629534633, 0x7f354d38a000, 0) = -1
            ...

        * tests/modify_ldt.c (printrc): Avoid only errno update in case of rc
        being -1 and not the whole printing routine.

        Complements: v5.4-40-g2939bbd "tests: fix printing errno in modify_ldt test"
        Resolves: https://github.com/strace/strace/issues/118
        Resolves: https://github.com/strace/strace/issues/119

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Make SysV IPC decoders on 32-bit architectures 64-bit time_t compatible.
        When libc moves to 64-bit time_t on 32-bit architectures, IPC
        definitions provided by sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h
        header files become unsuitable for SysV IPC decoders.

        Prepare for this change by using Linux kernel uapi headers instead of
        libc headers as the preferred source of SysV IPC definitions.

        Fall back to libc headers if Linux kernel uapi headers have known bugs
        in their SysV IPC definitions.

        * configure.ac (AC_CHECK_SIZEOF): Check for struct msqid64_ds in
        <linux/msg.h>.
        * m4/mpers.m4 (st_MPERS): Likewise.
        * ipc_defs.h: Prioritize HAVE_LINUX_IPC_H over HAVE_SYS_IPC_H.
        [HAVE_LINUX_IPC_H && !IN_MPERS]: Undefine HAVE_LINUX_IPC_H if
        ARCH_SIZEOF_STRUCT_MSQID64_DS != SIZEOF_STRUCT_MSQID64_DS.
        [HAVE_LINUX_IPC_H && MPERS_IS_m32]: Undefine HAVE_LINUX_IPC_H if
        ARCH_M32_SIZEOF_STRUCT_MSQID64_DS != M32_SIZEOF_STRUCT_MSQID64_DS.
        [HAVE_LINUX_IPC_H && MPERS_IS_mx32]: Undefine HAVE_LINUX_IPC_H if
        ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS != MX32_SIZEOF_STRUCT_MSQID64_DS.
        * linux/sparc/arch_defs_.h (ARCH_SIZEOF_STRUCT_MSQID64_DS): New macro.
        * linux/sparc64/arch_defs_.h (ARCH_M32_SIZEOF_STRUCT_MSQID64_DS):
        Likewise.
        * linux/x32/arch_defs_.h (ARCH_SIZEOF_STRUCT_MSQID64_DS): Likewise.
        * linux/x86_64/arch_defs_.h (ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS):
        Likewise.

        Reported-by: Khem Raj <raj.khem@gmail.com>
        Reported-by: Rich Felker <dalias@aerifal.cx>
        Resolves: https://github.com/strace/strace/issues/116

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently choose SysV IPC definitions between libc and uapi providers
        strace decoders should use SysV IPC definitions provided by either libc
        or Linux kernel uapi headers, not a random mix of them.

        * configure.ac (AC_CHECK_HEADERS): Remove linux/msg.h, linux/sem.h,
        linux/shm.h, sys/msg.h, sys/sem.h, and sys/shm.h.
        * ipc_defs.h (MSG_H_PROVIDER, SEM_H_PROVIDER, SHM_H_PROVIDER,
        NAME_OF_STRUCT_MSQID_DS, NAME_OF_STRUCT_SHMID_DS,
        NAME_OF_STRUCT_IPC_PERM_KEY): New macros.
        * ipc_msg.c: Include MSG_H_PROVIDER instead of <sys/msg.h> or
        <linux/msg.h>.
        * ipc_msgctl.c: Likewise.
        (msqid_ds_t): Redefine to struct NAME_OF_STRUCT_MSQID_DS.
        (print_msqid_ds): Replace __key with NAME_OF_STRUCT_IPC_PERM_KEY.
        * ipc_sem.c: Include SEM_H_PROVIDER instead of <sys/sem.h> or
        <linux/sem.h>.
        (print_sembuf): Define unconditionally.
        (tprint_sembuf_array): Use print_sembuf unconditionally.
        * ipc_shm.c: Include SHM_H_PROVIDER instead of <sys/shm.h> or
        <linux/shm.h>.
        * ipc_shmctl.c: Likewise.
        (shmid_ds_t): Redefine to struct NAME_OF_STRUCT_SHMID_DS.
        (print_shmid_ds): Replace __key with NAME_OF_STRUCT_IPC_PERM_KEY.
        * print_msgbuf.c: Include MSG_H_PROVIDER instead of <sys/msg.h>.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use ipc_defs.h.
        Include "ipc_defs.h" in all decoder files that also include
        one of system ipc header files.

        * ipc_shm.c: Include "ipc_defs.h".
        * print_msgbuf.c: Likewise.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use sizeof_field macro.
        * gen_bpf_attr_check.sh (SoM): Remove.
        Replace SoM with sizeof_field.
        * sockaddr.c (SIZEOF_SA_FAMILY): Use sizeof_field macro.
        * socketutils.c (UNIX_PATH_MAX): Likewise.

2020-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        macros.h: introduce sizeof_field macro.
        Handy for field size checks.

        * macros.h (sizeof_field): New macro.
        (offsetofend): Use it.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: consistently use offsetofend macro.
        * tests/msg_control.c (MIN_SIZE_OF): Remove.
        (test_scm_rights1, test_scm_rights2): Replace MIN_SIZE_OF with
        offsetofend.

2020-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix printing errno in modify_ldt test.
        Before this change, the test expected that the syscall always returns
        a value of type int, which is not the case when the Linux kernel
        is built with CONFIG_MODIFY_LDT_SYSCALL disabled.

        * tests/modify_ldt.c (printrc): Do not mangle errno if rc is not in
        the suitable range.

        Resolves: https://github.com/strace/strace/issues/118

2020-01-15  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with glibc-2.31 and Linux kernel headers < 5.3.
        PTRACE_GET_SYSCALL_INFO support was added in strace since version 4.26
        released in December 2018, in Linux kernel headers since version 5.3
        released in September 2019, and in glibc since version 2.31 released
        in February 2020.  strace is expected to support all reasonable
        combinations of Linux kernel header versions and glibc versions, in
        particular, in cases when PTRACE_GET_SYSCALL_INFO definitions are not
        available in system headers or available only in Linux kernel headers
        or glibc.  Due to the longer release cycle of glibc compared to Linux
        kernel, it's more likely to have PTRACE_GET_SYSCALL_INFO definitions
        provided by <linux/ptrace.h> rather than <sys/ptrace.h>.

        This change fixes build in a less likely environment when
        PTRACE_GET_SYSCALL_INFO definitions are provided by <sys/ptrace.h> only,
        e.g. with glibc >= 2.31 and Linux kernel headers < 5.3.

        * configure.ac (AC_CHECK_TYPES): Check for struct __ptrace_syscall_info
        in <sys/ptrace.h>, check for struct ptrace_syscall_info in
        <linux/ptrace.h>.
        * ptrace.h (struct ptrace_syscall_info): Define only if
        !HAVE_STRUCT_PTRACE_SYSCALL_INFO && !HAVE_STRUCT___PTRACE_SYSCALL_INFO.
        (struct_ptrace_syscall_info): New typedef.
        * get_personality.h: Replace struct ptrace_syscall_info with
        struct_ptrace_syscall_info.
        * linux/aarch64/arch_get_personality.c: Likewise.
        * linux/powerpc64/arch_get_personality.c: Likewise.
        * linux/s390x/arch_get_personality.c: Likewise.
        * linux/sparc64/arch_get_personality.c: Likewise.
        * linux/tile/arch_get_personality.c: Likewise.
        * linux/x86_64/arch_get_personality.c: Likewise.
        * ptrace_syscall_info.c: Likewise.
        * syscall.c: Likewise.
        * tests/ptrace_syscall_info.c: Likewise.
        * NEWS: Mention this fix.

        Reported-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
        Fixes: v4.26~51 "Add definitions for PTRACE_GET_SYSCALL_INFO API"

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        ci: re-enable testing with the latest mainline kernel headers.
        There should be no issues with v5.5-rc6.
        This reverts commit 1aa46bd14ec63869aa2c8870bd1c261e0c3a5c65.

        * .gitlab-ci.yml (variables): Remove KBRANCH.
        * .travis.yml (env:global): Likewise.

2020-01-14  Baruch Siach  <baruch@tkos.co.il>

        filter_seccomp: fix no-MMU build.
        Move the declaration of filter_generators out of HAVE_FORK ifdef
        to fix build for no-MMU targets:

        filter_seccomp.c: In function ‘check_seccomp_filter_properties’:
        filter_seccomp.c:608:42: error: ‘filter_generators’ undeclared (first use in this function); did you mean ‘linear_filter_generator’?
          for (unsigned int i = 0; i < ARRAY_SIZE(filter_generators); ++i) {
                                                  ^~~~~~~~~~~~~~~~~

        * filter_seccomp.c (linear_filter_generator,
        binary_match_filter_generator): Declare unconditionally.
        (filter_generator_t, filter_generators, filters, bpf_prog): Define
        unconditionally.
        * NEWS: Mention this fix.

        Fixes: v5.4~57 "filter_seccomp: list of seccomp filter generation strategies"

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        clone: implement decoding of new fields in struct clone_args.
        * configure.ac (AC_CHECK_TYPES): Remove struct clone_args.
        (AC_CHECK_MEMBERS): Check for struct clone_args.set_tid_size
        in <linux/sched.h>.
        * clone.c (struct strace_clone_args): Add set_tid and set_tid_size
        fields.
        (SYS_FUNC(clone3)): Decode set_tid and set_tid_size fields of struct
        clone_args introduced by Linux kernel commit v5.5-rc1~180^2~5.
        * NEWS: Mention this change.
        * tests/clone3.c: Check HAVE_STRUCT_CLONE_ARGS_SET_TID_SIZE instead of
        HAVE_STRUCT_CLONE_ARGS.
        (struct test_clone_args): Add set_tid and set_tid_size fields.
        (MAX_SET_TID_SIZE): New macro.
        (print_set_tid): New function.
        (print_clone3): Use it.
        (main): Check decoding of set_tid and set_tid_size fields.

2020-01-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: add support for clone3-specific CLONE_CLEAR_SIGHAND flag decoding
        Introduced by Linux commit v5.5-rc1~180^2~8.

        * xlat/clone3_flags.in: New file.
        * clone.c: Include "xlat/clone3_flags.h".
        (SYS_FUNC(clone3)): Use both clone_flags and clone3_flags for flag field
        decoding.
        * gcc_compat.h [!GNUC_PREREQ(3, 0)] (FAIL_BUILD_ON_ZERO): Stub
        definition.
        * tests/clone3.c: Include "xlat/clone3_flags.h".
        (ERR): New macro.
        (do_clone3_): Accept possible_errors bitmask instead of should_Fail
        flag.
        (main): Add CLONE_CLEAR_SIGHAND-specific checks, update flag-related
        checks.

2020-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: prepare clone3 test for upcoming changes.
        * tests/clone3.c: Include <stdint.h> and "xlat/clone_flags.h"
        unconditionally.  Do not include <linux/types.h>.
        (struct clone_args): Rename to struct test_clone_args, define
        unconditionally.
        (struct_clone_args): New typedef.
        (do_clone3_, print_clone3, main): Switch all users of
        struct test_clone_args to struct_clone_args.
        (main): Use TAIL_ALLOC_OBJECT_CONST_PTR.  Move printing of "clone3("
        prefix ...
        (print_clone3): ... here to fix errno clobbering.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        travis: add s390x builds.
        * .travis.yml (matrix): Add s390x builds.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        s390: workaround Linux kernel bug in syscall_get_nr.
        Apparently, arch/s390/include/asm/syscall.h:syscall_get_nr() returns 0
        for out-of-range syscall numbers.
        This kernel bug is exposed via PTRACE_GET_SYSCALL_INFO interface.
        Workaround it by falling back to get_regs() for the zero syscall number.

        * linux/s390/check_scno.c: New file.
        * linux/s390x/check_scno.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * syscall.c (get_scno): Update comment.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        ci: support Travis CI's ppc64le builds.
        * .travis.yml (matrix): Add ppc64le builds.
        * ci/install-dependencies.sh: Do not attempt to install multilib
        packages on ppc64le.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip stack tracing tests when /proc/self/maps is invalid.
        Apparently, some container orchestration systems are capable of messing
        up with /proc/self/maps.  For example, one can face with the following
        garbage in Travis CI:

                $ cat /proc/self/maps
                ee72dcc0000-ee72dcd0000 r-xp 00000000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
                ee72dcd0000-ee72dce0000 r--p 00000000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
                ee72dce0000-ee72dcf0000 rw-p 00010000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
                ...

        Our stack tracing cannot work properly when /proc/self/maps is damaged
        this way.

        * tests/strace-k.test: Check that the path to executable recorded
        in /proc/self/maps is valid and skip the test if it's not the case.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        filter_seccomp: fix stack trace caching.
        * filter_seccomp.c (traced_by_seccomp): Trace all syscalls that have
        MEMORY_MAPPING_CHANGE flag set when stack tracing is enabled.
        * NEWS: Mention this fix.

        syscall: do not capture stack trace while the tracee executes strace code
        * syscall.c (syscall_entering_trace) [ENABLE_STACKTRACE]: Do not capture
        stack trace when TCB_CHECK_EXEC_SYSCALL flag is set.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: simplify signal printing in legacy clone handler a bit.
        printsignal() does the right thing for quite a while (since v4.26~66
        "Stop using SIG_0") so the signal printing code can be simplified.
        This change is covered by a check in clone-flags test.

        * clone.c (SYS_FUNC(clone)): Simplify signal printing in absence
        of flags.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update KVM_* constants.
        * xlat/kvm_cap.in (KVM_CAP_PPC_GUEST_DEBUG_SSTEP): New constant
        introduced by Linux kernel commit v5.5-rc1~47^2~5^2~14.
        (KVM_CAP_ARM_NISV_TO_USER): New constant introduced by Linux kernel
        commits v5.5-rc1~47^2~16^2~3 and v5.5-rc1~47^2~16.
        (KVM_CAP_ARM_INJECT_EXT_DABT): New constant introduced by Linux kernel
        commits v5.5-rc1~47^2~16^2~2 and v5.5-rc1~47^2~16.
        * xlat/kvm_exit_reason.in (KVM_EXIT_ARM_NISV): New constant introduced
        by Linux kernel commit v5.5-rc1~47^2~16^2~3.

        xlat: add V4L2_CID_UNIT_CELL_SIZE to v4l2_control_ids.
        * xlat/v4l2_control_ids.in (V4L2_CID_UNIT_CELL_SIZE): New constant
        introduced by Linux kernel commit v5.5-rc1~143^2^2~223.

        xlat: add V4L2_CTRL_TYPE_AREA to v4l2_control_types.
        * xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_AREA): New constant
        introduced by Linux kernel commit v5.5-rc1~143^2^2~225.
        * configure.ac (V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16,
        V4L2_CTRL_TYPE_U32): Add missing definition checks.
        (V4L2_CTRL_TYPE_AREA): Add corresponding definition check.

        xlat: add KEY_MACRO* definitions to evdev_keycode.
        * xlat/evdev_keycode.in: Add new constants introduced by Linux kernel
        commit v5.5-rc1~92^2~1^2~8.

        xlat: add AUDIT_ANOM_CREAT to nl_audit_types.
        * xlat/nl_audit_types.in (AUDIT_ANOM_CREAT): New constant introduced
        by Linux kernel commit v5.5-rc1~104^2~1.

        prctl: improve arch_prctl decoding.
        * prctl.c (arch_prctl): ARCH_GET_GS and ARCH_GET_FS return 64-bit value
        even on x32; ARCH_GET_CPUID ignores the second argument.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        NEWS: mention Fedora bug number for the libdwfl cache issue.
        Also, mention the reporter in the git commit message.

        * NEWS: Mention Fedora bug number for the libdwfl cache issue.

        Reported-by: Pavel Zhukov <pzhukov@redhat.com>
        Complements: v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache"

2020-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        unwind-libdw: fix initialization of libdwfl cache.
        This fixes stack trace printing for early syscalls that precede
        the first syscall from memory mapping or execve families.

        * unwind-libdw.c (tcb_init): Set struct ctx.last_proc_updating
        to a value different from mapping_generation so that libdwfl cache
        is properly initialized before the first use.
        * NEWS: Mention this fix.

        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1788636

2020-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: Do not dereference SCM_TIMESTAMP* control messages in-place.
        * tests/sockopt-timestamp.c (print_timestamp_old,
        print_timestampns_old): Do not dereference SCM_TIMESTAMP* control
        messages in-place to avoid potential alignment issues in the future.
        * tests/msg_control.c (test_scm_timestamp_old, test_scm_timestampns_old,
        test_scm_timestamping_old, test_scm_timestamp_new,
        test_scm_timestampns_new, test_scm_timestamping_new): Likewise.
        (main): Use "tail_alloc(1024) + 1024" instead of "tail_alloc(1) + 1"
        for obtaining a tail_alloc'ed page to avoid false -Warray-bounds
        warnings from some versions of gcc.

        print_timespec.h: cleanup PRINT_TIMESPEC_ARRAY_DATA_SIZE.
        * print_timespec.h (PRINT_TIMESPEC_ARRAY_DATA_SIZE): Use loop initial
        declaration.  Do not treat potentially unaligned pointers as pointers
        to TIMESPEC_T.

2020-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        Fix potentially unaligned access in SO_TIMESTAMP*_NEW decoder and tests.
        * print_timespec.h [PRINT_TIMESPEC_DATA_SIZE ||
        PRINT_TIMESPEC_ARRAY_DATA_SIZE] (print_unaligned_timespec_t): New
        function.
        (PRINT_TIMESPEC_DATA_SIZE, PRINT_TIMESPEC_ARRAY_DATA_SIZE): Use it
        instead of print_timespec_t.
        * tests/sockopt-timestamp.c: Include <string.h>.
        (print_timestamp_new, print_timestampns_new): Fix potentially unaligned
        access of CMSG_DATA.
        * NEWS: Mention this fix.

        Fixes: v5.1~21 "Implement decoding of SO_TIMESTAMP*_NEW control messages"

2020-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check %creds.
        * tests/trace_creds.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add trace_creds.in.
        * tests/getuid.test: Extend to handle *-creds tests.
        * tests/gen_tests.in (getegid-creds, getegid32-creds, geteuid-creds,
        geteuid32-creds, getgid-creds, getgid32-creds, getuid-creds,
        getuid32-creds, trace_creds): New entries.

2019-12-29  Andrey Zax  <andrey.zax@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Implement %creds trace class.
        This patch implements a new trace class (%creds) to trace syscalls
        related to process credentials.

        syscallent headers are updated using the following command:

        sed -i -r '/[gs]et[^p]*([gu]id|groups)|cap[gs]et|\(prctl/ {
                        s/(\{ [0-6],\t)([A-Z]+\|[A-Z|]+,)\t/\1TC|\2/;
                        s/(\{ [0-6],\t)([A-Z]+,)/\1TC|\2/;
                        s/(\{ [0-6],\t)0/\1TC/
                }' linux/*/syscallent*.h

        * basic_filters.c (lookup_class): Add %creds member to syscall_class[].
        * sysent.h (TRACE_CREDS): New macro.
        * sysent_shorthand_defs.h (TC): Likewise.
        * strace.1.in (.SS Filtering): Add a description for `-e trace=%creds`.
        * linux/32/syscallent.h: Add TC flag to credentials syscalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-compat.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * NEWS: Mention this change.

2019-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: increase the child stack size in some tests that invoke clone.
        Increase the child stack size from the half page size to the full page
        size in those few tests that invoke clone syscall.

        The former size appears to be insufficient in some build setups.
        For example, clang 7 on Ubuntu bionic x86_64 makes ioctl_nsfs test fail
        due to child process segfaults.

        * tests/clone_parent.c (child_stack_size, clone): Remove.
        (do_clone): New macro.
        (main): Use it.
        * tests/clone_ptrace.c: Likewise.
        * tests/ioctl_nsfs.c (child_stack_size, clone): Remove.
        (do_clone): New macro.
        (test_user_namespace): Use it.

2019-12-15  Vladimir D. Seleznev  <vseleznv@altlinux.org>

        Fix typos in comments.
        * io.c (tprint_iov_upto): Fix typo in the function header comment.
        * tests/tests.h (f8ill_ptr_to_kulong): Likewise.
        * printsiginfo.c (print_si_info): Fix typo in the comment.
        * stage_output.c (strace_open_memstream): Likewise.
        * tests/prctl-seccomp-strict.c (main): Likewise.
        * tests/seccomp-strict.c (main): Likewise.
        * largefile_wrappers.h: Fix typos in the file header comment.
        * tests/zeroargc.c: Fix typo in the file header comment.

2019-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: insert a delay into bpf-obj_get_info_by_fd tests.
        According to Quentin Monnet [1], there is a delay when the locked memory
        is being reclaimed after a BPF program or map is removed.

        Privileged tools like iproute2 and bpftool workaround this Linux kernel
        limitation by raising RLIMIT_MEMLOCK to infinity prior to creating BPF
        objects.

        Our BPF tests are expected to be invoked without extra privileges
        and therefore do not have this option.

        Instead, we serialize all BPF tests invocations and insert a delay
        long enough to let the locked memory be reclaimed.

        [1] https://lists.strace.io/pipermail/strace-devel/2019-December/009274.html

        * tests/bpf-obj_get_info_by_fd.c (main): Add a comment and a sleep
        invocation.
        * tests/pure_executables.list: Remove bpf-obj_get_info_by_fd,
        bpf-obj_get_info_by_fd-prog, bpf-obj_get_info_by_fd-prog-v,
        and bpf-obj_get_info_by_fd-v because they call sleep function
        that may be implemented on top of clock_nanosleep* syscalls.

        Thanks-to: Quentin Monnet <quentin.monnet@netronome.com>
        References: https://github.com/strace/strace/issues/74

2019-12-10  Paul Chaignon  <paul.chaignon@gmail.com>

        bpf: support new fields for BPF_PROG_LOAD.
        * bpf_attr.h (BPF_PROG_LOAD_struct): New fields introduced in Linux
        commits v5.5-rc1~174^2~310^2~19^2~7 and v5.5-rc1~174^2~49^2~12^2~3.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode the new fields.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_PROG_LOAD_checks): Update expected outputs.
        * tests/bpf-obj_get_info_by_fd.c (print_prog_load): Likewise.
        * tests/kernel_version.c (print_bpf_attr): Likewise.

        bpf: update BPF constants.
        * xlat/bpf_attach_type.in (BPF_TRACE_RAW_TP): New constant introduced in
        Linux commit v5.5-rc1~174^2~249^2~4^2~1.
        (BPF_TRACE_FENTRY, BPF_TRACE_FEXIT): New constants introduced in Linux
        commit v5.5-rc1~174^2~49^2~12^2~16.
        * xlat/bpf_map_flags.in (BPF_F_MMAPABLE): New constant introduced in Linux
        commit v5.5-rc1~174^2~49^2~11^2~2.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_TRACING): New constant
        introduced in Linux commit v5.5-rc1~174^2~249^2~4^2~1.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
        BPF_PROG_QUERY_checks): Update expected outputs.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of NDA_LLADDR netlink neighbour table attribute.
        * tests/nlattr_ndmsg.c (main): Check decoding of NDA_LLADDR.

2019-12-03  Jamal Hadi Salim  <jhs@mojatatu.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_neigh: fix NDA_LLADDR netlink neighbour table attribute decoder.

        Before this fix NDA_LLADDR attributes used to be printed
        as inet addresses, not as mac addresses.

        * rtnl_neigh.c (decode_neigh_lladdr): New function.
        (ndmsg_nla_decoders): Use it for NDA_LLADDR decoding.
        * NEWS: Mention this fix.

        Fixes: v4.19~33 "rtnl_neigh: decode ndmsg netlink attributes"

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: use AC_LANG_PROGRAM instead of AC_LANG_SOURCE.
        AC_LANG_PROGRAM is a convenient wrapper around AC_LANG_SOURCE.

        * m4/mpers.m4 (st_MPERS): Use AC_LANG_PROGRAM instead of AC_LANG_SOURCE.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: modify CPPFLAGS and CFLAGS separately.
        * m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS, add MPERS_CFLAGS
        to CFLAGS.  This change is not expected to change behaviour.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: do not copy CFLAGS to CFLAGS_FOR_{M32,MX32}
        As result, CFLAGS is no longer passed to mpers.sh,
        reintroducing the traditional behaviour changed by commit v5.4~32.

        The copying behaviour in it's current form was problematic because some
        of compiler options may break mpers.sh; for example, if CFLAGS includes
        -flto, then mpers.sh breaks, since intermediate *.o files created by
        mpers.sh do not contain any real code.

        * configure.ac [$arch != aarch64]: Initialize CFLAGS_FOR_M32 and
        CFLAGS_FOR_MX32 to empty strings by default.
        * NEWS: Mention this fix.

        Reported-by: Andreas Schwab <schwab@linux-m68k.org>
        Reported-by: Thomas Deutschmann <whissi@gentoo.org>
        Resolves: https://github.com/strace/strace/issues/114
        Fixes: v5.4~32 "Add support for per-mpers compiler settings"

2019-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tweak restart_syscall test to workaround nanosleep changes.
        nanosleep function in glibc used to be implemented as a simple syscall
        wrapper around __NR_nanosleep, but starting with glibc commit
        glibc-2.30.9000-234-g3537ecb49c, it is implemented on top of
        __clock_nanosleep function which in turn is implemented on top of
        __clock_nanosleep_time64 function.

        These functions do not forward the last argument written by the kernel
        when the underlying syscall succeeds, breaking the expected output.
        Besides that, these proxy functions pass garbage in the upper 32-bits
        of tv_nsec on 32-bit architectures .

        Rather than changing restart_syscall test to use __NR_nanosleep syscall
        directly, relax the expected output with regards to the remaining time
        written by the kernel as this not what is being tested by
        restart_syscall test.

        * tests/restart_syscall.c: Stop including <assert.h>.
        (main): Do not use assert.  Change the initial value of rem variable.
        Use regexps instead of specific values of rem.tv_sec and rem.tv_nsec
        in the expected output.
        * NEWS: Mention this change.

2019-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.4-1.
        * strace.spec.in: Likewise.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.4 release.
        * NEWS: Update for 5.4 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tweak restart_syscall test to break in a more obvious way in case of faulty libc
        If libc implements nanosleep on top of clock_nanosleep, there is
        a chance of struct timespec translation bugs in libc breaking this test.
        Tweak the test to make this breakage more obvious.

        * tests/restart_syscall.c (main): Initialize rem variable with invalid
        timespec data.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix restart_syscall test on systems with emulated nanosleep.
        When libc emulates nanosleep on top of clock_nanosleep, the address
        of the structure passed to the kernel is not the same as the address
        of the structure passed to nanosleep.

        * tests/restart_syscall.c (main): Update expected output.

2019-11-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        ci: use kernel headers from Linux v5.4.
        There is too much noise when using unreleased kernel uapi.

        * .gitlab-ci.yml (variables): Add KBRANCH.
        * .travis.yml (env:global): Likewise.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        Use an LFS version of fcntl function when available.
        glibc-2.28 introduced fcntl64 as an LFS version of fcntl function,
        use this new function when available.

        * configure.ac (AC_CHECK_FUNCS): Add fcntl64.
        * largefile_wrappers.h (fcntl_fd): New macro.
        * strace.c (set_cloexec_flag): Use it instead of fcntl.

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

        bpf: update BPF constants.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCK_ADDR): New constant
        introduced by Linux commit v4.17-rc1~148^2~19^2^2~6.
        (BPF_PROG_TYPE_LWT_SEG6LOCAL, BPF_PROG_TYPE_LIRC_MODE2,
        BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_FLOW_DISSECTOR,
        BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
        BPF_PROG_TYPE_CGROUP_SOCKOPT): Update constant values following missing
        entry in enum.
        * tests/bpf.c (BPF_PROG_LOAD_checks): Update expected outputs and add test.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

        Fixes: v4.24~49 "xlat: update bpf(2)-related constants"
        Fixes: v4.25~58 "xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in"
        Fixes: v4.26~12 "xlat: add flow dissector bpf program type constants"
        Fixes: v5.2~38 "xlat: update BPF_* constants"
        Fixes: v5.3~60 "xlat: update BPF_* constants"

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

        bpf: support new field in BPF_MAP_LOOKUP_ELEM.
        * bpf_attr.h (BPF_MAP_LOOKUP_ELEM_struct): New field introduced by Linux
        commit v5.1-rc1~178^2~375^2~4^2~3.
        * xlat/bpf_map_lookup_elem_flags.in: New file.
        * bpf.c: Include "xlat/bpf_map_lookup_elem_flags.h".
        (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)): Decode the new field.
        * tests/bpf.c (BPF_MAP_LOOKUP_ELEM_checks): Update expected outputs.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for IPC_* and SHM_* constants.
        * xlat/shm_flags.in: Provide fallback definitions for constants.
        * xlat/shm_resource_flags.in: Likewise.

        xlat: update MSG_* constants.
        * xlat/ipc_msg_flags.in: Provide fallback definitions for constants.
        (MSG_COPY): New constant introduced by Linux kernel commit
        v3.8-rc3~16^2~30.
        * NEWS: Mention this.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change status-unfinished-threads test to use __NR_nanosleep.
        Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
        nanosleep function in glibc is implemented on top of clock_nanosleep,
        which makes it unsuitable for this test that is based on nanosleep
        syscall.

        * tests/status-unfinished-threads.c: Skip the test if __NR_nanosleep
        is not defined, include "kernel_old_timespec.h".
        (thread, main): Change the type of ts variable to kernel_old_timespec_t,
        invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change threads-execve test to use __NR_nanosleep.
        Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
        nanosleep function in glibc is implemented on top of clock_nanosleep,
        which makes it unsuitable for this test that uses both nanosleep
        and clock_nanosleep syscalls for different purposes.

        * tests/threads-execve.c: Skip the test if __NR_nanosleep is not defined.
        Include "kernel_old_timespec.h".
        (thread, main): Invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify umoven-illptr test against undefined __NR_nanosleep.
        * tests/umoven-illptr.c: Skip the test if __NR_nanosleep is not defined.
        Include "kernel_old_timespec.h" instead of <time.h>, use
        kernel_old_timespec_t instead of struct timespec.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change sleep helper to use __NR_nanosleep.
        Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
        nanosleep function in glibc is implemented on top of clock_nanosleep,
        which makes it unsuitable for the sleep helper that is expected to
        invoke nanosleep syscall.

        * tests/sleep.c: Skip the test if __NR_nanosleep is not defined.
        Include "kernel_old_timespec.h" instead of <time.h>.
        (main): Change the type of ts variable to kernel_old_timespec_t,
        invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: consistently check before use that sleep executable works.
        Add the required check to those few tests that miss it.

        * tests/status-detached.test: Invoke "run_prog ../sleep 0".
        * tests/strace-DD.test: Likewise.
        * tests/strace-ff.test: Likewise.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change restart_syscall test not to assume nanosleep syscall.
        Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
        nanosleep function in glibc is implemented on top of clock_nanosleep,
        which makes any code relying on the old behaviour fragile.

        Resolve this issue by allowing other syscalls from the nanosleep family.

        * tests/restart_syscall.c (NANOSLEEP_NAME_RE, NANOSLEEP_CALL_RE): New
        macros.
        (main): Use them to extend regular expressions to allow clock_nanosleep
        and clock_nanosleep_time64 syscalls.
        * tests/restart_syscall.test: Replace nanosleep with /nanosleep in the
        list of matched syscalls.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change nanosleep test to use __NR_nanosleep.
        Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
        nanosleep function in glibc is implemented on top of clock_nanosleep,
        which makes it unsuitable for the test of nanosleep decoder.

        * tests/nanosleep.c: Skip the test if __NR_nanosleep is not defined.
        Include "kernel_old_timespec.h" instead of <time.h>.
        (k_nanosleep): New function.
        (main): Change the type of ts variable to kernel_old_timespec_t,
        use k_nanosleep to invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: introduce kernel_old_timespec.h.
        This header file defines kernel_old_timespec_t type that is going to be
        used to define objects passed to such system calls as nanosleep.

        * tests/kernel_old_timespec.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add kernel_old_timespec.h.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change adjtimex test to use __NR_adjtimex.
        Starting with glibc commit glibc-2.30.9000-215-gc81aa64e81,
        adjtimex function in glibc is implemented on top of clock_adjtime,
        which makes it unsuitable for the test of adjtimex decoder.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct timex.tai.
        * tests/adjtimex.c: Skip the test if __NR_adjtimex is not defined.
        Include "kernel_old_timex.h".
        (k_adjtimex): New function.
        (main): Change the type of tx pointer to kernel_old_timex_t,
        use k_adjtimex to invoke adjtimex syscall.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: introduce kernel_old_timex.h.
        This header file defines kernel_old_timex_t type that is going to be
        used to define objects passed to such system calls as adjtimex.

        * tests/kernel_old_timex.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add kernel_old_timex.h.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite semop test.
        Starting with glibc commit glibc-2.30.9000-169-g765cdd0bff,
        semop function in glibc is implemented on top of semtimedop,
        which makes it unsuitable for the test of semop decoder.

        Resolve this issue by creating two tests: one that checks decoding
        of __NR_semop, and another that checks decoding of __NR_ipc SEMOP.

        * tests/semop-common.c: New file.
        * tests/Makefile.am (EXTRA_DIST): Add semop-common.c.
        * tests/semop-indirect.c: New file.
        * tests/semop.c: Rewrite using __NR_semop.
        * tests/pure_executables.list: Add semop-indirect.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (semop): Update.
        (semop-indirect): New entry.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a separate semtimedop test.
        The semop test is going to be changed soon, so create a separate
        semtimedop test based on the test we have.

        * tests/semtimedop.c: New file.
        * tests/pure_executables.list: Add semtimedop.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (semtimedop): New entry.

2019-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update PTP_* constants.
        * xlat/ptp_extts_flags.in (PTP_STRICT_FLAGS): New constant introduced
        by Linux kernel commit v5.4-rc8~8^2~9^2~5.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch from gcc-8 to gcc-9.
        * .travis.yml (matrix): Switch all gcc-8 builds except arm64 ones
        to gcc-9.  gcc-8 arm64 builds have to remain until gcc-9 arm64 builds
        are fixed, currently they error out because of missing
        gcc-9-multilib-arm-linux-gnueabihf package.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch some stack trace enabled builds from libunwind to libdw.
        Switch to Bionic allows to use libdw instead of libunwind.

        * .travis.yml (matrix): Change STACKTRACE from libunwind to libdw
        in most of Bionic-based builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch from Trusty to Bionic.
        Ideally, all builds have to be switched, but coverage build,
        unfortunately, errors out by Travis CI with a build timeout,
        musl-gcc x86 build fails with
        "undefined reference to `__stack_chk_fail_local'" error, and gcc-8 arm64
        builds error out because of missing gcc-8-multilib-arm-linux-gnueabihf
        package.

        * .travis.yml (dist): Change to bionic.
        (matrix): Add "dist: trusty" to coverage, musl-gcc x86, and gcc-8 arm64
        builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        ci: enable mpers in aarch64 builds.
        * ci/install-dependencies.sh (aarch64): Install libc6-dev-armhf-cross
        and linux-libc-dev-armhf-cross packages.
        * ci/run-build-and-tests.sh (aarch64): Enable strict mpers check
        by removing --enable-mpers=check configure option.

2019-11-15  Paul Chaignon  <paul.chaignon@gmail.com>

        ci: support Travis CI's aarch64 builds.
        Travis CI now supports aarch64 builds, launched with the new "arch: arm64"
        tag.  These builds are running inside LXD only for the moment.

        The aarch64 builds tend to be a lot slower than their x86_64 counterparts,
        so several timeout values need to be increased.

        Some tests occasionally take more than 10 minutes, hitting Travis CI's
        timeout on output inactivity.  Using "travis_wait 40" disables that
        timeout; it delays the start time for the output inactivity timeout by 40
        minutes, bringing it to the maximum build timeout of 50 minutes.

        * .travis.yml (matrix): Add aarch64 builds and mark previous builds as
        amd64.
        * ci/install-dependencies.sh: Install packages for aarch64 builds.
        * ci/run-build-and-tests.sh: Check mpers for aarch64.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        debian/control: add build dependencies for aarch64 mpers.
        * debian/control (Build-Depends): Add gcc-arm-linux-gnueabi,
        libc6-dev-armel-cross, linux-libc-dev-armel-cross as additional
        dependencies on arm64 in order to build proper mpers support.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        configure.ac: use a separate compiler for ARM EABI on AArch64.
        As gcc on AArch64 doesn't support compat ABI target, we have to find
        and use a separate compiler in order to get proper compat personality
        support on AArch64.

        * configure.ac (arch == aarch64): Try to find a compiler for ARM EABI
        based on known names for it in various distributions.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for per-mpers compiler settings.
        As some very special architectures require a separate compiler
        in order to compile binaries for additional supported personalities,
        we have to introduce such support.

        * Makefile.am (mpers_CPPFLAGS): Move $(strace_CPPFLAGS) ...
        (mpers_sh_opts): ... here.
        (mpers-m%.stamp:): Use $(mpers_CC) instead of $(CC) for compiler,
        pass $(mpers_CC_FLAGS) in quotes as it might be empty or contain spaces.
        ($(mpers_m32_targets)): Add @CFLAGS_FOR_M32@ to mpers_CC_FLAGS, set
        mpers_CPPFLAGS and mpers_CC.
        ($(mpers_mx32_targets)): Add @CFLAGS_FOR_MX32@ to mpers_CC_FLAGS, set
        mpers_CPPFLAGS and mpers_CC.
        * bootstrap (m_upper): Derive uppercase personality name.
        Set CC for mpers Makefile.am, add @CFLAGS_FOR_{M32,MX32}@ to
        MPERS_CC_FLAGS definition.
        * configure.ac: Derive default values for
        {CC,CPP,CFLAGS,CPPFLAGS}_FOR_{M32,MX32} from the respective CC, CPP,
        CFLAGS, and CPPFLAGS values.
        * m4/mpers.m4 (AC_DEFUN([st_MPERS])): Use
        {CC,CPP,CFLAGS,CPPFLAGS}_FOR_<$1> as CC, CPP, CFLAGS, and CPPFLAGS,
        respectively.  Enclose MPERS_CFLAGS in quotes in mpers.sh call.  Provide
        information about compiler in the AC_CACHE_CHECK message.
        * tests/Makefile.am (CC): New variable.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        ci: enable symbols demangling in stack trace enabled builds.
        * ci/install-dependencies.sh: Install libiberty-dev when STACKTRACE
        is specified.

        tests: lower expected performance gain in filter_seccomp-perf.test.
        * tests/filter_seccomp-perf.test (min_ratio): Change from 8 to 6,
        the former expectation was too optimistic for such slow architectures
        as parisc.

        tests: fix invalid copyright years range in a few tests.
        * maint/update_copyright_years.sh (process_file): When updating
        copyright years, if there is existing notice and its starting year is
        earlier than the year of the first commit, the former takes precedence.
        * tests/filter_seccomp-flag.c: Fix copyright years range.
        * tests/filter_seccomp-perf.c: Likewise.
        * tests/filter_seccomp-perf.test: Likewise.
        * tests/filter_seccomp.sh: Likewise.
        * tests/status-none-f.c: Likewise.

        ptp: add support of new PTP_*2 ioctls.
        * ptp.c [!PTP_CLOCK_GETCAPS2] (PTP_CLOCK_GETCAPS2): Define.
        [!PTP_EXTTS_REQUEST2] (PTP_EXTTS_REQUEST2): Likewise.
        [!PTP_PEROUT_REQUEST2] (PTP_PEROUT_REQUEST2): Likewise.
        [!PTP_ENABLE_PPS2] (PTP_ENABLE_PPS2): Likewise.
        [!PTP_SYS_OFFSET2] (PTP_SYS_OFFSET2): Likewise.
        (ptp_ioctl): Handle PTP_CLOCK_GETCAPS2, PTP_EXTTS_REQUEST2,
        PTP_PEROUT_REQUEST2, PTP_ENABLE_PPS2, and PTP_SYS_OFFSET2.
        * tests/ioctl_ptp.c: Check decoding of PTP_*2 ioctls.

        tests: rewrite ioctl_ptp test using sprintrc.
        * tests/ioctl_ptp.c: Do not include <errno.h>.
        (main): Use sprintrc.

        ptp: prepare for support of new PTP_*2 ioctls.
        * xlat/ptp_flags_options.in: Rename to ...
        * xlat/ptp_extts_flags.in: ... new file, add fallback definitions
        for constants.
        * xlat/ptp_perout_flags.in: New file.
        * ptp.c: Include "xlat/ptp_extts_flags.h" and "xlat/ptp_perout_flags.h"
        instead of "xlat/ptp_flags_options.h".
        (ptp_ioctl): Use ptp_extts_flags and ptp_perout_flags instead of
        ptp_flags_options.
        * tests/ioctl_ptp.c: Include "xlat/ptp_extts_flags.h" and
        "xlat/ptp_perout_flags.h" instead of "xlat/ptp_flags_options.h".
        (test_no_device): Use ptp_extts_flags and ptp_perout_flags instead of
        ptp_flags_options.

        prctl: implement decoding of PR_[GS]ET_TAGGED_ADDR_CTRL.
        * xlat/prctl_options.in (PR_SET_TAGGED_ADDR_CTRL,
        PR_GET_TAGGED_ADDR_CTRL): New constants introduced by Linux kernel commit
        v5.4-rc1~100^2~6^9~8.
        * prctl.c (SYS_FUNC(prctl)): Handle them.
        * NEWS: Mention this.
        * tests/prctl-no-args.c: Check PR_GET_TAGGED_ADDR_CTRL decoding.

        xlat: update KVM_CAP_* constants.
        * xlat/kvm_cap.in (KVM_CAP_ARM_IRQ_LINE_LAYOUT_2): New constant
        introduced by Linux kernel commit v5.4-rc1~138^2~20^2.
        (KVM_CAP_HYPERV_DIRECT_TLBFLUSH): New constant introduced by Linux
        kernel commit v5.4-rc1~26^2~53.
        * NEWS: Mention this.

        xlat: update KEXEC_* constants.
        * xlat/kexec_arch_values.in (KEXEC_ARCH_PARISC): New constant introduced
        by Linux kernel commit v5.4-rc1~188^2~4.
        * NEWS: Mention this.

        xlat: update CAN_* constants.
        * xlat/can_protocols.in (CAN_J1939): New constant introduced by Linux
        kernel commit v5.4-rc1~131^2~78^2~2.
        * NEWS: Mention this.

2019-11-14  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: implement decoding of BPF_BTF_GET_NEXT_ID command.
        * xlat/bpf_commands.in (BPF_BTF_GET_NEXT_ID): New constant introduced
        by Linux kernel commit v5.4-rc1~131^2~62^2~28^2~4.
        * bpf_attr.h (BPF_BTF_GET_NEXT_ID_struct,
        BPF_BTF_GET_NEXT_ID_struct_size): New macros.
        * bpf.c (decode_BPF_BTF_GET_NEXT_ID): Likewise.
        (bpf_cmd_decoders): Add BPF_CMD_ENTRY(BPF_BTF_GET_NEXT_ID).
        * NEWS: Mention this change.
        * tests/bpf.c (BPF_BTF_GET_NEXT_ID_checks): New macro.
        (checks): Add CHK(BPF_BTF_GET_NEXT_ID).

2019-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update MADV_* constants.
        * xlat/madvise_cmds.in (MADV_COLD): New constant introduced by Linux
        kernel commit v5.4-rc1~46^2~13.
        (MADV_PAGEOUT): New constant introduced by Linux kernel commit
        v5.4-rc1~46^2~11.
        * NEWS: Mention this.

2019-11-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.4.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.4-rc7
        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/riscv64/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2019-11-09  Paul Chaignon  <paul.chaignon@gmail.com>

        filter_seccomp: fix jump offset overflow in binary match generator.
        binary_match_filter_generator() is missing a check for jump offset
        overflows which might result in incorrect behavior if the binary match
        strategy is selected and overflows.

        I have only been able to reproduce the bug on mips after forcing strace to
        use the binary match generator.  Due to the large number of syscalls on
        mips, the binary match algorithm is suboptimal and the linear one is
        selected.  This bug could however be triggered inadvertently if tracing a
        very large set of syscalls not grouped together; in that case, the linear
        strategy might have a jump offset overflow itself and strace would
        fallback to the binary match one.

        * filter_seccomp (binary_match_filter_generator): Check for jump offset
        overflows.

2019-11-08  Paul Chaignon  <paul.chaignon@gmail.com>

        tests: fix potentially missing SHM_NORESERVE for mips.
        * tests/ipc_shm.c [!SHM_NORESERVE] (SHM_NORESERVE): Define.

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tolerate zero process group ID and session ID in strace-DDD.test.
        Paul Chaignon reported [1] that in some of Travis CI build environments
        process group ID and session ID may be equal to zero.

        Change the affected strace-DDD.test to tolerate these odd values as long
        as they don't interfere with the purpose of the test.

        [1] https://travis-ci.community/t/unexpected-zero-values-in-proc-pid-stat/5774

        * tests/strace-DDD.test: Tolerate zero process group ID and session ID.

        Reported-by: Paul Chaignon <paul.chaignon@gmail.com>

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix -a argument in ipc_msgbuf-Xraw test.
        * tests/gen_tests.in (ipc_msgbuf-Xraw): Change -a argument from 20 to 19.

2019-11-07  Paul Chaignon  <paul.chaignon@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify umount2.test against filtered umount2 syscall.
        Do not assume that umount2 syscall invoked with invalid arguments always
        fail with EINVAL as in some environments it can be filtered out e.g.
        using seccomp-bpf.

        * tests/umount2.c (main): Use sprintrc() to prepare expected output.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance termination signal forwarding check.
        Check that termination signal forwarding works properly when strace
        is invoked with the corresponding termination signal blocked.

        * tests/block_reset_run.c: New file.
        * tests/Makefile.am (check_PROGRAMS): Add block_reset_run.
        * tests/.gitignore: Likewise.
        * tests/termsig.test: Extend the check to cover the case when
        strace is invoked with the termination signal blocked.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

        Use __gcov_dump declaration from <gcov.h> if available.
        The function declaration provided by <gcov.h> is fine,
        use it when <gcov.h> is available.

        * configure.ac (AC_CHECK_HEADERS): Add gcov.h.
        * defs.h [ENABLE_COVERAGE_GCOV && HAVE_GCOV_H]: Include <gcov.h>.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

        Use __gcov_dump instead of __gcov_flush to dump profile information.
        __gcov_flush is essentially __gcov_dump followed by __gcov_reset.
        The way we use __gcov_flush so far does not need any __gcov_reset,
        so use __gcov_dump instead.

        * defs.h [ENABLE_COVERAGE_GCOV] (__gcov_flush): Replace with
        __gcov_dump.
        (GCOV_FLUSH): Replace with GCOV_DUMP.
        * filter_seccomp.c (check_seccomp_order_do_child): Replace GCOV_FLUSH
        with GCOV_DUMP.
        * strace.c (terminate): Likewise.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

        Reduce ENABLE_COVERAGE_GCOV ifdefery.
        Introduce a new macro GCOV_FLUSH and use it instead of __gcov_flush.

        * defs.h (GCOV_FLUSH): New macro.
        [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype.
        * filter_seccomp.c (__gcov_flush): Remove.
        (check_seccomp_order_do_child): Call GCOV_FLUSH instead of __gcov_flush.
        * strace.c (__gcov_flush): Remove.
        (terminate): Call GCOV_FLUSH instead of __gcov_flush.

2019-10-31  Dmitry V. Levin  <ldv@altlinux.org>

        filter_seccomp: simplify check_seccomp_filter_properties.
        * filter_seccomp.c (check_seccomp_filter_properties): Simplify slightly
        by removing a redundant "if" expression.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

        filter_seccomp: binary match generation strategy.
        This commit introduces a new BPF program generation strategy.  Traced
        syscalls are encoded in 32-bit bit arrays in the BPF program.  Syscalls
        are then matched against bit arrays at runtime with two ALU operations:
        a division to select the appropriate bit array to compare with,
        and a shift to select the appropriate bit in the bit array.

        Since there is no way to implement a jump table in BPF (jumps have fixed
        offsets), we have to iterate over all bit arrays to select the appropriate
        bit array.  The division and modulo are also converted into a shift and
        a bitwise AND, to improve performance and because seccomp-bpf disallows
        modulos in BPF.

        Compared to the linear generation strategy, this strategy generates
        programs of near constant size.  There is a single optimization that
        depends on traced syscalls: if a bit array is all-0 or all-1, we don't
        need to do a jset against it, we can simply jump to either RET_ALLOW
        or RET_TRACE.

        * filter_seccomp.c (JMP_PLACEHOLDER_ALLOW): New constant.
        (binary_match_filter_generator): New prototype.
        (filter_generators): Add binary_match_filter_generator.
        (replace_jmp_placeholders): Handle JMP_PLACEHOLDER_ALLOW case.
        (linear_filter_generator): New argument for replace_jmp_placeholders.
        (bpf_syscalls_match, binary_match_filter_generator): New functions.
        (dump_seccomp_bpf): Handle ldwimm, jset, rsh, lsh, and, tax, and txa
        instructions.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

        filter_seccomp: list of seccomp filter generation strategies.
        Iterate over a list of BPF program generators, to select the shortest
        program.  This commit doesn't introduce new generation strategies.

        * filter_seccomp.c (filter_generator_t): New typedef.
        (linear_filter_generator): New prototype.
        (filter_generators, filters): New variables.
        (seccomp_filter): Remove.
        (init_sock_filter): Rename to linear_filter_generator, signal overflow
        via function argument instead of erroring out.
        (check_seccomp_filter): Find the shortest program generated by all
        generation strategies, error in case of overflow in all generated
        programs.

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

        ci: install rsync for headers_install.
        Starting with Linux commit v5.3-rc1~111^2~40, "make headers_install"
        needs rsync.

        * ci/install-dependencies.sh: Install rsync before invoking
        "make headers_install".

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip a few tests on systems with nproc == 1.
        Several tests require some concurrency between threads,
        skip these tests if nproc reports 1.

        * tests/init.sh (require_min_nproc): New function.
        * tests/status-none-threads.test: Use it.
        * tests/threads-execve.test: Likewise.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update v4l2_sliced_flags.
        * xlat/v4l2_sliced_flags.in (V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
        V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625): Add fallback definitions.
        (V4L2_SLICED_VBI_525): Comment out as it has the same value as
        V4L2_SLICED_CAPTION_525.
        (V4L2_SLICED_VBI_625): Add fallback definition, move up.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update v4l2_vbi_flags.
        For some reason, it also used to include V4L2_VBI_ITU_[56]25_F[12]_START
        constants that are definitely unrelated to V4L2_VBI_* flags.

        * xlat/v4l2_vbi_flags.in (V4L2_VBI_UNSYNC, V4L2_VBI_INTERLACED): Add
        fallback definitions.
        (V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
        V4L2_VBI_ITU_625_F1_START, V4L2_VBI_ITU_625_F2_START): Remove.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for V4L2_TUNER_* constants.
        Also, since V4L2_TUNER_*_SAP have the same values as V4L2_TUNER_*_LANG2,
        comment out the former.

        * xlat/v4l2_tuner_audmodes.in: Add fallback definitions for constants,
        add #value_indexed.
        (V4L2_TUNER_MODE_SAP): Comment out.
        * xlat/v4l2_tuner_capabilities.in: Add fallback definitions for
        constants.
        (V4L2_TUNER_CAP_SAP): Comment out.
        * xlat/v4l2_tuner_rxsubchanses.in: Add fallback definitions for
        constants.
        (V4L2_TUNER_SUB_SAP): Comment out.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for some V4L2_* constants.
        * xlat/v4l2_capture_modes.in: Add fallback definitions for constants.
        * xlat/v4l2_control_flags.in: Likewise.
        * xlat/v4l2_streaming_capabilities.in: Likewise.
        * xlat/v4l2_frameinterval_types.in: Add fallback definitions for
        constants, add #value_indexed.
        * xlat/v4l2_framesize_types.in: Likewise.
        * xlat/v4l2_input_types.in: Likewise.
        * xlat/v4l2_memories.in: Likewise.
        * xlat/v4l2_tuner_types.in: Likewise.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

        ci: consistently parallelize make jobs.
        * ci/run-build-and-tests.sh: Use "nproc" instead of
        "getconf _NPROCESSORS_ONLN".
        * ci/install-dependencies.sh: Use "nproc" to parallelize make jobs.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround clang oddness.
        When a structure is initialized using designated initializers,
        clang >= 7, apparently, does not initialize trailing padding
        of the structure.

        * tests/bpf-obj_get_info_by_fd.c [CHECK_OBJ_PROG]
        (bpf_prog_load_attr_sizes): Replace the size of struct
        BPF_PROG_LOAD_struct with BPF_PROG_LOAD_struct_size.

2019-10-25  Paul Chaignon  <paul.chaignon@gmail.com>

        filter_seccomp: use init_sock_filter to check the number of BPF instructions
        With this commit, the number of instructions in the seccomp BPF program
        is checked by directly constructing the program.  The BPF program is
        therefore created during the check for seccomp availability instead of
        when seccomp filtering is initialized.  The BPF program is saved
        as a global variable between the two operations.

        * filter_seccomp.c (seccomp_filter, bpf_prog): New variables.
        (init_sock_filter): Disable seccomp-filter in case of overflow, move dump
        of BPF program in debug mode...
        (init_seccomp_filter): ...here.
        (check_bpf_program_size): Remove.
        (dump_seccomp_bpf): Remove arguments as they are now global variables.

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

        Remove XLAT_END.
        * xlat.h (XLAT_END): Remove.
        * process.c (struct_user_offsets_data): Replace XLAT_END with a zero
        xlat_data entry.

        Complements: v5.3~105 "Add xlat description structure"

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

        bfin, csky, m68k, sh: fix build regression.
        * xlat/cacheflush_flags.in: New file.
        * cacheflush.c [M68K || BFIN || CSKY || SH] (cacheflush_flags): Remove,
        include "xlat/cacheflush_flags.h" instead.

        Fixes: v5.3~105 "Add xlat description structure"

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.spec.in: add support for old distros that cannot handle .tar.xz.

        xlat: update V4L2_CTRL_TYPE_* constants.
        * xlat/v4l2_control_types.in: Add fallback definitions for constants,
        and #sorted.
        * configure.ac (AC_CHECK_MEMBERS): Check for struct
        v4l2_ext_control.string field.
        * v4l2.c (print_v4l2_ext_control): Change guard macro
        to HAVE_STRUCT_V4L2_EXT_CONTROL_STRING.

        xlat: update V4L2_COLORSPACE_* constants.
        * xlat/v4l2_colorspaces.in: Add #value_indexed.
        (V4L2_COLORSPACE_DEFAULT): New constant introduced by Linux commit
        v4.2-rc1~107^2~184.
        (V4L2_COLORSPACE_ADOBERGB): Rename to V4L2_COLORSPACE_OPRGB, per Linux
        commit v4.20-rc1~69^2~122.
        (V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_SMPTE240M,
        V4L2_COLORSPACE_REC709, V4L2_COLORSPACE_BT878,
        V4L2_COLORSPACE_470_SYSTEM_M, V4L2_COLORSPACE_470_SYSTEM_BG,
        V4L2_COLORSPACE_JPEG, V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_OPRGB,
        V4L2_COLORSPACE_BT2020, V4L2_COLORSPACE_RAW, V4L2_COLORSPACE_DCI_P3):
        Add fallback definitions.

        xlat: Provide fallback definitions for V4L2_FIELD_* constants.
        * xlat/v4l2_fields.in: Add fallback definitions for constants.

        xlat: update V4L2_BUF_TYPE_* constants.
        * xlat/v4l2_buf_types.in: Add fallback definitions for constants,
        mention V4L2_BUF_TYPE_PRIVATE in comment, add #value_indexed.
        * configure.ac (AC_CHECK_MEMBERS): Add checks for
        struct v4l2_format.fmt.pix_mp, struct v4l2_format.fmt.sdr, and
        struct v4l2_format.fmt.sliced.
        * v4l2.c (print_v4l2_format_fmt): Use the relevant HAVE_STRUCT_* macros
        instead of HAVE_DECL_V4L2_BUF_TYPE_*.

        xlat: provide fallback definitions for V4L2_CAP_* constants.
        * xlat/v4l2_device_capabilities_flags.in: Sort, add fallback definitions
        for constants.
        * configure.ac (AC_CHECK_MEMBERS): Check for struct
        v4l2_capability.device_caps.
        * v4l2.c (print_v4l2_capability): Change V4L2_CAP_DEVICE_CAPS guard
        to HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS.

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: decode struct input_absinfo regardless of in-kernel definitions.
        * evdev.c (struct_input_absinfo): New typedef.
        (abs_ioctl): Add code argument. Add orig_sz, res_sz, sz, read_sz local
        variables. Decode resolution field regardless of
        HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION.
        (evdev_read_ioctl, evdev_write_ioctl): Pass code to abs_ioctl.
        * tests/ioctl_evdev-success.c (print_input_absinfo): Update expected
        output.
        (main): Add absinfo_sz, absinfo_24, absinfo_32 local variables; add
        additional checks for struct input_absinfo.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: do not rely on EVIOC* constants provided in <linux/input.h>
        * xlat/evdev_ioctl_cmds.in: New file.
        * configure.ac (AC_CHECK_HEADERS([linux/input.h])): Check for struct
        input_keymap_entry and struct input_mask.
        * evdev.c [!INPUT_PROP_MAX] (INPUT_PROP_MAX): New macro definition.
        (struct_input_keymap_entry, struct_input_mask): New typedefs.
        [HAVE_STRUCT_INPUT_KEYMAP_ENTRY]: Add a static_assert to check
        that sizeof(struct input_keymap_entry) has the expected value.
        [HAVE_STRUCT_INPUT_MASK]: Add a static_assert to check
        that sizeof(struct input_mask) has the expected value.
        [!EVIOCGPROP] (EVIOCGPROP): New macro definition.
        [!EVIOCGMTSLOTS] (EVIOCGMTSLOTS): Likewise.
        [!EVIOCGSW] (EVIOCGSW): Likewise.
        [!EVIOCGKEYCODE_V2] (keycode_V2_ioctl): Remove guard.
        (keycode_V2_ioctl): Change type of ike to struct_input_keymap_entry.
        [!EVIOCGMTSLOTS] (mtslots_ioctl): Remove guard.
        [!EVIOCGREP || EVIOCSREP] (repeat_ioctl): Likewise.
        (evdev_read_ioctl) [!EVIOCGREP] <case EVIOCGREP>: Likewise.
        (evdev_read_ioctl) [!EVIOCGKEYCODE_V2] <case EVIOCGKEYCODE_V2>:
        Likewise.
        (evdev_read_ioctl) [!EVIOCGMTSLOTS] <case EVIOCGMTSLOTS>: Likewise.
        (evdev_read_ioctl) [!EVIOCGPROP] <case EVIOCGPROP>: Likewise.
        (evdev_read_ioctl) [!EVIOCGSW] <case EVIOCGSW>: Likewise.
        (evdev_write_ioctl) [!EVIOCSREP] <case EVIOCSREP>: Likewise.
        (evdev_write_ioctl) [!EVIOCSKEYCODE_V2] <case EVIOCSKEYCODE_V2>: Likewise.
        (evdev_write_ioctl) [!EVIOCREVOKE] <case EVIOCREVOKE>: Likewise.
        (evdev_write_ioctl) [!EVIOCSCLOCKID] <case EVIOCSCLOCKID>: Likewise.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests/nsyscalls.c: remove redundant definition of SYSCALL_BIT.
        Starting with commit v5.3~111, tests/nsyscalls.c includes "scno.h"
        which already defines SYSCALL_BIT where appropriate.

        * tests/nsyscalls.c (SYSCALL_BIT): Remove.

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace "sed -E" with "sed -r"
        because the latter is more portable.

        * tests/strace-D.test: Replace "sed -E" with "sed -r".

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add BPF_MAP_TYPE_DEVMAP_HASH to bpf_map_types.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_DEVMAP_HASH): New constant,
        introduced by Linux commit v5.4-rc1~131^2~248^2~16^2~3.
        * tests/bpf.c: Update expected output.

        xlat: add BPF_F_CLONE to bpf_map_flags.
        * xlat/bpf_map_flags.in (BPF_F_CLONE): New flag, introduced by Linux
        commit v5.4-rc1~131^2~62^2~34^2~2.
        * tests/bpf.c: Update expected output.

        xlat: add BPF_F_TEST_STATE_FREQ to bpf_prog_flags.
        * xlat/bpf_prog_flags.in (BPF_F_TEST_STATE_FREQ): New constant,
        introduced by Linux commit v5.4-rc1~131^2~62^2~17^2~3.
        * tests/bpf.c: Update expected output.

        xlat: update waitid_types.
        * xlat/waitid_types.in (P_PIDFD): New constant, introduced by Linux
        commit v5.4-rc1~203^2~4.
        (P_ALL, P_PID, P_PGID): Add fallback values.
        (P_PPID, P_SID, P_CID, P_UID, P_GID, P_LWPID): Remove.

        xlat: update v4l2_format_description_flags.
        * xlat/v4l2_format_description_flags.in (V4L2_FMT_FLAG_COMPRESSED,
        V4L2_FMT_FLAG_EMULATED): Add fallback definitions.
        (V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM): New constant, introduced by Linux
        commit v5.4-rc1~145^2~69.
        (V4L2_FMT_FLAG_DYN_RESOLUTION): New constant, introduced by Linux commit
        v5.4-rc1~145^2~68.

        xlat: update sock_sctp_options.
        * xlat/sock_sctp_options.in (SCTP_ASCONF_SUPPORTED): New constant,
        introduced by Linux commit v5.4-rc1~131^2~204^2~4.
        (SCTP_AUTH_SUPPORTED): New constant, introduced by Linux commit
        v5.4-rc1~131^2~204^2~1.
        (SCTP_ECN_SUPPORTED): New constant, introduced by Linux commit
        v5.4-rc1~131^2~140^2.

        xlat: add EROFS_SUPER_MAGIC_V1 to fsmagic.
        * xlat/fsmagic.in (EROFS_SUPER_MAGIC_V1): New constant, introduced
        by Linux commit v5.4-rc1~134^2~105.

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_route: decode struct rta_mfc_stats and struct rtvia unconditionally
        * rtnl_route.c (struct_rta_mfc_stats, struct_rtvia): New typedefs.
        [HAVE_STRUCT_RTA_MFC_STATS]: Add a static_assert to check
        that sizeof(struct rta_mfc_stats) has the expected value.
        [HAVE_STRUCT_RTVIA]: Add a static_assert to check that sizeof(struct
        rtvia) has the expected value.
        (decode_rta_mfc_stats) [HAVE_STRUCT_RTA_MFC_STATS]: Remove guard.
        (decode_rta_mfc_stats): Change the type of mfcs variable to
        struct_rta_mfc_stats.
        (decode_rtvia): Change the type of via variable to struct_rtvia.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_neightbl: always decode struct ndt_config and struct ndt_stats.
        * rtnl_neightbl.c (struct_ndt_config, struct_ndt_stats): New typedefs.
        [HAVE_STRUCT_NDT_CONFIG]: New static_assert to check
        that sizeof(struct ndt_config) has the expected value.
        [HAVE_STRUCT_NDT_STATS]: New static_assert to check
        that sizeof(struct ndt_stats) has the expected value.
        (decode_ndt_config) [HAVE_STRUCT_NDT_CONFIG]: Remove guard.
        (decode_ndt_config): Change the type of ndtc variable
        to struct_ndt_config.
        (decode_ndt_stats) [HAVE_STRUCT_NDT_STATS]: Remove guard.
        (decode_ndt_stats): Change the type of ndtst variable
        to struct_ndt_stats.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_mdb: decode messages regardless of availability of kernel headers.
        * netlink_route.c [!HAVE_STRUCT_BR_PORT_MSG]: Do not skip decoding of
        RTM_DELMDB, RTM_GETMDB, and RTM_NEWMDB messages.
        * rtnl_mdb.c: Remove #ifdef HAVE_STRUCT_BR_PORT_MSG guard.
        (struct_br_port_msg, struct_br_mdb_entry): New typedefs.
        [HAVE_STRUCT_BR_PORT_MSG]: Static assert check for struct br_port_msg
        size.
        [HAVE_STRUCT_BR_NDB_ENTRY]: Static assert check for strucr br_mdb_entry
        size.
        (decode_mdba_mdb_entry_info) [!HAVE_STRUCT_BR_MDB_ENTRY]: Remove.
        (decode_mdba_mdb_entry_info): Change entry type to struct_br_mdb_entry.
        (decode_mdba_mdb_entry_info) [HAVE_STRUCT_BR_MDB_ENTRY_FLAGS,
        HAVE_STRUCT_BR_MDB_ENTRY_VID]: Remove guards.
        (decode_br_port_msg): Change bpm type to struct_br_port_msg.
        * tests/nlattr_ifinfomsg.c: Use TEST_NLATTR_OBJECT_MINSZ to test
        struct rtnl_link_stats printing.
        * tests/nlattr_mdba_mdb_entry.c: Update expected output.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: print pad field in the struct ifla_port_vsi decoder.
        And steamline the flow a bit.

        * rtnl_link.c (decode_ifla_port_vsi): Factor the printing code out of
        the conditional statement, add pad field printing.
        * tests/nlattr_ifla_port.c: Add check for the pad field printing.

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: use internal rtnl_link_stats* and ifla_port_vsi definitions.
        Define substitutes for struct rtnl_link_stats, struct
        rtnl_link_stats64, and struct ifla_port_vsi internally.
        Add a static_assert that informs about future growth of the structures
        provided by the kernel headers.

        * rtnl_link.c (struct_rtnl_link_stats, struct_rtnl_link_stats64,
        struct_ifla_port_vsi): New typedefs.
        [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]: Add a static_assert to check
        that sizeof(struct rtnl_link_stats) has the expected value.
        [HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Add a static_assert
        to check that sizeof(struct rtnl_link_stats) has the expected value.
        [HAVE_STRUCT_IFLA_PORT_VSI]: Add a static_assert to check
        that sizeof(struct ifla_port_vsi) has the expected value.
        (decode_rtnl_link_stats) [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]:
        Remove guard.
        (decode_rtnl_link_stats): Change the type of st variable to
        struct_rtnl_link_stats; use struct_rtnl_link_stats in offsetofend
        statement for min_size definition.
        (decode_rtnl_link_stats64) [HAVE_STRUCT_RTNL_LINK_STATS64,
        HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Remove guards.
        (decode_rtnl_link_stats64): Change the type of st variable
        to struct_rtnl_link_stats64.
        (decode_ifla_port_vsi) [HAVE_STRUCT_IFLA_PORT_VSI]: Remove guard.
        (decode_ifla_port_vsi): Change the type of vsi variable
        to struct_ifla_port_vsi.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Enable building of netlink_crypto decoder without linux/cryptouser.h.
        * xlat/crypto_msgs.in: New file.
        * configure.ac (AC_CHECK_TYPES): Check for struct crypto_user_alg.
        * netlink.c: Include "xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
        (netlink_decoders[]): Remove HAVE_LINUX_CRYPTOUSER_H guard around
        [NETLINK_CRYPTO] item.
        * netlink_crypto.c: Remove HAVE_LINUX_CRYPTOUSER_H guard; include
        <linux/cryptouser.h> under HAVE_LINUX_CRYPTOUSER_H; include
        "xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
        [!CRYPTO_MAX_NAME] (CRYPTO_MAX_NAME): New macro.
        (struct_crypto_user_alg, struct_crypto_report_hash,
        struct_crypto_report_cipher, struct_crypto_report_blkcipher,
        struct_crypto_report_aead, struct_crypto_report_rng): New typedefs.
        [HAVE_STRUCT_CRYPTO_USER_ALG]: New static_assert to check
        that sizeof(struct crypto_user_alg) has the expected value.
        [HAVE_STRUCT_CRYPTO_REPORT_HASH]: New static_assert to check
        that sizeof(struct crypto_report_hash) has the expected value.
        [HAVE_STRUCT_CRYPTO_REPORT_CIPHER]: New static_assert to check
        that sizeof(struct crypto_report_cipher) has the expected value.
        [HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]: New static_assert to check
        that sizeof(struct crypto_report_blkcipher) has the expected value.
        [HAVE_STRUCT_CRYPTO_REPORT_AEAD]: New static_assert to check
        that sizeof(struct crypto_report_aead) has the expected value.
        [HAVE_STRUCT_CRYPTO_REPORT_RNG]: New static_assert to check
        that sizeof(struct crypto_report_rng) has the expected value.
        (decode_crypto_report_hash) [!HAVE_STRUCT_CRYPTO_REPORT_HASH]: Remove.
        (decode_crypto_report_hash): Change type of rhash to
        struct_crypto_report_hash.
        (decode_crypto_report_blkcipher) [!HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]:
        Remove.
        (decode_crypto_report_blkcipher): Change type of rblkcipher to
        struct_crypto_report_blkcipher.
        (decode_crypto_report_aead) [!HAVE_STRUCT_CRYPTO_REPORT_AEAD]: Remove.
        (decode_crypto_report_aead): Change type of raead to
        struct_crypto_report_aead.
        (decode_crypto_report_rng) [!HAVE_STRUCT_CRYPTO_REPORT_RNG]: Remove.
        (decode_crypto_report_rng): Change type of rrng to
        struct_crypto_report_rng.
        (decode_crypto_report_cipher) [!HAVE_STRUCT_CRYPTO_REPORT_CIPHER]:
        Remove.
        (decode_crypto_report_cipher): Change type of rcipher to
        struct_crypto_report_cipher.
        (decode_crypto_user_alg): Change type of alg to struct_crypto_user_alg.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        macros.h: include <stddef.h>
        Since offsetofend macro definition relies on presence of offsetof
        declaration.

        * macros.h: Include <stddef.h>.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: remove additional indentation level for switch case labels.
        And while we are here, factor out evdev_write_ioctl_mpers call
        out of the switch statement.

        * evdev.c (bit_ioctl, evdev_read_ioctl, evdev_ioctl): Remove
        one indentation level inside the switch statements.
        (evedev_write_ioctl): Remove one indentation level inside the switch
        statement; move default branch out of the switch statement.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: introduce TEST_NLATTR_OBJECT_MINSZ.
        It is useful in cases where a structure grows over time and we support
        decoding of only part of it.

        * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, TEST_NLATTR_OBJECT_EX):
        Add minsz_ parameter, use it instead of sizeof(obj_).
        (TEST_NLATTR_OBJECT): Pass sizeof(obj_) as minsz_.
        (TEST_NLATTR_OBJECT_MINSZ): New macro.
        * tests/nlattr_crypto_user_alg.c (main): Add proper minsz_ argument to
        TEST_NLATTR_OBJECT_EX instances.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for ABS_MT_* constants.
        * xlat/evdev_mtslots.in: Add fallback definitions.  Add #sorted.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: compact struct tcb a bit by moving currpers field.
        As reported by pahole, struct tcb has size of 328 bytes and 8 bytes
        of holes on x86_64; by moving currpers after qual_flg, both holes are
        leminated and the structure fits into 8 cache lines now.  This should
        also benefit other 64-bit architectures.

        * defs.h [SUPPORTED_PERSONALITIES > 1] (struct tcb): Move currpers field
        after qual_flg field.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: use unsgined type for mount_flags fallback values.
        Reported by cppcheck:

            strace/xlat/mount_flags.h:256: error[shiftTooManyBitsSigned]:
            Shifting signed 32-bit value by 31 bits is undefined behaviour
            #  254|    XLAT(MS_BORN),
            #  255|    XLAT(MS_ACTIVE),
            #  256|->  XLAT(MS_NOUSER),
            #  257|    XLAT_END
            #  258|   };

        * xlat/mount_flags.in: Use 1U instead of 1 as a bit shifting operand.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1747524

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_rule: decode fib_rule_uid_range without use of <linux/fib_rules.h>
        * rtnl_rule.c (decode_fib_rule_uid_range): Define struct type for
        fib_rule_uid_range explicitly.
        (decode_fib_rule_uid_range) [!HAVE_STRUCT_FIB_RULE_UID_RANGE]: Remove.
        * xlat/fib_rule_flags.in: Add fallback definitions.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update MDB_FLAGS_* constants.
        Also, provide fallback definitions for constants.

        * xlat/mdb_flags.in (MDB_FLAGS_OFFLOAD): Add fallback definition.
        (MDB_FLAGS_FAST_LEAVE): New constant, introduced by Linux commit
        v5.4-rc1~131^2~321.

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for XDP_FLAGS_* constants.
        * xlat/xdp_flags.in: Add fallback definitions.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for netlink_ack_flags constants.
        * xlat/netlink_ack_flags.in: Add fallback definitions.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for UFFD_FEATURE_* constants.
        * xlat/uffd_api_features.in: Add fallback definitions.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        riscv64: remove dead code left after riscv64 mpers removal.
        Since there is no compat on RISCV64 so far, its dead remains are only
        confusing.

        * linux/riscv64/arch_get_personality.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.

        Reported-by: Elvira Khabirova <lineprinter0@gmail.com>
        Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
        Complements: v5.3~18 "riscv64: remove mpers support"

2019-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: try to avoid false positives in times sanity check.
        Checking clock_gettime(CLOCK_PROCESS_CPUTIME_ID) starting from the
        second iteration may produce false positives sometimes, try to spend
        more iterations before starting checking it.

        * tests/times.c (NUM_USER_ITERS_SQRT): New enum entity.
        (NUM_USER_ITERS): Define via NUM_USER_ITERS_SQRT.
        (main): Check i against NUM_USER_ITERS_SQRT first before checking
        the returned CPU time for sanity.

2019-10-09  Dmitry V. Levin  <ldv@altlinux.org>

        filter_seccomp: fix build on antique systems.
        Fixed build on systems that do not provide necessary definitions
        of AUDIT_ARCH_* constants.

        * filter_seccomp.c [PERSONALITY0_AUDIT_ARCH]: Include
        "xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY.
        * tests/filter_seccomp-flag.c: Likewise.
        * NEWS: Mention this fix.

        Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check -DD and -DDD options.
        * tests/strace-D.test: Check -DD and -DDD.
        * tests/strace-DD.test: New test.
        * tests/strace-DDD.test: Likewise.
        * tests/strace-DD.expected: New file.
        * tests/strace-DDD.expected: Likewise.
        * tests/tracer_ppid_pgid_sid.c: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add tracer_ppid_pgid_sid.
        (MISC_TESTS): Add strace-DD.test and strace-DDD.test.
        (EXTRA_DIST): Add strace-DD.expected and strace-DDD.expected.

2019-10-07  Fanda Uchytil  <strace.t8xuewpmde@h4x.cz>
            Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        strace: expand -D option.
        As of now, despite of being stated that -D option runs strace as a "detached"
        grandchild (and the option name being named after "daemon"), strace
        still runs in the same process group and session, thus not being
        "detached" in a common sense and being subjected to process group kill
        and session termination kill. Quoting[1]:

            I stumble upon unexpected behavior: if strace is used with option '-D'
            (tracer as a detached grandchild) and process (leader) kills whole
            process group, it will kill strace too.

            It can be easily reproduced by `timeout` from "coreutils":

              # timeout -s KILL 2 strace -D -o ./strace-inside.log /bin/sleep 10 &

            Here we can see, that `strace` didn't finished its output (because it
            was killed):

              # tail -n 1 ./strace-inside.log
              nanosleep({tv_sec=10, tv_nsec=0},

            If `timeout` is not run in '--foreground' mode, it changes process group
            and after "timeout" it sends two kills:

              setpgid(0, 0)                           = 0
              kill(37337, SIGKILL)                    = 0
              kill(0, SIGKILL)                        = ?

            The first kill is for the `sleep` and the second one is for the process
            group (which is `strace` part of). PIDs and their relations are:

              timeout  pid=30595   [ppid=476   bash   ]     pgrp=30595
              sleep    pid=37337   [ppid=30595 timeout]     pgrp=30595
              strace   pid=30603   [ppid=1     systemd]     pgrp=30595

            Here is "strace log" of `strace` inside `timeout`:

              strace: Process 30603 attached
              wait4(-1,  <unfinished ...>)            = ?
              +++ killed by SIGKILL +++

            I think that detached `strace` should not be killed like that -- it
            should not be part of former grandparents' "job pipeline".

        While this behaviour is not exactly intuitive, it is implemented this
        way for quite some time, so it might be relied upon by some of strace
        users.  In order to address this issue, two new levels of
        "daemonisation" are added, that put strace in a separate process group
        and session, respectively.

        [1] https://lists.strace.io/pipermail/strace-devel/2019-October/009160.html

        * strace.1.in (.SH SYNOPSIS): Update.
        (.SS Tracing): Document -DD and -DDD.
        * strace.c (DAEMONIZE_NONE, DAEMONIZE_GRANDCHILD, DAEMONIZE_NEW_PGROUP,
        * DAEMONIZE_NEW_SESSION, DAEMONIZE_OPTS_GUARD__, MAX_DAEMONIZE_OPTS):
        * New enumeration entities.
        (daemonized_tracer): Change type to unsigned int.
        (usage): Document -DD and -DDD.
        (startup_attach) <daemonized_tracer == DAEMONIZE_NEW_PGROUP>: Call
        setpgid.
        <daemonized_tracer == DAEMONIZE_NEW_SESSION>: Call setsid.
        (init) <case 'D'>: Increase daemonized_tracer instead of setting to 1.
        (init): Bail out if too many -D's are given.
        * NEWS: Mention this improvement.
        * tests/options-syntax.test: Add checks for -D option usage.

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

        Fix -b execve when --seccomp-bpf option is specified.
        As --seccomp-bpf does not support detaching, explicitly turn off
        this option when -b execve is specified.

        * strace.c (init): Turn off --seccomp-bpf when -b execve is specified.
        * NEWS: Mention this fix.
        * tests/bexecve.test: Check it.

        Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

        filter_seccomp: fix build for no-MMU targets.
        Avoid unsupported fork() call on no-MMU Linux systems to fix
        the following link error:

        ld: strace-filter_seccomp.o: in function `check_seccomp_filter':
        filter_seccomp.c:(.text+0x39a): undefined reference to `fork'
        collect2: error: ld returned 1 exit status

        * filter_seccomp.c (__gcov_flush, check_seccomp_order_do_child,
        check_seccomp_order_tracer): Move under HAVE_FORK guard.
        (check_seccomp_order): Move fork code under HAVE_FORK guard.
        (check_seccomp_filter_properties): Do not check for NOMMU_SYSTEM.
        * NEWS: Mention this fix.

        Reported-and-tested-by: Baruch Siach <baruch@tkos.co.il>
        Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check -D option.
        * tests/strace-D.test: New test.
        * tests/strace-D.expected: New file.
        * tests/Makefile.am (MISC_TESTS): Add strace-D.test.
        (EXTRA_DIST): Add strace-D.expected.

        tests: check -F and -zZ options.
        * tests/options-syntax.test: Check error diagnostics of -F and -zZ
        options.

        tests: extend checks of --seccomp-bpf diagnostics.
        * tests/options-syntax.test: Add --seccomp-bpf checks.

        tests: add support of multi-line diagnostics to check_h.
        * tests/syntax.sh (check_h): Add support of multi-line diagnostics.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move FLAG_ macro from defs.h to macros.h.
        Rename it to FLAG and implement via newly added BIT helper macro,
        in preparation for general use

        * defs.h: Use FLAG instead of FLAG_.
        (FLAG_): Move it...
        * macros.h (FLAG): Here, implement using BIT macro.
        [!BIT] (BIT): New macro.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: sort entries in ioctl_decode switch statement.
        * ioctl.c (ioctl_decode): Sort case branches in the switch statement.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: avoid double printing of ellipsis in print_array.
        When PAF_ARRAY_TRUNCATED flag is provided to print_array_ex.

        * util.c (print_array_ex): Add truncated flag, set it when the output
        is truncated, avoid explicit ellipsis printing when it is set.

        Fixes: v5.3~14 "Add PAF_ARRAY_TRUNCATED flag for print_array_ex"

2019-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add ioctl_evdev-success* test binaries to .gitignore.
        * tests/.gitignore: Add ioctl_evdev-success-Xabbrev,
        ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
        ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw,
        and ioctl_evdev-success-v-Xverbose.

        Fixes: v5.3~9 "Handle xlat verbosity in evdev bitset printing"

2019-10-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests/sigaction: workaround odd libcs on alpha and mips.
        Apparently, some libcs define SA_RESTORER on alpha and mips
        despite of the absence of sa_restorer field.  Workaround this
        to match the logic implemented in decode_old_sigaction().

        * tests/sigaction.c (main) [ALPHA || MIPS]: Do not check decoding
        of sa_restorer field.

2019-10-02  Dmitry V. Levin  <ldv@altlinux.org>

        Distribute copyright-year-gen, file-date-gen, and git-version-gen.
        These scripts have to be distributed along with configure.ac since
        the latter uses them.

        * Makefile.am (EXTRA_DIST): Add copyright-year-gen, file-date-gen,
        and git-version-gen.

2019-10-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix -a argument in stat and lstat tests.
        * tests/trace_lstat.in (lstat): Change -a argument from 32 to 31.
        * tests/trace_stat.in (stat): Change -a argument from 32 to 30.
        * tests/gen_tests.in (lstat): Change -a argument from 32 to 31.
        (stat): Change -a argument from 32 to 30.

        This fixes Debian bug #929715.

2019-10-01  Dmitry V. Levin  <ldv@altlinux.org>

        Prefer https URLs where possible.
        * maint/README-release: Use https URL instead of http.
        * xlat/elf_em.in: Likewise.

        Update debian/watch.
        * debian/watch: Sync with Debian strace-4.26-0.2 package.

        Update ax_prog_cc_for_build.m4.
        * m4/ax_prog_cc_for_build.m4: Update from autoconf-archive.

        Update auxiliary maintainer mode build tools.
        * git-set-file-times: Update from rsync.
        * git-version-gen: Update from gnulib.
        * gitlog-to-changelog: Likewise.

2019-09-27  Andreas Schwab  <schwab@linux-m68k.org>

        Remove traces of riscv64 mpers.
        * tests/options-syntax.test: Remove riscv64.
        * tests/qualify_personality.sh: Likewise.
        * tests/strace-V.test: Likewise.

        Fixes: v5.3~18 "riscv64: remove mpers support"

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: move --seccomp-bpf description down.
        Option descriptions generally maintain lexicographical order.

        * strace.1.in (.SS Miscellaneous): Move --seccomp-bpf option description
        down in order to maintain lexicographical option description order.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: mention seccomp(2) in --seccomp-bpf option description.
        And format ptrace(2) properly as well.

        * strace.1.in (.SS Miscellaneous): Mention seccomp(2), format ptrace(2)
        mention.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: describe time format specification.
        Commits v5.3~74 and v5.3~73 have introduced an extended syntax
        for time interval sizes specification, but the relevant descriotion
        was lacking.  Fix it by adding the relevant section to the man page
        and reference to it in the descriptions of the respective options.

        * strace.1.in (.SH OPTIONS): Rewrite descriptions of -O,
        -e inject=delay_enter, and -e inject=delay_exit values, refer to section
        "Time specification format description".
        (.SS "Time specification format description"): New section.

        Complements: v5.3~74 "delay: use parse_ts for parsing delay value"
        Complements: v5.3~73 "count: use parse_ts for parsing overhead value"

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: add a missing comma before "but"
        * strace.1.in (.SH DESCRIPTION): Add a missing comma.

        strace.1.in: eliminate empty lines.
        Replace them with .IP or just remove.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: properly indent -e inject description.
        As inject option description is moved to a separate section, its
        .TP macro now requires an argument.

        * strace.1.in (.SS Tampering): Add indent size argument to the first
        .TP macro instance.

        Fixes: v5.3~99 "strace.1.in: reorder options"

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.3-1.
        * strace.spec.in: Likewise.

        Prepare for 5.3 release.
        * NEWS: Update for 5.3 release.

        tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
        * tests/clone3.c (do_clone3_): Do not assume that unimplemented
        syscalls always fail with ENOSYS.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2019-09-25  Chen Jingpiao  <chenjingpiao@gmail.com>
            Paul Chaignon  <paul.chaignon@gmail.com>

        tests: check seccomp-assisted syscall filtering.
        Test filter_seccomp-perf checks whether seccomp-filter is actually
        enabled by comparing the number of syscalls performed in a time interval
        when seccomp-filter is enabled vs. disabled.  The number of syscalls
        should be at least one order of magnitude higher when seccomp-filter
        is enabled.

        Test filter_seccomp-flag ensures the audit_arch_vec[].flag constants do
        not conflict with syscall numbers.  If this test fails, then the number
        of syscalls grew high enough that the code for seccomp-filter needs to
        be updated.

        * tests/init.sh (test_prog_set): New function.
        * tests/status-none-f.c: New file.
        * tests/filter_seccomp.in: Likewise.
        * tests/filter_seccomp.sh: Likewise.
        * tests/filter_seccomp-perf.c: Likewise.
        * tests/filter_seccomp-flag.c: Likewise.
        * tests/filter_seccomp-perf.test: New test.
        * tests/Makefile.am (EXTRA_DIST): Add filter_seccomp.in and
        filter_seccomp.sh.
        (MISC_TESTS): Add filter_seccomp-perf.test.
        (check_PROGRAMS): Add filter_seccomp-perf and filter_seccomp-flag.
        * tests/pure_executables.list: Add status-none-f.
        * tests/.gitignore: Add status-none-f, filter_seccomp-perf, and
        filter_seccomp-flag.
        * tests/gen_tests.in (filter_seccomp, filter_seccomp-flag): New entries.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-25  Paul Chaignon  <paul.chaignon@gmail.com>

        filter_seccomp: skip seccomp setup when there's nothing to filter.
        If the trace_set set is complete (no syscalls are filtered), seccomp
        filtering is disabled.  This patch adds a new is_complete_set_array
        function to check whether all sets of a set array are complete.

        * number_set.c (is_complete_set_array): New function.
        * number_set.h (is_complete_set_array): New prototype.
        * filter_seccomp.c (check_seccomp_filter): Skip seccomp setup if there is
        nothing to filter.

2019-09-25  Chen Jingpiao  <chenjingpiao@gmail.com>
            Paul Chaignon  <paul.chaignon@gmail.com>

        Introduce seccomp-assisted syscall filtering.
        With this patch, strace can rely on seccomp to only be stopped at syscalls
        of interest, instead of stopping at all syscalls.  The seccomp filtering
        of syscalls is opt-in only; it must be enabled with the --seccomp-bpf
        option.  Kernel support is first checked with check_seccomp_filter(),
        which also ensures the BPF program derived from the syscalls to filter
        is not larger than the kernel's limit.

        The --seccomp-bpf option implies -f, but a warning is emitted if -f is not
        explicitly specified.  Since a task's children inherit its seccomp
        filters, we want to ensure all children are also traced to avoid their
        syscalls failing with ENOSYS (cf. SECCOMP_RET_TRACE in seccomp man page).

        Fork/vfork/clone children of traced processes are marked as not having a
        seccomp filter until we receive a first seccomp-stop.  They are therefore
        stopped at every syscall entries and exits until that first seccomp-stop.

        The current BPF program implements a simple linear match of the syscall
        numbers.  Contiguous sequences of syscall numbers are however matched as
        an interval, with two instructions only.  The algorithm can be improved
        or replaced in the future without impacting user-observed behavior.

        The behavior of SECCOMP_RET_TRACE changed between Linux 4.7 and 4.8
        (cf. PTRACE_EVENT_SECCOMP in ptrace man page).  This patch supports both
        behaviors by checking the kernel's actual behavior before installing the
        seccomp filter.

        * filter_seccomp.c: New file.
        * filter_seccomp.h: New file.
        * Makefile.am (strace_SOURCES): Add filter_seccomp.c and
        filter_seccomp.h.
        * linux/aarch64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH): Define for aarch64.
        * linux/powerpc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH): Likewise for powerpc64.
        * linux/s390x/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        * linux/sparc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH): Likewise for sparc64.
        PERSONALITY1_AUDIT_ARCH): Likewise for s390x.
        * linux/tile/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH): Likewise for tile.
        * linux/x32/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH): Likewise for x32.
        * linux/x86_64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
        PERSONALITY1_AUDIT_ARCH, PERSONALITY2_AUDIT_ARCH): Likewise for x86_64.
        * linux/ia64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise for IA64.
        * strace.c (usage): Document --seccomp-bpf option.
        (startup_child): Mark process has having seccomp filter.
        (exec_or_die): Initialize seccomp filtering if requested.
        (init): Handle --seccomp-bpf option and check that seccomp can be
        enabled.
        (print_debug_info): Handle PTRACE_EVENT_SECCOMP.
        (next_event): Capture PTRACE_EVENT_SECCOMP event.
        (dispatch_event): Handle PTRACE_EVENT_SECCOMP event.
        * trace_event.h (trace_event): New enumeration entity.
        * strace.1.in: Document new --seccomp-bpf option.
        * NEWS: Mention this change.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

        Add support for long options.
        Recognize --help and --version options as aliases to -h and -V options,
        respectively.

        * strace.c: Include <getopt.h>.
        (init): Move short options to optstring, add longopts array, use
        getopt_long instead of getopt.
        (usage): Document --help and --version options.
        * strace.1.in: Likewise.
        * tests/strace-V.test: Check that "strace --version" output is the same
        as "strace -V" output.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Handle xlat verbosity in evdev bitset printing.
        * defs.h (print_xint32_array_member, print_xint64_array_member): New
        function declarations.
        (print_xlong_array_member): New static inline function.
        * util.c (print_xint32_array_member, print_xint64_array_member): New
        functions.
        * evdev.c (decode_bitset): Handle xlat verbosity option.
        * tests/ioctl_evdev-Xabbrev.c: New file.
        * tests/ioctl_evdev-Xraw.c: Likewise.
        * tests/ioctl_evdev-Xverbose.c: Likewise.
        * tests/ioctl_evdev-success-Xabbrev.c: Likewise.
        * tests/ioctl_evdev-success-Xraw.c: Likewise.
        * tests/ioctl_evdev-success-Xverbose.c: Likewise.
        * tests/ioctl_evdev-success-v-Xabbrev.c: Likewise.
        * tests/ioctl_evdev-success-v-Xraw.c: Likewise.
        * tests/ioctl_evdev-success-v-Xverbose.c: Likewise.
        * tests/ioctl_evdev-v-Xabbrev.c: Likewise.
        * tests/ioctl_evdev-v-Xraw.c: Likewise.
        * tests/ioctl_evdev-v-Xverbose.c: Likewise.
        * tests/ioctl_evdev-success.c (test_evdev, print_getbit, main): Update
        expected output.
        * tests/ioctl_evdev.c (UNK_CMD): New macro.
        (print_ffe_common, main): Update expected output.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl_evdev-success-Xabbrev,
        ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
        ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw, and
        ioctl_evdev-success-v-Xverbose.
        * tests/gen_tests.in (ioctl_evdev-Xabbrev, ioctl_evdev-Xraw,
        ioctl_evdev-Xverbose, ioctl_evdev-v-Xabbrev, ioctl_evdev-v-Xraw,
        ioctl_evdev-v-Xverbose, ioctl_evdev-success-Xabbrev,
        ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
        ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw,
        ioctl_evdev-success-v-Xverbose tests): New entries.
        (ioctl_evdev, ioctl_evdev-v): Add alignment option.
        * tests/pure_executables.list: Add ioctl_evdev-Xabbrev,
        ioctl_evdev-Xraw, ioctl_evdev-Xverbose, ioctl_evdev-v-Xabbrev,
        ioctl_evdev-v-Xraw, ioctl_evdev-v-Xverbose.
        * tests/.gitignore: Likewise.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: do not print comments twice in -Xverbose.
        Figure out whether the ioctl code is decoded inside a comment and adjust
        printflags/printxval calls accordingly.

        * ioctl.c (ioctl_print_code, evdev_decode_number): Add abbrev variable,
        set it to true if xlat style is not XLAT_STYLE_VERBOSE, do not provide
        dflt and set xlat style to XLAT_STYLE_ABBREV in printflags/printxval
        calls (that are now changed to printflags_ex/printxval_ex to accomodate
        the change).

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_evdev-success: rewrite ABS_MT check.
        Use null-terminating array instead of providing array size in the first
        element.

        * tests/ioctl_evdev-success.c (print_mtslots, main): Update
        mtslots_str/invalid_mtslot_str array usage.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add xlat verbosity support to printxval.
        * tests/Makefile.am (libtests_a_SOURCES): Remove printxval.c, add
        printxval-Xabbrev.c, printxval-Xraw.c, and printxval-Xverbose.c.
        (EXTRA_DIST): Add printxval.c.
        * tests/printxval.c [!XLAT_RAW] (lookup_xlat): New function.
        (printxval): Wrap in XLAT_NAME.
        (sprintxlat, sprintxval): New functions.
        * tests/printxval-Xabbrev.c: New file.
        * tests/printxval-Xraw.c: Likewise.
        * tests/printxval-Xverbose.c: Likewise.
        * tests/tests.h (printxval): Remove declaration.
        (printxval_abbrev, printxval_raw, printxval_verbose, sprintxlat_abbrev,
        sprintxlat_raw, sprintxlat_verbose, sprintxval_abbrev, sprintxval_raw,
        sprintxval_verbose): New declarations.
        (printxval, sprintxlat, sprintxval): New macros, defined based on values
        of XLAT_RAW amd XLAT_VERBOSE macros.
        * tests/ioprio.c: Simplify the printing code since printxval now has
        xlat verbosity support.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/tests.h: add XLAT_STR macro.
        XLAT_STR allows describing expected output succintly in some simple
        cases.

        * tests/tests.h (XLAT_STR): New macro.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add PAF_ARRAY_TRUNCATED flag for print_array_ex.
        PAF_ARRAY_TRUNCATED allows enforcing the fact that an array
        is truncated, which is useful for arrays in local memory that are known
        as being truncated.

        * defs.h (xlat_style_private_flag_bits): Add PAF_ARRAY_TRUNCATED_BIT.
        (xlat_style_private_flags): Add PAF_ARRAY_TRUNCATED.
        * util.c (print_array_ex): Handle PAF_ARRAY_TRUNCATED in flags.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for printing local arrays to print_array.
        * defs.h (print_array_ex): Describe parameters.
        (print_local_array): A wrapper for printing arrays in local memory
        via print_array_ex.
        * util.c (print_array_ex): Handle case of NULL tfetch_mem_func by
        printing elements of array in local memory pointed by start_addr
        parameter.

        tests: move ioctl_evdev-v binary to pure_executables.list.
        * tests/Makefile.am (check_PROGRAMS): Move ioctl_evdev-v ...
        * tests/pure_executables.list: ... here.

        tests: implement ioctl_evdev-success-v.test via ioctl_evdev-success.test
        * tests/ioctl_evdev-success-v.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove ioctl_evdev-success-v.test.
        * tests/gen_tests.in: Add ioctl_evdev-success-v as a wrapper for
        ioctl_evdev-success.test.
        * tests/ioctl_evdev-success.test: Save "$args" to $prog, increase -a
        parameter value to 26 columns, inject "$@" into run_strace arguments,
        call $prog instead of axplicit program name.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        riscv64: remove mpers support.
        There is no riscv32 Linux support in Linux mainline,
        and no compat support in riscv64 as well.

        * linux/riscv64/arch_defs_.h: Remove.
        * linux/riscv64/ioctls_arch1.h: Likewise.
        * linux/riscv64/ioctls_inc1.h: Likewise.
        * linux/riscv64/syscallent1.h: Likewise.
        * Makefile.am (EXTRA_DIST): Remove them.
        * configure.ac (st_MPERS([m32])): Remove riscv64.
        * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove RISC-V
        from the list.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        riscv: rename to riscv64.
        The only currently supported RISC-V architecture is the 64-bit RISC-V.
        As the generic name we use causes confusion [1], rename it to riscv64.

        [1] https://lists.strace.io/pipermail/strace-devel/2019-August/009057.html

        * Makefile.am (EXTRA_DIST): Rename linux/riscv to linux/riscv64.
        * configure.ac: Rename riscv to riscv64, RISCV to RISCV64.
        * linux/riscv: Rename to linux/riscv64.
        * riscv.c: Rename RISCV to RISCV64.
        * tests/options-syntax.test: Rename riscv to riscv64.
        * tests/qualify_personality.sh: Likewise.
        * tests/strace-V.test: Likewise.

2019-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: implement clone3 syscall decoding.
        * configure.ac (AC_CHECK_HEADERS): Check for linux/sched.h presence.
        (AC_CHECK_TYPES): Check for struct clone_args in <linux/sched.h>.
        * clone.c: Include "print_fields.h".
        (struct strace_clone_args): New type.
        (print_nonzero_bytes): New function.
        (SYS_FUNC(clone3)): New decoder.
        * linux/syscallent-common.h ([BASE_NR + 435]): Wire up clone3.
        * NEWS: Mention this change.
        * tests/clone3.c: New file.
        * tests/clone3-Xabbrev.c: Likewise.
        * tests/clone3-Xraw.c: Likewise.
        * tests/clone3-Xverbose.c: Likewise.
        * tests/clone3-success.c: Likewise.
        * tests/clone3-success-Xabbrev.c: Likewise.
        * tests/clone3-success-Xraw.c: Likewise.
        * tests/clone3-success-Xverbose.c: Likewise.
        * tests/clone3-success.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add clone3-success,
        clone3-success-Xabbrev, clone3-success-Xraw, and
        clone3-success-Xverbose.
        (DECODER_TESTS): Add clone3-success.test.
        * tests/gen_tests.in (clone3, clone3-Xabbrev, clone3-Xraw,
        clone3-Xverbose, clone3-success-Xabbrev, clone3-success-Xraw,
        clone3-success-Xverbose): New entries.
        * tests/pure_executables.list: Add clone3, clone3-Xabbrev, clone3-Xraw,
        and clone3-Xverbose.
        * tests/.gitignore: Add clone3, clone3-Xabbrev, clone3-Xraw,
        clone3-Xverbose, clone3-success, clone3-success-Xabbrev,
        clone3-success-Xraw, and clone3-success-Xverbose.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/tests.h: add XLAT_KNOWN and XLAT_UNKNOWN macros.
        XLAT_KNOWN allows describing expected output succintly in some simple
        cases.

        * tests/tests.h (XLAT_KNOWN, XLAT_UNKNOWN): New macros, define based
        on values of XLAT_RAW and XLAT_VERBOSE macros.

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix umovestr_cached.test when process_vm_readv is not implemented
        * tests/umovestr_cached.test: Run strace with -z option to filter out
        failing process_vm_readv invocations.

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable umovestr_cached.test on ia64.
        ia64 invokes extra process_vm_readv syscalls to obtain syscall
        arguments, see linux/ia64/get_syscall_args.c for details.

        * tests/umovestr_cached.test [ $STRACE_ARCH == ia64 ]: Skip.

2019-09-15  Paul Chaignon  <paul.chaignon@gmail.com>

        tests: fix format warnings on x32.
        The type of __X32_SYSCALL_BIT changed from int to unsigned long by Linux
        kernel commit v5.3-rc1-1-g45e29d119e9923ff14dfb840e3482bef1667bbfb.
        Consequently, __NR_* macros are now defined to values of an unsigned long
        integer type on x32.

        tests/prctl-seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
        Fix format warning.
        tests/seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
        Likewise.

2019-09-15  Dmitry V. Levin  <ldv@altlinux.org>

        Implement memory caching for umove* functions.
        When the data to be fetched by vm_read_mem resides in a single memory
        page, fetch the whole page and cache it.  This implementation caches
        up to two memory pages.

        * defs.h (invalidate_umove_cache): New prototype.
        * strace.c (next_event): Call invalidate_umove_cache.
        * ucopy.c (cached_idx, cached_raddr): New static variables.
        (process_read_mem): New function.
        (vm_read_mem): Use them.  Implement fetched page caching.
        * tests/umovestr_cached.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add umovestr_cached.test.
        * tests/umovestr_cached.c: New file.
        * tests/pure_executables.list: Add umovestr_cached.
        * tests/.gitignore: Likewise.

2019-09-10  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.3.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.3-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/i386/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v5.3-rc8.
        * maint/ioctls_sym.sh (x86_list): Add KVM_SET_PMU_EVENT_FILTER.

2019-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Rewrite printnum_{slong,ulong,ptr,kptr} using dispatch_{word,klong}size.
        * defs.h (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
        Remove declaration.
        (printnum_slong, printnum_ulong): Implement unconditionally using
        dispatch_wordsize and opt_wordsize for the last argument.
        (printnum_ptr): Implement unconditionally using dispatch_wordsize.
        (printnum_kptr): Implement unconditionally using dispatch_klongsize.
        * util.c (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
        Remove.

        defs.h: introduce {opt,dispatch}_{word,klong}size.
        * defs.h (set_personality, current_personality, current_wordsize,
        current_klongsize, max_addr, max_kaddr): Move upwards.
        (opt_wordsize): New macro, calls the first or the second argument
        depending on the word size.
        (dispatch_wordsize): New macro, calls the first or the second function
        with the rest of macro parameters as arguments depending on the word
        size.
        (opt_klongsize): New macro, calls the first or the second argument
        depending on the kernel long size.
        (dispatch_klongsize): New macro, calls the first or the second function
        with the rest of macro parameters as arguments depending on the kernel
        long size.

2019-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: fix PRINT_UNKNOWN_TAIL_EX.
        In the conversion of PRINT_UNKNOWN_TAIL into PRINT_UNKNOWN_TAIL_EX
        the usage of sizeof(*(hdr_)) hasn't been replaced to (hdr_size_)
        in all places.  Offset calculation also had to be changed.

        * s390.c (PRINT_UNKNOWN_TAIL_EX): Fix addr and len arguments
        in is_filled and print_quoted_string calls.

        Fixes: v5.2-97-g210593c "s390: update sthyi decoder"
        Reported-by: Dan Horák <dan@danny.cz>
        Resolves: https://github.com/strace/strace/issues/108

2019-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add comment about CLONE_DETACHED to clone_flags.in.
        It's ignored by kernel, but present in the UAPI header.

        * xlat/clone_flags.in: Add a comment about CLONE_DETACHED.

2019-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: fix print_tls_arg on x86.
        When strace is built for (32-bit) x86, it has HAVE_STRUCT_USER_DESC
        and SUPPORTED_PERSONALITIES == 1, which led to execution of the both
        branches.  Simplify the logic by including the SUPPORTED_PERSONALITIES
        into the condition.

        * clone.c (print_tls_arg): Include SUPPORTED_PERSONALITIES into the "if"
        condition.

2019-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: update sthyi decoder.
        Sync up with the description[1].

        [1] https://www.ibm.com/support/knowledgecenter/SSB27U_6.4.0/com.ibm.zvm.v640.hcpb4/hcpb4sth.htm

        * s390.c (struct sthyi_machine): Add fields reserved_1__, infmplnm;
        update comment for the infmval1 field; update the related static_assert.
        (struct sthyi_partition): Update infpflg1 comment; update infpval1
        comment; add infpplnm field; update the related static_assert.
        (struct sthyi_hypervisor): Update infyflg1 field comment; add
        infyinsf and infyautf fields; update the related static_assert.
        (CHECK_SIZE_EX): Rename from CHECK_SIZE; add min_size_ argument, check size_
        against it.
        (CHECK_SIZE): New macro, a wrapper for CHECK_SIZE_EX.
        (PRINT_UNKNOWN_TAIL_EX): Rename from PRINT_UNKNOWN_TAIL, add hdr_size_
        argument.
        (PRINT_UNKNOWN_TAIL): New macro, a wrapper for PRINT_UNKNOWN_TAIL_EX.
        (print_sthyi_machine): New local variable last_decoded; use
        CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
        of last_decoded; decode reserved_1__ and infmplnm fields if the returned
        size indicates that they are present; use PRINT_UNKNOWN_TAIL_EX for
        printing structure's tail.
        (print_sthyi_partition): New local variable last_decoded; use
        CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
        of last_decoded; decode infpplnm field if the returned size indicates
        that it is present; use PRINT_UNKNOWN_TAIL_EX for printing structure's
        tail.
        (print_funcs): New function.
        (print_sthyi_hypervisor): New local variable last_decoded; use
        CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
        of last_decoded; update infyflg1 field decoding; decode infyinsf
        and infyautf fields if the returned size indicates that they
        are present; use PRINT_UNKNOWN_TAIL_EX for printing structure's tail.
        (s390_sthyi): Update specification URL.
        * tests/s390_sthyi.c: Update expected output.

2019-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: replace structure size comments with static_assert's.
        * s390.c: Add static_assert statements for compile-time check of
        struct sthyi_hdr, struct sthyi_machine, struct sthyi_partition,
        struct sthyi_hypervisor, and struct sthyi_guest sizes.

2019-08-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: convert ksysent.test into a generated test.
        * tests/ksysent.test: Remove.
        * tests/Makefile.am (MISC_TESTS): Remove ksysent.test.
        * tests/gen_tests.in (ksysent): New entry.
        * ci/run-build-and-tests.sh: Replace ksysent.log with ksysent.gen.log.
        * strace.spec.in: Likewise.

2019-08-31  Paul Chaignon  <paul.chaignon@gmail.com>

        Add seccomp filter syscall flag.
        This commit adds a new syscall flag for syscall that are traced by default
        under seccomp filter.

        The syscallent changes can be reproduced with the following script:

          git grep -l 'SEN(\(execv\|ipc\|socketcall\|ipc\)' |
          xargs -r sed -i -e '/SEN(execv/ s/TP|/&TSD|/' \
          -e '/SEN(ipc)/ s/TI/&|TSD/' -e '/SEN(socketcall)/ s/TD/&|TSD/' \
          -e '/SEN(syscall)/ s/0,/TSD,/'

        * sysent.h (TRACE_SECCOMP_DEFAULT): Define new flag.
        * sysent_shorthand_defs.h (TSD): Define new flag shorthand.
        * linux/32/syscallent.h: Add TSD flag.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2019-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.spec: lower CentOS version requirement for pkgconfig(bluez)
        bluez-libs-devel provides pkgconfig(bluez) and the actual headers both
        in RHEL 6 and RHEL 7, so the version condition for enablement
        of pkgconfig(bluez) in spec file can be lowered.  However, the package
        in question is in the "optional" repository in RHEL, and there seems to be
        no easy way to enable it in OBS (where this spec file is mainly used)
        so only %centos check is actually changed for now.

        * strace.spec.in: Change "0%{?centos} >= 8" to "0%{?centos} >= 6"
        for "BuildRequires: pkgconfig(bluez)" enablement.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1746885

2019-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: properly decode sockaddr_hci addresses without hci_channel.
        Before Linux commit v2.6.38-rc1~476^2~14^2~3^2~43^2~9,
        struct sockaddr_hci did not contain hci_channel field.

        * configure.ac (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): Add check
        for struct sockaddr_hci.hci_channel.
        * sockaddr.c (print_sockaddr_data_bt): Decode struct sockaddr_hci
        without hci_channel field.
        * tests/net-sockaddr.c (check_hci): Add check for struct sockaddr_hci
        decoding without hci_channel field; guard hci_channel with #ifdef
        HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL.
        (check_raw): Remove "len++", as 4-byte AF_BLUETOOTH socket addresses are
        interpreted as struct sockaddr_hci without hci_channel field.

2019-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: try to be more clear with -e trace=class deprecation notice
        It was reported that the current way of labelling of the percent-less
        -e trace=class syntax variant may be confusing, as it can be read
        as deprecation of the whole option and not specific syntax; try to be
        more clear by moving the deprecation notices into the option
        descriptions.

        * strace.1.in (.SS Filtering): Move the deprecation notice
        of -e trace={file,process,network,signal,ipc,desc,memory} syntax
        to the descriptions of the respective options.

        Reported-by: Alexey Gladkov <gladkov.alexey@gmail.com>

2019-08-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: normalise fsmagic formatting.
        For historical reasons, it was this way as there was no support for
        explicitly defined xlat values, which is no longer the case.

        The following command was used:

            sed -ri \
                -e 's/^\{ ([^]*),[[:space:]]*"([^"]*)"([[:space:]]*)\},$/\2\3\1/' \
                -e 's/^([^\t]{14,15}\t)/\1\t/' \
                xlat/fsmagic.in

        * xlat/fsmagic.in: Normalise the formatting.

2019-08-23  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>

        Add support for /dev/watchdog ioctls.
        * watchdog_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (DECL_IOCTL): Add watchdog.
        * ioctl.c (ioctl_decode): Add 'W' case.
        * xlat/watchdog_ioctl_cmds.in: New file.
        * tests/ioctl_watchdog.c: New file.
        * tests/.gitignore: Add ioctl_watchdog.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_watchdog): New entry.

2019-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        umoven: use error_func_msg instead of error_msg.
        * ucopy.c (umoven): Use error_func_msg instead of error_msg.

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Use perror_func_msg instead of perror_msg where appropriate.
        * linux/aarch64/set_scno.c (arch_set_scno): Use perror_func_msg
        instead of perror_msg.
        * ucopy.c (umoven_peekdata, umoven, umovestr_peekdata, umovestr):
        Likewise.
        * upeek.c (upeek): Likewise.
        * upoke.c (upoke): Likewise.

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use on some architectures
        When PTRACE_GET_SYSCALL_INFO is in use on those architectures
        that invoke set_regs in arch_set_scno, get_regs is not called,
        so it has to be invoked explicitly before tampering.

        * linux/arc/set_scno.c (arch_set_scno): Explicitly call get_regs
        when PTRACE_GET_SYSCALL_INFO is in use.
        * linux/avr32/set_scno.c: Likewise.
        * linux/csky/set_scno.c: Likewise.
        * linux/ia64/set_scno.c: Likewise.
        * linux/m68k/set_scno.c: Likewise.
        * linux/metag/set_scno.c: Likewise.
        * linux/mips/set_scno.c: Likewise.
        * linux/nios2/set_scno.c: Likewise.
        * linux/or1k/set_scno.c: Likewise.
        * linux/riscv/set_scno.c: Likewise.
        * linux/s390/set_scno.c: Likewise.
        * linux/sparc/set_scno.c: Likewise.
        * linux/tile/set_scno.c: Likewise.
        * NEWS: Mention this fix.

        Thanks-to: Anatoly Pugachev <matorola@gmail.com>
        Fixes: v5.2~27 "sparc, sparc64: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use"

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: fix redundant get_regs invocation.
        An explicit get_regs invocation was added to arch_set_error and
        arch_set_success on sparc/sparc64 by commit v5.2~27 in attempt to fix
        syscall tampering on these architectures when PTRACE_GET_SYSCALL_INFO
        is in use.

        That change, however, did not fix the bug because set_error and
        set_success already invoke get_regs on all architectures where
        ptrace_setregset_or_setregs is defined, this includes sparc and sparc64.

        * linux/sparc/set_error.c (sparc_set_o0_psr): Do not invoke get_regs.
        * linux/sparc64/set_error.c (sparc64_set_o0_tstate): Likewise.
        * NEWS (5.2): Remove the statement about syscall tampering fix
        on sparc and sparc64 when PTRACE_GET_SYSCALL_INFO is in use.

2019-08-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: avoid shifting left a signed number by 31 bit.
        cppcheck warns about it with the following diagnostics:

            error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is
            undefined behaviour

        * v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): Shift left 1U and not 1 in
        order to get 0x80000000.

2019-08-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.spec.in: use SPDX shortname format in License: tag.
        Otherwise some rpm lintians complain about it:

            strace.src: W: invalid-license LGPL-2.1-or-later
            strace.src: W: invalid-license GPL-2.0-or-later

        * strace.spec.in (License): Change license description from
        "LGPL-2.1-or-later and GPL-2.0-or-later" to "LGPL-2.1+ and GPL-2.0+".

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of pidfd_open syscall.
        ... introduced by Linux kernel commits v5.3-rc1~142^2~2
        and v5.3-rc1~142^2~1.

        * pidfd_open.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_pidfd_open.
        * linux/syscallent-common.h [BASE_NR + 434]: Wire up pidfd_open.
        * NEWS: Mention this change.
        * tests/pidfd_open.c: New file.
        * tests/pidfd_open-P.c: Likewise.
        * tests/pidfd_open-y.c: Likewise.
        * tests/gen_tests.in (pidfd_open, pidfd_open-P, pidfd_open-y): New
        entries.
        * tests/pure_executables.list: Add pidfd_open, pidfd_open-P, and
        pidfd_open-y.
        * tests/.gitignore: Likewise.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        xlat/gen.sh: remove #stop support.
        There are no users of #stop directive anymore.

        * xlat/gen.sh (gen_header): Remove '#stop' support.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        xlat/skf_off: use XLAT_MACROS_ONLY instead of #stop.
        * xlat/skf_off.in: Remove #stop.
        * bpf_sock_filter.c: Wrap "xlat/skf_off.h" inclusion in XLAT_MACROS_ONLY.

        xlat/scsi_sg_commands: use XLAT_MACROS_ONLY instead of #stop.
        * xlat/scsi_sg_commands.in: Remove #stop.
        * scsi.c: Wrap "xlat/scsi_sg_commands.h" inclusion in XLAT_MACROS_ONLY.
        * tests/ioctl_scsi.c: Likewise.
        * tests/ioctl_sg_io_v4.c: Likewise.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: mark as value indexed those files that meet certain criteria.
        Automatically prepend #value_indexed using the following script:

        for f in xlat/*.in; do
                awk -n 'BEGINFILE {if (FILENAME ~ /flag/) exit 1; nr=0}
                        (nr == 0 && $1 ~ /^#/) {exit 1}
                        $1 !~ /^[A-Z_0-9]/ {next}
                        NF < 2 || $2 !~ /^[0-9]/ || ($2 - nr != 0 && $2 - nr != 1) {exit 1}
                        {nr++}
                        ENDFILE {if (nr < 2) exit 1}' "$f" &&
                sed -i '1i#value_indexed' "$f"
        done

        * xlat/blkpg_ops.in: Prepend #value_indexed.
        * xlat/btrfs_balance_ctl_cmds.in: Likewise.
        * xlat/btrfs_compress_types.in: Likewise.
        * xlat/btrfs_cont_reading_from_srcdev_mode.in: Likewise.
        * xlat/crypto_nl_attrs.in: Likewise.
        * xlat/dcb_commands.in: Likewise.
        * xlat/epollctls.in: Likewise.
        * xlat/f_owner_types.in: Likewise.
        * xlat/fib_rule_actions.in: Likewise.
        * xlat/futexwakecmps.in: Likewise.
        * xlat/futexwakeops.in: Likewise.
        * xlat/ioprio_class.in: Likewise.
        * xlat/ioprio_who.in: Likewise.
        * xlat/kcmp_types.in: Likewise.
        * xlat/keyctl_commands.in: Likewise.
        * xlat/lwtunnel_encap_types.in: Likewise.
        * xlat/mpol_modes.in: Likewise.
        * xlat/multicast_router_types.in: Likewise.
        * xlat/netfilter_versions.in: Likewise.
        * xlat/netlink_protocols.in: Likewise.
        * xlat/netlink_types.in: Likewise.
        * xlat/nf_acct_msg_types.in: Likewise.
        * xlat/nf_cthelper_msg_types.in: Likewise.
        * xlat/nf_ctnetlink_exp_msg_types.in: Likewise.
        * xlat/nf_ctnetlink_msg_types.in: Likewise.
        * xlat/nf_cttimeout_msg_types.in: Likewise.
        * xlat/nf_ipset_msg_types.in: Likewise.
        * xlat/nf_nftables_msg_types.in: Likewise.
        * xlat/nf_osf_msg_types.in: Likewise.
        * xlat/nf_queue_msg_types.in: Likewise.
        * xlat/nf_ulog_msg_types.in: Likewise.
        * xlat/nl_netfilter_subsys_ids.in: Likewise.
        * xlat/nlmsgerr_attrs.in: Likewise.
        * xlat/pr_cap_ambient.in: Likewise.
        * xlat/pr_dumpable.in: Likewise.
        * xlat/pr_mce_kill.in: Likewise.
        * xlat/pr_mce_kill_policy.in: Likewise.
        * xlat/pr_set_mm.in: Likewise.
        * xlat/pr_tsc.in: Likewise.
        * xlat/quota_formats.in: Likewise.
        * xlat/quotatypes.in: Likewise.
        * xlat/routing_types.in: Likewise.
        * xlat/rtnl_addr_attrs.in: Likewise.
        * xlat/rtnl_addrlabel_attrs.in: Likewise.
        * xlat/rtnl_dcb_attrs.in: Likewise.
        * xlat/rtnl_ifla_brport_attrs.in: Likewise.
        * xlat/rtnl_ifla_events.in: Likewise.
        * xlat/rtnl_ifla_info_attrs.in: Likewise.
        * xlat/rtnl_ifla_port_attrs.in: Likewise.
        * xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
        * xlat/rtnl_ifla_xdp_attrs.in: Likewise.
        * xlat/rtnl_link_attrs.in: Likewise.
        * xlat/rtnl_mdb_attrs.in: Likewise.
        * xlat/rtnl_mdba_mdb_attrs.in: Likewise.
        * xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
        * xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
        * xlat/rtnl_mdba_router_attrs.in: Likewise.
        * xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.
        * xlat/rtnl_neigh_attrs.in: Likewise.
        * xlat/rtnl_neightbl_attrs.in: Likewise.
        * xlat/rtnl_neightbl_parms_attrs.in: Likewise.
        * xlat/rtnl_netconf_attrs.in: Likewise.
        * xlat/rtnl_route_attrs.in: Likewise.
        * xlat/rtnl_rta_metrics_attrs.in: Likewise.
        * xlat/rtnl_rule_attrs.in: Likewise.
        * xlat/rtnl_tc_action_attrs.in: Likewise.
        * xlat/rtnl_tc_attrs.in: Likewise.
        * xlat/rtnl_tca_stab_attrs.in: Likewise.
        * xlat/rtnl_tca_stats_attrs.in: Likewise.
        * xlat/s390_guarded_storage_commands.in: Likewise.
        * xlat/s390_runtime_instr_commands.in: Likewise.
        * xlat/seccomp_mode.in: Likewise.
        * xlat/seccomp_ops.in: Likewise.
        * xlat/shutdown_modes.in: Likewise.
        * xlat/sigchld_codes.in: Likewise.
        * xlat/sigev_value.in: Likewise.
        * xlat/sigpoll_codes.in: Likewise.
        * xlat/smc_link_group_roles.in: Likewise.
        * xlat/sock_netlink_options.in: Likewise.
        * xlat/sock_pnp_options.in: Likewise.
        * xlat/sock_tls_options.in: Likewise.
        * xlat/socketcalls.in: Likewise.
        * xlat/tcp_states.in: Likewise.
        * xlat/uring_register_opcodes.in: Likewise.
        * tests/socketcall.c (main): Update assertion.

2019-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Replace direct usage of err_name/errnoent with print_err.
        Introduce print_err function that prints error number respecting current
        xlat verbosity settings, and switch err_name/errnoent callers to use
        this new function instead.

        * defs.h (err_name): Remove.
        (print_err): New declaration.
        * print_fields.h (PRINT_FIELD_ERR_D, PRINT_FIELD_ERR_U): New macros.
        * syscall.c (err_name): Add static qualifier, change argument type
        to uint64_t.
        (print_err): New function.
        * keyctl.c (keyctl_reject_key): Use print_err for printing error
        argument.
        * net.c (print_get_error): Use print_err for printing err.
        * numa.c (print_status): Use print_err for printing errno.
        * netlink.c: Include "print_fields.h".
        (decode_nlmsgerr): Use PRINT_FIELD_ERR_D for printing errno field.
        * printsiginfo.c: Include "print_fields.h".
        (print_si_info): Use PRINT_FIELD_ERR_U for printing si_errno field.
        * ptrace_syscall_info.c (print_ptrace_syscall_info): Use
        PRINT_FIELD_ERR_D for printing info.exit.rval.
        * tests/pidfd_send_signal.c (main): Update expected output.
        * tests/ptrace.c (main): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-13  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_unix_diag: implement UDIAG_SHOW_UID/UNIX_DIAG_UID decoding.
        ... introduced by Linux kernel commit v5.3-rc1~140^2~467.

        * linux/unix_diag.h (UDIAG_SHOW_UID, UNIX_DIAG_FIRST_UNUSED): New macro
        constants.
        (UNIX_DIAG_UID): New enum constant.
        * xlat/unix_diag_attrs.in: Add UNIX_DIAG_UID.
        * xlat/unix_diag_show.in: Add UDIAG_SHOW_UID.
        * netlink_unix_diag.c (unix_diag_msg_nla_decoders): Handle
        UNIX_DIAG_UID.
        * NEWS: Mention this.
        * tests/nlattr.c (test_nlattr, test_nla_type): Replace
        UNIX_DIAG_SHUTDOWN + 1 with UNIX_DIAG_FIRST_UNUSED.

2019-08-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_route: implement RTM_{NEW,DEL,GET}CHAIN decoding.
        * xlat/nl_route_types.in (RTM_NEWCHAIN, RTM_DELCHAIN, RTM_GETCHAIN): New
        constants introduced by Linux kernel commit v4.19-rc1~140^2~279^2~9.
        * netlink_route.c (route_decoders) <[RTM_NEWCHAIN - RTM_BASE],
        [RTM_DELCHAIN - RTM_BASE], [RTM_GETCHAIN - RTM_BASE]>: Invoke
        decode_tcmsg.
        * NEWS: Mention this.

2019-08-13  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update TCP_* constants.
        * xlat/sock_tcp_options.in (TCP_TX_DELAY): New constant introduced
        by Linux kernel commit v5.3-rc1~140^2~269.
        * NEWS: Mention this.

        xlat: update *_MAGIC constants.
        * xlat/fsmagic.in (Z3FOLD_MAGIC): New constant introduced
        by Linux kernel commit v5.3-rc1~31^2~30.
        (DMA_BUF_MAGIC): New constant introduced by Linux kernel commit
        v5.3-rc1~22^2~20^2~42.
        * NEWS: Mention this.

        xlat: update KVM_CAP_* constants.
        * xlat/kvm_cap.in (KVM_CAP_PMU_EVENT_FILTER): New constant introduced
        by Linux kernel commit v5.3-rc1~115^2~5.
        * NEWS: Mention this.

        xlat: update KEYCTL_* constants.
        * xlat/keyctl_commands.in (KEYCTL_PKEY_QUERY, KEYCTL_PKEY_ENCRYPT,
        KEYCTL_PKEY_DECRYPT, KEYCTL_PKEY_SIGN, KEYCTL_PKEY_VERIFY): New
        constants introduced by Linux kernel commit v4.20-rc1~29^2~20.
        (KEYCTL_MOVE): New constant introduced by Linux kernel commit
        v5.3-rc1~189^2~3.
        (KEYCTL_CAPABILITIES): New constant introduced by Linux kernel commit
        v5.3-rc1~189^2.
        * NEWS: Mention this.

        xlat: update BPF_* constants.
        * xlat/bpf_attach_type.in (BPF_CGROUP_GETSOCKOPT,
        BPF_CGROUP_SETSOCKOPT): New constants introduced by Linux kernel commit
        v5.3-rc1~140^2~65^2~8^2~8.
        * xlat/bpf_prog_flags.in (BPF_F_TEST_RND_HI32): New constant
        introduced by Linux kernel commit v5.3-rc1~140^2~371^2~28^2~12.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCKOPT): New constant
        introduced by Linux kernel commit v5.3-rc1~140^2~65^2~8^2~8.
        * NEWS: Mention this.
        * tests/bpf.c (print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4,
        BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update expected output.
        * tests/kernel_version.c (print_bpf_attr, main): Likewise.

        xlat: update XDP_* constants.
        * xlat/sock_xdp_options.in (XDP_OPTIONS): New constant introduced
        by Linux kernel commit v5.3-rc1~140^2~65^2~9^2~13.

        xlat: update ETH_* constants.
        * xlat/ethernet_protocols.in (ETH_P_LLDP): New constant introduced
        by Linux kernel commit v5.3-rc1~140^2~329^2~6.

2019-08-11  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update SO_* constants.
        * xlat/sock_options.in (SO_BINDTOIFINDEX): New constant introduced
        by Linux commit v5.1-rc1~178^2~508.
        (SO_RCVTIMEO_NEW, SO_SNDTIMEO_NEW): New constants introduced by Linux
        commit v5.1-rc1~178^2~363^2.
        (SO_DETACH_REUSEPORT_BPF): New constant introduced by Linux commit
        v5.3-rc1~140^2~179^2~12.

        * xlat/setsock_options.in: Regenerate using maint/gen_xlat_defs.sh.

2019-08-11  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definition for MAP_UNINITIALIZED.
        Linux commit v5.3-rc1~65^2~86 fixed the definition of MAP_UNINITIALIZED
        flag that used to depend on CONFIG_MMAP_ALLOW_UNINITIALIZED.

        * xlat/mmap_flags.in (MAP_UNINITIALIZED): Add fallback definition.

2019-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: add ability to sort on errors field.
        For completeness.

        * count.c (error_cmp): New function.
        (set_sortby): Add sort keys for errors field.
        * strace.1.in (.SH OPTIONS) <-S>: Document it.
        * strace.c (usage): Likewise.
        * tests/strace-S.test: Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: provide alternative names for sorting options.
        as some might be easier to remember than others.

        * count.c (set_sortby): Add aliases for the existing sorting options.
        * strace.1.in (.SH OPTIONS) <-S>: Document new aliases.
        * tests/strace-S.test: Check new sort keys.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: rewrite sort function selection using a table.
        * count.c (set_sortby): Replace nested if's with iteration over a table.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend -S option check.
        * tests/strace-S.test: Check default sorting method and "-S time".

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall: track syscall system time a bit more explicitly.
        Before, it relied on implicit assumptions that syscall-exit event is
        right the next one after syscall-enter.  Also, there's some additional
        debugging output that might help someone someday.

        * count.c (count_syscall): Calculate system time as difference of tcp's
        stime and ltime.
        * defs.h (struct tcb): Add ltime, atime fields, remove dtime.
        * strace.c (droptcb): Print total system time spent by a tcb.
        (startup_tcb): Store initial system time in atime.
        (next_event): Update stime directly.
        * syscall.c (syscall_entering_finish): Store current system time in
        tcb's ltime field.
        (syscall_exiting_finish): Likewise.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: substract overhead per call.
        * count.c (zero_ts): New variable.
        (count_syscall): Calculate the spent time in the wts variable, then add
        it to cc->time.
        (call_summary_pers): Do not perform overhead correction.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add ts_min and ts_max.
        * defs.h (ts_min, ts_max): New declarations.
        * util.c (ts_min, ts_max): New functions.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: use parse_ts for parsing overhead value.
        * count.c (set_overhead): Change argument type to const char *, call
        parse_ts to parse it and set to overhead.
        * defs.h (set_overhead): Update declaration.
        * strace.c: (init) <case 'O'>: do not parse argument, pass optarg to
        set_overhead call.
        * tests/count.test (GENERIC, WALLCLOCK, WALLCLOCK1, HALFCLOCK): New
        variables with expected patterns.
        Add checks for the new -O syntax.

        delay: use parse_ts for parsing delay value.
        * delay.c (fill_delay_data): Change intval argument to struct timespec
        *val, assign val to ts.
        * delay.h (fill_delay_data): Update function declaration.
        * filter_qualify.c (parse_delay_token): Parse input with parse_ts,
        supply the resulting struct timespec to fill_delay_data.
        * tests/delay.c (check_): New function for providing diagnostic in case
        of check failure.
        (check_delay): Use it.
        * tests/delay.test: Check new delay syntax.

        util.c: add parse_ts.
        * defs.h (parse_ts): New declaration.
        * util.c (parse_ts): New function.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count: fix types in sorting comparison callbacks.
        * count.c (time_cmp. syscall_cmp): Change arguments type
        to "const void *", change indices cast type to "unsigned int *".
        (count cmp): Likewise.  Change count variables type to unsigned int.
        (sortfun): Specify types of arguments.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: improve control ID printing.
        Control ID space is hierarchical, so, higher bits provide information
        about control class.

        * v4l2.c (print_v4l2_cid): New function.
        (print_v4l2_control): Use print_v4l2_cid for printing control ID field.
        * tests/ioctl_v4l2.c: Add checks for control ID printing.

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add syslog-success test.
        * tests/.gitignore: Add syslog-success
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add syslog-success.test.
        * tests/syslog-success.c: New file.
        * tests/syslog-success.test: New test.
        * tests/syslog.c: Add support for running under syscall retval
        injection, add checks.

        syslog: decode log level in SYSLOG_ACTION_CONSOLE_LEVEL command.
        * xlat/syslog_console_levels.in: New file.
        * syslog.c: Include "xlat/syslog_console_levels.h".
        (SYS_FUNC(syslog)): Add SYSLOG_ACTION_CONSOLE_LEVEL case.
        * tests/syslog.c: Add checks.

        syslog: fix argument printing.
        * syslog.c (SYS_FUNC(syslog)): Store conversion to int of tcp->u_arg[2]
        in len; print address using printaddr64 (as syslog doesn't use compat
        for x32), and third argument as int (as it has this type in the syscall
        handler).
        * tests/syslog.c: Add checks.

        syslog: do not print bufp and len for commands that ignore them.
        * syslog.c (SYS_FUNC(syslog)): Defer printing of comma after the first
        argument to the specific command handlers, return RVAL_DECODED without
        additional printing for SYSLOG_ACTION_CLOSE, SYSLOG_ACTION_OPEN,
        SYSLOG_ACTION_CLEAR, SYSLOG_ACTION_CONSOLE_OFF,
        SYSLOG_ACTION_CONSOLE_ON, SYSLOG_ACTION_SIZE_UNREAD,
        SYSLOG_ACTION_SIZE_BUFFER.
        * tests/syslog.c: Add checks.

        syslog: fix switch statement indentation.
        * syslog.c (SYS_FUNC(syslog)): Decrease indentation level of case
        clauses in the switch statement.

        syslog: print syslog command with verbose style, as it is not in UAPI.
        * syslog.c (SYS_FUNC(syslog)): Print syslog_action_type using
        XLAT_STYLE_VERBOSE.
        * tests/syslog.c: Update expected output.

2019-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: update hppa workaround in remap_file_pages test.
        ... to cater for the change of MAP_TYPE on hppa introduced
        by Linux kernel commit v4.17-rc1~146^2~9.

        * tests/remap_file_pages.c (main) [__hppa__ && MAP_TYPE != 0x03]
        (MAP_TYPE_str): Define to "0x2b /* MAP_??? */".

2019-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        Remove AUDIT_ARCH_* fallback definitions from arch_get_personality.c files
        Since xlat/audit_arch.h provides definitions for all AUDIT_ARCH_*
        constants, remove their fallback definitions from other files.

        * get_personality.c [SUPPORTED_PERSONALITIES > 1]: Include
        "xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY.
        * linux/aarch64/arch_get_personality.c (AUDIT_ARCH_ARM): Remove.
        * linux/powerpc64/arch_get_personality.c (AUDIT_ARCH_PPC): Remove.
        * linux/riscv/arch_get_personality.c (AUDIT_ARCH_RISCV32): Remove.
        * linux/s390x/arch_get_personality.c (AUDIT_ARCH_S390): Remove.
        * linux/sparc64/arch_get_personality.c (AUDIT_ARCH_SPARC): Remove.
        * linux/tile/arch_get_personality.c (AUDIT_ARCH_TILEGX32,
        AUDIT_ARCH_TILEPRO): Remove.
        * linux/x86_64/arch_get_personality.c (AUDIT_ARCH_I386): Remove.

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update audit_arch.in.
        * xlat/audit_arch.in: Add fallback definitions.
        (__AUDIT_ARCH_CONVENTION_MIPS64_N32, __AUDIT_ARCH_64BIT,
        __AUDIT_ARCH_LE): New macros.
        (AUDIT_ARCH_V850): New constant.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add elf_em.in.
        For now, it's a source of fallback values for AUDIT_ARCH_* constants.

        * xlat/elf_em.in: New file.
        * xlat/audit_arch.in (AUDIT_ARCH_ARM, AUDIT_ARCH_ARMEB, AUDIT_ARCH_FRV,
        AUDIT_ARCH_MICROBLAZE, AUDIT_ARCH_OPENRISC): Define unconditionally.
        * printsiginfo.c: Include "xlat/elf_em.h".
        * tests/ptrace_syscall_info.c: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: sync up strace -h message with the man page.
        Especially synopsis.

        * strace.c (usage): copy synopsis over from the man page; add "-A"
        and "-qq" options description.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: add missing options to synopsis.
        * strace.1.in (.SH SYNOPSIS): add second "-q", "-w", second "-y", "-z",
        and "-Z" to normal call variant; add "-w", "-z" and "-Z" to syscall
        statistics call variant.

        strace.c: split lines in strace -h output to fit into 80 columns.
        * strace.c (usage): split "-yy", "-c", "-e" options descriptions to fit
        into 80 columns width.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: move -v to Output format section in strace -h message.
        And also reword it into a more general and concise form in order to fit
        into 80-columnt width.

        * strace.c (usage): Move "-v" option to the "Output format" option of
        the help message, reword its description.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: add "-k" to strace -h list of options.
        It is mentioned in the "Output format" section below, but not in the
        usage section.

        * strace.c (usage): Define K_OPT macro with a value that depends
        on ENABLE_STACKTRACE macro presence, use it in the help output, undefine
        it.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: rewrite supported -e status options in a more compact form.
        * strace.1.in (.SS Filtering): Rewrite -e status value options in a
        sublist.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: reformat mpers support matrix table.
        In order to make it much less wider.

        * strace.1.in (.SH MULTIPLE PERSONALITY SUPPORT): Move additional text
        in x86_64 line to notes under the table, clarify PowerPC specifics.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: compact small named lists.
        And also rewrite nested .RS/.RE abomination.

        * strace.1.in (.SS Output format): compact -X option values variants
        using ".TQ".
        (.SS Tampering): Rewrite -e inject=:when= expression variants using
        ".TP"/".TQ".
        (.SH MULTIPLE PERSONALITY SUPPORT): compact optional features list using
        ".TQ".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: rewrite conditional parts.
        The current implementation doesn't work as intended since in case the
        condition is false, .ig has no effect and it results in "warning: macro
        'end_unwind_opt' not defined".  Rewrite it into something more dumb and
        verbose, but hopefully correct.

        * strace.1.in (.SH SYNOPSYS, .SS Output format): Prepend each
        conditional line with respective ".if" instead of trying to wrap
        it in ".ig".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: add AUTHORS section.
        * strace.1.in: Add .SH AUTHORS, refer to the CREDITS file.

        strace.1.in: add a link to the current project's home page.
        * strace.1.in (.SH SEE ALSO): Add a link to strace's home page.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: reorder options.
        In an attempt to make the order more sensible.

        * strace.1.in (.SH OPTIONS): Insert ".SS General" at the beginning of
        the section; move ".SS Startup" after ".SS General"; move ".SS Tracing"
        after ".SS Startup"; move ".SS Filtering" after ".SS Startup"; insert
        ".SS Tampering" after ".SS Statistics"; move "-e expr" from ".SS
        Filtering" to ".SS General"; move "-e abbrev", "-e verbose", "-e raw",
        "-e read", "-e write", "-e kvm=vcpu" and "-v" from ".SS Filtering"
        to ".SS Output format"; move "-e inject" and "-e fault" from
        ".SS Filtering" to ".SS Tampering".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Treat PowerPC 64 LE as a separate architecture.
        That seems to be the easiest way to properly handle the fact that
        PPC64LE does not have a meaningful m32 personality.

        * configure.ac: Move AC_C_BIGENDIAN before arch detection; determine
        powerpc64/powerpc64le arch based on $ac_cv_c_bigendian value.
        * linux/dummy.h [POWERPC64LE] (sys_oldselect): Redirect to printargs.
        * linux/powerpc64le/arch_defs_.h: New file.
        * linux/powerpc64le/arch_regs.c: Likewise.
        * linux/powerpc64le/arch_rt_sigframe.c: Likewise.
        * linux/powerpc64le/errnoent.h: Likewise.
        * linux/powerpc64le/get_error.c: Likewise.
        * linux/powerpc64le/get_scno.c: Likewise.
        * linux/powerpc64le/get_syscall_args.c: Likewise.
        * linux/powerpc64le/ioctls_arch0.h: Likewise.
        * linux/powerpc64le/ioctls_inc0.h: Likewise.
        * linux/powerpc64le/raw_syscall.h: Likewise.
        * linux/powerpc64le/rt_sigframe.h: Likewise.
        * linux/powerpc64le/set_error.c: Likewise.
        * linux/powerpc64le/set_scno.c: Likewise.
        * linux/powerpc64le/syscallent.h: Likewise.
        * linux/powerpc64le/userent.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * tests/ipc_msg.c: Check for POWERPC64LE definition in addition to
        POWERPC64.
        * util.c (getllval): Add check for POWERPC64LE definition in addition to
        POWERPC64.
        * strace.1.in (.SH MULTIPLE PERSONALITY SUPPORT): Mention that only big
        endian PowerPC 64 has mpers support.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-04  Pierre Marsais  <pierre.marsais@lse.epita.fr>

        Fix invalid free in trace_close_memstream.
        In maybe_switch_tcbs we exchange the pointers to the memstream's buffers
        between 2 tcb, however the libc doesn't know and keeps updating the
        tcb->memfptr as if the exchange didn't happen.  This leads to
        unsynchronized tcb->memfptr and tcb->outf and invalid frees.
        Adding a new indirection fixes the problem.

        * stage_output.c (struct staged_output_data): New struct.
        (strace_open_memstream, strace_close_memstream): Use it.
        * defs.h (struct tcb): Replace real_outf, memfptr, and memfloc
        with a pointer to struct staged_output_data.
        * strace.c (maybe_switch_tcbs): Use it.
        * syscall.c (print_syscall_resume): Ditto.

2019-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix expected output for some ipc tests.
        * tests/gen_tests.in (ipc_msgbuf-Xraw, ipc_shm, ipc_shm-Xabbrev,
        ipc_shm-Xverbose): Adjust -a argument.

2019-08-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check the latest MSG_TRUNC decoding fix.
        * tests/recv-MSG_TRUNC.c: New file.
        * tests/recvfrom-MSG_TRUNC.c: Likewise.
        * tests/gen_tests.in (recv-MSG_TRUNC, recvfrom-MSG_TRUNC): New entries.
        * tests/pure_executables.list: Add recv-MSG_TRUNC and
        recvfrom-MSG_TRUNC.
        * tests/.gitignore: Likewise.

2019-08-02  Jeremy Kerr  <jk@ozlabs.org>

        net: Fix access beyond tracee buffer for MSG_TRUNC receives.
        The recv(), recvfrom() and recvmsg() calls allow a MSG_TRUNC flag, which
        indicates that the kernel should return the available size of an
        incoming message, rather than the received size.

        When strace-ing a truncated recv(), strace will try to access a
        return-value size area of the tracee's buffer, which may be larger than
        the actual buffer:

          $ obj/strace -e trace=recvfrom ~/tmp/recv-test
          recvfrom(3, "\1\2\3\4\0\0\0\0", 4, MSG_TRUNC, NULL, NULL) = 8

        If I add a non-readable guard page after the tracee's recv buffer, we
        see strace failing to read the vm area:

          $ obj/strace -e trace=recvfrom ~/tmp/recv-test+guard
          recvfrom(3, obj/strace: umoven: short read (4 < 8) @0x7f0b0d7ddffc
          0x7f0b0d7ddffc, 4, MSG_TRUNC, NULL, NULL) = 8

        This change restricts the maximum read size to the size of the tracee's
        actual buffer.

        The recvmsg() handler will do the right thing by using the .iov_len
        data, so no change is required there.

        * net.c (sys_recv, sys_recvfrom): Clamp maximum sockbuf size.

2019-07-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add xlat description structure.
        Rename struct xlat to struct xlat_data and make struct xlat an xlat
        descriptor that contains various information about xlat.
        So far it's the type and the number of items.

        As a result, xlookup/printxval now have enough information for handling
        xlat depending on its type, so *index/*_search API is not needed any
        longer.

        * xlat.h (struct xlat_data): Rename from struct xlat.
        (struct xlat): New type definition.
        * xlat.c (xlat_search, printxval_sized, printxval_searchn_ex, xlat_idx,
        printxval_indexn_ex, printxval_dispatch_ex): Remove.
        (xlookup): Handle xlat_data based on xlat type.
        (xlat_search_eq_or_less, xlookup_le): New functions.
        (sprintflags_ex, printflags_ex): Update.
        * xlat/gen.sh (gen_header): Add handling for #sorted, generate new
        struct xlat descriptor.
        * defs.h (arp_hardware_types_size, ethernet_protocols_size,
        inet_protocols_size, evdev_abs_size, xlat_search, xlat_idx,
        printxval_searchn_ex, printxval_searchn, printxval_search,
        printxval_search_ex, printxval_indexn_ex, printxval_indexn,
        printxval_index, printxval_index_ex, printxval_dispatch_ex,
        printxval_dispatch): Remove.
        (enum xlat_style_private_flag_bits): Remove PAF_INDEX_XLAT_SORTED_BIT
        and PAF_INDEX_XLAT_VALUE_INDEXED_BIT.
        (enum xlat_style_private_flag): Remove PAF_INDEX_XLAT_SORTED and
        PAF_INDEX_XLAT_VALUE_INDEXED.
        (print_array_ex): Remove index_xlat_size argument.
        (xlookup_le): New declaration.
        (printxval_ex): New macro.
        * dyxlat.c (struct dyxlat): Remove used field (use xlat.size instead),
        embed struct xlat, add pointer to struct xlat_data.
        (MARK_END): Remove.
        (dyxlat_alloc, dyxlat_free, dyxlat_get, dyxlat_add_pair): Update in
        accordance with the structure changes.
        * evdev.c (evdev_abs_size): Remove.
        (keycode_ioctl): Use printxval instead of printxval_index.
        (decode_bitset): Remove.
        (decode_bitset_): Rename to decode_bitset, remove decode_nr_size and xt
        arguments, call printxval instead of printxval_dispatch.
        (bit_ioctl, evdev_read_ioctl): Do not pass xlat type to decode_bitset.
        * fsconfig.c (SYS_FUNC(fsconfig)): Use printxval instead of
        printxval_index.
        * print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED,
        PRINT_FIELD_XVAL_INDEX): Remove.
        * nlattr.h (struct decode_nla_xlat_opts): Remove xlat_size and xt
        fields.
        * nlattr.c (decode_nla_meminfo): Do not pass
        PAF_INDEX_XLAT_VALUE_INDEXED flag and netlink_sk_meminfo_indices size
        in a print_array_ex call.
        (decode_nla_xval): Call printxval_ex instead of printxval_dispatch_ex.
        (decode_nla_ether_proto, decode_nla_ip_proto): Do not pass xlat_size and
        xt fields in opts.
        (decode_nla_flags): Remove XT_INDEXED unsupported warning.
        * process.c (struct_user_offsets_data): Rename from struct_user_offsets,
        change type to struct xlat_data[].
        (struct_user_offsets): New xlat description.
        (print_user_offset_addr): Rewrite using xlookup_le.
        * util.c (print_array_ex): Remove index_xlat_size argument, simply call
        printxval_ex for index printing.
        * aio.c (tprint_lio_opcode): Use printxval_ex instead of
        printxval_indexn_ex.
        * bpf.c: Use printxval instead of printxval_index; use PRINT_FIELD_XVAL
        instead of PRINT_FIELD_XVAL_INDEX.
        * bpf_filter.c (print_bpf_filter_code): Use printxval instead of
        printxval_index.
        * ioctl.c (evdev_decode_number): Use printxval instead of
        printxval_indexn.
        * kvm.c (kvm_ioctl_decode_check_extension): Use printxval64 instead of
        printxval_index.
        (kvm_ioctl_run_attach_auxstr): Use xlookup instead of xlat_idx.
        * net.c: Use printxval instead of printxval_search/printxval_index, use
        printxval_ex instead of printxval_searchn_ex.
        * netlink.c (get_fd_nl_family): Rewrite using xlat descriptor structure.
        * netlink_packet_diag.c (decode_packet_diag_msg): Use PRINT_FIELD_XVAL
        instead of PRINT_FIELD_XVAL_SORTED_SIZED.
        * netlink_smc_diag.c (decode_smc_diag_shutdown): Remove ARRSZ_PAIR
        wrapper.
        (decode_smc_diag_fallback): Use printxval_ex instead of
        printxval_search_ex.
        (decode_smc_diag_msg): Use PRINT_FIELD_XVAL instead of
        PRINT_FIELD_XVAL_INDEX.
        * print_statfs.c (print_statfs_type): Use printxval instead of
        printxval_search.
        * ptrace_syscall_info.c (print_ptrace_syscall_info): Use
        PRINT_FIELD_XVAL instead of PRINT_FIELD_XVAL_INDEX.
        * rtnl_link.c (decode_ifla_inet6_flags, decode_ifla_inet6_agm):
        Likewise.
        (decode_nla_tun_type, decode_ifla_xdp_attached): Remove xlat_size,
        xt fields.
        (decode_ifla_inet_conf, decode_ifla_inet6_conf, decode_ifla_inet6_stats,
        decode_ifla_inet6_icmp6_stats): Remove PAF_INDEX_XLAT_VALUE_INDEXED flag
        and ARRSZ_PAIR wrapper in print_array_ex calls.
        (decode_ifinfomsg): Use PRINT_FIELD_XVAL instead of
        PRINT_FIELD_XVAL_SORTED_SIZED.
        * rtnl_route.c (decode_nla_rt_proto): Use printxval instead of
        printxval_search.
        * sock.c (print_ifreq): Use PRINT_FIELD_XVAL instead of
        PRINT_FIELD_XVAL_SORTED_SIZED.
        * sockaddr.c (print_sockaddr_data_ll, print_sockaddr_data_bt,
        print_sockaddr): Use printxval instead of printxval_search and
        printxval_index.
        * time.c (getitimer, osf_getitimer, setitimer, osf_setitimer,
        printclockname): Use printxval instead of printxval_index.
        (do_adjtimex): Use xlookup instead of xlat_idx.
        * tests/btrfs.c: Update xlat handling, use struct xlat_data instead of
        struct xlat for XLAT() arrays.
        * tests/ioctl_block.c: Likewise.
        * tests/ioctl_rtc.c: Likewise.
        * tests/printflags.c: Likewise.
        * tests/printxval.c: Likewise.
        * tests/prlimit64.c: Likewise.
        * tests/setrlimit.c: Likewise.
        * tests/socketcall.c: Likewise.
        * tests/xgetrlimit.c: Likewise.
        * tests/xstatfsx.c: Likewise.
        * xlat/af_packet_versions.in: Add #value_indexed.
        * xlat/arp_hardware_types.in: Add #sorted.
        * xlat/ax25_protocols.in: Likewise.
        * xlat/bluetooth_l2_cid.in: Likewise.
        * xlat/bluetooth_l2_psm.in: Likewise.
        * xlat/ethernet_protocols.in: Likewise.
        * xlat/evdev_ff_types.in: Likewise.
        * xlat/fsmagic.in: Likewise.
        * xlat/hw_breakpoint_type.in: Likewise.
        * xlat/iffflags.in: Likewise.
        * xlat/inet6_if_flags.in: Likewise.
        * xlat/inet_protocols.in: Likewise.
        * xlat/msgctl_flags.in: Likewise.
        * xlat/perf_hw_cache_id.in: Likewise.
        * xlat/perf_hw_cache_op_id.in: Likewise.
        * xlat/perf_hw_cache_op_result_id.in: Likewise.
        * xlat/perf_hw_id.in: Likewise.
        * xlat/perf_sw_ids.in: Likewise.
        * xlat/perf_type_id.in: Likewise.
        * xlat/routing_protocols.in: Likewise.
        * xlat/semctl_flags.in: Likewise.
        * xlat/shmctl_flags.in: Likewise.
        * xlat/smc_decl_codes.in: Likewise.
        * xlat/sock_ax25_options.in: Likewise.
        * xlat/sock_bluetooth_options.in: Likewise.
        * xlat/sock_dccp_options.in: Likewise.
        * xlat/sock_tipc_options.in: Likewise.
        * xlat/socketlayers.in: Likewise.
        * xlat/v4l2_control_classes.in: Likewise.
        * xlat/v4l2_pix_fmts.in: Likewise.
        * xlat/v4l2_sdr_fmts.in: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        NEWS: retroactively mention that -z/-Z fix addresses Debian bug #176376.

        xlat/v4l2_pix_fmts.in: work around V4L2_PIX_FMT_BGRA444 value change.
        * xlat/v4l2_pix_fmts.in: Undefine V4L2_PIX_FMT_BGRA444 as it has changed
        its value in Linux commit v5.2-rc5-403-g22be8233b34f.

2019-07-18  Anatoly Pugachev  <matorola@gmail.com>

        README-configure: recommend 'make -k check' instead of 'make check'
        * maint/install.texi: Replace 'make check' with 'make -k check'.
        * README-configure: Regenerate.

2019-07-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Generalise hardware address printing.
        * defs.h [!MAX_ADDR_LEN] (MAX_ADDR_LEN): New macro.
        (sprint_hwaddr): New declaration.
        (print_hwaddr): New inline function, a wrapper for sprint_hwaddr.
        * print_fields.h (PRINT_FIELD_HWADDR_SZ): New macro.
        * print_mac.c: Include "xlat/arp_hardware_types.h" under
        XLAT_MACROS_ONLY.
        [!MAX_ADDR_LEN] (MAX_ADDR_LEN): Remove.
        (sprint_hwaddr): New function.
        * sock.c (print_ifreq) <SIOCSIFHWADDR, SIOCGIFHWADDR>: Print hardware
        address using PRINT_FIELD_HWADDR_SZ.

        open: implement sprint_open_modes using sprintflags_ex.
        * defs.h (sprintflags_ex): Add "sep" argument.
        (sprintflags): Pass '\0' in "sep" argument.
        * open.c (sprint_open_modes): Use sprintflags_ex for printing
        open_mode_flags.
        * xlat.c (sprintflags_ex): Add "sep" argument, use it as initial
        separator (if not nul).

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently define __NR_* constants.
        Include <asm/unistd.h> from "scno.h", include "scno.h" instead of
        <asm/unistd.h>, do not include <asm/unistd.h> where "scno.h" is already
        included.

        * scno.head: Include <asm/unistd.h>.
        * clone.c: Include "scno.h" instead of <asm/unistd.h>.
        * syscall.c: Likewise.
        * tests/_newselect.c: Likewise.
        * tests/accept.c: Likewise.
        * tests/accept_compat.h: Likewise.
        * tests/access.c: Likewise.
        * tests/acct.c: Likewise.
        * tests/aio.c: Likewise.
        * tests/alarm.c: Likewise.
        * tests/answer.c: Likewise.
        * tests/attach-f-p.c: Likewise.
        * tests/brk.c: Likewise.
        * tests/chmod.c: Likewise.
        * tests/chown.c: Likewise.
        * tests/chown32.c: Likewise.
        * tests/chroot.c: Likewise.
        * tests/clock_adjtime.c: Likewise.
        * tests/clock_nanosleep.c: Likewise.
        * tests/clock_xettime.c: Likewise.
        * tests/creat.c: Likewise.
        * tests/delay.c: Likewise.
        * tests/delete_module.c: Likewise.
        * tests/dev-yy.c: Likewise.
        * tests/dup2.c: Likewise.
        * tests/dup3.c: Likewise.
        * tests/epoll_create.c: Likewise.
        * tests/epoll_create1.c: Likewise.
        * tests/epoll_ctl.c: Likewise.
        * tests/epoll_pwait.c: Likewise.
        * tests/epoll_wait.c: Likewise.
        * tests/eventfd.c: Likewise.
        * tests/faccessat.c: Likewise.
        * tests/fadvise64.c: Likewise.
        * tests/fadvise64_64.c: Likewise.
        * tests/fallocate.c: Likewise.
        * tests/fanotify_init.c: Likewise.
        * tests/fanotify_mark.c: Likewise.
        * tests/fchdir.c: Likewise.
        * tests/fchmod.c: Likewise.
        * tests/fchmodat.c: Likewise.
        * tests/fchown.c: Likewise.
        * tests/fchown32.c: Likewise.
        * tests/fchownat.c: Likewise.
        * tests/fcntl.c: Likewise.
        * tests/fcntl64.c: Likewise.
        * tests/fdatasync.c: Likewise.
        * tests/file_handle.c: Likewise.
        * tests/flock.c: Likewise.
        * tests/fstat.c: Likewise.
        * tests/fstat64.c: Likewise.
        * tests/fstatat64.c: Likewise.
        * tests/fstatfs.c: Likewise.
        * tests/fstatfs64.c: Likewise.
        * tests/fsync.c: Likewise.
        * tests/ftruncate.c: Likewise.
        * tests/ftruncate64.c: Likewise.
        * tests/futex.c: Likewise.
        * tests/futimesat.c: Likewise.
        * tests/get_mempolicy.c: Likewise.
        * tests/get_sigset_size.c: Likewise.
        * tests/getcpu.c: Likewise.
        * tests/getcwd.c: Likewise.
        * tests/getdents.c: Likewise.
        * tests/getdents64.c: Likewise.
        * tests/getegid32.c: Likewise.
        * tests/geteuid32.c: Likewise.
        * tests/getgid.c: Likewise.
        * tests/getgid32.c: Likewise.
        * tests/getgroups.c: Likewise.
        * tests/getgroups32.c: Likewise.
        * tests/getpgrp.c: Likewise.
        * tests/getpid.c: Likewise.
        * tests/getrandom.c: Likewise.
        * tests/getresgid.c: Likewise.
        * tests/getresgid32.c: Likewise.
        * tests/getresuid.c: Likewise.
        * tests/getresuid32.c: Likewise.
        * tests/getrlimit.c: Likewise.
        * tests/getrusage.c: Likewise.
        * tests/gettid.c: Likewise.
        * tests/getuid.c: Likewise.
        * tests/getuid32.c: Likewise.
        * tests/getxxid.c: Likewise.
        * tests/init_module.c: Likewise.
        * tests/inject-nf.c: Likewise.
        * tests/inotify.c: Likewise.
        * tests/inotify_init1.c: Likewise.
        * tests/ioctl_inotify.c: Likewise.
        * tests/ioctl_loop.c: Likewise.
        * tests/ioctl_perf.c: Likewise.
        * tests/ioctl_uffdio.c: Likewise.
        * tests/ioperm.c: Likewise.
        * tests/iopl.c: Likewise.
        * tests/ioprio.c: Likewise.
        * tests/ipc.c: Likewise.
        * tests/ipc_msgbuf.c: Likewise.
        * tests/kexec_load.c: Likewise.
        * tests/keyctl.c: Likewise.
        * tests/kill.c: Likewise.
        * tests/ksysent.c: Likewise.
        * tests/lchown.c: Likewise.
        * tests/lchown32.c: Likewise.
        * tests/libmmsg.c: Likewise.
        * tests/libsocketcall.c: Likewise.
        * tests/link.c: Likewise.
        * tests/linkat.c: Likewise.
        * tests/llseek.c: Likewise.
        * tests/localtime.c: Likewise.
        * tests/lookup_dcookie.c: Likewise.
        * tests/lseek.c: Likewise.
        * tests/lstat.c: Likewise.
        * tests/lstat64.c: Likewise.
        * tests/madvise.c: Likewise.
        * tests/migrate_pages.c: Likewise.
        * tests/mkdir.c: Likewise.
        * tests/mkdirat.c: Likewise.
        * tests/mknod.c: Likewise.
        * tests/mknodat.c: Likewise.
        * tests/mlock.c: Likewise.
        * tests/modify_ldt.c: Likewise.
        * tests/move_pages.c: Likewise.
        * tests/mq_sendrecv.c: Likewise.
        * tests/newfstatat.c: Likewise.
        * tests/nsyscalls.c: Likewise.
        * tests/old_mmap.c: Likewise.
        * tests/oldfstat.c: Likewise.
        * tests/oldlstat.c: Likewise.
        * tests/oldselect-efault.c: Likewise.
        * tests/oldselect.c: Likewise.
        * tests/oldstat.c: Likewise.
        * tests/open.c: Likewise.
        * tests/openat.c: Likewise.
        * tests/osf_utimes.c: Likewise.
        * tests/pause.c: Likewise.
        * tests/perf_event_open.c: Likewise.
        * tests/perf_event_open_nonverbose.c: Likewise.
        * tests/pipe.c: Likewise.
        * tests/pipe2.c: Likewise.
        * tests/poll.c: Likewise.
        * tests/ppoll.c: Likewise.
        * tests/prctl-arg2-intptr.c: Likewise.
        * tests/prctl-dumpable.c: Likewise.
        * tests/prctl-no-args.c: Likewise.
        * tests/prctl-pdeathsig.c: Likewise.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/prctl-securebits.c: Likewise.
        * tests/prctl-spec-inject.c: Likewise.
        * tests/prctl-tid_address.c: Likewise.
        * tests/prctl-tsc.c: Likewise.
        * tests/prlimit64.c: Likewise.
        * tests/process_vm_readv.c: Likewise.
        * tests/process_vm_writev.c: Likewise.
        * tests/pselect6.c: Likewise.
        * tests/ptrace.c: Likewise.
        * tests/qual_inject-error-signal.c: Likewise.
        * tests/qual_inject-retval.c: Likewise.
        * tests/qual_inject-signal.c: Likewise.
        * tests/quotactl-xfs.c: Likewise.
        * tests/quotactl.c: Likewise.
        * tests/read-write.c: Likewise.
        * tests/readahead.c: Likewise.
        * tests/readdir.c: Likewise.
        * tests/readlink.c: Likewise.
        * tests/readlinkat.c: Likewise.
        * tests/reboot.c: Likewise.
        * tests/rename.c: Likewise.
        * tests/renameat.c: Likewise.
        * tests/request_key.c: Likewise.
        * tests/rmdir.c: Likewise.
        * tests/rt_sigpending.c: Likewise.
        * tests/rt_sigprocmask.c: Likewise.
        * tests/rt_sigsuspend.c: Likewise.
        * tests/rt_sigtimedwait.c: Likewise.
        * tests/rt_tgsigqueueinfo.c: Likewise.
        * tests/s390_guarded_storage.c: Likewise.
        * tests/s390_pci_mmio_read_write.c: Likewise.
        * tests/s390_runtime_instr.c: Likewise.
        * tests/s390_sthyi.c: Likewise.
        * tests/sched_get_priority_mxx.c: Likewise.
        * tests/sched_rr_get_interval.c: Likewise.
        * tests/sched_xetaffinity.c: Likewise.
        * tests/sched_xetattr.c: Likewise.
        * tests/sched_xetparam.c: Likewise.
        * tests/sched_xetscheduler.c: Likewise.
        * tests/sched_yield.c: Likewise.
        * tests/seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter.c: Likewise.
        * tests/seccomp-strict.c: Likewise.
        * tests/seccomp_get_action_avail.c: Likewise.
        * tests/select.c: Likewise.
        * tests/sendfile.c: Likewise.
        * tests/sendfile64.c: Likewise.
        * tests/setdomainname.c: Likewise.
        * tests/setfsgid.c: Likewise.
        * tests/setfsgid32.c: Likewise.
        * tests/setfsuid.c: Likewise.
        * tests/setfsuid32.c: Likewise.
        * tests/setgid.c: Likewise.
        * tests/setgid32.c: Likewise.
        * tests/setgroups.c: Likewise.
        * tests/setgroups32.c: Likewise.
        * tests/sethostname.c: Likewise.
        * tests/setns.c: Likewise.
        * tests/setregid.c: Likewise.
        * tests/setregid32.c: Likewise.
        * tests/setresgid.c: Likewise.
        * tests/setresgid32.c: Likewise.
        * tests/setresuid.c: Likewise.
        * tests/setresuid32.c: Likewise.
        * tests/setreuid.c: Likewise.
        * tests/setreuid32.c: Likewise.
        * tests/setrlimit.c: Likewise.
        * tests/setuid.c: Likewise.
        * tests/setuid32.c: Likewise.
        * tests/sigaction.c: Likewise.
        * tests/signal.c: Likewise.
        * tests/signalfd4.c: Likewise.
        * tests/sigpending.c: Likewise.
        * tests/sigprocmask.c: Likewise.
        * tests/sigreturn.c: Likewise.
        * tests/sigsuspend.c: Likewise.
        * tests/socketcall.c: Likewise.
        * tests/splice.c: Likewise.
        * tests/stack-fcall-3.c: Likewise.
        * tests/stat.c: Likewise.
        * tests/stat64.c: Likewise.
        * tests/statfs.c: Likewise.
        * tests/statfs64.c: Likewise.
        * tests/status-none-threads.c: Likewise.
        * tests/status-unfinished-threads.c: Likewise.
        * tests/statx.c: Likewise.
        * tests/swap.c: Likewise.
        * tests/sxetmask.c: Likewise.
        * tests/symlink.c: Likewise.
        * tests/symlinkat.c: Likewise.
        * tests/sync.c: Likewise.
        * tests/sync_file_range.c: Likewise.
        * tests/sync_file_range2.c: Likewise.
        * tests/syslog.c: Likewise.
        * tests/tee.c: Likewise.
        * tests/threads-execve.c: Likewise.
        * tests/time.c: Likewise.
        * tests/timer_create.c: Likewise.
        * tests/timer_xettime.c: Likewise.
        * tests/timerfd_xettime.c: Likewise.
        * tests/times-fail.c: Likewise.
        * tests/times.c: Likewise.
        * tests/truncate.c: Likewise.
        * tests/truncate64.c: Likewise.
        * tests/ugetrlimit.c: Likewise.
        * tests/umount.c: Likewise.
        * tests/umount2.c: Likewise.
        * tests/umoven-illptr.c: Likewise.
        * tests/umovestr-illptr.c: Likewise.
        * tests/uname.c: Likewise.
        * tests/unix-pair-send-recv.c: Likewise.
        * tests/unlink.c: Likewise.
        * tests/unlinkat.c: Likewise.
        * tests/unshare.c: Likewise.
        * tests/ustat.c: Likewise.
        * tests/utime.c: Likewise.
        * tests/utimensat.c: Likewise.
        * tests/utimes.c: Likewise.
        * tests/vhangup.c: Likewise.
        * tests/vmsplice.c: Likewise.
        * tests/waitid.c: Likewise.
        * tests/waitpid.c: Likewise.
        * tests/xet_robust_list.c: Likewise.
        * tests/xet_thread_area_x86.c: Likewise.
        * tests/xetitimer.c: Likewise.
        * tests/xetpgid.c: Likewise.
        * tests/xetpriority.c: Likewise.
        * tests/xettimeofday.c: Likewise.
        * strace.c: Do not include <asm/unistd.h>.
        * ucopy.c: Likewise.
        * tests/add_key.c: Likewise.
        * tests/aio_pgetevents.c: Likewise.
        * tests/bpf-obj_get_info_by_fd.c: Likewise.
        * tests/bpf.c: Likewise.
        * tests/copy_file_range.c: Likewise.
        * tests/execveat.c: Likewise.
        * tests/finit_module.c: Likewise.
        * tests/fsconfig.c: Likewise.
        * tests/fsmount.c: Likewise.
        * tests/fsopen.c: Likewise.
        * tests/fspick.c: Likewise.
        * tests/getegid.c: Likewise.
        * tests/geteuid.c: Likewise.
        * tests/getppid.c: Likewise.
        * tests/inotify_init.c: Likewise.
        * tests/io_uring_enter.c: Likewise.
        * tests/io_uring_register.c: Likewise.
        * tests/io_uring_setup.c: Likewise.
        * tests/kcmp.c: Likewise.
        * tests/kern_features.c: Likewise.
        * tests/kernel_version.c: Likewise.
        * tests/kexec_file_load.c: Likewise.
        * tests/maybe_switch_current_tcp.c: Likewise.
        * tests/mbind.c: Likewise.
        * tests/membarrier.c: Likewise.
        * tests/memfd_create.c: Likewise.
        * tests/mlock2.c: Likewise.
        * tests/move_mount.c: Likewise.
        * tests/open_tree.c: Likewise.
        * tests/pidfd_send_signal.c: Likewise.
        * tests/pkey_alloc.c: Likewise.
        * tests/pkey_free.c: Likewise.
        * tests/pkey_mprotect.c: Likewise.
        * tests/preadv2-pwritev2.c: Likewise.
        * tests/ptrace_syscall_info.c: Likewise.
        * tests/remap_file_pages.c: Likewise.
        * tests/renameat2.c: Likewise.
        * tests/riscv_flush_icache.c: Likewise.
        * tests/set_mempolicy.c: Likewise.
        * tests/test_printstrn.c: Likewise.
        * tests/test_ucopy.c: Likewise.
        * tests/userfaultfd.c: Likewise.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: remove syscall numbers range [1024...1079] from syscallent.h.
        Remove support for decoding syscalls in range [1024...1079] on aarch64
        as this range has never been implemented in mainline kernel releases.

        * linux/aarch64/syscallent.h [1024...1079]: Remove.
        * NEWS: Mention this change.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip socketcall test on arm eabi.
        arm eabi has no socketcall even if __NR_socketcall is defined.

        * tests/socketcall.c: Conditionalize on !__ARM_EABI__ along with
        __NR_socketcall.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify statx test.
        Do not assume that <linux/stat.h> defines struct statx.

        * configure.ac (AC_CHECK_TYPES): Check for struct statx in
        <linux/stat.h>.
        * tests/statx.c: Conditionalize on HAVE_STRUCT_STATX along with
        __NR_statx.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify old_mmap test.
        Do not assume that old mmap syscall is implemented in the kernel
        when __NR_mmap is defined.

        * tests/alarm.c (main): Print mmap return code using sprintrc,
        do not invoke mprotect if mmap is not implemented.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify alarm test.
        Do not assume that alarm syscall always succeeds.

        * tests/alarm.c (main): Use sprintrc.

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add ability to pass style to printxval_index_ex macro.
        So it matches its name.

        * defs.h (printxval_index_ex): Add style__ macro, pass it as the 5th
        argument to the printxval_indexn_ex call.

2019-07-16  Bharath Vedartham  <linux.bhar@gmail.com>

        tests: extend coverage of syslog tests.
        The current syslog test covers only those cases where the type parameter
        is one of SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL,
        SYSLOG_ACTION_READ_CLEAR as per codecov.

        Add test case to cover the default case.

        * tests/syslog.c (SYSLOG_ACTION_SIZE_BUFFER): New macro.
        (main): Check SYSLOG_ACTION_SIZE_BUFFER decoding.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        aio: assorted iocb decoder updates.
        * xlat/aio_iocb_flags.in: New file.
        * defs.h (pollflags, rwf_flags): New declarations.
        * configure.ac (AC_CHECK_MEMBERS): Check for aio_flags and aio_rw_flags
        fields of struct iocb.
        * aio.c [HAVE_STRUCT_IOCB_AIO_FLAGS]: Include "xlat/aio_iocb_flags.h".
        (AIO_RW_FLAGS_FIELD): New macro definition, defined based on the
        presence of HAVE_STRUCT_IOCB_AIO_RW_FLAGS macro.
        (iocb_sub): Add SUB_POLL.
        (tprint_lio_opcode): Change IOCB_CMD_POLL subtype to SUB_POLL.
        (print_common_flags): Conditionalize on HAVE_STRUCT_IOCB_AIO_FLAGS
        instead of IOCB_FLAG_RESFD.  Print aio_flags using aio_iocb_flags xlat.
        (print_iocb_header): Always print aio_data.  Print aio_rw_flags if it
        is non-zero.  Print aio_reqprio based on the presence of
        IOCB_FLAG_IOPRIO flag in aio_flags (use print_ioprio if it set and print
        as a signed integer otherwise).
        (print_iocb): Decode SUB_POLL subtype.
        * tests/aio.c: Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioprio: add print_ioprio function.
        That respects xlat style settings.

        * ioprio.c (print_ioprio): New function.
        * defs.h (print_ioprio): New declaration.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: serialize bpf-obj_get_info_by_fd based executables.
        Concurrent execution of many bpf-obj_get_info_by_fd based tests may
        lead to a temporary resource shortage that causes them to fail with
        the following error diagnostics:

                BPF_MAP_CREATE failed: Operation not permitted

        Avoid this issue by serializing execution of all relevant tests.

        * tests/lock_file.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add lock_file.c
        * tests/tests.h (lock_file_by_dirname): New prototype.
        * tests/bpf-obj_get_info_by_fd.c (main): Call lock_file_by_dirname
        to obtain an exclusive lock on bpf-obj_get_info_by_fd executable.

        References: https://github.com/strace/strace/issues/74
        References: https://github.com/strace/strace/issues/105

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build and run on alpha with fresh kernel headers.
        Fix tests on alpha with Linux kernel headers containing commits
        v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~1.

        * tests/getegid.c: Include "scno.h".
        (main): Use sprintrc.
        * tests/geteuid.c: Likewise.
        * tests/getppid.c: Likewise.
        * tests/getgid.c [__NR_getgid == __NR_getxgid]: Skip.
        * tests/getuid.c [__NR_getuid == __NR_getxuid]: Skip.
        * tests/getpid.c [__NR_getpid == __NR_getxpid]: Skip.
        * tests/umount2.c (__NR_umount2): Remove.
        (TEST_SYSCALL_NR): New macro.
        (main): Use it instead of __NR_umount2.
        * tests/ksysent.sed: Remove new __NR_get[gup]id aliases to traditional
        __NR_getx[gup]id names (on alpha).
        Prioritize __NR_umount over __NR_umount2, __NR_osf_shmat over __NR_shmat.
        * NEWS: Mention these fixes.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        copyright-year-gen, file-date-gen: enhance error diagnostics.
        * copyright-year-gen: Prefix error message with the script name.
        * file-date-gen: Likewise.  Bail out in case of invalid date.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: honor exit status of commands run by m4_esyscmd.
        If the command run by m4_esyscmd exits with non-zero exit status,
        autom4te shall terminate.

        * m4/st_esyscmd_s.m4: New file.
        * configure.ac: Replace m4_esyscmd with st_esyscmd_s.

        References: https://github.com/strace/strace/issues/105

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: test evdev bitset decoding more thoroughly.
        * tests/ioctl_evdev-success-v.test: Inject various values.
        * tests/ioctl_evdev-success.test: Likewise.
        * tests/ioctl_evdev-success.c (NUM_WORDS): New macro.
        (struct evdev_check): Constify arg_ptr and print_arg args.
        (invoke_test_syscall, test_evdev, print_input_absinfo, print_input_id,
        print_mtslots): Add const qualifiers.
        (print_getbit): Add const qualifiers, rewrite to expect trailing NULL
        in the string array instead of leading string count.
        (main): Set size for ev_more, ev_less, ev_zero arrays; replace leading
        count element in ev_more_str, ev_less_str, ev_zero_str with trailing
        NULL; replace ev_more_str and ev_less_str with ev_more_str_2/ev_less_str_2
        and ev_more_str_3/ev_less_str_3 that differ by presence of flags that reside
        beyond first two bytes; add static and const qualifiers where possible;
        add key/key_sts_8/key_str_16 values; update a to provide either ev_more_str_2
        or ev_more_str_3 and either key_str_8 or key_str_16 depending on inject_retval
        value.

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: fix array size calculation in decode_bitset_
        max_nr is in bits (as it is a number of flags), result is in bytes, and
        the array allocation has to be in personality words.

        There's still an open question, however, what to do on big-endian
        architectures when a non-divisible-by-4 value is returned.

        * evdev.c (decode_bitset_): Declare size_bits, initialise it and use it
        later instead of size; round up size by personality's word boundary.

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: avoid bit vector decoding on non-successful and 0 return codes.
        Reported by Clang.

            strace/evdev.c:157:3: note: The value 0 is assigned to 'size'
            #                size = tcp->u_rval * 8;
            #                ^~~~~~~~~~~~~~~~~~~~~~
            strace/evdev.c:158:2: warning: Declared variable-length array (VLA)
            has zero size
            #        char decoded_arg[size];
            #        ^

        * evdev.c (decode_bitset_): Bail out before decoded_arg VLA definition.

2019-07-13  Chen Jingpiao  <chenjingpiao@gmail.com>

        filter_qualify: export trace_set set.
        In preparation for seccomp-assisted syscall filtering, export
        trace_set set, which will be used to derive the BPF program.

        * filter_qualify.c (trace_set): Remove static qualifier.
        * number_set.h (trace_set): New declaration.

2019-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.2-1.
        * strace.spec.in: Likewise.

2019-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.2 release.
        * NEWS: Update for 5.2 release.

        Update .mailmap.
        * .mailmap: Add both email addresses of Zhibin Li to avoid duplication
        in CREDITS file.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        maint/update_copyright_years.sh: take all commits into account.
        This helps to avoid accidental shrinking of copyright years range.

        * maint/update_copyright_years.sh: Take all commits into account
        to find copyright years of the earliest and the latest commit.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

        tests: check status qualifier.
        This change adds 8 test cases for -e status with unfinished, failed,
        none, successful, detached, and the whole set.  The test cases for
        failed, successful, and the whole set use chdir(2).  Threaded test cases
        for unfinished and none rely on a child thread execve'ing the lead
        thread.  There are additional single-threaded tests for status=none and
        status=unfinished.  The test case for detached interrupts strace while
        attached to a sleeping process.

        * tests/status.c: New file.
        * tests/status-all.c: Likewise.
        * tests/status-failed.c: Likewise.
        * tests/status-detached.expected: Likewise.
        * tests/status-none.c: Likewise.
        * tests/status-none-threads.c: Likewise.
        * tests/status-successful.c: Likewise.
        * tests/status-unfinished-threads.c: Likewise.
        * tests/status-unfinished.c: Likewise.
        * tests/status-detached.test: New test.
        * tests/status-none-threads.test: Likewise.
        * tests/status-unfinished-threads.test: Likewise.
        * tests/tests.h (test_status_chdir): New prototype.
        * tests/.gitignore: Add status-all, status-failed, status-none,
        status-none-threads, status-successful, status-unfinished,
        and status-unfinished-threads.
        * tests/gen_tests.in: Add status-all, status-failed, status-successful,
        status-none, and status-unfinished.
        * tests/pure_executables.list: Likewise.
        * tests/Makefile.am (libtests_a_SOURCES): Add status.c.
        (check_PROGRAMS): Add status-none-threads and status-unfinished-threads.
        (status_none_threads_LDADD, status_unfinished_threads_LDADD): New
        variables.
        (MISC_TESTS): Add status-detached.test, status-none-threads.test, and
        status-unfinished-threads.test.
        (EXTRA_DIST): Add status-detached.expected.

        Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

        Implement -e status=set option.
        The status qualifier enables filtering based on the return status of
        syscalls.  -z and -Z become aliases for -e status=successful and -e
        status=failed.  Staged output is only enabled when at least one status
        is filtered, that is, when the set is incomplete.

        * signal.c (popcount32): Move ...
        * defs.h (popcount32): ... here.
        (not_failing_only, failing_only): Remove.
        * filter_qualify.c (status_set): New number_set variable.
        (statuses): New variable for names of statuses.
        (statusstr_to_uint, qualify_status): New functions.
        (qual_options): Handle status qualifier.
        * number_set.c (get_number_setbit, is_complete_set): New functions.
        * number_set.h (is_complete_set): New prototype.
        (status_t): New enumeration for statuses.
        (status_set): New prototype.
        * strace.1.in: Document new status qualifier.
        * strace.c (not_failing_only, failing_only): Remove.
        (droptcb): Handle status=detached option.
        (init): Handle new status qualifier, set status_set variable on -z and -Z
        options, warn on -zZ and -Zz, use is_complete_set.
        (maybe_switch_tcbs): Reopen memstream after tcb switch.
        (print_event_exit): Handle status=unfinished option.
        * syscall.c (syscall_entering_trace): Use is_complete_set.
        (syscall_exiting_trace): Use is_complete_set, handle status=unavailable
        option.
        * NEWS: Mention this change.

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

        Stage output for -z and -Z options.
        -z and -Z options print only successful and failing syscalls respectively.
        However, failure of syscall is only known after syscall return.  Thus, we
        end up with something like this on, e.g., ENOENT:

          open("does_not_exist", O_RDONLY <unfinished ...>

        whereas the intended result is that the open(...) line is not shown at all.

        This change fixes this issue using open_memstream.  When either the -z or
        the -Z option is used, the output is staged in memory (using
        open_memstream) until we know the syscall return status.  If the
        open_memstream function is not available, these new options error out.

        Document -z and -Z options as new features since they have never worked
        properly before and were undocumented since commit v4.4.95~21.

        * stage_output.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_FUNCS): Add open_memstream.
        * defs.h (struct tcb): Add real_outf, memfptr, and memfloc fields for
        memstream.
        (strace_open_memstream, strace_close_memstream): New prototypes.
        * strace.1.in: Document -z and -Z options.
        * strace.c (usage): Mention -z and -Z options.
        (init): Error on -z and -Z options if open_memstream if unavailable.
        (maybe_switch_tcbs): Handle switch of memstream between tcbs.
        (printleader): Avoid marking staged syscalls as unfinished.
        * syscall.c (syscall_entering_trace): Open memstream.
        (syscall_exiting_trace): Filter failed syscalls if failing_only is set,
        handle raw(tcp) case.
        (print_syscall_resume): Avoid marking staged syscalls as resumed.
        * NEWS: Mention this change.

        Resolves: https://github.com/strace/strace/issues/49
        Resolves: https://github.com/strace/strace/issues/50
        Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

        Add -Z option to print only failing syscalls.
        Existing -z option prints only successful syscalls.
        This change adds a -Z option to print only failing syscalls.

        Both options will start to behave properly with the subsequent commit.

        * strace.c (init): Handle new -Z option.
        * defs.h (failing_only): New prototype.
        * syscall.c (failing_only): New variable.
        (syscall_exiting_trace): Ignore failed syscalls if failing_only is set.

        References: https://github.com/strace/strace/issues/50
        Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: rename ptrace_get_syscall_info to strace_get_syscall_info.
        ... to avoid potential conflict with future glibc versions.

        * syscall.c (ptrace_get_syscall_info): Rename to
        strace_get_syscall_info.  All callers updated.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build with cutting-edge glibc.
        Fix the following compilation error:

        In file included from statx.c:44:
        xstatx.c:47:16: error: ‘struct libc_statx’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

        * tests/xstatx.c (struct statx): New forward declaration.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        Fix misleading stray PTRACE_EVENT_EXEC diagnostics.
        If current_tcp is to be switched, entering(current_tcp) is irrelevant.

        * strace.c (maybe_switch_tcbs): Update comment.
        (dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke
        maybe_switch_current_tcp early, skip the check for a stray
        PTRACE_EVENT_EXEC if current_tcp was switched.
        * tests/maybe_switch_current_tcp.c: New file.
        * tests/pure_executables.list: Add maybe_switch_current_tcp.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (maybe_switch_current_tcp): New entry.
        * tests/Makefile.am (maybe_switch_current_tcp_LDADD): New variable.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor maybe_switch_tcbs.
        Change maybe_switch_tcbs to return NULL when no switching is necessary.
        Introduce maybe_switch_current_tcp as a thing wrapper around
        maybe_switch_tcbs.

        * strace.c (maybe_switch_current_tcp): New function.
        (dispatch_event): Use it instead of maybe_switch_tcbs, move comments
        and the os_release check before maybe_switch_tcbs invocation ...
        (maybe_switch_tcbs): ... here.  Change return value to NULL
        if no switching was performed.

2019-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify strace -k tests against link-time optimizer.
        Some distributions enable by default a link-time optimizer that
        mangles stack_fcall sample executables in a way that renders them
        unusable for test purposes.

        Robustify tests to defeat link-time optimizer.

        * tests/stack-fcall.h (f0, f1, f2, f3): Add second parameter.
        * tests/stack-fcall.c (main): Pass main as the second parameter to f0.
        * tests/stack-fcall-0.c (f0): Add second parameter f, pass the xor of it
        and f0 to f1.
        * tests/stack-fcall-1.c (f1): Add second parameter f, pass the xor of it
        and f1 to f2.
        * tests/stack-fcall-2.c (f2): Add second parameter f, pass the xor of it
        and f2 to f3.
        * tests/stack-fcall-3.c: Include <asm/unistd.h>.
        (f3): Add second parameter f, invoke __NR_gettid syscall with the xor
        of f and f3 as its argument.

2019-07-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ia64: optimize syscallent table.
        Use shuffle_scno since all valid syscall numbers start from 1024.

        * linux/syscallent_base_nr.h: New file.
        * linux/ia64/syscallent_base_nr.h: Likewise.
        * linux/ia64/shuffle_scno.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * linux/ia64/syscallent.h [SYSCALLENT_BASE_NR] (BASE_NR): Define to 0.
        * syscall.c: Include "syscallent_base_nr.h".
        * clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Use
        shuffle_scno.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        inotify: decode file descriptor returned by inotify_init.
        * inotify.c (SYS_FUNC(inotify_init)): New function.
        * linux/dummy.h (sys_inotify_init): Remove macro definition.
        * tests/inotify_init.c: New file.
        * tests/inotify_init-y.c: Likewise.
        * tests/inotify_init1-y.c: Likewise.
        * tests/inotify_init1.c [PRINT_PATHS]: Print inotify fd path.
        * tests/inotify_init-y.test: New test.
        * tests/.gitignore: Add inotify_init, inotify_init-y, inotify_init1-y.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (inotify_init, inotify_init1-y): New tests.
        * tests/Makefile.am (DECODER_TESTS): Add inotify_init-y.test.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_addr: decode IFA_RT_PRIORITY and IFA_TARGET_NETNSID.
        * rtnl_addr.c (ifaddrmsg_nla_decoders): Decode IFA_RT_PRIORITY as u32,
        decode IFA_TARGET_NETNSID as s32.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mips o32: print an error message when fetching of syscall arguments fails
        ... instead of failing silently.

        * linux/mips/get_syscall_args.c (get_syscall_args): Print an error message
        when umoven fails.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/smc_diag.h: update struct smc_diag_req definition.
        In accordance with Linux commit v4.19-rc8~22^2~17^2.

        * linux/smc_diag.h (struct smc_diag_req): Use an anonymous union
        for diag_fallback/diag_mode fields.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kvm: avoid bogus vcpu_info assignment in vcpu_register.
        Also reformat code a bit to make nesting a bit clearer.

        Reported by Clang.

        * kvm.c (vcpu_register): Do not assign vcpu_alloc result to vcpu_info
        as this value is not used afterwards in the function.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sync_file_range2: remove unneeded argn assignment.
        clang complains about it:

                 argn = printllval(tcp, "%lld", argn);
                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            sync_file_range2.c:43:2: note: Value stored to 'argn' is never read

        * sync_file_range2.c (SYS_FUNC(sync_file_range2)): Do not assign
        printllval result to argn for the second time.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: avoid infinite loop in subcalls parsing.
        clang complains about it, so it might be a good reason to refactor it
        into something more linear.

        * syscall.c (syscall_entering_decode): Put syscall subcall decoding
        before ipc/socket subcall decoding, remove the loop.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of mode argument of mbind and set_mempolicy syscalls
        * tests/mbind.c: Include "scno.h".
        (errstr): New variable.
        (k_mbind): New function.
        (out_str): New macro.
        (mpol_modes): New array.
        (main): Use it and k_mbind.
        * tests/set_mempolicy.c: Include "scno.h", do not include <errno.h>,
        "xlat.h" and "xlat/mpol_modes.h".
        (errstr): New variable.
        (k_set_mempolicy): New function.
        (out_str): New macro.
        (mpol_modes): New array.
        (print_nodes): Use it and k_set_mempolicy.
        (main): Likewise.
        * tests/mbind-Xabbrev.c: New file.
        * tests/mbind-Xraw.c: Likewise.
        * tests/mbind-Xverbose.c: Likewise.
        * tests/set_mempolicy-Xabbrev.c: Likewise.
        * tests/set_mempolicy-Xraw.c: Likewise.
        * tests/set_mempolicy-Xverbose.c: Likewise.
        * tests/gen_tests.in (mbind-Xabbrev, mbind-Xraw, mbind-Xverbose,
        set_mempolicy-Xabbrev, set_mempolicy-Xraw, set_mempolicy-Xverbose):
        New entries.
        * tests/pure_executables.list: Add mbind-Xabbrev, mbind-Xraw,
        mbind-Xverbose, set_mempolicy-Xabbrev, set_mempolicy-Xraw,
        and set_mempolicy-Xverbose.
        * tests/.gitignore: Likewise.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        numa: enhance decoding of mode argument of mbind and set_mempolicy syscalls
        Implement decoding of memory policy mode flags introduced by Linux
        kernel commits v2.6.26-rc1~990 and v2.6.26-rc1~988.

        * xlat/mpol_mode_flags.in: New file.
        * numa.c: Include "xlat/mpol_mode_flags.h".
        (print_mode): Print MPOL_MODE_FLAGS part of mode argument as flags.
        * NEWS: Mention this.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        numa: factor out printing of mode argument of mbind and set_mempolicy syscalls
        This printing is going to be extended by subsequent changes.

        * numa.c (print_mode): New function.
        (SYS_FUNC(mbind), SYS_FUNC(set_mempolicy)): Use it.

2019-07-04  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.2.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.2-rc7
        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.
        * NEWS: Mention this.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: refactor arch_set_error and arch_set_success.
        * linux/sparc/set_error.c (sparc_set_o0_psr): New function.
        (arch_set_error, arch_set_success): Use it.
        * linux/sparc64/set_error.c (sparc64_set_o0_tstate): New function.
        (arch_set_error, arch_set_success): Use it.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use
        When PTRACE_GET_SYSCALL_INFO is in use on sparc, psr is not loaded,
        so it has to be loaded explicitly before tampering.
        Likewise, when PTRACE_GET_SYSCALL_INFO is in use on sparc64, tstate
        is not loaded, so it has to be loaded explicitly before tampering.

        * linux/sparc/set_error.c (arch_set_error, arch_set_success): Explicitly
        call get_regs before changing psr when PTRACE_GET_SYSCALL_INFO is in use.
        * linux/sparc64/set_error.c (arch_set_error, arch_set_success):
        Explicitly call get_regs before changing tstate when
        PTRACE_GET_SYSCALL_INFO is in use.
        * NEWS: Mention this fix.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc: skip poking CCR if it is unchanged.
        * linux/powerpc/set_error.c (arch_set_r3_ccr): New function.
        (arch_set_error, arch_set_success): Use it.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use.
        When PTRACE_GET_SYSCALL_INFO is in use, CCR is not loaded, so it has
        to be loaded explicitly before tampering.

        * linux/powerpc/set_error.c (arch_set_error, arch_set_success):
        Explicitly load CCR before changing it when PTRACE_GET_SYSCALL_INFO
        is in use.
        * NEWS: Mention this fix.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename mbindflags to mbind_flags.
        The former name was not consistent with others.

        * xlat/mbindflags.in: Rename to xlat/mbind_flags.in; all users updated.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update MPOL_F_* get_mempolicy flags.
        * xlat/get_mempolicy_flags.in (MPOL_F_MEMS_ALLOWED): New constant
        introduced by Linux kernel v2.6.24-rc1~1212.
        * NEWS: Mention this.
        * tests/get_mempolicy.c (main): Update expected output.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename mempolicyflags to get_mempolicy_flags.
        The former name was ambiguous.

        * xlat/mempolicyflags.in: Rename to xlat/get_mempolicy_flags.in;
        all users updated.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename policies to mpol_modes.
        The former name was too vague.

        * xlat/policies.in: Rename to xlat/mpol_modes.in; all users updated.

2019-07-03  Michal Sekletar  <msekleta@redhat.com>

        xlat: add MPOL_LOCAL constant.
        * xlat/policies.in (MPOL_LOCAL): New constant introduced by Linux kernel
        commit v3.8-rc1~92^2~33.

        Resolves: https://github.com/strace/strace/pull/102

2019-07-03  Zhibin Li  <haoyouab@gmail.com>

        ioctl: remove redundant _IOC_NR.
        * ioctl.c (evdev_decode_number): Replace _IOC_NR(nr) with nr
        as the latter is defined to _IOC_NR(code).

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: add support for new fields in BPF_PROG_TEST_RUN.
        * bpf_attr.h (struct BPF_PROG_TEST_RUN_struct): Add ctx_size_in,
        ctx_size_out, ctx_in, and ctx_out fields.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Decode these fields
        introduced by Linux kernel commit v5.2-rc1~133^2~193^2~6.
        * tests/bpf.c (BPF_PROG_TEST_RUN_checks): Check it.

2019-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: implement decoding of BPF_MAP_FREEZE command.
        BPF_MAP_FREEZE command was introduced by Linux commit
        v5.2-rc1~133^2~193^2~12^2~12.

        * bpf_attr.h (struct BPF_MAP_FREEZE_struct): New type.
        (BPF_MAP_FREEZE_struct_size, expected_BPF_MAP_FREEZE_struct_size): New
        macros.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_FREEZE)): New bpf command
        decoder.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add BPF_CMD_ENTRY(BPF_MAP_FREEZE).
        * NEWS: Mention this.
        * tests/bpf.c (union bpf_attr_data): Add
        BPF_ATTR_DATA_FIELD(BPF_MAP_FREEZE).
        (BPF_MAP_FREEZE_checks): New checks array.
        (main) <checks>: Add CHK(BPF_MAP_FREEZE).

2019-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update BPF_* constants.
        * xlat/bpf_attach_type.in (BPF_CGROUP_SYSCTL): New constant introduced
        by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
        (BPF_CGROUP_UDP4_RECVMSG, BPF_CGROUP_UDP6_RECVMSG): New constants
        introduced by Linux kernel commit v5.2-rc6~33^2~44^2^2~5.
        * xlat/bpf_commands.in (BPF_MAP_FREEZE): New constant introduced
        by Linux kernel commit v5.2-rc1~133^2~193^2~12^2~12.
        * xlat/bpf_map_flags.in (BPF_F_RDONLY_PROG, BPF_F_WRONLY_PROG): New
        constants introduced by Linux kernel commit
        v5.2-rc1~133^2~193^2~12^2~13.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_SK_STORAGE): New constant
        introduced by Linux kernel commit v5.2-rc1~133^2~80^2^2~6.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SYSCTL): New constant
        introduced by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
        (BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE): New constant introduced
        by Linux kernel commit v5.2-rc1~133^2~80^2~1^2~4.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
        BPF_PROG_QUERY_checks): Update.
        * tests/kernel_version.c (print_bpf_attr): Update.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of fspick syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~1,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * fspick.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_fspick.
        * xlat/fspick_flags.in: New file.
        * linux/syscallent-common.h [BASE_NR + 433]: Wire up fspick.
        * NEWS: Mention this change.
        * tests/fspick.c: New file.
        * tests/fspick-P.c: Likewise.
        * tests/gen_tests.in (fspick, fspick-P): New entries.
        * tests/pure_executables.list: Add fspick and fspick-P.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of fsmount syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~2,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * fsmount.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_fsmount.
        * xlat/fsmount_cmds.in: New file.
        * xlat/mount_attr_atime.in: Likewise.
        * xlat/mount_attr_flags.in: Likewise.
        * linux/syscallent-common.h [BASE_NR + 432]: Wire up fsmount.
        * NEWS: Mention this change.
        * tests/fsmount.c: New file.
        * tests/gen_tests.in (fsmount): New entry.
        * tests/pure_executables.list: Add fsmount.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of fsconfig syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~3,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * fsconfig.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_fsconfig.
        * xlat/fsconfig_cmds.in: New file.
        * linux/syscallent-common.h [BASE_NR + 431]: Wire up fsconfig.
        * NEWS: Mention this change.
        * tests/fsconfig.c: New file.
        * tests/fsconfig-P.c: Likewise.
        * tests/gen_tests.in (fsconfig, fsconfig-P): New entries.
        * tests/pure_executables.list: Add fsconfig and fsconfig-P.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        print_dirfd: do not print trailing comma.
        It was fine to print trailing comma in print_dirfd until introduction
        of a syscall with the last argument being a dirfd.
        Now it's time to change print_dirfd.

        * open.c (print_dirfd): Do not print comma.
        (SYS_FUNC(open)): Print comma after print_dirfd() invocation.
        * access.c (SYS_FUNC(faccessat)): Likewise.
        * chmod.c (SYS_FUNC(fchmodat)): Likewise.
        * execve.c (SYS_FUNC(execveat)): Likewise.
        * fanotify.c (SYS_FUNC(fanotify_mark)): Likewise.
        * fchownat.c (SYS_FUNC(fchownat)): Likewise.
        * file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
        * link.c (SYS_FUNC(linkat), SYS_FUNC(unlinkat), SYS_FUNC(symlinkat)):
        Likewise.
        * mknod.c (SYS_FUNC(mknodat)): Likewise.
        * move_mount.c (SYS_FUNC(move_mount)): Likewise.
        * open_tree.c (SYS_FUNC(open_tree)): Likewise.
        * readlink.c (SYS_FUNC(readlinkat)): Likewise.
        * renameat.c (decode_renameat): Likewise.
        * stat.c (SYS_FUNC(newfstatat)): Likewise.
        * stat64.c (SYS_FUNC(fstatat64)): Likewise.
        * statx.c (SYS_FUNC(statx)): Likewise.
        * utimes.c (SYS_FUNC(futimesat), do_utimensat): Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of fsopen syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~5,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * fsopen.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_fsopen.
        * xlat/fsopen_flags.in: New file.
        * linux/syscallent-common.h [BASE_NR + 430]: Wire up fsopen.
        * NEWS: Mention this change.
        * tests/fsopen.c: New file.
        * tests/gen_tests.in (fsopen): New entry.
        * tests/pure_executables.list: Add fsopen.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of move_mount syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~8,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * move_mount.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_move_mount.
        * xlat/move_mount_flags.in: New file.
        * linux/syscallent-common.h [BASE_NR + 429]: Wire up move_mount.
        * NEWS: Mention this change.
        * tests/move_mount.c: New file.
        * tests/move_mount-P.c: Likewise.
        * tests/gen_tests.in (move_mount, move_mount-P): New entries.
        * tests/pure_executables.list: Add move_mount and move_mount-P.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of open_tree syscall.
        ... introduced by Linux kernel commits v5.2-rc1~141^2~9,
        v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

        * configure.ac (AC_CHECK_HEADERS): Add linux/mount.h.
        * open_tree.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_open_tree.
        * xlat/open_tree_flags.in: New file.
        * linux/syscallent-common.h [BASE_NR + 428]: Wire up open_tree.
        * NEWS: Mention this change.
        * tests/open_tree.c: New file.
        * tests/open_tree-P.c: Likewise.
        * tests/gen_tests.in (open_tree, open_tree-P): New entries.
        * tests/pure_executables.list: Add open_tree and open_tree-P.
        * tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce linux/syscallent-common.h and linux/syscallent-common-32.h.
        These files are going to be used to define syscall entries for common
        syscalls added in Linux kernel 5.1+.

        * linux/syscallent-common.h: New file.
        * linux/syscallent-common-32.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        (syscallent_names): Add syscallent-common.h and syscallent-common-32.h.
        * linux/mips/.gitignore: Add syscallent-common-32-stub.h
        and syscallent-common-stub.h.
        * linux/mips/genstub.sh: Parametrize source directory.  Change syscall
        name prefix to SYSCALL_NAME_PREFIX.
        * configure.ac [MIPS]: Generate stubs for linux/syscallent-common.h
        and linux/syscallent-common-32.h files.
        * linux/mips/syscallent-n32.h [LINUX_MIPSN32]
        [BASE_NR + 403..BASE_NR + 427]: Remove, include "syscallent-common-32.h"
        and "syscallent-common.h" instead.
        [!LINUX_MIPSN32] (SYSCALL_NAME_PREFIX): Define.
        [!LINUX_MIPSN32]: Include "syscallent-common-32-sub.h"
        and "syscallent-common-stub.h".
        * linux/mips/syscallent-o32.h [LINUX_MIPSO32]
        [BASE_NR + 403..BASE_NR + 427]: Remove, include "syscallent-common-32.h"
        and "syscallent-common.h" instead.
        [!LINUX_MIPSO32] (SYSCALL_NAME_PREFIX): Define.
        [!LINUX_MIPSO32]: Include "syscallent-common-32-sub.h"
        * linux/32/syscallent.h [403..427]: Remove, include
        "syscallent-common-32.h" and "syscallent-common.h" instead.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.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/alpha/syscallent.h (BASE_NR): Define.
        [534..537]: Remove, include "syscallent-common.h" instead.
        * linux/ia64/syscallent.h [BASE_NR + 424..BASE_NR + 427]: Remove,
        include "syscallent-common.h" instead.
        * linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise.
        [!LINUX_MIPSN64] (SYSCALL_NAME_PREFIX): Define.
        [!LINUX_MIPSN64]: Include "syscallent-common-stub.h".
        * linux/64/syscallent.h [424..427]: Remove, include
        "syscallent-common.h" instead.
        * 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.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: introduce BASE_NR to syscallent initializers.
        * linux/ia64/syscallent.h (BASE_NR): New macro.  Use it instead of 1024.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        mips: refactor syscallent initializers.
        Change format of designated initializers to BASE_NR + offset.

        * linux/mips/syscallent-n32.h (BASE_NR): New macro.  Use it in designated
        initializers.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update AT_* constants.
        * xlat/at_flags.in (AT_RECURSIVE): New constant introduced
        by Linux kernel commit v5.2-rc1~141^2~9.
        * NEWS: Mention this.
        * tests/linkat.c: Update expected output.
        * tests/unlinkat.c: Update expected output.
        * tests/utimensat.c: Update expected output.
        * tests/xstatx.c: Update expected output.

2019-06-28  Paul Chaignon  <paul.chaignon@gmail.com>

        travis: Move fastest test configuration first.
        I use Travis CI to check each patch before sending my patchsets.  Most
        failures are simple and make all test configurations fail.  However, since
        Travis CI runs test configurations in order and given that the first three
        configurations are the slowest ones, it takes about twenty minutes to see
        the failure.  Moving the fastest test configuration first would allow to
        fail earlier.  It would become about 3x faster to fail in case of simple
        mistakes.

        * .travis.yml (CC=gcc, STACKTRACE=no): Move to first position.

2019-06-22  Dmitry V. Levin  <ldv@altlinux.org>

        get_os_release: tolerate malformed kernel release strings.
        * strace.c (get_os_release): Handle malformed kernel release strings
        gracefully.

        Resolves: https://github.com/strace/strace/issues/101

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of CLONE_PIDFD flag of clone syscall.
        * clone.c (SYS_FUNC(clone)): Print pidfd returned by the kernel
        when CLONE_PIDFD flag is set.
        * tests/clone-flags.c (main): Check it.

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce printnum_fd.
        This is going to be used to implement decoding of CLONE_PIDFD flag
        of clone syscall.

        * defs.h (printnum_fd): New prototype.
        * util.c (printnum_fd): New function.

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance decoding of CLONE_PARENT_SETTID flag of clone syscall.
        * clone.c (SYS_FUNC(clone)): Print the parent_tid returned by the kernel
        instead of its address when CLONE_PARENT_SETTID flag is set.
        * tests/clone-flags.c (main): Check it.

        clone: fix printing of zero clone flags.
        * clone.c (SYS_FUNC(clone)): Fix printing of zero clone flags.
        * tests/clone-flags.c (main): Check it.

        clone: print read-only arguments on entering syscall.
        * clone.c (SYS_FUNC(clone)): Print child_stack, stack_size, and flags
        arguments on entering syscall.
        * NEWS: Mention this change.

        tests: check decoding of clone flags.
        * tests/clone-flags.c: New file.
        * tests/pure_executables.list: Add clone-flags.
        * tests/.gitignore: Likewise.
        * tests/clone-flags.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add clone-flags.test.

2019-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        clone: cleanup.
        * clone.c (print_tls_arg): Use addr argument.

2019-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update CLONE_* constants.
        * xlat/clone_flags.in (CLONE_IDLETASK): Remove unused flag conflicting
        with CLONE_PIDFD.

        Fixes: v5.1-8-gb43f44bca "xlat: update CLONE_* constants"

2019-06-14  Paul Chaignon  <paul.chaignon@gmail.com>

        Use debug_msg macro where possible.
        * linux/alpha/get_scno.c (arch_get_scno): Use debug_msg instead of
        open-coding it.
        * linux/mips/get_scno.c: Likewise.
        * linux/sh/get_scno.c: Likewise.

2019-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update ETH_* constants.
        * xlat/ethernet_protocols.in (ETH_P_DSA_8021Q): New constant introduced
        by Linux kernel commit v5.2-rc1~133^2~58^2~7.
        * NEWS: Mention this.

        xlat: update KBD_* constants.
        * xlat/evdev_keycode.in (KEY_KBD_LAYOUT_NEXT): New constant
        introduced by Linux kernel commit v5.2-rc1~79^2^2~7.
        * NEWS: Mention this.

        xlat: update TIPC_* constants.
        * xlat/sock_tipc_options.in (TIPC_SOCK_RECVQ_USED): New constant
        introduced by Linux kernel commit v5.2-rc1~133^2~143.
        * NEWS: Mention this.

        xlat: update KVM_CAP_* constants.
        * xlat/clone_flags.in (KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2): New
        constant introduced by Linux kernel commit v5.2-rc1~17^2~11.
        (KVM_CAP_PPC_IRQ_XIVE): New constant introduced by Linux kernel commits
        v5.2-rc1~17^2~2^2~19 and v5.2-rc1~17^2~2.
        (KVM_CAP_ARM_SVE): New constant introduced by Linux kernel commit
        v5.2-rc1~17^2~1^2~31.
        (KVM_CAP_ARM_PTRAUTH_ADDRESS, KVM_CAP_ARM_PTRAUTH_GENERIC): New
        constants introduced by Linux kernel commits v5.2-rc1~17^2~1^2~10
        and v5.2-rc1~17^2~1.
        * NEWS: Mention this.

        xlat: update CLONE_* constants.
        * xlat/clone_flags.in (CLONE_PIDFD): New constant introduced by Linux
        kernel commit v5.2-rc1~158^2~2.
        * NEWS: Mention this.

2019-05-26  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update V4L2_PIX_* constants.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT_STATELESS): New constant
        introduced by Linux kernel commit v5.2-rc1~33^2~132.
        (V4L2_PIX_FMT_BGRA32, V4L2_PIX_FMT_BGRX32, V4L2_PIX_FMT_RGBA32,
        V4L2_PIX_FMT_RGBX32): New constants introduced by Linux kernel commit
        v5.2-rc1~33^2~25.
        (V4L2_PIX_FMT_RGBA444, V4L2_PIX_FMT_RGBX444, V4L2_PIX_FMT_ABGR444,
        V4L2_PIX_FMT_XBGR444, V4L2_PIX_FMT_XBGR444, V4L2_PIX_FMT_BGRX444): New
        constants introduced by Linux kernel commit v5.2-rc1~33^2~24.
        (V4L2_PIX_FMT_RGBA555, V4L2_PIX_FMT_RGBX555, V4L2_PIX_FMT_ABGR555,
        V4L2_PIX_FMT_XBGR555, V4L2_PIX_FMT_BGRA555, V4L2_PIX_FMT_BGRX555): New
        constants introduced by Linux kernel commit v5.2-rc1~33^2~23.

        xlat: fix v4l2_pix_fmts sorting order.
        * xlat/v4l2_pix_fmts.in: Fix sorting order.

        xlat: update V4L2_CID_* constants.
        * xlat/v4l2_control_ids.in (V4L2_CID_FWHT_I_FRAME_QP,
        V4L2_CID_FWHT_P_FRAME_QP): New constants introduced by Linux kernel
        commit v5.2-rc1~33^2~132.
        (V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP,
        V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP,
        V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP): New constants introduced by
        Linux kernel commit v5.2-rc1~33^2~95.
        * NEWS: Mention this.

2019-05-25  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update AUDIT_* constants.
        * xlat/nl_audit_types.in (AUDIT_FANOTIFY): New constant introduced by
        Linux kernel commit v4.15-rc1~130^2^2~11.
        (AUDIT_TIME_INJOFFSET): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~2.
        (AUDIT_TIME_ADJNTPVAL): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~1.

2019-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update AUDIT_ARCH_* constants.
        * xlat/audit_arch.in (AUDIT_ARCH_ARCOMPACT, AUDIT_ARCH_ARCOMPACTBE,
        AUDIT_ARCH_ARCV2, AUDIT_ARCH_ARCV2BE): New constants introduced by Linux
        kernel commit v5.2-rc1~144^2~16.
        (AUDIT_ARCH_C6X, AUDIT_ARCH_C6XBE): New constants introduced by Linux
        kernel commit v5.2-rc1~144^2~15.
        (AUDIT_ARCH_CSKY): New constant introduced by Linux kernel commit
        v5.0-rc1~37^2~15.
        (AUDIT_ARCH_H8300): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~14.
        (AUDIT_ARCH_HEXAGON): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~12.
        (AUDIT_ARCH_NDS32, AUDIT_ARCH_NDS32BE): New constants introduced by
        Linux kernel commit v5.2-rc1~144^2~9.
        (AUDIT_ARCH_NIOS2): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~8.
        (AUDIT_ARCH_RISCV32, AUDIT_ARCH_RISCV64): New constants introduced by
        Linux kernel commit v5.0-rc2~23^2~1^2~5.
        (AUDIT_ARCH_TILEGX, AUDIT_ARCH_TILEGX32, AUDIT_ARCH_TILEPRO): New
        constants introduced by Linux kernel commit v4.3-rc1~83^2~3.
        (AUDIT_ARCH_UNICORE): New constant introduced by Linux kernel commit
        v5.2-rc1~144^2~6.
        (AUDIT_ARCH_XTENSA): New constant introduced by Linux kernel commit
        v5.0-rc1~92^2~8.
        * NEWS: Mention this.

2019-05-23  Masatake YAMATO  <yamato@redhat.com>

        tests: print the reason of failure in ioctl_kvm_run tests.
        * tests/ioctl_kvm_run_common.c (run_kvm): Print
        hardware_entry_failure_reason field of kvm_run
        when KVM_RUN is failed with KVM_EXIT_FAIL_ENTRY.

2019-05-23  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 5.1-1.
        * strace.spec.in: Likewise.

2019-05-22  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.1 release.
        * NEWS: Update for 5.1 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use xzalloc(sz) instead of xcalloc(1, sz)
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Use xzalloc
        instead of xcalloc of one-item-sized array.
        * kvm.c (vcpu_alloc): Likewise.
        * perf.c (fetch_perf_event_attr): Likewise.
        * syscall.c (ptrace_get_scno): Likewise.

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xmalloc: introduce xzalloc.
        * xmalloc.h (xmalloc, xcalloc, xreallocarray): Document.
        (xzalloc): New function, a thin wrapper around xcalloc with xmalloc
        interface.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Rename the stat struct used internally by strace to strace_stat_t.
        * largefile_wrappers.h (struct_stat): Rename to strace_stat_t.
        * strace.c (startup_child): Rename struct_stat to strace_stat_t.
        * util.c (printdev): Likewise.

        Move open_file to largefile_wrappers.h.
        * util.c (open_file): Move it ...
        * largefile_wrappers.h: ... here.

2019-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify bpf-obj_get_info_by_fd test against future kernels.
        * tests/bpf-obj_get_info_by_fd.c (print_prog_load, main): Change
        log_level from 42 to 7, to placate Linux kernels containing commit
        v5.2-rc1~133^2~193^2~18^2~9.

        bpf: add support for new fields in struct bpf_prog_info.
        * bpf_attr.h (struct bpf_prog_info_struct): Add run_time_ns and run_cnt
        fields.
        * bpf.c (print_bpf_prog_info): Decode run_time_ns and run_cnt fields
        introduced by Linux kernel commit v5.1-rc1~178^2~17^2~15^2~2.
        * NEWS: Mention it.
        * tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

        xlat: update FAN_* constants.
        * xlat/fan_mark_flags.in (FAN_MARK_FILESYSTEM): New constant
        introduced by Linux kernel commit v4.20-rc1~75^2~10.
        * tests/fanotify_mark.c (main): Update expected output.

        xlat: update IPV6_* constants.
        * xlat/sock_ipv6_options.in (IPV6_MULTICAST_ALL): New constant
        introduced by Linux kernel commit v4.20-rc1~14^2~384.
        (IPV6_ROUTER_ALERT_ISOLATE): New constant introduced
        by Linux kernel commit v5.1-rc1~178^2~22.
        * NEWS: Mention this.

        xlat: update F_SEAL_* constants.
        * xlat/f_seals.in (F_SEAL_FUTURE_WRITE): New constant introduced
        by Linux kernel commit v5.1-rc1~152^2~49.
        * NEWS: Mention this.

2019-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        btrfs: implement decoding of BTRFS_IOC_FORGET_DEV argument.
        ... introduced by Linux kernel commit v5.1-rc1~47^2~47.

        * btrfs.c (btrfs_ioctl) [BTRFS_IOC_FORGET_DEV]: Handle
        BTRFS_IOC_FORGET_DEV.
        * tests/btrfs.c (btrfs_test_device_ioctls) [BTRFS_IOC_FORGET_DEV]:
        Check it.

2019-05-21  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v5.1.
        * linux/32/ioctls_inc_align16.h: Update from linux v5.1
        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.
        * NEWS: Mention this.
        * tests/ioctl_random.c (main): Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-05-20  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update FAN_* constants.
        * xlat/fan_init_flags.in (FAN_REPORT_FID): New constant introduced
        by Linux kernel commit v5.1-rc1~139^2~18.
        * xlat/fan_event_flags.in (FAN_ATTRIB, FAN_MOVED_FROM, FAN_MOVED_TO,
        FAN_CREATE, FAN_DELETE, FAN_DELETE_SELF, FAN_MOVE_SELF): New constants
        introduced by Linux kernel commit v5.1-rc1~139^2~9.
        * NEWS: Mention this.
        * tests/fanotify_init.c (main): Update expected output.
        * tests/fanotify_mark.c (main): Likewise.

        xlat: update PR_SPEC_* constants.
        * xlat/pr_spec_get_store_bypass_flags.in (PR_SPEC_DISABLE_NOEXEC):
        New constant introduced by Linux kernel commit v5.1-rc1~168^2.
        * xlat/pr_spec_set_store_bypass_flags.in: Likewise.
        * NEWS: Mention this.
        * tests/prctl-spec-inject.c (get_strs, set_strs): Update.

        xlat: update BPF_* constants.
        * xlat/ebpf_class.in (BPF_JMP32): New constant introduced
        by Linux kernel commit v5.1-rc1~178^2~404^2~4^2~15.
        * xlat/bpf_map_update_elem_flags.in (BPF_F_LOCK): New constant
        introduced by Linux kernel commit v5.1-rc1~178^2~375^2~4^2~3.
        * NEWS: Mention this.

        xlat: update V4L2_* constants.
        * xlat/v4l2_control_ids.in
        (V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION): New constant
        introduced by Linux kernel commit v5.1-rc1~88^2~261.
        (V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET): New constant
        introduced by Linux kernel commit v5.1-rc1~88^2~260.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_AYUV32, V4L2_PIX_FMT_XYUV32,
        V4L2_PIX_FMT_VUYA32, V4L2_PIX_FMT_VUYX32): New constants
        introduced by Linux kernel commit v5.1-rc1~88^2~90.
        * NEWS: Mention this.

        xlat: update NT_* constants.
        * xlat/nt_descriptor_types.in (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS): New
        constants introduced by Linux kernel commit v5.1-rc1~82^2~44.
        * NEWS: Mention this.

2019-05-19  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of io_uring_* syscalls.
        ... introduced by Linux kernel commits v5.1-rc1~99^2~14,
        v5.1-rc1~99^2~7, and v5.1-rc7~24^2.

        * configure.ac (AC_CHECK_HEADERS): Add linux/io_uring.h.
        * io_uring.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * pathtrace.c (pathtrace_match_set): Add SEN_io_uring_enter,
        SEN_io_uring_register, and SEN_io_uring_setup.
        * xlat/uring_enter_flags.in: New file.
        * xlat/uring_register_opcodes.in: Likewise.
        * linux/32/syscallent.h [425, 426, 427]: Wire up io_uring_setup,
        io_uring_enter, and io_uring_register.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h [535, 536, 537]: Likewise.
        * linux/ia64/syscallent.h [1024 + 425, 1024 + 426, 1024 + 427]: Likewise.
        * linux/mips/syscallent-n32.h [6425, 6426, 6427]: Likewise.
        * linux/mips/syscallent-n64.h [5425, 5426, 5427]: Likewise.
        * linux/mips/syscallent-o32.h [4425, 4426, 4427]: Likewise.
        * NEWS: Mention this change.
        * tests/io_uring_enter.c: New file.
        * tests/io_uring_register.c: Likewise.
        * tests/io_uring_setup.c: Likewise.
        * tests/gen_tests.in (io_uring_enter, io_uring_register,
        io_uring_setup): New entries.
        * tests/pure_executables.list: Add io_uring_enter, io_uring_register,
        and io_uring_setup.
        * tests/.gitignore: Likewise.

2019-05-18  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of pidfd_send_signal syscall.
        ... introduced by Linux kernel commit v5.1-rc1~6^2~1.

        * signal.c (SYS_FUNC(pidfd_send_signal)): New function.
        * linux/32/syscallent.h [424]: Wire up pidfd_send_signal.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h [534]: Likewise.
        * linux/ia64/syscallent.h [1024 + 424]: Likewise.
        * linux/mips/syscallent-n32.h [6424]: Likewise.
        * linux/mips/syscallent-n64.h [5424]: Likewise.
        * linux/mips/syscallent-o32.h [4424]: Likewise.
        * NEWS: Mention this change.
        * tests/pidfd_send_signal.c: New file.
        * tests/gen_tests.in (pidfd_send_signal): New entry.
        * tests/pure_executables.list: Add pidfd_send_signal.
        * tests/.gitignore: Likewise.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of SO_TIMESTAMP*_NEW control messages.
        * configure.ac (AC_CHECK_TYPES): Check for struct __kernel_timespec
        and struct __kernel_sock_timeval.
        * tests/msg_control.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
        HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
        (test_scm_timestamp): Rename to test_scm_timestamp_old.
        (test_scm_timestampns): Rename to test_scm_timestampns_old.
        (test_scm_timestamping): Rename to test_scm_timestamping_old.
        [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (test_scm_timestamp_new): New
        function.
        [HAVE_STRUCT___KERNEL_TIMESPEC] (test_scm_timestampns_new,
        test_scm_timestamping_new): New functions.
        (test_sol_socket): Use them.
        * tests/sockopt-timestamp.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
        HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
        Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode.
        (print_timestampns_old): Define unconditionally.
        [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (print_timestamp_new): New function.
        [HAVE_STRUCT___KERNEL_TIMESPEC] (print_timestampns_new): Likewise.
        (main): Test SO_TIMESTAMPNS_OLD unconditionally.
        [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL]: Test SO_TIMESTAMP_NEW.
        [HAVE_STRUCT___KERNEL_TIMESPEC]: Test SO_TIMESTAMPNS_NEW.

        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.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

        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.

        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.

        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.

2019-05-11  Dmitry V. Levin  <ldv@altlinux.org>

        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.

        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.

        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.

        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.

        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.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce kernel_timex64_t.
        This is going to be used to implement clock_adjtime64 parser.

        * kernel_timex.h (kernel_timex64_t): New type.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-04-15  Dmitry V. Levin  <ldv@altlinux.org>

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

        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.

2019-03-24  Guo Ren  <ren_guo@c-sky.com>

        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.

        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.

2019-03-24  Guo Ren  <ren_guo@c-sky.com>

        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

        Reviewed-By: Dmitry V. Levin <ldv@altlinux.org>

        * clone.c [RISCV]: Use default definitions for ARG_* macros.
        * NEWS: Mention this fix.

2019-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-19  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 5.0 release.
        * NEWS: Update for 5.0 release.

        .mailmap: add more entries to avoid duplication in CREDITS.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        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"

2019-03-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright year number range.
        * COPYING: Update copyright year number range.
        * tests/COPYING: Likewise.
        * debian/copyright: Likewise.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-03-17  Shankara Pailoor  <shankarapailoor@gmail.com>

        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>

2019-03-17  Shankara Pailoor  <shankarapailoor@gmail.com>

        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>

2019-03-17  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-03-15  Tuan Hoang  <tmhoang@linux.ibm.com>

        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.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        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).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        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).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        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).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        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).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

        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

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

        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.

        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.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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>

2019-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-02-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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"

2019-02-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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().

        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.

2019-02-25  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        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.

        maint: update for linux 5.0-rc8.
        * maint/ioctls_sym.sh (x86_list): Add KVM_GET_SUPPORTED_HV_CPUID.

2019-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        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.

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        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>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: speedup, part 2.
        * xlat/gen.sh (gen_header): Use "grep -q" instead of "grep > /dev/null".

        xlat/gen.sh: speedup, part 1.
        * xlat/gen.sh (cond_def, cond_xlat): Use printf builtin instead of cat.

        xlat/gen.sh: cleanup.
        * xlat/gen.sh: Export LC_ALL=C so it could be omitted from individual
        invocations.
        (cond_def): Remove LC_ALL=C from sed invocation.
        (gen_header): Remove LC_COLLATE=C.

2019-02-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Makefile.am: pass D variable to shell scripts' environment.
        And set -x if D is set to 1, so the commands called by various shell scripts
        are easier to see during debugging.

        * Makefile.am (bpf_attr_check.c, sen.h, mpers-m%.stamp, $(srcdir)/CREDITS): Pass
        D variable in the environment to the shell script call.
        * gen_bpf_attr_check.sh: Set -x if D is set to 1.
        * generate_mpers_am.sh: Likewise.
        * generate_sen.sh: Likewise.
        * maint/gen-contributors-list.sh: Likewise.
        * mpers.sh: Likewise.
        * mpers_test.sh: Likewise.

2019-02-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add checks for dumpstr output into read-write test.
        util.c:dumpstr() now aligns offsets in accordance with the total length
        of the dump and also may perform only partial dump, so let's add checks
        for these cases.

        * tests/fill_memory.c (fill_memory_ex): Change the type of the period
        argument from unsigned char to unsigned int.
        * tests/tests.h (fill_memory_ex): Likewise.
        * tests/read-write.c (dump_str_ex): Rename from dump_str, add idx_w
        argument, support len greater than 240 bytes.
        (dump_str): New function, wrapper for dump_str_ex with the default index
        width.
        (print_hex): Add checks for dumpstr output, close fd 1 later.

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: update dumpstr.
        Use a buffer of a limited size, use proper type for dump amount, avoid
        hard-coding of byte counts, calculate output buffer size more accurately
        and minimise its rewriting, pad offset with zeros in accordance
        with expected output amount.

        * defs.h (dumpstr): Change the type of len argument from int to
        kernel_ulong_t.
        * macros.h (ROUNDUP_DIV): New macro.
        (ROUNDUP): Rewrite using ROUNDUP_DIV.
        * util.c (ILOG2_ITER_): New macro.
        (ilog2_64, ilog2_32): New functions.
        (ilog2_klong): New macro, wrapper around ilog2_32/ilog2_64, so (potentially
        more expensive) ilog2_64 is not used for ilog2 calculation
        of a kernel_ulong_t-typed variable on architectures with 32-bit kernel long.
        (dumpstr): Update.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Generalise UUID printing.
        It was open-coded (using yet another open-coded hexadecimal character
        printing) in btrfs.c and can be used in other places (like dm.c or
        rtnl_link.c).

        * defs.h (print_uuid): New declaration.
        * print_fields.h (PRINT_FIELD_UUID): New macro.
        * util.c (print_uuid): New function.
        * btrfs.c (prnibble, UUID_STRING_SIZE, btrfs_unparse_uuid): Remove.
        (btrfs_ioctl): Use PRINT_FIELD_UUID for UUID printing.

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Generalise some printing primitives.
        Character class checks and hexadecimal number formatting are open-coded
        all over the place, let's try to de-duplicate them a bit.

        * print_utils.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * util.c: Include "print_utils.h".
        (string_quote, dumpstr): Use sprint_byte_hex and is_print.
        * v4l2.c: Include "print_utils.h".
        (print_pixelformat): Use is_print and BYTE_HEX_CHARS_PRINTF_QUOTED,
        add a note that the routine is rather generic.

2019-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move call_summary() from cleanup() to terminate()
        cleanup() has exactly two call sites, die() and terminate(), and the
        first one resets cflag in order to prevent call_summary() invocation.
        Move the call to terminate() in order to avoid bogus cflag reset.

        * strace.c (die): Remove cflag reset.
        (cleanup): Move call_summary() call ...
        (terminate): ... here.

2019-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled.
        This allows avoiding ifdefs sometimes.

        * defs.h [!ENABLE_STACKTRACE] (stack_trace_enabled): Define as 0.
        * strace.c (init): Remove #ifdef ENABLE_STACKTRACE around -c/-k check.

2019-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        build: fix --with-libiberty.
        * m4/st_demangle.m4 (st_DEMANGLE): Move the check for cplus_demangle
        out of AC_CHECK_HEADERS because the latter checks for demangle.h in two
        different places and an absence of demangle.h in one of these places
        would cause a build error in --with-libiberty=yes mode.
        * NEWS: Mention this fix.

        Resolves: https://github.com/strace/strace/issues/92

2019-02-18  Shankara Pailoor  <shankarapailoor@gmail.com>

        Honor xlat styles when decoding ioprio_get and ioprio_set.
        * ioprio.c (SYS_FUNC(ioprio_get), SYS_FUNC(ioprio_set)): Add xlat_style
        support.
        * tests/ioprio-Xabbrev.c: New file.
        * tests/ioprio-Xraw.c: Likewise.
        * tests/ioprio-Xverbose.c: Likewise.
        * tests/ioprio.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE macros.
        * tests/gen_tests.in (ioprio-Xabbrev, ioprio-Xraw, ioprio-Xverbose): New
        tests.
        * tests/pure_executables.list: Add ioprio-Xabbrev, ioprio-Xraw, and
        ioprio-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-18  Shankara Pailoor  <shankarapailoor@gmail.com>

        move_pages: honor xlat styles.
        * numa.c (print_status): Add xlat_style support for status argument.
        * tests/move_pages-Xabbrev.c: New file.
        * tests/move_pages-Xraw.c: Likewise.
        * tests/move_pages-Xverbose.c: Likewise.
        * tests/move_pages.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE
        macros.
        * tests/gen_tests.in (move_pages-Xabbrev, move_pages-Xraw,
        move_pages-Xverbose): New tests.
        * tests/pure_executables.list: Add move_pages-Xabbrev, move_pages-Xraw,
        and move_pages-Xverbose.
        * tests/.gitignore: Likewise.

2019-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify threads-execve test against the odds.
        Give threads-execve.test more chances to succeed.

        * tests/threads-execve.test: Retry the test until run out of time.

2019-02-17  Shankara Pailoor  <shankarapailoor@gmail.com>

        Honor xlat styles when decoding resource limits.
        * resource.c (sprint_rlim64, sprint_rlim32): Remove.
        (print_rlim64_t, print_rlim32_t): New functions.
        (print_rlimit64, print_rlimit32): Use them.
        * tests/setrlimit-Xabbrev.c: New file.
        * tests/setrlimit-Xraw.c: Likewise.
        * tests/setrlimit-Xverbose.c: Likewise.
        * tests/setrlimit.c (main): Handle XLAT_ABBREV, XLAT_RAW,
        and XLAT_VERBOSE macros.
        * tests/xgetrlimit.c (sprint_rlim): Likewise.
        * tests/gen_tests.in (setrlimit-Xabbrev, setrlimit-Xraw,
        setrlimit-Xverbose): New tests.
        * tests/pure_executables.list: Add setrlimit-Xabbrev, setrlimit-Xraw,
        and setrlimit-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-17  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: workaround kernel bug in syscall number tampering.
        Linux kernel commit v4.6-rc2~20^2 introduced a regression:
        when tracer changes syscall number to -1, the kernel fails
        to initialize %r28 with -ENOSYS and subsequently fails
        to return the error code of the failed syscall to userspace.
        Workaround this by initializing %r28 ourselves.

        * linux/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING): Define
        to 0.
        * linux/hppa/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING):
        Define to 1.
        * syscall.c (tamper_with_syscall_entering)
        [ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING]: When changing syscall number
        to -1, set the return value as well.

2019-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: define PT_* constants as offsets inside struct pt_regs.
        Define constants passed to upeek and upoke using a method that works
        with different wordsize values.

        * linux/hppa/arch_regs.c (PT_GR26, PT_GR30, PT_IAOQ0, PT_IAOQ1): Remove.
        (PT_GR20, PT_GR28, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Redefine using
        offsets inside struct pt_regs.
        * linux/hppa/get_syscall_args.c (arch_get_syscall_args): Replace PT_GR26
        with offsets inside struct pt_regs.

2019-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: enhance decoding of PTRACE_PEEKUSER and PTRACE_POKEUSER.
        Print symbolic constants corresponding to numeric arguments
        of PTRACE_PEEKUSER and PTRACE_POKEUSER requests.

        * linux/hppa/userent.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * NEWS: Mention this.

2019-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: fix 7th syscall argument with PTRACE_GET_SYSCALL_INFO API.
        As PTRACE_GET_SYSCALL_INFO API supports 6 syscall arguments,
        all architectures that have syscalls with more than 6 arguments
        (i.e. mips o32) have to fetch extra arguments manually when using
        PTRACE_GET_SYSCALL_INFO API.

        * linux/mips/get_syscall_args.c [LINUX_MIPSO32]
        (arch_get_syscall_args_extra): New function.
        * syscall.c (get_syscall_args) [MAX_ARGS > 6]: Use it.

        Fixes: v4.26~49 "Introduce PTRACE_GET_SYSCALL_INFO support"

2019-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        mips: update comment.
        * linux/mips/get_syscall_args.c (decode_syscall_subcall): Update comment.

        Complements: v4.26-27-g2c8b6de91 "mips o32: fix build"

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add kill_child test.
        This tests repeatedly creates and kills children, so some corner
        cases in handling of not-quite-existing processes can be observed.

        Previously, strace was crashing in the following situation:

            13994 ????( <unfinished ...>
            ...
            13994 <... ???? resumed>) = ?

        as tcp->s_ent wasn't initialised on syscall entering and
        strace.c:print_event_exit segfaulted when tried to access
        tcp->s_ent->sys_name.

        * tests/kill_child.c: New file.
        * tests/kill_child.test: New test.
        * tests/.gitignore: Add kill_child.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add kill_child.test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        Wire up kexec_file_load syscall on architectures that use generic unistd.h
        * linux/32/syscallent.h [294]: Wire up kexec_file_load syscall
        introduced by linux commit v5.0-rc1~35^2~41^2~15.
        * linux/64/syscallent.h [294]: Likewise.
        * NEWS: Mention this.

        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1676045

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        Wire up rseq syscall on architectures that use generic unistd.h.
        * linux/32/syscallent.h [293]: Wire up rseq syscall introduced by linux
        commit v4.19-rc1~109^2~47.
        * linux/64/syscallent.h [293]: Likewise.
        * NEWS: Mention this.

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify preadv2-pwritev2 test against odd kernels.
        The test used to assume that either both preadv2 and pwritev2 syscalls
        are implemented or both are not implemented, but, apparently, there are
        kernels in the wild that implement just preadv2 syscall without
        pwritev2.

        * tests/preadv2-pwritev2.c (main): Skip the dumpio part of the test
        if either preadv2 or pwritev2 syscall is not implemented.

        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1668750

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ptrace_restart: do not print diagnostics when ptrace returns ESRCH.
        After some discussion, it was decided that the situation
        when the tracee is gone does not worth reporting.

        * strace.c (ptrace_restart): Return early if ptrace returned ESRCH.

        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1662936

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ptrace_restart: use xlat-based approach for printing ptrace requests.
        * defs.h (ptrace_cmds): New prototype.
        * strace.c (ptrace_op_str): New function.
        (ptrace_restart): Use it.

2019-02-10  Dmitry V. Levin  <ldv@altlinux.org>

        Fix whitespace issues.
        * Makefile.am (strace_SOURCES, EXTRA_DIST): Replace SPACE symbol followed
        by TAB symbol with TAB symbol.
        * kvm.c (is_map_for_file): Likewise.
        * tests/gen_tests.in (ioctl_ptp, printsignal-Xverbose): Likewise.
        * xlat/skf_ad.in: Likewise.

2019-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make inline message on failed restart attempt more verbose.
        Hopefully, now it is less confusing.

        * strace.c (ptrace_restart): Provide intent and pid in the inline error
        message.

        References: https://bugzilla.redhat.com/show_bug.cgi?id=1662936

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: set MEMORY_MAPPING_CHANGE in stub sysent.
        As unknown syscalls may incur unknown side effects.

        * syscall.c (stub_sysent): Set sys_flags to MEMORY_MAPPING_CHANGE.

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use accessors for tcp->s_ent, return a stub struct if it is NULL.
        Since code paths are non-trivial, it's an attempt to future-proof
        and prevent improper access of tcp->s_ent fields.

        * defs.h (struct tcb): Update the description of s_ent field.
        (stub_sysent): New declaration.
        (tcp_sysent, n_args): New macro functions.
        (indirect_ipccall): Use tcp_sysent() instead of tcp->s_ent.
        * ipc.c (SYS_FUNC(ipc)): Use n_args() instead of tcp->s_ent->nargs.
        * linux/alpha/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/bfin/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/hppa/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/ia64/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/microblaze/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/mips/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/sh/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/sh64/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/xtensa/get_syscall_args.c (get_syscall_args): Likewise.
        * prctl.c (print_prctl_args): Likewise.
        * signal.c (SYS_FUNC(sgetmask)): Likewise.
        * util.c (printargs, printargs_u, printargs_d): Likewise.
        * syscall.c (decode_ipc_subcall, decode_syscall_subcall: Likewise.
        (dumpio, tamper_with_syscall_exiting, syscall_entering_decode,
        syscall_entering_decode, syscall_entering_trace, syscall_entering_trace,
        syscall_exiting_decode, print_syscall_resume, syscall_exiting_trace,
        get_syscall_result): Use tcp_sysent() instead of tcp->s_ent.
        (stub_sysent): New stub sysent.
        (get_scno): Reset scno, s_ent, qual_flg; initialise s->ent from
        stub_sysent.
        * pathtrace.c (pathtrace_match_set): Use tcp_sysent() instead of
        tcp->s_ent.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: remove arch check for SEN_execv usage.
        SEN_* declarations are always present and can be used regardless
        of architecture.

        * syscall.c (syscall_entering_trace): Remove "#if defined SPARC ||
        defined SPARC64" guard.

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Merge "<... resumed>" printing.
        Apparently, it was slightly different with no apparent reason.
        Use a single routine to print this message now.

        * defs.h (print_syscall_resume): New function declaration.
        * strace.c (print_event_exit): Replace open-coding of "<... resumed>"
        message printing with a print_syscall_resume() call.
        * syscall.c (syscall_exiting_trace): Likewise.
        (print_syscall_resume): New function.
        * tests/threads-execve.c: Update expected output.

2019-01-09  Shankara Pailoor  <shankarapailoor@gmail.com>

        sockaddr: print sin6_flowinfo field before sin6_addr.
        The sin6_flowinfo field comes before sin6_addr in the sockaddr_in6
        defintion, but for some reason we switch the order when decoding.
        This patch fixes the order of decoding.

        * sockaddr.c (print_sockaddr_data_in6): Print sin6_flowinfo field
        before sin6_addr.
        * NEWS: Mention this fix.
        * tests/group_req.c (main): Update expected output.
        * tests/net-sockaddr.c (check_in6_linklocal, check_in6): Likewise.
        * tests/net-yy-inet6.c (INADDR_STR, SA_FIELDS): Likewise.
        * tests/sockaddr_xlat.c (validate_in6): Likewise.

2019-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: fix build.
        Commit 917c2ccf3a67 "Refactor stack pointers" moved mips_REG_* macros
        from linux/mips/arch_regs.h to linux/mips/arch_regs.c because these
        macros are no longer used outside syscall.c or files included by
        syscall.c, but this caused a build regression on mips o32 because
        decode_syscall_subcall() uses mips_REG_SP prior to its definition.

        * syscall.c (decode_syscall_subcall): Move ...
        * linux/mips/get_syscall_args.c: ... here.
        * NEWS: Mention this fix.

        Reported-by: Baruch Siach <baruch@tkos.co.il>
        Fixes: v4.26~61 "Refactor stack pointers"

2019-01-08  Baruch Siach  <baruch@tkos.co.il>

        Fix build for no-MMU targets.
        Commit 7488ce9e23f1 "Check whether PTRACE_GET_SYSCALL_INFO is supported
        by the kernel" added a fork() call in test_ptrace_get_syscall_info()
        which is included in the main strace executable code.  Although the
        test_ptrace_get_syscall_info() routine is not called on no-MMU targets,
        the compiler can't optimize it out because it is a global symbol.
        So build for no-MMU targets currently fails:

        strace-ptrace_syscall_info.o: In function `test_ptrace_get_syscall_info':
        ptrace_syscall_info.c:(.text+0x1c): undefined reference to `fork'

        * ptrace_syscall_info.c (test_ptrace_get_syscall_info): Make
        the definition depend on HAVE_FORK.
        * strace.c (init): Call test_ptrace_get_syscall_info unconditionally.
        * NEWS: Mention this fix.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Fixes: v4.26~50 "Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel"

2019-01-08  Baruch Siach  <baruch@tkos.co.il>

        linux/mips/.gitignore: drop copyright header.
        The '/*' in the first line of the copyright header matches all files in
        that directory.  No other .gitignore file has this header.  Drop it.

        * linux/mips/.gitignore: Remove copyright header.

        Fixes: v4.26~23 "Add copyright headers to some files that lack them"

2019-01-08  Shankara Pailoor  <shankarapailoor@gmail.com>

        Honor xlat styles when decoding sockaddr_in, sockaddr_in6, and sockaddr_ll
        * print_fields.h (PRINT_FIELD_NET_PORT): Handle xlat styles.
        * sockaddr.c (print_sll_protocol): New function.
        (print_sockaddr_data_ll, print_inet_addr, print_sockaddr_data_in6):
        Handle xlat styles.
        * NEWS: Mention this.
        * tests/sockaddr_xlat.c: New file.
        * tests/sockaddr_xlat-Xabbrev.c: Likewise.
        * tests/sockaddr_xlat-Xraw.c: Likewise.
        * tests/sockaddr_xlat-Xverbose.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add sockaddr_xlat.c.
        * tests/gen_tests.in (sockaddr_xlat-Xabbrev, sockaddr_xlat-Xraw,
        sockaddr_xlat-Xverbose): New tests.
        * tests/pure_executables.list: Add sockaddr_xlat-Xabbrev,
        sockaddr_xlat-Xraw, and sockaddr_xlat-Xverbose.
        * tests/.gitignore: Likewise.

2019-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Remove PRINT_FIELD_INET4_ADDR.
        Reduce code duplication by removing PRINT_FIELD_INET4_ADDR
        and using PRINT_FIELD_INET_ADDR instead.

        * print_fields.h (PRINT_FIELD_INET4_ADDR): Remove.
        * msghdr.c (print_cmsg_ip_pktinfo): Use PRINT_FIELD_INET_ADDR
        instead of PRINT_FIELD_INET4_ADDR.
        * net.c (print_mreq): Likewise.
        * sockaddr.c (print_sockaddr_data_in): Likewise.

2019-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update REL_* constants.
        * xlat/evdev_relative_axes.in (REL_HWHEEL_HI_RES): New constant
        introduced by Linux kernel commit v5.0-rc1~18^2^7~7.
        * NEWS: Mention this.

        xlat: update UDP_* constants.
        * xlat/sock_udp_options.in (UDP_GRO): New constant introduced
        by Linux kernel commit v5.0-rc1~129^2~379^2~8.
        * NEWS: Mention this.

        xlat: update FAN_* constants.
        * xlat/fan_event_flags.in (FAN_OPEN_EXEC, FAN_OPEN_EXEC_PERM): New
        constants introduced by Linux kernel commits v5.0-rc1~124^2~5
        and v5.0-rc1~124^2~3, respectively.
        * NEWS: Mention this.
        * tests/fanotify_mark.c (main): Update expected output.

        xlat: update SCTP_* constants.
        * xlat/sock_sctp_options.in (SCTP_EVENT): New constant introduced
        by Linux kernel commit v5.0-rc1~129^2~255^2.
        * NEWS: Mention this.

        xlat: update IFLA_* constants.
        * xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MULTI_BOOLOPT): New
        constant introduced by Linux kernel commit v5.0-rc1~129^2~207^2~2.
        * NEWS: Mention this.
        * tests/nlattr_ifla_linkinfo.c (main): Update.

        xlat: update NETNSA_* constants.
        * xlat/rtnl_nsid_attrs.in (NETNSA_TARGET_NSID, NETNSA_CURRENT_NSID): New
        constants introduced by Linux kernel commits v5.0-rc1~129^2~201^2~2
        and v5.0-rc1~129^2~201^2, respectively.
        * rtnl_nsid.c (rtgenmsg_nla_decoders): Add NETNSA_TARGET_NSID
        and NETNSA_CURRENT_NSID.
        * NEWS: Mention this.

        xlat: update SECCOMP_* constants.
        * xlat/seccomp_ops.in (SECCOMP_GET_NOTIF_SIZES): New constant introduced
        by Linux kernel commit v5.0-rc1~66^2~1^2~1.
        * xlat/seccomp_ret_action.in (SECCOMP_RET_USER_NOTIF): Likewise.
        * xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_NEW_LISTENER):
        Likewise.
        * NEWS: Mention this.
        * tests/seccomp-filter.c (main): Update expected output.
        * tests/seccomp-filter-v.c (main): Likewise.
        * tests/seccomp_get_action_avail.c (main): Check SECCOMP_RET_USER_NOTIF.

        xlat: update NT_* constants.
        * xlat/nt_descriptor_types.in (NT_ARM_PAC_MASK, NT_MIPS_MSA): New
        constants introduced by Linux kernel commits v5.0-rc1~35^2~21
        and v5.0-rc1~30^2~58, respectively.
        * NEWS: Mention this.

        xlat: update PR_* constants.
        * xlat/prctl_options.in (PR_PAC_RESET_KEYS): New constant introduced
        by Linux kernel commit v5.0-rc1~35^2~19.
        * NEWS: Mention this.

        xlat: update V4L2_* constants.
        * xlat/v4l2_buf_types.in (V4L2_BUF_TYPE_META_OUTPUT): New constant
        introduced by Linux kernel commit v5.0-rc1~181^2~21.
        * xlat/v4l2_device_capabilities_flags.in (V4L2_CAP_META_OUTPUT):
        Likewise.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_CNF4): New constant introduced
        by Linux kernel commit v5.0-rc1~182^2~120.
        * NEWS: Mention this.

        xlat: update KVM_CAP_* constants.
        * xlat/kvm_cap.in (KVM_CAP_MANUAL_DIRTY_LOG_PROTECT,
        KVM_CAP_HYPERV_CPUID): New constants introduced by Linux kernel commits
        v5.0-rc1~156^2~115 and v5.0-rc1~156^2~74, respectively.
        * NEWS: Mention this.

        xlat: update NDA_* constants.
        * xlat/rtnl_neigh_attrs.in (NDA_PROTOCOL): New constant introduced
        by Linux kernel commit v5.0-rc1~129^2~79.
        * rtnl_neigh.c (ndmsg_nla_decoders): Add NDA_PROTOCOL.
        * NEWS: Mention this.

        xlat: update BTRFS_FEATURE_INCOMPAT_* constants.
        * xlat/btrfs_features_incompat.in
        (BTRFS_FEATURE_INCOMPAT_METADATA_UUID): New constant introduced by Linux
        kernel commit v5.0-rc1~126^2~64.
        * NEWS: Mention this.

        xlat: update *_MAGIC constants.
        * xlat/fsmagic.in (BINDERFS_SUPER_MAGIC): New constant introduced
        by Linux kernel commit v5.0-rc1~95^2~15.
        * NEWS: Mention this.

        xlat: update KERN_* constants.
        * xlat/sysctl_kern.in (KERN_PANIC_ON_WARN, KERN_PANIC_PRINT): New
        constants introduced by Linux kernel commits v3.19-rc1~135^2~91
        and v5.0-rc1~38^2~16, respectively.
        * configure.ac (AC_CHECK_DECLS): Add them.
        * NEWS: Mention this.

        xlat: update BPF_F_* constants.
        * xlat/bpf_map_flags.in (BPF_F_ZERO_SEED): New constant introduced
        by Linux kernel commit v5.0-rc1~129^2~114^2~18^2~3.
        * xlat/bpf_prog_flags.in (BPF_F_ANY_ALIGNMENT): New constant introduced
        by Linux kernel commit v5.0-rc1~129^2~209^2~17^2~3.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
        print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update.

2019-01-05  Martin Lau  <kafai@fb.com>

        tests: fix prog_info initialization in bpf-obj_get_info_by_fd-prog*
        The sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, ...) is
        called in a loop.  The bpf_prog_get_info_attr.info object is in size 104
        but bpf_prog_get_info_attr.info_len is in size 168.  Hence, if the prog
        is jited, the second iteration onwards will have nr_jited_ksyms == 1
        which is asking the kernel to fill the
        bpf_prog_get_info_attr.info.jited_ksyms and it is NULL.

        * tests/bpf-obj_get_info_by_fd.c (main): Clear memory beyond prog_info
        at the start of every iteration.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use tail_alloc instead of calloc in bpf-obj_get_info_by_fd-prog*
        This guarantees that map_info and prog_info objects are not accessed
        out of bounds.

        * tests/bpf-obj_get_info_by_fd.c: Include <string.h>.
        (main): Use tail_alloc instead of calloc for map_info and prog_info.

2019-01-02  Dmitry V. Levin  <ldv@altlinux.org>

        Bring lists back to the sorted order.
        * .gitignore: Make the list sorted again.
        * Makefile.am (strace_SOURCES): Likewise.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in: Likewise.
        * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, EXTRA_DIST):
        Likewise.

2019-01-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix strace-k.test on alpha.
        Change strace-k.test to use chdir syscall instead of getpid syscall
        because the latter is not universally available, e.g. there is no getpid
        syscall on alpha.

        * tests/stack-fcall-3.c (f3) <default>: Replace getpid with chdir.
        * tests/strace-k.test: Likewise.
        * tests/strace-k.expected: Likewise.
        * tests/strace-k-demangle.expected: Likewise.
        * NEWS: Mention this.

2018-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        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

2018-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.26-1.
        * strace.spec.in: Likewise.

2018-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.26 release.
        * NEWS: Update for 4.26 release.

        strace.spec.in: add a comment about the license.

2018-12-26  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.20.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.20
        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/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.

        maint: update for linux 4.20.
        * maint/ioctls_sym.sh: Include linux/compiler_attributes.h in every
        processed file.
        Use asm/ioctls.h workaround for asm-generic/ioctls.h too.

2018-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update BPF_* constants.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE): New
        constant introduced by Linux kernel commit v4.20-rc1~14^2~124^2~12^2~7.
        (BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK): New constants introduced
        by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~3.
        * xlat/bpf_commands.in (BPF_MAP_LOOKUP_AND_DELETE_ELEM): New constant
        introduced by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~2.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Update.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add PR_SPEC_INDIRECT_BRANCH to pr_spec_cmds.
        * xlat/pr_spec_cmds.in (PR_SPEC_INDIRECT_BRANCH): New constant,
        introduced by Linux commit v4.20-rc5~4^2~3.
        * prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL, case
        PR_SET_SPECULATION_CTRL>: Add PR_SPEC_INDIRECT_BRANCH handling.
        * tests/prctl-spec-inject.c (main): Add PR_SPEC_INDIRECT_BRANCH decoding
        checks, update expected output.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update V4L2_CID_* and V4L2_PIX_FMT_* constants.
        * xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS,
        V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION): New constants, introduced
        by Linux commit v4.20-rc1~51^2~4.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_MPEG2_SLICE): Likewise.
        (V4L2_PIX_FMT_SUNXI_TILED_NV12): New constant, introduced by Linux
        commit v4.20-rc1~51^2~3.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add ABS_RESERVED to evdev_abs.
        * xlat/evdev_abs.in (ABS_RESERVED): New constant, introduced by Linux
        commit v4.20-rc1~133^2~2^2.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add REL_RESERVED and REL_WHEEL_HI_RES to evdev_relative_axes.
        * xlat/evdev_relative_axes.in (REL_RESERVED): New constant, introduced
        by Linux commit v4.20-rc1~133^2~2^2.
        (REL_WHEEL_HI_RES): New constant, introduced by Linux commit
        v4.20-rc1~133^2~2^2~6 and updated by Linux commit v4.20-rc1~133^2~2^2.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update kvm_cap.
        * xlat/kvm_cap.in (KVM_CAP_NESTED_STATE): New constant, introduced
        by Linux commit v4.19-rc1~87^2~62.
        (KVM_CAP_ARM_INJECT_SERROR_ESR): New constant, introduced by Linux
        commit v4.19-rc1~55^2~12^2~14, merged with its final value
        in v4.19-rc1~55^2~12.
        (KVM_CAP_MSR_PLATFORM_INFO): New constant, introduced by Linux commit
        v4.19-rc5~8^2~2.
        (KVM_CAP_PPC_NESTED_HV): New constant, introduced by Linux commit
        v4.20-rc1~113^2~107^2~1.
        (KVM_CAP_HYPERV_SEND_IPI): New constant, introduced by Linux commit
        v4.20-rc1~113^2~72.
        KVM_CAP_COALESCED_PIO): New constant, introduced by Linux commit
        v4.20-rc1~113^2~31.
        (KVM_CAP_HYPERV_ENLIGHTENED_VMCS): New constant, introduced by Linux
        commit v4.20-rc1~113^2~25.
        (KVM_CAP_EXCEPTION_PAYLOAD): New constant, introduced by Linux commit
        v4.20-rc1~113^2~8.
        (KVM_CAP_ARM_VM_IPA_SIZE): New constant, introduced by Linux commit
        v4.20-rc1~113^2~5^2~8 and updated by Linux commit
        v4.20-rc1~113^2~5.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add IFA_TARGET_NETNSID to rtnl_addr_attrs.
        * xlat/rtnl_addr_attrs.in (IFA_TARGET_NETNSID): New constant, introduced
        by Linux commit v4.20-rc1~14^2~428^2~7.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update neighbor_cache_entry_flags.
        * xlat/neighbor_cache_entry_flags.in (NTF_OFFLOADED): New constant,
        introduced by Linux commit v4.13-rc1~157^2~252^2~13.
        (NTF_STICKY): New constant, introduced by Linux commit
        v4.20-rc1~14^2~392.
        (NTF_USE, NTF_SELF, NTF_MASTER, NTF_PROXY, NTF_EXT_LEARNED, NTF_ROUTER):
        Add fallback definitions.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add flow dissector bpf program type constants.
        * xlat/bpf_attach_type.in (BPF_FLOW_DISSECTOR): New constant
        introduced by Linux commit v4.20-rc1~14^2~259^2~9^2~4.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_FLOW_DISSECTOR): Likewise.
        * NEWS: Mention this.
        * tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update.
        * tests/kernel_version.c (print_bpf_attr): Update.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_tc: add TCA_STATS_BASIC_HW.
        * xlat/rtnl_tca_stats_attrs.in (TCA_STATS_BASIC_HW): New constant,
        introduced by Linux commit v4.20-rc1~14^2~274^2~1.
        * rtnl_tc.c (tca_stats_nla_decoders): Add TCA_STATS_BASIC_HW.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add NETLINK_DUMP_STRICT_CHK to sock_netlink_options.
        * xlat/sock_netlink_options.in (NETLINK_DUMP_STRICT_CHK): New constant,
        introduced by Linux commit v4.20-rc1~14^2~130^2~17.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add IFLA_BR_VLAN_STATS_PER_PORT to rtnl_ifla_info_data_bridge_attrs
        * xlat/rtnl_ifla_info_data_bridge_attrs.in
        (IFLA_BR_VLAN_STATS_PER_PORT): New constant, introduced by Linux commit
        v4.20-rc1~14^2~90.
        * rtnl_link.c (ifla_info_data_bridge_nla_decoders): Add
        IFLA_BR_VLAN_STATS_PER_PORT.
        * NEWS: Mention this.
        * tests/nlattr_ifla_linkinfo.c (main): Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add TCP_CLOSE to netlink_states.
        * xlat/netlink_states.in: Decode state 7 as TCP_CLOSE, since that's what
        net core sets socket's initial state to.

        xlat: add fallback definitions to setsock_ipv6_options.
        * xlat/setsock_ipv6_options.in: Add fallback definitions.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add SOL_CAN_* to socketlayers.
        * xlat/socketlayers.in (SOL_CAN_BASE): New constant, introduced by Linux
        commit v2.6.25-rc1~1162^2~1414.
        (SOL_CAN_RAW): New constant, introduced by Linux commit
        v2.6.25-rc1~1162^2~1413.
        * NEWS: Mention this.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add FAN_ENABLE_AUDIT and FAN_REPORT_TID to fan_init_flags.
        * xlat/fan_init_flags.in (FAN_ENABLE_AUDIT): New constant, introduced
        by Linux commit v4.15-rc1~130^2^2~11.
        (FAN_REPORT_TID): New constant, introduced by Linux commit
        v4.20-rc1~75^2~2.
        * NEWS: Mention this.
        * tests/fanotify_init.c (main): Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update siginfo_codes.
        * xlat/siginfo_codes.in (SI_LWP): Remove, as it is not present on Linux.
        (SI_NOINFO): Define only on SPARC, provide fallback value.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: use XLAT_MACROS_ONLY instead of #stop.
        As the former allows controlling presence of xlat definitions
        during the inclusion and not header generation.

        * xlat/loop_cmds.in: Remove #stop.
        * loop.c: Wrap "xlat/loop_cmds.h" inclusion in XLAT_MACROS_ONLY.
        * tests/ioctl_loop.c: Likewise.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syslog: move constant definitions to xlat.
        * syslog.c (enum): Remove.
        * xlat/syslog_action_type.in: Add fallback definitions.

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        Add copyright headers to some files that lack them.
        We do our best to keep copyright headers up to date, yet
        git history provides better information on this subject
        and is more accurate than copyright headers.

        Update copyright headers.

        Update NEWS.

2018-12-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: consistently use CTRL-combinations.

        strace.1.in: print names of entities in bold, provide man page sections.
        * strace.1.in (.SH DESCRIPTION, .SH OPTIONS): Add man page section
        numbers.  Make mentions of strace and other entities bold.

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1.in: document %net.
        * strace.1.in: Mention %net as a synonym to %network.

        Complements: v4.25-21-g97c3deca5 "basic_filters: add %net as a possible designation for network syscalls"

2018-12-24  Shankara Pailoor  <shankarapailoor@gmail.com>

        quotactl: add xlat styles support.
        * quota.c (print_qcmd): New function.
        (SYS_FUNC(quotactl)): Use it to print the quotactl command.
        * tests/quotactl.c (print_dqinfo, print_dqfmt): Handle XLAT_RAW
        and XLAT_VERBOSE.
        (QUOTA_STR, QUOTA_ID_STR, QUOTA_STR_INVALID): New macros.
        (gen_quotacmd, gen_quotaid): New functions.
        (main): Use them.
        * tests/quotactl-Xabbrev.c: New file.
        * tests/quotactl-Xraw.c: Likewise.
        * tests/quotactl-Xverbose.c: Likewise.
        * tests/gen_tests.in (quotactl-Xabbrev, quotactl-Xraw,
        quotactl-Xverbose): New tests.
        * tests/pure_executables.list: Add quotactl-Xabbrev, quotactl-Xraw,
        and quotactl-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        xlat_idx: do not issue warnings for holes in indices.
        Some xlat indices like evdev_abs have holes, avoid issuing warnings
        about them.

        * xlat.c (xlat_idx): Do not issue warnings for holes in the index.

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_link: fix off-by-one errors in indexed and sorted xlat lookups.
        * rtnl_link.c (decode_nla_tun_type, decode_ifla_xdp_attached,
        decode_ifla_inet_conf, decode_ifla_inet6_flags, decode_ifla_inet6_conf,
        decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats,
        decode_ifla_inet6_agm): Decrement xlat size by one to account
        for XLAT_END as other users of indexed and sorted xlats do.

        Fixes: v4.25~71 "rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value"
        Fixes: v4.23~41 "rtnl_link: decode IFLA_AF_SPEC"
        Fixes: v4.23~37 "rtnl_link: implement IFLA_INFO_DATA for tun devices"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        net: fix off-by-one error in sorted xlat lookup.
        * net.c (ax25_protocols): Decrement xlat size by one to account
        for XLAT_END as other users of sorted xlats do.

        Fixes: v4.25~28 "net: add support for AX.25 protocols and socket option names decoding"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_smc_diag: fix off-by-one error in xlat lookup.
        * netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size
        by one to account for XLAT_END as other users of xlats do.

        Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        aio: fix off-by-one error in indexed xlat lookup.
        * aio.c (tprint_lio_opcode): Decrement xlat size by one to account
        for XLAT_END as other users of indexed xlats do.

        Fixes: v4.24~71 "aio: print IOCB_CMD_* using xlat"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        nlattr: fix off-by-one error in indexed xlat lookup.
        * nlattr.c (decode_nla_meminfo): Decrement xlat size by one
        to account for XLAT_END as other users of indexed xlats do.

        Fixes: v4.23~89 "nlattr: print index names in netlink meminfo array"

2018-12-23  Eugene Syromiatnikov  <esyr@redhat.com>

        evdev: fix off-by-one error in decode_bitset.
        * evdev.c (decode_bitset): Decrement sorted/indexed xlat's size by one
        in order to account for guarding XLAT_END, as other sorted/indexed xlat
        wrappers do.

        Fixes: v4.23~261 "evdev: support various types of xlats in decode_bitset"

2018-12-22  Dmitry V. Levin  <ldv@altlinux.org>

        strace: terminate itself if interrupted by a signal.
        * strace.c (terminate): Terminate itself if interrupted by a signal.
        * NEWS: Mention this change.
        * tests/detach-running.test: Check it.
        * tests/detach-sleeping.test: Likewise.
        * tests/detach-stopped.test: Likewise.

2018-12-17  Shankara Pailoor  <shankarapailoor@gmail.com>

        tests: check that printsignal handles xlat styles properly.
        * tests/printsignal.c: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/printsignal-Xabbrev.c: New file.
        * tests/printsignal-Xraw.c: Likewise.
        * tests/printsignal-Xverbose.c: Likewise.
        * tests/gen_tests.in (printsignal-Xabbrev, printsignal-Xraw,
        printsignal-Xverbose): New tests.
        * tests/pure_executables.list: Add printsignal-Xabbrev,
        * printsignal-Xraw, and printsignal-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        signal: return NULL if signal number has no string representation.
        Also return NULL if signal number is 0.

        * signal.c (signame): Return NULL if signal name has not been found.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

        filter_qualify: prepare for the change of signame semantics.
        * filter_qualify.c (sigstr_to_uint): Check signame return value.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use sprintsigname for converting signal number to string.
        As signame is being converted to an xlookup-like function, a separate
        routine is needed in order to get string representation of signal.

        * defs.h (sprintsigname): New prototype.
        * signal.c (sprintsigname): New function.
        * strace.c (print_debug_info, print_signalled, print_stopped): Use it
        instead of signame.
        * wait.c (printstatus): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use printsignal instead of signame.
        As the former respects xlat styles while the latter doesn't.

        * clone.c (SYS_FUNC(clone)): Use printsignal for printing termination
        signal in printflags.
        * fcntl.c (print_fcntl) <case F_SETSIG>: Use printsignal.
        * prctl.c (SYS_FUNC(prctl)) <case PR_GET_PDEATHSIG,
        case PR_SET_PDEATHSIG>: Likewise.
        * print_sigevent.c (print_sigevent): Likewise.
        * s390.c (s390_runtime_instr): Likewise.
        * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Likewise.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        signal: make printisgnal honor xlat style.
        * signal.c (printsignal): Respect current xlat style.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Always define WCOREDUMP.
        wait.c does it already, now strace.c also does.

        * wait.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * strace.c: Replace <sys/wait.h> with "wait.h".
        [!WCOREDUMP]: Remove.
        * wait.c: Replace <sys/wait.h> with "wait.h".
        [!WCOREFLAG] (WCOREFLAG), [!WCOREDUMP] (WCOREDUMP): Move to wait.h,
        rework.
        [!W_STOPCODE] (W_STOPCODE), [!W_EXITCODE] (W_EXITCODE),
        [!W_CONTINUED] (W_CONTINUED): Move to wait.h.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Masatake YAMATO  <yamato@redhat.com>

        net: enhance decoding of getsockopt(SO_ERROR)
        * net.c (print_get_error): New function decoding error
        number returned as option value for SO_ERROR option.
        (print_getsockopt) <case SO_ERROR>: Call print_get_error.

        * tests/so_error.c: New test.
        * tests/gen_tests.in (so_error): Likewise.
        * tests/pure_executables.list: Add so_error.
        * tests/.gitignore: Likewise.

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: do not clobber r12 for raw syscalls.
        According to
        https://sourceware.org/ml/libc-alpha/2018-12/msg00470.html
        GCC mainline now gives errors for an asm that clobbers the stack
        pointer.

        According to
        https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html>
        GCC previously ignored such a clobber; thus, this patch removes it
        from the clobbers for ia64 raw syscalls.

        * linux/ia64/raw_syscall.h (raw_syscall_0): Remove "r12" from clobbers.

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

        block: decode BLKGETZONESZ and BLKGETNRZONES ioctls.
        These ioctls were introduced by linux kernel commits v4.20-rc1~17^2~16
        and v4.20-rc1~17^2~15, respectively.

        * block.c (block_ioctl): Handle BLKGETZONESZ and BLKGETNRZONES.
        * xlat/block_ioctl_cmds.in (BLKGETZONESZ, BLKGETNRZONES): New entries.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Implement PTRACE_GET_SYSCALL_INFO decoder.
        * defs.h (audit_arch): New prototype.
        * process.c: Include "ptrace_syscall_info.h".
        (SYS_FUNC(ptrace)) <PTRACE_GET_SYSCALL_INFO>: Call
        print_ptrace_syscall_info on exiting syscall.
        * ptrace_syscall_info.h (print_ptrace_syscall_info): New prototype.
        * ptrace_syscall_info.c: Include "print_fields.h" and
        "xlat/ptrace_syscall_info_op.h".
        (print_ptrace_syscall_info): New function.
        * xlat/ptrace_syscall_info_op.in: New file.
        * tests/ptrace_syscall_info.c: New file.
        * tests/gen_tests.in (ptrace_syscall_info): New test.
        * tests/pure_executables.list: Add ptrace_syscall_info.
        * tests/.gitignore: Likewise.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce PTRACE_GET_SYSCALL_INFO support.
        When PTRACE_GET_SYSCALL_INFO API works,
        use it instead of traditional upeek/get_regs API.

        Tested on x86_64 and x86.

        * get_personality.c: New file.
        * get_personality.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * linux/aarch64/arch_get_personality.c: New file.
        * linux/powerpc64/arch_get_personality.c: Likewise.
        * linux/riscv/arch_get_personality.c: Likewise.
        * linux/s390x/arch_get_personality.c: Likewise.
        * linux/sparc64/arch_get_personality.c: Likewise.
        * linux/tile/arch_get_personality.c: Likewise.
        * linux/x32/arch_get_personality.c: Likewise.
        * linux/x86_64/arch_get_personality.c: Likewise.
        * linux/check_scno.c: Likewise.
        * linux/x32/check_scno.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * linux/ia64/arch_getrval2.c (getrval2): Invoke get_regs()
        if ptrace_syscall_info is in use.
        * linux/mips/arch_getrval2.c: Likewise.
        * linux/sparc/arch_getrval2.c: Likewise.
        * defs.h (get_personality_from_syscall_info): New prototype.
        * syscall.c: Include "get_personality.h" and "ptrace_syscall_info.h".
        (get_regs_error): Define unconditionally.
        (ptrace_sci): New static variable.
        (clear_regs): Reset ptrace_sci.op.
        (ptrace_syscall_info_is_valid, ptrace_get_syscall_info,
        get_syscall_regs): New functions.
        (get_syscall_result_regs): Change to get_syscall_regs.
        (get_instruction_pointer, get_stack_pointer, get_scno, get_syscall_args,
        get_error, set_error, set_success): Add ptrace_syscall_info support.
        * tests/int_0x80.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add int_0x80.test.
        (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Remove.
        * tests/gen_tests.in (int_0x80): Remove.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel.
        The result of this check is going to be used by subsequent commits.

        * ptrace_syscall_info.c: New file.
        * ptrace_syscall_info.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * strace.c: Include "ptrace_syscall_info.h".
        (init): Call test_ptrace_get_syscall_info.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Add definitions for PTRACE_GET_SYSCALL_INFO API.
        Provide fallback definitions for PTRACE_GET_SYSCALL_INFO API.
        Add very basic PTRACE_GET_SYSCALL_INFO support in the parser
        of ptrace syscall.

        * ptrace.h: Include <stdint.h>.
        [!PTRACE_GET_SYSCALL_INFO] (PTRACE_GET_SYSCALL_INFO,
        PTRACE_SYSCALL_INFO_NONE, PTRACE_SYSCALL_INFO_ENTRY,
        PTRACE_SYSCALL_INFO_EXIT, PTRACE_SYSCALL_INFO_SECCOMP,
        struct ptrace_syscall_info): Define.
        * xlat/ptrace_cmds.in: Add PTRACE_GET_SYSCALL_INFO.
        * process.c (SYS_FUNC(ptrace)): Handle it.

2018-12-10  Dmitry V. Levin  <ldv@altlinux.org>

        Change the license of strace to LGPL-2.1-or-later.
        strace is now provided under the terms of the GNU Lesser General
        Public License version 2.1 or later, see COPYING for more details.

        strace test suite is now provided under the terms of the GNU General
        Public License version 2 or later, see tests/COPYING for more details.

2018-12-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change the license to GPL-2.0-or-later.
        strace test suite is now provided under the terms of the GNU General
        Public License version 2 or later, see tests/COPYING for more details.

2018-12-10  Shankara Pailoor  <shankarapailoor@gmail.com>

        bpf: honor xlat styles when printing kernel version.
        * print_kernel_version.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (print_kernel_version): New prototype.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)):
        Use print_kernel_version.
        * tests/kernel_version.c: New file.
        * tests/kernel_version-Xabbrev.c: Likewise.
        * tests/kernel_version-Xraw.c: Likewise.
        * tests/kernel_version-Xverbose.c: Likewise.
        * tests/gen_tests.in (kernel_version, kernel_version-Xabbrev,
        kernel_version-Xraw, kernel_version-Xverbose): New tests.
        * tests/pure_executables.list: Add kernel_version,
        kernel_version-Xabbrev, kernel_version-Xraw, and kernel_version-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-10  Shankara Pailoor  <shankarapailoor@gmail.com>

        print_dev_t: add xlat styles support.
        * print_dev_t.c (print_dev_t): Respect xlat_verbosity.
        * tests/btrfs.c (sprint_makedev): New function.
        (btrfs_print_balance_args, btrfs_test_dev_info_ioctl,
        btrfs_test_dev_replace_ioctl, btrfs_test_get_dev_stats_ioctl,
        btrfs_test_scrub_ioctls): Use it to update expected output.
        * tests/xstatx.c (print_st_mode, sprint_makedev): New functions.
        (print_stat): Use them.
        * tests/fstat-Xabbrev.c: New file.
        * tests/fstat-Xraw.c: Likewise.
        * tests/fstat-Xverbose.c: Likewise.
        * tests/fstat64-Xabbrev.c: Likewise.
        * tests/fstat64-Xraw.c: Likewise.
        * tests/fstat64-Xverbose.c: Likewise.
        * tests/gen_tests.in (fstat-Xabbrev, fstat-Xraw, fstat-Xverbose,
        fstat64-Xabbrev, fstat64-Xraw, fstat64-Xverbose): New entries.
        * tests/trace_fstat.in: Likewise.
        * tests/trace_stat_like.in: Likewise.
        * tests/pure_executables.list: Add fstat-Xabbrev, fstat-Xraw,
        fstat-Xverbose, fstat64-Xabbrev, fstat64-Xraw, and fstat64-Xverbose.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        i386, x32: use upoke() instead of set_regs()
        This brings i386 and x32 in line with x86_64
        and removes redundant HAVE_GETREGS_OLD checks.
        Besides that, use of PTRACE_GET_SYSCALL_INFO would require
        an extra get_regs() invocation before set_regs().

        * syscall.c (ARCH_MIGHT_USE_SET_REGS): Define to 1.
        [HAVE_GETREGS_OLD] (ARCH_MIGHT_USE_SET_REGS): Redefine to 0.
        (ptrace_setregset_or_setregs): Check ARCH_MIGHT_USE_SET_REGS instead
        of HAVE_GETREGS_OLD.
        * linux/i386/arch_regs.c (ARCH_MIGHT_USE_SET_REGS): Redefine to 0.
        * linux/powerpc/arch_regs.c: Likewise.
        * linux/x86_64/arch_regs.c: Likewise.
        * linux/i386/set_error.c (arch_set_error, arch_set_success)
        [!HAVE_GETREGS_OLD]: Remove.
        * linux/i386/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove.
        * linux/powerpc/set_error.c (arch_set_error, arch_set_success)
        [!HAVE_GETREGS_OLD]: Remove.
        * linux/powerpc/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove.
        * linux/x86_64/set_error.c [!HAVE_GETREGS_OLD]: Remove.
        * linux/x86_64/set_scno.c: Likewise.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        upoke: workaround crippled x32.
        As PTRACE_POKEUSER is crippled on x32 by design from the very first
        linux kernel commit v3.4-rc1~33^2~2 when it was introduced,
        workaround this by using the raw x86_64 syscall instead.

        * linux/ptrace_pokeuser.c: New file.
        * linux/x32/ptrace_pokeuser.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * upoke.c: Include "ptrace_pokeuser.c".
        (upoke): Use ptrace_pokeuser instead of ptrace.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: remove some annoying pieces of unused code.
        * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): Remove.
        (arch_get_scno): Remove ifdefed archeological artefacts.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor tamper_with_syscall_exiting()
        Move the code than deals with updating the return and error values
        to separate functions.

        * syscall.c (set_error, set_success): New functions.
        (tamper_with_syscall_exiting): Use them.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor get_syscall_args() and get_error()
        * linux/*/get_error.c: Rename all arch-specific implementations
        of get_error() to arch_get_error().
        * linux/*/get_syscall_args.c: Rename all arch-specific implementations
        of get_syscall_args() to arch_get_syscall_args().
        * syscall.c (get_syscall_args, get_error): New functions.
        (tamper_with_syscall_exiting, get_syscall_result): Do not clear
        tcp->u_error before get_error() invocation as the latter does it now.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor stack pointers.
        Change all linux/*/arch_regs.c to provide either ARCH_SP_REG
        or ARCH_SP_PEEK_ADDR.  Introduce get_stack_pointer(), rewrite
        all code accessing stack pointers to use get_stack_pointer().
        On some architectures stack pointers were referred to as frame pointers,
        clean up this confusion.

        * defs.h (get_stack_pointer): New prototype.
        * syscall.c (get_stack_pointer): New function.
        * linux/arch_rt_sigframe.c: New file.
        * linux/aarch64/arch_regs.c (aarch64_sp_ptr, arm_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/alpha/arch_regs.c: Import linux/alpha/arch_regs.h.
        (REG_FP): Rename to REG_SP.
        (ARCH_SP_PEEK_ADDR): New macro.
        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/arc/arch_regs.c (arc_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/arm/arch_regs.c (arm_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/arm/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/avr32/arch_regs.c (avr32_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/bfin/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
        * linux/hppa/arch_regs.c: Import linux/hppa/arch_regs.h.
        (PT_GR30, ARCH_SP_PEEK_ADDR): New macros.
        * linux/hppa/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/i386/arch_regs.c (i386_esp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/i386/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/i386/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/ia64/arch_regs.c (ia64_frame_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/ia64/arch_regs.h (ia64_frame_ptr): Remove.
        * linux/ia64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/m68k/arch_regs.c (m68k_usp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/m68k/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c.
        * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/metag/arch_regs.c (metag_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/metag/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/microblaze/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
        * linux/mips/arch_regs.c: Import linux/mips/arch_regs.h.
        (mips_regs): Add static qualifier.
        (ARCH_SP_REG): New macro.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/nios2/arch_regs.c (nios2_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/or1k/arch_regs.c (or1k_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/powerpc/arch_regs.c (ppc_regs): Add static qualifier.
        (ARCH_SP_REG): New macro.
        * linux/powerpc/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/powerpc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/riscv/arch_regs.c (riscv_sp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/s390/arch_regs.c (s390_frame_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/s390/arch_sigreturn.c (S390_FRAME_PTR): Remove.
        (arch_sigreturn): Use get_stack_pointer.
        * linux/s390x/arch_regs.c (s390_frame_ptr, s390x_frame_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/s390x/arch_sigreturn.c (S390_FRAME_PTR): Remove.
        * linux/sh/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
        * linux/sh64/arch_regs.c: Likewise.
        * linux/sparc/arch_regs.c: Import linux/sparc/arch_regs.h.
        (sparc_regs): Add static qualifier.
        (ARCH_SP_REG): New macro.
        * linux/sparc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/sparc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
        get_stack_pointer.
        * linux/tile/arch_regs.c (tile_regs): Add static qualifier.
        (ARCH_SP_REG): New macro.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
        * linux/x86_64/arch_regs.c (i386_esp_ptr, x86_64_rsp_ptr): Remove.
        (ARCH_SP_REG): New macro.
        * linux/x86_64/arch_regs.h (i386_esp_ptr, x86_64_rsp_ptr): Remove.
        * linux/x86_64/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c.
        * linux/xtensa/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
        * linux/aarch64/arch_regs.h: Remove.
        * linux/aarch64/arch_rt_sigframe.c: Remove.
        * linux/alpha/arch_regs.h: Remove.
        * linux/alpha/arch_rt_sigframe.c: Remove.
        * linux/arc/arch_regs.h: Remove.
        * linux/arc/arch_rt_sigframe.c: Remove.
        * linux/arm/arch_regs.h: Remove.
        * linux/arm/arch_rt_sigframe.c: Remove.
        * linux/avr32/arch_regs.h: Remove.
        * linux/avr32/arch_rt_sigframe.c: Remove.
        * linux/bfin/arch_rt_sigframe.c: Remove.
        * linux/hppa/arch_regs.h: Remove.
        * linux/i386/arch_regs.h: Remove.
        * linux/m68k/arch_regs.h: Remove.
        * linux/metag/arch_regs.h: Remove.
        * linux/microblaze/arch_rt_sigframe.c: Remove.
        * linux/mips/arch_regs.h: Remove.
        * linux/mips/arch_rt_sigframe.c: Remove.
        * linux/nios2/arch_regs.h: Remove.
        * linux/nios2/arch_rt_sigframe.c: Remove.
        * linux/or1k/arch_regs.h: Remove.
        * linux/or1k/arch_rt_sigframe.c: Remove.
        * linux/powerpc/arch_regs.h: Remove.
        * linux/powerpc64/arch_regs.h: Remove.
        * linux/riscv/arch_regs.h: Remove.
        * linux/riscv/arch_rt_sigframe.c: Remove.
        * linux/s390/arch_regs.h: Remove.
        * linux/s390/arch_rt_sigframe.c: Remove.
        * linux/s390x/arch_regs.h: Remove.
        * linux/s390x/arch_rt_sigframe.c: Remove.
        * linux/sh/arch_rt_sigframe.c: Remove.
        * linux/sh64/arch_rt_sigframe.c: Remove.
        * linux/sparc/arch_regs.h: Remove.
        * linux/sparc/arch_rt_sigframe.c: Remove.
        * linux/sparc64/arch_regs.h: Remove.
        * linux/tile/arch_regs.h: Remove.
        * linux/tile/arch_rt_sigframe.c: Remove.
        * linux/xtensa/arch_rt_sigframe.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove them, add linux/arch_rt_sigframe.c.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor print_pc()
        Split print_pc() into arch-independent print_instruction_pointer()
        and arch-specific get_instruction_pointer().

        * print_instruction_pointer.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (print_pc): Remove.
        (get_instruction_pointer, print_instruction_pointer): New prototypes.
        * syscall.c (print_pc): Remove.
        (get_instruction_pointer): New function.
        * strace.c (printleader): Replace print_pc with
        print_instruction_pointer.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        ppc64: remove redundant redefinition.
        * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Remove.

2018-12-05  Shankara Pailoor  <shankarapailoor@gmail.com>

        print_dev_t: print major and minor numbers in hex like stat(1)
        * print_dev_t.c (print_dev_t): Print major and minor numbers in hex.
        * strace.1.in: Update makedev example.
        * tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
        * tests/btrfs.c (btrfs_print_balance_args, btrfs_test_scrub_ioctls,
        btrfs_test_dev_info_ioctl, btrfs_test_get_dev_stats_ioctl,
        btrfs_test_dev_replace_ioctl): Update expected output.
        * tests/ioctl_dm.c (main): Likewise.
        * tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise.
        * tests/mknod.c (main): Likewise.
        * tests/mknodat.c (main): Likewise.
        * tests/nlattr_unix_diag_msg.c (main): Likewise.
        * tests/ustat.c (main): Likewise.
        * tests/xstatx.c (print_stat): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-05  Janosch Frank  <frankja@linux.ibm.com>

        s390x: beautify sthyi data tail prints.
        The test already expects a ", " before the print of struct
        padding. Let's add it to s390.c to make the output look a bit nicer and
        fix test runs on z/VM that have padding at the end of the STHYI structs.

        * s390.c (decode_ebcdic): Add missing comma.

2018-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        Stop using SIG_0.
        Number 0 is not a valid signal number, and SIG_0 is not a valid
        description for a signal.

        * linux/signalent.h: Replace SIG_0 with 0.
        * linux/alpha/signalent.h: Likewise.
        * linux/hppa/signalent.h: Likewise.
        * linux/mips/signalent.h: Likewise.
        * linux/sparc/signalent.h: Likewise.
        * filter_qualify.c (sigstr_to_uint): Start iterations with number 1.
        * tests/fcntl-common.c (test_fcntl_others): Update expected output.
        * tests/kill.c (main): Likewise.
        * tests/ptrace.c (test_peeksiginfo): Likewise.
        * tests/s390_runtime_instr.c (main): Likewise.

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        mem: fix build on architectures where kernel_ulong_t is bigger than long
        * mem.c (print_mmap_flags): Fix format string.

        Fixes: v4.25-26-g0933b3086 "mem: add xlat styles support to print_mmap_flags"

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add remap_file_pages test variants with different xlat verbosity levels
        * tests/remap_file_pages-Xabbrev.c: New file.
        * tests/remap_file_pages-Xraw.c: Likewise.
        * tests/remap_file_pages-Xverbose.c: Likewise.
        * tests/remap_file_pages.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/pure_executables.list: Add remap_file_pages-Xabbrev,
        remap_file_pages-Xraw, and remap_file_pages-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (remap_file_pages-Xabbrev, remap_file_pages-Xraw,
        remap_file_pages-Xverbose): New tests.

2018-11-26  Shankara Pailoor  <shankarapailoor@gmail.com>

        mem: add xlat styles support to print_mmap_flags.
        * mem.c (print_mmap_flags): Respect xlat_verbosity.
        * tests/mmap.c (main): Update expected output.
        * tests/old_mmap.c (main): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add memfd_create test variants with different xlat verbosity levels
        * tests/memfd_create-Xabbrev.c: New file.
        * tests/memfd_create-Xraw.c: Likewise.
        * tests/memfd_create-Xverbose.c: Likewise.
        * tests/memfd_create.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/pure_executables.list: Add memfd_create-Xabbrev, memfd_create-Xraw,
        and memfd_create-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (memfd_create-Xabbrev, memfd_create-Xraw,
        memfd_create-Xverbose): New tests.

2018-11-26  Shankara Pailoor  <shankarapailoor@gmail.com>

        memfd_create: add xlat styles support.
        * memfd_create.c (SYS_FUNC(memfd_create)): Respect xlat_verbosity.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance error diagnostics when the first exec fails.
        When the first exec fails, strace used to print the trace of the child
        process till its end, producing a lot of confusing output.
        Enhance the diagnostics by hiding irrelevant parts of the trace.

        * defs.h (TCB_CHECK_EXEC_SYSCALL): New macro.  Change values of TCB_*
        macros listed after TCB_CHECK_EXEC_SYSCALL.
        (check_exec_syscall): New macro.
        * strace.c (dispatch_event) <TE_STOP_BEFORE_EXECVE>: Clear
        TCB_CHECK_EXEC_SYSCALL flag.
        * syscall.c (syscall_entering_trace): Do not clear TCB_HIDE_LOG when
        TCB_CHECK_EXEC_SYSCALL is set, set TCB_CHECK_EXEC_SYSCALL along with
        clearing TCB_HIDE_LOG.
        (syscall_exiting_decode): Set TCB_HIDE_LOG if TCB_CHECK_EXEC_SYSCALL
        is set.
        * tests/first_exec_failure.test: New file.
        * tests/Makefile.am (MISC_TESTS): Add first_exec_failure.test.

        Closes: https://github.com/strace/strace/issues/88

2018-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        build: use more traditional git options.
        The support of --no-patch alias to -s option in "git diff" and related
        git commands was added in git v1.8.4.

        * copyright-year-gen: Use "git show -s" instead of "git show --no-patch".
        * file-date-gen: Use "git log -s" instead of "git log --no-patch".

        Closes: https://github.com/strace/strace/issues/80

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        basic_filters: add %net as a possible designation for network syscalls.
        * basic_filters.c (lookup_class) <syscall_class>: Add %net as an alias
        for TRACE_NETWORK.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        hppa: add a comment about old name of syscall number 102.
        Also, remove empty definition.

        * linux/hppa/syscallent.h ([102]): Remove empty definition,
        add a comment that it was socketcall.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mips: update syscall entry for reserved221 syscall.
        The syscall number 4221 is actually called "reserved221" on mips.

        * linux/mips/syscallent-o32.h ([4221]): Set to "reserved221".

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        arm: add a comment that __ARM_NR_cmpxchg was removed in 4.4.
        * linux/arm/syscallent.h: Add a comment about __ARM_NR_cmpxchg.

        arm: replace empty syscall entry definitions with comments.
        * linux/arm/syscallent.h ([222]): Remove definition, add a comment
        that it was tux syscall.
        ([223]): Remove definition, add comment that it was unused.
        ([254]): Remove definition, add comment that it was reserved
        for set_thread_area.
        ([255]): Remove definition, add comment that it was reserved
        for get_thread_area.

        linux/dummy.h: remove unused sys_phys definition.
        * linux/dummy.h (sys_phys): Remove.

        numa: use already existing array item printing function.
        * numa.c (print_int): Remove.
        (SYS_FUNC(move_pages)): Use print_int32_array_member instead of
        print_int.

        net: use already existing array item printing function.
        * net.c (print_uint32): Remove.
        (print_getsockopt): Use print_uint32_array_member instead of
        print_uint32.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove HAVE_LINUX_GENETLINK_H ifdefs.
        <linux/netlink.h> is available since Linux 2.6.15 (commit
        v2.6.15-rc1~53^2).

        * configure.ac (AC_CHECK_HEADERS): Remove linux/genetlink.h.
        * socketutils.c [!HAVE_LINUX_GENETLINK_H]: Remove.
        * tests/netlink_generic.c [!HAVE_LINUX_GENETLINK_H]: Likewise.

2018-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Document -X option in strace -h output.
        * strace.c (usage): Mention -X option.

        Reported-by: Dmitry Vyukov <dvyukov@google.com>
        Complements: v4.23~308 "Add user interface for configuring xlat output style"

2018-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Move kill_save_errno to a separate header file.
        This function is going to be used outside strace.c,
        so make it globally available and move it to a separate header file.

        * strace.c (kill_save_errno): Add "inline" keyword, change return type
        from "void" to "int", move the function ...
        * kill_save_errno.h: ... to this new file.
        * Makefile.am (strace_SOURCES): Add it.

2018-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        syscall_entering_trace: set TCB_FILTERED along with TCB_HIDE_LOG.
        This allows to remove some of hide_log() checks that became redundant.

        * syscall.c (syscall_entering_trace): Set TCB_FILTERED along with
        TCB_HIDE_LOG, remove now redundant hide_log(tcp) check.
        (syscall_exiting_decode): Replace "filtered(tcp) || hide_log(tcp)"
        with "filtered(tcp)".

2018-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        syscall_entering_trace: optimize clearing of TCB_HIDE_LOG flag.
        * syscall.c (syscall_entering_trace): Since we check for TCB_HIDE_LOG
        flag anyway, do not clean it unless it is set.

2018-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        print_inet_addr: print nameless and named addresses using the same style
        * sockaddr.c (print_inet_addr): Handle var_name == NULL case in a more
        structured way: use inet_addr("%s") form to print AF_INET addresses
        in structureless contexts where no structure field name is available.
        Likewise, use inet_pton(AF_INET6, "%s") that case.
        * tests/nlattr_ifaddrmsg.c (main): Update expected output.
        * tests/nlattr_ifla_af_spec.c (main): Likewise.

        Complements: v4.19~76 "print_inet_addr: add support of invocations without field name"

2018-11-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of RND* ioctl commands.
        * tests/ioctl_random.c (main): Check the error path of RNDADDENTROPY
        parser.  Check decoding of unrecognized RND* ioctl commands.

2018-11-05  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>

        Add support for /dev/[u]random ioctls.
        * random_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (DECL_IOCTL): Add random.
        * ioctl.c (ioctl_decode): Add 'R' case.
        * xlat/random_ioctl_cmds.in: New file.
        * tests/ioctl_random.c: New file.
        * tests/.gitignore: Add ioctl_random.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_random): New entry.

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add dist/INSTALL.
        * dist/INSTALL: New file.
        * bootstrap: Copy it.
        * .gitignore: Add /INSTALL.

        References: https://github.com/strace/strace/issues/17
        References: https://github.com/strace/strace/issues/55
        Closes: https://github.com/strace/strace/issues/67

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Rename INSTALL to README-configure.
        * INSTALL-git.md: Replace INSTALL with README-configure.
        * maint/install.texi: Likewise.
        * INSTALL: Rename to README-configure, regenerate.
        * Makefile.am (EXTRA_DIST): Add README-configure.

        References: https://github.com/strace/strace/issues/85
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        dist/README: add more references.
        * dist/README: Mention README-hacking, add links to repositories
        and the mailing list archive.

        Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        README.md: add a link to the new contributors guide.
        * README.md: Add a link to the Guide of new contributors.

        Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>

2018-10-30  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.25-1.
        * strace.spec.in: Likewise.

        Prepare for 4.25 release.
        * NEWS: Update for 4.25 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2018-10-25  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2018-10-25  Elvira Khabirova  <lineprinter@altlinux.org>

        Implement decoding of NBD_* ioctl commands.
        * nbd_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (DECL_IOCTL): Add nbd.
        * ioctl.c (ioctl_decode): Add 0xab (nbd) case.
        * xlat/nbd_ioctl_cmds.in: Likewise.
        * xlat/nbd_ioctl_flags.in: Likewise.
        * tests/ioctl_nbd.c: Likewise.
        * tests/.gitignore: Add ioctl_nbd.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_nbd): New entry.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-10-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build with recent kernel headers.
        Linux commit v4.19-rc2-5-g2ecefa0a15fd0ef88b9cd5d15ceb813008136431
        changed the definition of struct keyctl_dh_params in an incompatible
        way again.  Workaround this issue by using designated initializers.

        * tests/keyctl.c (main): Use designated initializers for
        struct keyctl_dh_params.

2018-10-24  Dmitry V. Levin  <ldv@altlinux.org>

        arm, sparc, sparc64: wire up io_pgetevents.
        * linux/arm/syscallent.h ([399]): Wire up io_pgetevents syscall
        introduced by Linux commit v4.19-rc7~24^2~1.
        (ARM_FIRST_SHUFFLED_SYSCALL, SYS_socket_subcall): Raise from 400 to 500,
        to make room for new syscalls.
        * linux/sparc/syscallent.h ([361]): Wire up io_pgetevents syscall
        introduced by Linux commit v4.19~31^2~5.
        * linux/sparc64/syscallent.h: Likewise.

2018-10-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.19.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.19-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/i386/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux 4.19-rc8.
        * maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE.

2018-10-24  Dmitry V. Levin  <ldv@altlinux.org>

        Remove redundant VIDIOC_SUBDEV_* constants.
        Remove those of VIDIOC_SUBDEV_* constants are defined exactly the same
        way by the Linux kernel as their VIDIOC_* origins.

        Linux kernel commit v4.19-rc1~137^2~248 introduced more of such
        duplicates, forward remove them as well.

        * linux/32/ioctls_inc_align16.h: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
        VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS,
        VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_QUERY_DV_TIMINGS,
        VIDIOC_SUBDEV_S_DV_TIMINGS, and VIDIOC_SUBDEV_S_EDID.
        * 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.
        * maint/ioctls_sym.sh: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
        VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUMSTD,
        VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_G_STD,
        VIDIOC_SUBDEV_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERYSTD,
        VIDIOC_SUBDEV_S_DV_TIMINGS, VIDIOC_SUBDEV_S_EDID, and
        VIDIOC_SUBDEV_S_STD.

2018-09-27  Dmitry V. Levin  <ldv@altlinux.org>

        xtensa: fix typo in pkey_alloc syscall number.
        * linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349.

2018-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: print _IOC_NONE in symbolic form even if it is equal to 0.
        On some architectures _IOC_NONE equals to 1, on others it is 0.
        Change the way how ioctl direction flags are printed so that
        _IOC_NONE is printed in symbolic form even if it is equal to 0.

        * xlat/ioctl_dirs.in (_IOC_NONE): Move to the head of the list.
        * tests/ioctl_inotify.c (main): Update expected output.
        * tests/ioctl_loop. (main): Likewise.c
        * tests/ioctl_perf.c (main): Likewise.
        * tests/ioctl_scsi.c (main): Likewise.

2018-09-18  Dmitry V. Levin  <ldv@altlinux.org>

        Disable git-archive.
        Since configure uses git-version-gen which in turn depends
        on "git describe" or  a .tarball-version file, raw archives
        generated by "git archive" cannot be built.

        * .gitattributes: New file.
        * README-github_gitlab-autogenerated-archives.txt: Likewise.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        Workaround signedness bugs in system NLMSG_OK reported by -Wsign-compare
        Introduce a replacement for NLMSG_OK provided by <linux/netlink.h> since
        that system macro contains signedness bugs that are not going to be fixed.

        * netlink.h: Include <stdbool.h>.
        (is_nlmsg_ok): New static inline function.
        * socketutils.c (receive_responses): Use it instead of NLMSG_OK.
        * tests/netlink_inet_diag.c (check_responses): Likewise.
        * tests/netlink_netlink_diag.c (check_responses): Likewise.
        * tests/netlink_unix_diag.c (check_responses): Likewise.

        Closes: https://github.com/strace/strace/issues/79

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests/sprintrc.c: drop redundant check.
        * tests/sprintrc.c (sprintrc_ex): Remove fmt check, this also fixes the
        warning reported by clang -Wtautological-constant-out-of-range-compare.

        build: enable gcc -Woverride-init and clang -Winitializer-overrides.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Winitializer-overrides
        and -Woverride-init.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: exclude arm_sync_file_range from ksysent test.
        arm_sync_file_range is better known as sync_file_range2.

        * tests/ksysent.sed: Filter out arm_sync_file_range.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        Ignore warnings about overridden initialization of hwaddr_sizes.
        As hwaddr_sizes array is explicitly initialized this way,
        ignore potential warnings reported by gcc -Woverride-init
        and clang -Winitializer-overrides.

        * gcc_compat.h (CLANG_PREREQ): New macro.
        (DIAG_PUSH_IGNORE_OVERRIDE_INIT, DIAG_POP_IGNORE_OVERRIDE_INIT): New
        macros non-trivially defined for gcc >= 4.2 and clang >= 2.8.
        * sock.c (print_ifreq): Use them to ignore warnings about overridden
        initialization of hwaddr_sizes array.

        Closes: https://github.com/strace/strace/issues/77

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround clang -Wunneeded-internal-declaration bug.
        * tests/execve.c (main): Explicitly mark q_envp variable as used
        to workaround clang -Wunneeded-internal-declaration bug.
        * tests/execveat.c (main): Likewise.
        * tests/nsyscalls.c (main): Explicitly mark syscallent variable as used
        to workaround clang -Wunneeded-internal-declaration bug.

        Closes: https://github.com/strace/strace/issues/78

2018-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        process: honor xlat style in print_user_offset_addr.
        * process.c (print_user_offset_addr): Print in accordance with xlat
        verbosity setting.

        time: add xlat styles support to printclockname.
        * time.c (printclockname): Respectl xlat_verbosity.

        perf: rewrite print_perf_event_attr using PRINT_FIELD_* macros.
        * perf.c: Include "print_fields.h".
        (PRINT_XLAT): Remove.
        (print_perf_event_attr): Use PRINT_FIELD_* macros.

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check stack unwinding for signals.
        * tests/stack-fcall-3.c: Include <signal.h>.
        (f3): Call getpid or kill depending on the argument, store getpid result.
        * tests/stack-fcall.c (main): Remove arguments, call f0(0) and f0(1).
        * tests/strace-k-demangle.expected: Update expected output.
        * tests/strace-k.expected: Likewise.
        * tests/strace-k.test: Rewrite pattern matching code.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print stack traces on signals.
        I don't know why it hasn't been done earlier.

        * strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print
        if stack trace printing is enabled.

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for open_access_modes constants.
        * xlat/open_access_modes.in: Add fallback values.

        xlat: update resources.
        * xlat/resources.in: Declare as #value indexed, provide fallback values.
        (RLIMIT_VMEM): Remove.

        nlattr: ignore nla_type flags when selecting nlattr decoder.
        * nlattr.c (decode_nlattr_with_data): Apply NLA_TYPE_MASK to nla_type
        before decoder selection.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_packet_diag: assorted decoding fixes.
        * xlat/af_packet_versions.in: New file.
        * netlink_packet_diag.c: Include "xlat/af_packet_versions.h".
        (decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol,
        currently it should be set to 0.
        (decode_packet_diag_info): Decode pdi_version field using af_packet_versions
        xlat; decode pdi_index field as an interface index.
        (packet_diag_msg_nla_decoders) <PACKET_DIAG_UID>: Decode using
        decode_nla_uid.
        (decode_packet_diag_msg): Decode pdiag_num as an low-level protocol.
        * tests/netlink_sock_diag.c: Update expected output.
        * tests/nlattr_packet_diag_msg.c: Likewise.

        sockaddr: add X.25 socket address decoding support.
        * sockaddr.c: Include <linux/x25.h>.
        (print_sockaddr_data_x25): New function.
        (sa_printers) <[AF_X25]>: New socket address handler.
        * tests/net-sockaddr.c (check_x25): New function.
        (main): Use it to check X.25 socket address decoding.

        net: add support for AX.25 protocols and socket option names decoding.
        * xlat/ax25_protocols.in: New file.
        * xlat/sock_ax25_options.in: Likewise.
        * net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h".
        * (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
        ax25_protocols xlat.
        (print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
        using sock_ax25_options xlat.

        sockaddr: decode AX.25 socket addresses.
        * defs.h (print_ax25_addr): New prototype.
        * print_fields.h (PRINT_FIELD_AX25_ADDR): New macro.
        * sockaddr.c: Include <linux/ax25.h>.
        (check_ax25_address, ax25_addr2str, print_ax25_addr_raw,
        print_ax25_addr, print_sockaddr_data_ax25): New functions.
        (sa_printers) <[AF_AX25]>: New printer.
        * tests/net-sockaddr.c (AX25_ADDR): New macro.
        (check_ax25): New function.
        (main): Use it to check AX.25 socket address decoding.

        macros: add ROUNDUP macro.
        * macros.h (ROUNDUP): New macro.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: recognise FUTEX_BITSET_MATCH_ANY bitmask.
        * xlat/futexbitset.in: New file.
        * futex.c: Include "xlat/futexbitset.h".
        (futex) <FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET>: Decode val3 using
        futexbitset xlat.
        * tests/futex.c: Add checks for 0xffffffff bitset mask printing.

        Closes: Linux commit v4.16-rc1~166^2^2~2

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioprio: move constant definitions to xlat.
        * xlat/ioprio_class.in: Add fallback values.
        * xlat/ioprio_who.in: Likewise.
        * ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums.

        net: decode AF_PACKET protocols in socket syscall.
        * net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode.
        (SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols xlat.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_ifindex: add public get_ifname method.
        In order to be able to obtain sanitised device name internally.

        * defs.h (get_ifname): New declaration.
        * print_ifindex.c (get_ifname): Refactor, leaving out addition
        of if_nametoindex("") part.
        (sprint_ifname): New function, adds if_nametoindex("")
        to get_ifname's output.
        (print_ifindex): Use sprint_ifname instead of get_ifname.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketutils: introduce get_family_by_proto.
        Add a helper function that returns address family based on the internal
        notion of the socket protocol using protocols table.

        * defs.h (get_family_by_proto): New declaration.
        * socketutils.c (get_family_by_proto): New function.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketutils: add more IP/IPv6 transport protocols.
        * defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP,
        SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW,
        SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6,
        SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6.
        * socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY
        mode.
        (protocols): Add protocol descriptions for them.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketutils: store more information in protocols table.
        This also allows getting rid of all these *_v[46]_get calls.

        * socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol,
        and proto_name paramteres, use them where appropriate.
        (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove.
        (protocols): Add family and proto fields to the structure, call inet_get
        for IP/IPv6 protocols.
        (get_sockaddr_by_inode_uncached): Update protocols->get calls.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: whitespace cleanup, fix typo in comment.
        * sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess
        indentation from the switch statement.

        tests: add utimensat test variants with different xlat verbosity levels.
        * tests/utimensat-Xabbrev.c: New file.
        * tests/utimensat-Xraw.c: Likewise.
        * tests/utimensat-Xverbose.c: Likewise.
        * tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw,
        and utimensat-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New
        tests.

        print_timespec: make print_timespec_t_utime respect xlat style setting.
        * print_timespec.c (print_timespec_t_utime): Print raw timespec value
        in accordance with xlat style setting.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink: honor custom xlat style setting during nlmsg flags printing.
        Commit v4.23~343 introduced xlat style argument to printflags_ex, but
        XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342,
        which led to missing out fixing the sole external user of this
        peculiar extended interface.

        * netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of
        XLAT_STYLE_ABBREV in printflags_ex call.

        Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT"

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_netfilter: use xlat styles for res_id workaround printing.
        * netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex
        in order to respect xlat style setting.

        xlat: provide fallback definitions for epollevents.
        * xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL
        constant (introduced by Linux commit v4.16-rc1~3^2~3).

        xlat: provide fallback definitions to pollflags.
        * xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
        POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.

        xlat: provide fallback values for socktypes.
        * xlat/socktypes.in: Provide fallback values.

        xlat: provide fallback values to route_nexthop_flags.
        * xlat/route_nexthop_flags.in: Add fallback values.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        block: move fallback definitions for ioctl commands to xlat.
        * xlat/block_ioctl_cmds.in: New file.
        * block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
        (BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN,
        BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET,
        BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove
        fallback definitions as those are porvided by block_ioctl_cmds xlat now.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Decode BLKGETSIZE64 unconditionally.
        It is available on all supported kernel versions.

        * block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64.
        * configure.ac: Remove BLKGETSIZE64 check.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add ability to specify a default string to print_xlat_ex.
        In order to avoid dealing with xlat verbosity styles outside xlat code
        as much as possible.

        * defs.h (xlat_style_private_flag_bits): Rename from
        print_array_flag_bits, add PXF_DEFAULT_STR_BIT.
        (xlat_style_private_flags): Rename from print_array_flags, add
        FLAG_(PXF_DEFAULT_STR).
        * xlat.c (print_xlat_ex): Handle PXF_DEFAULT_STR by interpreting str
        as a default value (print both value and str in XLAT_STYLE_ABBREV).

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: provide common AF_INET{,6} address decoders.
        Rename decode_ifla_inet6_token to decode_nla_in6_addr,
        add a sister function decode_nla_in_addr for future use.

        * nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions.
        * nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations.
        * rtnl_link.c (decode_ifla_inet6_token): Remove.
        (ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: decode SOL_XDP socket option names.
        * xlat/sock_xdp_options.in: New file.
        * net.c: Include "xlat/sock_xdp_options.h".
        (print_sockopt_fd_level_name) <case SOL_XDP>: Print SOL_XDP socket
        option names.

        xlat: add SOL_XDP to socketlayers.in.
        * xlat/socketlayers.in (SOL_XDP): New constant, introduced by Linux
        commit v4.18-rc1~114^2~304^2~4^2~14.

        xlat: add AF_XDP to addrfams.in.
        * xlat/addrfams.in (AF_XDP): New constant, introduced by Linux commit
        v4.18-rc1~114^2~304^2~4^2~14.

        netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value.
        * xlat/sock_shutdown_flags.in: New file.
        * netlink_smc_diag.c: Include "xlat/sock_shutdown_flags.h".
        (decode_smc_diag_shutdown): New function.
        (smc_diag_msg_nla_decoders) <[SMC_DIAG_SHUTDOWN]>: Use
        decode_smc_diag_shutdown.
        * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_SHUTDOWN.

        tests/ioctl_v4l2: do not calculate page end address each time.
        * tests/ioctl_v4l2.c (main): Replace page + size with page_end.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields: simplify UINT64_MAX printing.
        As we have print_xlat_u now.

        * print_fields.h (PRINT_FIELD_U64): Use print_xlat_u for UINT64_MAX
        printing.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nsfs: simplify auxstr logic.
        There's no need to check whether non-NULL value is being assigned to
        auxstr; syscall_exiting_trace does it itself.

        * nsfs.c (nsfs_ioctl) <case NS_GET_NSTYPE>: Simply assign result of
        xlookup to auxstr if syserror(tcp) is false.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_REUSEPORT): New constant,
        introduced by Linux commit v4.19-rc1~140^2~24^2~2^2~5.
        * tests/bpf.c: Update expected output.

        xlat: add IPSTATS_MIB_REASM_OVERLAPS to snmp_ip_stats_mib.in.
        * xlat/snmp_ip_stats.in (IPSTATS_MIB_REASM_OVERLAPS): New constant,
        introduced by Linux commit v4.19-rc1~140^2~128^2~2.

        xlat: update bpf_map_types.in.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_CGROUP_STORAGE): New constant,
        introduced by Linux commit v4.19-rc1~140^2~108^2~3^2~12.
        (BPF_MAP_TYPE_REUSEPORT_SOCKARRAY): New constant, introduced by Linux
        commit v4.19-rc1~140^2~24^2~2^2~6.
        * tests/bpf.c: Update expected output.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: add IFLA_MIN_MTU and IFLA_MAX_MTU attributes.
        Introduced by Linux commit v4.19-rc1~140^2~205^2~1.

        * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>:
        New decoder, calls decode_nla_u32.
        * xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add IPV4_DEVCONF_BC_FORWARDING-1 to inet_devconf_indices.in.
        * xlat/inet_devconf_indices.in (IPV4_DEVCONF_BC_FORWARDING-1): New
        constant, introduced by Linux commit v4.19-rc1~140^2~208^2~1.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_netconf: add NETCONFA_BC_FORWARDING attribute.
        Introduced by Linux commit v4.19-rc1~140^2~208^2~1.

        * rtnl_netconf.c (netconfmsg_nla_decoders) <[NETCONFA_BC_FORWARDING]>:
        New decoder, calls decode_nla_s32.
        * xlat/rtnl_netconf_attrs.in (NETCONFA_BC_FORWARDING): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_smc_diag: add SMC_DIAG_FALLBACK attribute support.
        Introduced by Linux commit v4.19-rc1~140^2~253^2~1.

        * linux/smc_diag.h (SMC_DIAG_FALLBACK): New enumeration item.
        (struct smc_diag_fallback): New type definition.
        * netlink_smc_diag.c: Include "xlat/smc_decl_codes.h".
        (decode_smc_diag_fallback): New function.
        (smc_diag_msg_nla_decoders) <[SMC_DIAG_FALLBACK]>: New decoder, calls
        decode_smc_diag_fallback.
        * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_FALLBACK
        attribute decoding.
        * xlat/smc_decl_codes.in: New file.
        * xlat/smc_diag_attrs.in (SMC_DIAG_FALLBACK): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add style argument to printxval_search_ex macro.
        It is identical to printxval_search otherwise.

        * defs.h (printxval_search_ex): Add style argument.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update v4l2_pix_fmts.in.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT): New constant, introduced by
        Linux commit v4.19-rc1~137^2~221.
        (V4L2_PIX_FMT_SBGGR14P, V4L2_PIX_FMT_SGBRG14P, V4L2_PIX_FMT_SGRBG14P,
        V4L2_PIX_FMT_SRGGB14P): New constants, introduced by Linux commit
        v4.19-rc1~137^2~97.
        (V4L2_PIX_FMT_Y10P): New constant, introduced by Linux commit
        v4.19-rc1~137^2~95.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_smc_diag: decode smc_diag_msg.diag_fallback constant names.
        Introduced by Linux commit v4.19-rc1~140^2~285^2~4.

        * xlat/smc_diag_mode.in: New file.
        * netlink_smc_diag.c: Include "xlat/smc_diag_mode.h".
        (decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode
        xlat.
        * tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output.
        * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: add IFLA_BRPORT_BACKUP_PORT attribute.
        Introduced by Linux commit v4.19-rc1~140^2~288^2.

        * xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New
        constant.
        * rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>:
        New decoder.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update nt_descriptor_types.in.
        * xlat/nt_descriptor_types.in (NT_VMCOREDD): New named constant,
        introduced by Linux commit v4.18-rc1~114^2~252^2~2.
        (NT_MIPS_DSP): New named constant, introduced by Linux commit
        v4.19-rc1~42^2~63.
        (NT_MIPS_FP_MODE): New named constant, introduced by Linux commit
        v4.19-rc1~42^2~62.

        xlat: add AUDIT_INTEGRITY_POLICY_RULE to nl_audit_types.in.
        * xlat/nl_audit_types.in (AUDIT_INTEGRITY_POLICY_RULE): New constant,
        introduced by Linux commit v4.19-rc1~124^2~5.

        rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value.
        * xlat/rtnl_ifla_xdp_attached_mode.in: New file.
        * rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h".
        (decode_ifla_xdp_attached): New function.
        (ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use
        decode_ifla_xdp_attached instead of decode_nla_u8.
        * tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: add new IFLA_XDP_* attributes.
        Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6.

        * xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID,
        IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants.
        * rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for
        IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID.
        * tests/nlattr_ifla_xdp.c: Add checks for new attributes.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update v4l2_control_ids.in.
        * xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_VP8_PROFILE): Renamed
        from V4L2_CID_MPEG_VIDEO_VPX_PROFILE (the latter is now a synonym),
        by Linux commit v4.19-rc1~137^2~270.
        (V4L2_CID_MPEG_VIDEO_VP9_PROFILE): New constant, introduced by Linux
        commit v4.19-rc1~137^2~269.

        xlat: add SO_TXTIME to sock_options.in.
        * xlat/sock_options.in (SO_TXTIME): New constant, introduced by Linux
        commit v4.19-rc1~140^2~465^2~12.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding.
        The message has been added by Linux commit v4.19-rc1~140^2~507^2~1.

        * linux/smc_diag.h: Include "gcc_compat.h".
        (enum): Add SMC_DIAG_DMBINFO.
        (struct smcd_diag_dmbinfo): New type definition.
        * xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant.
        * netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function.
        (smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls
        decode_smc_diag_dmbinfo.
        * tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add SCTP_REUSE_PORT to sock_sctp_options.in.
        * xlat/sock_sctp_options.in (SCTP_REUSE_PORT): New constant, introduced
        by Linux commit v4.19-rc1~140^2~518.

        xlat: add IN_MASK_CREATE to inotify_flags.in.
        * xlat/inotify_flags.in (IN_MASK_CREATE): New constant, introduced by
        Linux commit v4.19-rc1~115^2.
        * tests/inotify.c (main): Update expected output.

2018-08-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
        * tests/nsyscalls.c (test_syscall): Do not assume that unimplemented
        syscalls always fail with ENOSYS.

        tests: workaround systemd-nspawn habit of disabling mlockall syscall.
        * tests/mmap.c (main): Do not assume that mlockall syscall always
        succeeds.

        tests: workaround systemd-nspawn habit of disabling munlockall syscall.
        * tests/munlockall.c (main): Do not assume that munlockall syscall
        always succeeds.

2018-08-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Decode AF_SMC netlink messages unconditionally.
        As smc_diag.h is bundled, there is little sense to build AF_SMC support
        conditionally.

        * netlink_smc_diag.c [!AF_SMC]: Include xlat/addrfams.h under
        XLAT_MACROS_ONLY, enable the rest of file.
        * netlink_sock_diag.c: Include xlat/addrfams.h under XLAT_MACROS_ONLY.
        (diag_decoders): Remove "ifdef AF_SMC" condition for [AF_SMC], reorder
        in accordance with address family values.
        * tests/nlattr_smc_diag_msg.c [!AF_SMC]: Define AF_SMC to 43, enable
        the rest of test.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        strace.c: introduce struct tcb_wait_data.
        Introduce a new structure to pass information between next_event(),
        restart_delayed_tcb(), and dispatch_event().

        This is going to be used by a subsequent change of next_event().

        * strace.c (struct tcb_wait_data): New type.
        (next_event): Remove parameters, return a pointer
        to const struct tcb_wait_data.  Return NULL instead of TE_BREAK.
        (dispatch_event): Replace all parameters with a pointer
        to const struct tcb_wait_data, obtain the trace event, siginfo,
        and status from its fields.
        (restart_delayed_tcb): Add local struct tcb_wait_data variable
        with te field set to TE_RESTART, pass it to dispatch_event().
        (main): Remove status and si variables, update next_event()
        and dispatch_event() invocations.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: fix typo in smc_protocols.in.
        * xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        ci: add a test with the latest gcc and mainline headers.
        * .gitlab-ci.yml (gcc-x86_64-libdw-mainline): New entry.
        * .travis.yml (CC=gcc-8, KHEADERS=torvalds/linux): Likewise.

        ci: update gitlab ubuntu image.
        * .gitlab-ci.yml (image): Replace "ubuntu:17.10" with "ubuntu:18.04".

        ci: install kernel headers after compiler dependencies.
        * ci/install-dependencies.sh: Install kernel headers after compiler
        dependencies to avoid a needless attempt to install $common_packages.

        ci: fix kernel headers version diagnostics.
        * ci/run-build-and-tests.sh: Honor $CPPFLAGS when printing
        kernel headers version.

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

        tests: enhance test coverage of evdev ioctl.
        * tests/ioctl_evdev.c (main): Test EVIOCGMTSLOTS(8) command.

        tests: check decoding of successful evdev ioctl.
        * tests/ioctl_evdev-success.c: New file.
        * tests/ioctl_evdev-success-v.c: Likewise.
        * tests/ioctl_evdev-success.test: New test.
        * tests/ioctl_evdev-success-v.test: Likewise.
        * tests/.gitignore: Add ioctl_evdev-success and ioctl_evdev-success-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add the two tests mentioned above.

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

        evdev: fix decoding of EVIOCGBIT(0, ...)
        There is a comment in drivers/input/evdev.c which says:
        /* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */

        That is, EVIOCGBIT(0, ...) should return a bit mask with supported
        event types instead of SYN_* event codes.

        * defs.h (evdev_ev): New prototype.
        * evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h".
        (bit_ioctl) <case EV_SYN>: Replace EV_SYN with 0, use evdev_ev
        with XT_SORTED in decode_bitset invocation instead.
        * ioctl.c: Do not include "xlat/evdev_ev.h".
        (evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN".
        * tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT
        output.
        * xlat/evdev_sync.in: Remove.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Fixes: v4.10~89 "Add decoding for evdev ioctls"

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

        evdev: fix decoding of bit sets.
        According to drivers/input/evdev.c:bits_to_user(),
        the Linux kernel returns the number of bytes, not bits.

        * evdev.c (decode_bitset_): Treat syscall return value as the number
        of bytes.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Fixes: v4.10~89 "Add decoding for evdev ioctls"

2018-08-19  Pierre Marsais  <pierre.marsais@lse.epita.fr>

        kvm: decode the argument of KVM_CHECK_EXTENSION.
        xlat/kvm_cap.in has been generated using the following command line:

        grep '#define\s\+KVM_CAP' $linux/include/uapi/linux/kvm.h |
        sed -E -e 's/^#define\s+([^ \t]+)\s*([0-9]+).*$/printf "%-40s%s\n" \1 \2/e' \
               -e 's/ {8}/\t/g; s/ +/\t/g'

        * xlat/kvm_cap.in: New file.
        * kvm.c: Include "xlat/kvm_cap.h".
        (kvm_ioctl_decode_check_extension): New function.
        (kvm_ioctl): Use it.
        * tests/ioctl_kvm_run_common.c (main): Check decoding
        of KVM_CHECK_EXTENSION command.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update V4L2_CID_USER_*_BASE constants.
        * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_S2255_BASE,
        V4L2_CID_USER_SI476X_BASE, V4L2_CID_USER_SAA7134_BASE,
        V4L2_CID_USER_ADV7180_BASE, V4L2_CID_USER_TC358743_BASE,
        V4L2_CID_USER_MAX217X_BASE): New constants.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: workaround V4L2_CID_USER_IMX_BASE Linux kernel ABI breakage.
        Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48
        has changed the value of V4L2_CID_USER_IMX_BASE constant introduced
        by commit v4.13-rc1~141^2~121 because the old value was already used
        by V4L2_CID_USER_MAX217X_BASE.

        This is of course an ABI breakage that affects Linux kernels starting
        with 4.13 and up to 4.18, as well as their LTS derivatives.

        Since the imx driver didn't provide any public control ID definitions,
        it looks like the best way to handle this situation is to pretend that
        the old value of V4L2_CID_USER_IMX_BASE didn't exist.

        * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_IMX_BASE): Redefine.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.24-1.
        * strace.spec.in: Likewise.

        Prepare for 4.24 release.
        * NEWS: Update for 4.24 release.

2018-08-12  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2018-08-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.18.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.18-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/s390x/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux v4.18.
        * maint/ioctls_sym.sh: Add workaround for linux/omap3isp.h file.

2018-08-12  Dmitry V. Levin  <ldv@altlinux.org>

        Replace BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL.
        Linux kernel commit v4.18-rc1~37^2~66 introduced FS_IOC_[GS]ETFSLABEL
        ioctl constants as generalized copies of BTRFS_IOC_[GS]ET_FSLABEL.

        * linux/32/ioctls_inc_align16.h: Replace BTRFS_IOC_[GS]ET_FSLABEL
        with FS_IOC_[GS]ETFSLABEL.
        * 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.
        * maint/ioctls_sym.sh: Remove BTRFS_IOC_[GS]ET_FSLABEL.
        * tests/btrfs.c (FS_IOC_GETFSLABEL, FS_IOC_SETFSLABEL): Add fallback
        definitions.
        (btrfs_test_label_ioctls, btrfs_test_read_ioctls): Replace
        BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL.

2018-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        open.c: use __O_TMPFILE.
        As it is the flag kernel actually checks against,
        and it is now guaranteed to have a fallback definition.

        * open.c (STRACE_O_TMPFILE): Remove.
        (decode_open): Use __O_TMPFILE instead of STRACE_O_TMPFILE.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: regenerate sock_options.in.
        * xlat/sock_options.in: Regenerate using maint/gen_xlat_defs.sh script.
        * xlat/sock_options.sh: Remove.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add fallback definitions to open_mode_flags.
        * xlat/open_mode_flags.in: Regenerate using maint/gen_xlat_defs.sh script
        to provide fallback definitions.  Implement a workaround for O_NDELAY.

        Co-Authored-by: Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: remove non-Linux flags from open_mode_flags.
        * xlat/open_mode_flags.in (O_PRIV, FNDELAY, FAPPEND, FMARK, FDEFER,
        FSHLOCK, FEXLOCK, FCREAT, FTRUNC, FEXCL, FNBIO, FSYNC, FNOCTTY,
        O_SHLOCK, O_EXLOCK): Remove flags that are not present in Linux.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add fallback definitions to madvise_cmds.
        * xlat/madvise_cmds.in: Regenerate using maint/gen_xlat_defs.sh script
        to provide fallback definitions.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add fallback definitions to mmap_flags.
        * xlat/mmap_flags.in: Regenerate using maint/gen_xlat_defs.sh script
        to provide fallback definitions.  Implement a workaround for MAP_RENAME.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint: add a Linux UAPI headers crawler.
        This script is going to be used to generate xlat fallback values.

        * maint/gen_xlat_defs.sh: New file.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: use $RPM_OPT_FLAGS when building auxiliary programs.
        * strace.spec.in: Set CFLAGS_FOR_BUILD to "$RPM_OPT_FLAGS" so that
        $RPM_OPT_FLAGS is honored when building auxiliary programs like
        ioctlsort.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: compress changelog files.
        Some say uncompressed changelog files are too big.

        * strace.spec.in: Compress ChangeLog and ChangeLog-CVS using gzip -9n.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: use a SUSE-specific group name for SUSE.
        Since, apparently, it isn't quite happy with a simple group name
        "Development/Debuggers".

        * strace.spec.in (Group): Add %{?suse_version:/Tools}.

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.spec.in: use a SUSE-specific license name for SUSE.
        Since, apparently, it isn't quite happy with a simple "BSD".

        * strace.spec.in (License): Add %{?suse_version:-3-Clause}.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: allow any error code when trying to set time.
        Lower expectations of particular error code numbers when trying to set
        time.  This helps to workaround issues with unexpected return codes
        in some exotic environments where EPERM is returned instead of EINVAL
        (e.g. mock that uses systemd-nspawn).

        * tests/clock_xettime.c (main): Do not hardcode EINVAL, print return
        codes using sprintrc.
        * tests/xettimeofday.c (main): Likewise.
        * NEWS: Mention this fix.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390x: fix build with old kernel headers.
        Avoid defining psw_compat_t and s390_compat_regs if their definitions
        are provided by kernel.  Before Linux commit v3.10-rc1~201^2~11,
        these definition were available in <asm/ptrace.h>.

        * configure.ac (AC_CHECK_TYPES): Check for s390_compat_regs.
        * linux/s390x/arch_regs.c [HAVE_S390_COMPAT_REGS]: Do not define
        psw_compat_t and s390_compat_regs.
        * NEWS: Mention this fix.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: minor updates here and there.
        * strace.spec.in: Add descriptive comments to build requirements.
        Introduce %maybe_use_defattr and use it instead of %defattr.
        Add output of ld --version to the build environment information.
        Use printf instead of echo -e.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: remove strace64 subpackage.
        strace64 subpackage used to be installed into ppc32 and sparc32
        userspace running by a 64-bit kernel to trace 64-bit processes.

        As simultaneous decoding of processes running both in 64-bit and 32-bit
        personality is fully supported on every architecture with compat kernel
        support for quite some time, one can just install a 64-bit strace and
        there is no more need for that strace64 kludge.

        * strace.spec.in (strace64_arches, copy64, %ifarch %{strace64_arches}):
        Remove.

2018-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

        Update NEWS.

        rtnl_route: decode new RTA_* attributes.
        * rtnl_route.c (rtmsg_nla_decoders): Add entries for RTA_IP_PROTO,
        RTA_SPORT, and RTA_DPORT.

        xlat: update RTA_* constants.
        * xlat/rtnl_route_attrs.in: Add RTA_IP_PROTO, RTA_SPORT, and RTA_DPORT
        * constants introduced by Linux kernel commit v4.18-rc1~114^2~165^2~2.

        rtnl_link: decode new IFLA_BRPORT_* attributes.
        * rtnl_link.c (ifla_brport_nla_decoders): Add entries for
        IFLA_BRPORT_GROUP_FWD_MASK, IFLA_BRPORT_NEIGH_SUPPRESS, and
        IFLA_BRPORT_ISOLATED.

        xlat: update IFLA_BRPORT_* constants.
        * xlat/rtnl_ifla_brport_attrs.in: Add IFLA_BRPORT_GROUP_FWD_MASK
        constant introduced by Linux kernel commit v4.15-rc1~84^2~607.
        Add IFLA_BRPORT_NEIGH_SUPPRESS constant introduced by Linux kernel
        commit v4.15-rc1~84^2~523^2~2.
        Add IFLA_BRPORT_ISOLATED constant introduced by Linux kernel commit
        v4.18-rc1~114^2~142.

        xlat: update IFA_* constants.
        * xlat/rtnl_addr_attrs.in: Add IFA_RT_PRIORITY constant introduced
        by Linux kernel commit v4.18-rc1~114^2~108^2~3

        xlat: update RTPROT_* constants.
        * xlat/routing_protocols.in: Add RTPROT_BGP, RTPROT_ISIS, RTPROT_OSPF,
        RTPROT_RIP, and RTPROT_EIGRP constants introduced by Linux kernel commit
        v4.18-rc1~114^2~90.

2018-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: save the script used to generate xlat/sock_options.in.
        * xlat/sock_options.sh: New file from commit message of commit v4.23~199.

2018-08-01  Zhibin Li  <08826794brmt@gmail.com>

        tests: check decoding of getsockopt(PACKET_STATISTICS)
        * tests/net-tpacket_stats.c: New file.
        * tests/net-tpacket_stats-success.c: Likewise.
        * tests/gen_tests.in (net-tpacket_stats): New test.
        * tests/net-tpacket_stats-success.test: Likewise.
        * tests/.gitignore: Add net-tpacket_stats and net-tpacket_stats-success.
        * tests/Makefile.am (check_PROGRAMS): Add net-tpacket_stats-success.
        (DECODER_TESTS): Add net-tpacket_stats-success.test.
        * tests/pure_executables.list: Add net-tpacket_stats.

        tests: check decoding of setsockopt(PACKET_[R|T]X_RING)
        * tests/net-tpacket_req.c: New file.
        * tests/.gitignore: Add net-tpacket_req.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (net-tpacket_req): New test.

        tests: check decoding of setsockopt(PACKET_[ADD|DROP]_MEMBERSHIP)
        * tests/net-packet_mreq.c: New file.
        * tests/.gitignore: Add net-packet_mreq.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (net-packet_mreq): New test.

2018-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: bring lists back to the sorted order.
        * tests/.gitignore: Make the list sorted again.
        * tests/pure_executables.list: Likewise.
        * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS):
        Likewise.

2018-07-20  Zhibin Li  <08826794brmt@gmail.com>

        tests: check decoding of successful quotactl.
        * tests/quotactl-success.c: New file.
        * tests/quotactl-success-v.c: Likewise.
        * tests/quotactl-xfs-success.c: Likewise.
        * tests/quotactl-xfs-success-v.c: Likewise.
        * tests/quotactl-success.test: New test.
        * tests/quotactl-success-v.test: Likewise.
        * tests/quotactl-xfs-success.test: Likewise.
        * tests/quotactl-xfs-success-v.test: Likewise.
        * tests/.gitignore: Add quotactl-success, quotactl-success-v,
        quotactl-xfs-success and quotactl-xfs-success-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add four new tests listed above.
        * tests/quotactl.h: [INJECT_RETVAL] (check_quota): Use errstr instead of
        sprintrc; check that returned value is equivalent to the injected one;
        append "(INJECTED)" string to errstr.
        * tests/quotactl.c: Changed condition rc != 0 to rc < 0 in callback
        functions and value of opaque pointer addr_cb_arg in order to check
        successful injection.
        * tests/quotactl-xfs.c: Likewise.

2018-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        net: enhance decoding of getsockopt(PACKET_STATISTICS)
        * net.c (print_tpacket_stats): Change decoder to match the kernel
        behaviour: getsockopt syscall accepts any non-negative *optlen and
        writes either MIN(sizeof(struct tpacket_stats), *optlen) or
        MIN(sizeof(struct tpacket_stats_v3), *optlen) bytes of data.

        net: compile SO_PEERCRED/SO_ATTACH_FILTER/SO_ATTACH_REUSEPORT_CBPF code unconditionally
        * net.c: Remove checks for SO_PEERCRED, SO_ATTACH_FILTER, and
        SO_ATTACH_REUSEPORT_CBPF macros as they are defined unconditionally
        since commit v4.23~199.

        net: enhance decoding of getsockopt(SO_PEERCRED)
        * net.c (print_ucred): Rename to print_get_ucred, change decoder
        to match the kernel behaviour: getsockopt syscall accepts any
        non-negative *optlen and writes MIN(sizeof(struct ucred), *optlen)
        bytes of data.
        (print_getsockopt): Replace print_ucred with print_get_ucred.
        * tests/so_percred.c: Include <string.h>.
        (main): Update expected output.

        net: enhance decoding of getsockopt(SO_LINGER)
        * net.c (print_get_linger): Change decoder to match the kernel
        behaviour: getsockopt syscall accepts any non-negative *optlen
        and writes MIN(sizeof(struct linger), *optlen) bytes of data.
        (print_set_linger): Move after definition of SYS_FUNC(getsockopt).
        * tests/so_linger.c: Include <stddef.h> and <string.h>.
        (main): Update expected output.

        net: generalize getsockopt length check.
        * net.c (print_getsockopt): Apply (ulen < 0 || rlen < 0) check for all
        cases.  As the kernel neither accepts nor returns a negative length
        in case of successful getsockopt syscall invocation, these negative
        values must have been forged by userspace.

2018-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build with fresh glibc.
        Workaround additional incompatibility between <sys/stat.h> and
        <asm/stat.h> introduced by glibc-2.27.9000-566-gfd70af4.

        * tests/xstatx.c (statx, statx_timestamp): Redefine before the inclusion
        of <sys/stat.h> to avoid conflicts between definitions provided by the
        linux kernel headers and the GNU libc.

2018-07-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/quotactl.h: document check_quota.
        * tests/quotactl.h (check_quota): Add a comment describing the function
        usage.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

        tests/quotactl-xfs.c: fix indentation.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

        tests: use check_quota for invalid quotactl commands.
        Use check_quota function for invalid commands instead of manual quotactl
        syscall invocations. In this way successful injection can also be checked
        for these commands in the next commit.

        * tests/quotactl.c (main): Add invalid_cmd_str and invalid_id_str local
        variables, remove unused variable rc, use check_quota instead of manual
        quotactl syscall invocations.
        * tests/quotaclt.c (main): Add invalid_cmd_str variable, remove unused
        variable rc, use check_quota instead of manual quotactl syscall invocations.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

        tests: enhance test coverage of quotactl syscall parser.
        * tests/quotactl.c (print_dqfmt): New function.
        (main): Use print_dqfmt to print flags of quota format, improve existing
        tests and add more tests for Q_GETFMT.
        * tests/quotactl-xfs.c: Improve existing tests and add more tests for
        Q_XGETQSTAT and Q_XGETQSTATV.

        tests/quotactl-xfs.c: fix typos in QCMD.
        * tests/quotactl-xfs.c (main): fix typos of sub-commands in QCMD.

        Mpersify decoder of struct xfs_dqstats.
        * xfs_quota_stat.h: New file.
        * fetch_struct_xfs_quotastat.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * quota.c: Include xfs_quota_stat.h
        (struct fs_qfilestat, struct xfs_dqstats): Moved to xfs_quota_stat.h.
        (decode_cmd_data) <case Q_XGETQSTAT>: Use fetch_struct_quotastat.

        quota: fix disorder of PRINT_FIELD invocations.
        * quota.c (decode_cmd_data) <case Q_XGETQSTAT>: Print fields
        of struct xfs_dqstats in the structure order.

2018-07-12  Zhibin Li  <08826794brmt@gmail.com>

        tests: extend coverage for other fcntl flags.
        * tests/fcntl-common.c: Include <assert.h>.
        (struct fcntl_cmd_check): New structure.
        (print_retval_flags, test_other_set_cmd, test_other_get_cmd,
        print_flags_getfd, print_flags_getsig, print_flags_getlease,
        test_fcntl_others): New functions.
        (main): Use test_fcntl_others.

2018-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        Implement -e kvm= option on all architectures.
        Make -e kvm= interface available on all architectures by adding a stub
        on those architectures that do not have <linux/kvm.h>.

        * filter_qualify.c (qualify_kvm): Define unconditionally.
        (qual_options): Define qualify_kvm entry unconditionally.
        * strace.c (usage): Mention kvm argument of -e option unconditionally.

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update bpf(2)-related constants.
        * xlat/bpf_attach_type.in (BPF_CGROUP_UDP4_SENDMSG,
        BPF_CGROUP_UDP6_SENDMSG): New constant, introduced by Linux commit
        v4.18-rc1~114^2~9^2~20^2~4.
        (BPF_LIRC_MODE2): New constant, introduced by Linux commit
        v4.18-rc1~114^2~9^2~15^2~1.
        * xlat/bpf_commands.in (BPF_BTF_LOAD): New constant, introduced by Linux
        commit v4.18-rc1~114^2~417^2~1^2~5.
        (BPF_BTF_GET_FD_BY_ID): New constant, introduced by Linux commit
        v4.18-rc1~114^2~223^2~21^2~4.
        (BPF_TASK_FD_QUERY): New constant, introduced by Linux commit
        v4.18-rc1~114^2~148^2~1^2~5.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_XSKMAP): New constant, introduced
        by Linux commit v4.18-rc1~114^2~304^2~4^2~8.
        (BPF_MAP_TYPE_SOCKHASH): New constant, introduced by Linux commit
        v4.18-rc1~114^2~223^2~5^2~2.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_LWT_SEG6LOCAL): New constant,
        introduced by Linux commit v4.18-rc1~114^2~148^2~2^2~1.
        (BPF_PROG_TYPE_LIRC_MODE2): New constant, introduced by Linux commit
        v4.18-rc1~114^2~9^2~15^2~1.
        * tests/bpf.c: Update expected output.

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Wire up io_pgetevents and rseq on hppa, microblaze, mips, powerpc, and s390
        * linux/hppa/syscallent.h ([350]): Wire up io_pgetevents syscall
        introduced by Linux commit v4.18-rc3~7^2~2.
        * linux/microblaze/syscallent.h ([399], [400]): Wire up io_pgetevents
        and rseq syscalls introduced by Linux commit v4.18-rc3~33^2~2.
        * linux/mips/syscallent-n32.h ([6331], [6332]): Wire up rseq and
        io_pgetevents syscalls introduced by Linux commits v4.18-rc2~11^2~2
        and v4.18-rc2~11^2, respectively.
        * linux/mips/syscallent-n64.h ([5327], [5328]): Likewise.
        * linux/mips/syscallent-o32.h ([4367], [4368]): Likewise.
        * linux/powerpc/syscallent.h ([388]): Wire up io_pgetevents syscall
        introduced by Linux commit v4.18-rc3~14^2~2.
        * linux/powerpc64/syscallent.h ([388]): Likewise.
        * linux/s390/syscallent.h ([382], [383]): Wire up io_pgetevents
        and rseq syscalls introduced by Linux commits v4.18-rc4~18^2~1
        and v4.18-rc4~18^2, respectively.
        * linux/s390x/syscallent.h([382], [383]): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint: improve the tag message.
        * maint/gen-tag-message.sh: Align the wording of the changes section
        header with the one used in NEWS, add a reference to CREDITS in
        "Contributors" section.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        Upgrade invalid -e kvm= argument to a fatal error.
        * filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of
        error_msg in case of invalid -e kvm= argument.
        * tests/options-syntax.test: Check it.

        Mention -e inject option in "strace -h" output.
        * strace.c (usage): Mention inject argument of -e option.

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

        tests: check decoding of vcpu auxstr.
        * tests/ioctl_kvm_run_common.c: Rename from ioctl_kvm_run.c.
        (run_kvm): Parametrize printing of KVM_RUN ioctl with print_KVM_RUN
        invocation.
        (main): Invoke optional KVM_NO_CPUID_CALLBACK macro when the old kernel
        behavior is detected.
        * tests/Makefile.am (EXTRA_DIST): Add ioctl_kvm_run_common.c.
        * tests/ioctl_kvm_run.c: New file, a wrapper around
        ioctl_kvm_run_common.c.
        * ioctl_kvm_run_auxstr_vcpu.c: Likewise.
        * tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu): New test.
        * tests/pure_executables.list: Add ioctl_kvm_run_auxstr_vcpu.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

        strace.1.in: document -e kvm=vcpu option.
        * strace.1.in (-e kvm=vcpu): Document new option.
        * NEWS: Mention -e kvm=vcpu option.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

        kvm: attach the exit reason of vcpu as auxstr to KVM_RUN output.
        In KVM, a virtual machine implementation like Qemu can access a vcpu
        via ioctl.  KVM_RUN is an ioctl command to enter vcpu.  The command
        returns control for various reasons: needs of device emulation or
        consuming time slices are the typical ones.  The vmi takes a different
        action for the reason.

        We, strace users, want to know the reason to understand kvm.  This
        change prints the reason as auxstr if "-e kvm=vcpu" option is given,
        and if strace runs on Linux 4.16.0 or higher, which includes commit
        e46b469278a59781f9b25ff608af84892963821b, "kvm: embed vcpu id to dentry
        of vcpu anon inode."

        The way to get the reason is a bit complicated because the ioctl does
        not return it to the userspace directly.  Instead, the vmi and kvm
        communicate via an area of the process virtual memory where the fd of
        vcpu is mmap'ed.  strace must peek the area to know the reason.

        The change does three things: (1) recording the area for the given vcpu
        when the target calls VCPU_CREATE to vcpu_info_list per tcb data field,
        (2) verifying the data recorded in vcpu_info_list before doing (3), and
        (3) decoding the exit reason field of the area.

        The change is complicated because there is a case that strace
        does not have a chance to do (1) if -p option is used.
        In this case, vcpu_info data created in the step (2).

        The area has more fields than "exit reason",
        dumping them may be implemented in the future.

        * defs.h (struct tcb) [HAVE_LINUX_KVM_H]: Add vcpu_info_list field.
        [HAVE_LINUX_KVM_H]: (kvm_run_structure_decoder_init,
        kvm_vcpu_info_free): New declarations.
        * strace.c (usage): Add "kvm" as a new expression for -e option.
        (droptcb): Call kvm_vcpu_info_free.
        * filter_qualify.c (qualify_kvm): New function calling
        kvm_run_structure_decoder_init to enable for attaching the exit
        reason to auxstr.
        (qual_options): Add "kvm" as an entry.
        * xlat/kvm_exit_reason.in: New file.
        * kvm.c: Include xmalloc.h and mmap_cache.h.
        (dump_kvm_run_structure): New static variable.
        (kvm_run_structure_decoder_init): New function.
        (vcpu_info): New struct definition representing the 3-tuple: vcpu file
        descriptor, id of the vcpu, and mmap'ed entry.
        (vcpu_find, vcpu_alloc, vcpu_register, vcpu_getinfo,
        kvm_vcpu_info_free): New functions to access tcb's vcpu_info_list
        field and vcpu_info data type.
        (is_map_for_file, map_len): New helper functions.
        (kvm_ioclt_run_attach_auxstr, kvm_ioctl_decode_run): New functions
        decoding vcpu exit reason and attaching the decoded data to auxstr
        field of tcb.
        (kvm_ioctl_create_vcpu): Call vcpu_register to make an entry mapping
        a file descriptor and the vcpu id associated with the fd.
        (kvm_ioctl): Call kvm_ioctl_decode_run.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: add customizable search function.
        * mmap_cache.c (mmap_cache_search_custom): New function.
        * mmap_cache.h (mmap_cache_search_fn): New type.
        (mmap_cache_search_custom): New function prototype.

2018-07-07  Pierre Marsais  <pierre.marsais@lse.epita.fr>

        tests: check verbose decoding of kvm ioctl.
        * tests/ioctl_kvm_run-v.c: New file.
        * tests/ioctl_kvm_run.c: Include xlat.h and xlat/kvm_cpuid_flags.h.
        (print_kvm_segment, print_kvm_sregs, print_kvm_regs): New functions.
        (run_kvm): Use them.
        (print_cpuid_ioctl) [VERBOSE]: Print verbose ioctl decoding.
        * tests/gen_tests.in (ioctl_kvm_run-v): New entry.
        * tests/pure_executables.list: Add ioctl_kvm_run-v.
        * tests/.gitignore: Likewise.

        tests: check decoding of kvm ioctls related to struct kvm_cpuid2.
        * tests/ioctl_kvm_run.c [!HAVE_STRUCT_KVM_CPUID2]: Skip the test.
        (KVM_MAX_CPUID_ENTRIES): New macro.
        (print_cpuid_ioctl): New function.
        (main): Add tests for cpuid related ioctl.

2018-07-07  Pierre Marsais  <pierre.marsais@lse.epita.fr>

        kvm: decode the argument of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands
        * configure.ac (AC_CHECK_TYPES): Add struct kvm_cpuid2.
        * xlat/kvm_cpuid_flags.in: New file.
        * kvm.c [HAVE_STRUCT_KVM_CPUID2]: Include "xlat/kvm_cpuid_flags.h".
        [HAVE_STRUCT_KVM_CPUID2] (print_kvm_cpuid_entry, kvm_ioctl_decode_cpuid2):
        New functions.
        (kvm_ioctl) [HAVE_STRUCT_KVM_CPUID2]: Use kvm_ioctl_decode_cpuid2.
        * NEWS: Mention this improvement.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Zhibin Li  <08826794brmt@gmail.com>

        net: fix a typo in print_tpacket_stats.

2018-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix race condition in aio.test.
        * tests/aio.c (main): Print aio_key fields before the io_submit syscall
        invocation to avoid races with the kernel.

2018-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        ci: robustify network-related operations.
        Reduce false positives by wrapping network-related operations into a loop.

        * ci/install-dependencies.sh (retry_if_failed): New function.
        Use it to invoke apt-get update, apt-get install, git clone,
        add-apt-repository, and pip install.

2018-06-29  Zhibin Li  <08826794brmt@gmail.com>

        .gitignore: ignore linux/linux.
        Ignore directory linux/linux created by workaround from commit
        v4.23-11-g15003d4.

        * .gitignore: Add /linux/linux.

2018-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems where libc relies on <linux/signal.h>
        Commit v4.23~10 has broken the build with Android's libc because it
        relies on the UAPI headers (such as <linux/signal.h>) to define various
        types, rather than copying them into the libc headers (such as <signal.h>)
        like most other Linux C libraries.

        * linux/linux/signal.h: Rename to linux/signal.h.in.
        * Makefile.am (strace_SOURCES): Remove linux/linux/signal.h.
        (EXTRA_DIST): Add linux/signal.h.in.
        (DISTCLEANFILES): Add linux/linux/signal.h.
        * configure.ac (AC_CACHE_CHECK): Check whether <linux/signal.h>
        can be used along with <signal.h>, install linux/linux/signal.h
        workaround if they cannot be used together.

        Reported-by: Elliott Hughes <enh@google.com>
        Closes: https://github.com/strace/strace/issues/72

2018-06-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add AUDIT_INTEGRITY_EVM_XATTR to nl_audit_types.
        * xlat/nl_audit_types.in (AUDIT_INTEGRITY_EVM_XATTR): New constant,
        introduced by Linux commit v4.18-rc1~100^2~9.

        xlat: add UDP_SEGMENT to sock_udp_options.
        * xlat/sock_udp_options.in (UDP_SEGMENT): New constant, introduced by
        Linux commit v4.18-rc1~114^2~377^2~8.

2018-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Remove redundant range initializers in syscallent files.
        * linux/aarch64/syscallent.h: Remove redundant range initializers.
        * linux/x32/syscallent.h: Likewise.

2018-06-17  Chen Jingpiao  <chenjingpiao@gmail.com>

        x32: move rseq syscall entry to a suitable place.
        As rseq syscall is not x32-specific, move it after the previous one
        that is not x32-specific.  Fix the unused syscall number range.

        * linux/x32/syscallent.h ([334]): Move it after [333].
        ([335 ... 511]): Update the range.

2018-06-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        aio: make iocb array output more strucutred.
        * aio.c (print_iocb): Print curly brackets.
        (print_iocbp): Do not print curly brackets.
        * tests/aio.c: Update expected output.

        aio: print IOCB_CMD_* using xlat.
        * xlat/aio_cmds.in: New file.
        * aio.c (tprint_lio_opcode): Change array of structs "cmds" to array of
        enums "subs", use printxval_indexn_ex for printing cmd, return sub type
        using subs array.

        xlat/sock_tcp_options.in: add #value_indexed.
        * xlat/sock_tcp_options.in: Add #value_indexed, provide fallback
        definitions.
        * net.c (print_sockopt_fd_level_name) <case SOL_TCP>: Use
        printxval_index instead of printxval.

        xlat/sock_tcp_options.in: update.
        * xlat/sock_tcp_options.in (TCP_ZEROCOPY_RECEIVE): New constant,
        introduced by Linux commit v4.18-rc1~114^2~351^2~1.
        (TCP_INQ): New constant, introduced by Linux commit v4.18-rc1~114^2~330.

        xlat/sigtrap_codes.in: add TRAP_UNK.
        * xlat/sigtrap_codes.in (TRAP_UNK): New constant, introduced by Linux
        commit v4.17-rc1-15-gdb78e6a.

2018-06-15  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.23-1.
        * strace.spec.in: Likewise.

2018-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.23 release.
        * NEWS: Update for 4.23 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

        tests: add missing copyright headers.
        * tests/prctl-spec-inject.test: Add copyright header.
        * tests/qualify_personality.sh: Likewise.

        maint: document release procedure.
        * maint/README-release: New file.
        * maint/gen-release-notes.sh: Likewise.
        * maint/gen-release-github.sh: Likewise.
        * maint/gen-release-gitlab.sh: Likewise.

        maint: prepend contributor names in tag messages with an asterisk.
        * maint/gen-tag-message.sh: Prepend every line of
        gen-contributors-list.sh output with an asterisk.

2018-06-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        Wire up rseq syscall.
        This new syscall was introduced by Linux commit v4.17-1308-gd7822b1.

        * linux/dummy.h (sys_rseq): New macro.
        * linux/arm/syscallent.h (398): Add rseq entry.
        * linux/i386/syscallent.h (386): Likewise.
        * linux/powerpc/syscallent.h (387): Likewise.
        * linux/powerpc64/syscallent.h (387): Likewise.
        * linux/x32/syscallent.h (334): Likewise.
        * linux/x86_64/syscallent.h (334): Likewise.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of io_pgetevents syscall.
        * configure.ac (AC_CHECK_TYPES): Check for struct __aio_sigset
        in <linux/aio_abi.h>.
        * tests/aio_pgetevents.c: New file.
        * tests/.gitignore: Add aio_pgetevents.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (aio_pgetevents): New test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement io_pgetevents syscall decoding.
        Introduced by Linux commit v4.17-rc3-7-g7a074e9.

        * print_aio_sigset.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * aio.c (print_io_getevents): Rename from SYS_FUNC(io_getevents), add
        has_usig flag, print user sigset on exiting if has_usig is set to true.
        (SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): New functions,
        wrappers for print_io_getevents.
        * linux/32/syscallent.h ([292]): Wire up io_pgetevents.
        * linux/64/syscallent.h ([292]): Likewise.
        * linux/i386/syscallent.h ([385]): Likewise.
        * linux/x32/syscallent.h ([333]): Likewise.
        * linux/x86_64/syscallent.h ([333]): Likewise.
        * NEWS: Mention this improvement.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        travis: re-enable testing with the latest mainline kernel headers.
        As <linux/signal.h> is out of the game now, the Linux commit
        v4.17-rc3-7-g7a074e9 should not cause harm anymore, so let's enable
        testing with the latest mainline kernel headers again.

        * .travis.yml (matrix): Do not specify KBRANCH for KHEADERS=torvalds/linux.

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        Workaround incompatibility between <linux/signal.h> and libc headers.
        Override <linux/signal.h> with <signal.h> so that those few linux
        headers that include <linux/signal.h> could be included along with libc
        headers.

        * linux/linux/signal.h: New file.
        * Makefile.am (strace_SOURCES): Add it.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add personality specification syntax checks.
        * tests/options-syntax.test: Add personality specification syntax
        checks.

        tests: add basic checks for personality designation support.
        * tests/qualify_personality.sh: New file.
        * tests/qualify_personality_empty.in: Likewise.
        * tests/trace_personality_32.in: Likewise.
        * tests/trace_personality_64.in: Likewise.
        * tests/trace_personality_regex_32.in: Likewise.
        * tests/trace_personality_regex_64.in: Likewise.
        * tests/trace_personality_regex_x32.in: Likewise.
        * tests/trace_personality_x32.in: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/gen_tests.in (trace_personality_32, trace_personality_64,
        trace_personality_x32, trace_personality_regex_32,
        trace_personality_regex_64, trace_personality_regex_x32): New tests.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for personality designation in regex qualifications.
        * basic_filters.c (qualify_syscall_regex): Copy syscall name
        to a temporary buffer, append the personality designation to it,
        and check it against regular expression if the syscall name
        hasn't been matched already.

        References: https://github.com/strace/strace/issues/35

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for personality designation in syscall qualifications.
        * syscall.c (personality_designators): New array.
        * defs.h (personality_designators): New declaration.
        * basic_filters.c (qualify_syscall_separate_personality,
        qualify_syscall_number_personality): New functions.
        (qualify_syscall_number): Use qualify_syscall_separate_personality for
        checking for a personality specification, call
        qualify_syscall_number_personality for setting number set for specific
        personality.
        (qualify_syscall_name_personality): New function.
        (qualify_syscall_name): Use qualify_syscall_separate_personality for
        checking for a personality specification, call
        qualify_syscall_name_personality for setting number set for specific
        personality.
        * strace.1.in (.SS Filtering): Document it.
        * NEWS: Mention it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Closes: https://github.com/strace/strace/issues/35

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add basic checks for inject=SET:syscall= expression syntax.
        * tests/qual_fault-syscall.test: New test.
        * tests/qual_inject-error-signal-syscall.test: Likewise.
        * tests/qual_inject-retval-syscall.test: Likewise.
        * tests/qual_inject-signal-syscall.test: Likewise.
        * tests/Makefile.am (MISC_TESTS): Add them.
        * tests/qual_fault-syntax.test: Add checks for inject=SET:syscall=
        expression syntax.
        * tests/qual_inject-syntax.test: Likewise.
        * tests/qual_fault.test: Append $suffix to -e fault arguments, override
        $NAME with $name_override if the latter is set.
        * tests/qual_inject-error-signal.test: Append $suffix to -e inject
        arguments, override $NAME with $name_override if the latter is set.
        * tests/qual_inject-retval.test: Likewise.
        * tests/qual_inject-signal.test: Likewise.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement injection of syscalls with no side effects as an alternative to -1
        * defs.h (INJECT_F_SYSCALL, INJECT_ACTION_FLAGS, TCB_TAMPERED_NO_FAIL,
        syscall_tampered_nofail): New macros.
        (inject_data): Add scno field.
        * filter_qualify.c (struct inject_personality_data): New type.
        (parse_inject_token): Add "pdata" argument, parse "syscall=" option.
        (parse_inject_expression): Add "pdata" argument, forward it to
        parse_inject_token.
        (qualify_inject_common) <pdata>: New variable array, pass it to
        parse_inject_expression, copy it into inject_vec.
        * syscall.c (tamper_with_syscall_entering): Inject the specified syscall
        if INJECT_F_SYSCALL is set.
        (tamper_with_syscall_exiting): Update the check for a failed syscall
        injection.
        (get_syscall_result): Update get_error invocation.
        * strace.1.in: Document new syscall injection expression.
        * NEWS: Mention it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Closes: https://github.com/strace/strace/issues/26

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: remove legacy i386 entries from the syscall entry table.
        Remove the last piece of IA-32 mode support.  Besides being obsolete,
        these bogus syscall entries cause problems with syscall name resolution.

        * linux/ia64/syscallent.h [CST > 0]: Remove.

        Complements: v4.21~17 "linux/ia64: remove IA-32 mode support"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux: set error flags in arch_set_error on POWER and Alpha.
        * alpha/set_error.c (arch_set_error): Set alpha_r3 to 1, update tracee's
        REG_A3.
        * powerpc/set_error.c (arch_set_error): Set bit 28 in CCR register,
        update tracee's PT_CCR.

        Fixes: v4.15~126 "Implement arch specific methods of changing syscall number and error code"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of IFLA_LINKINFO netlink attribute.
        * tests/nlattr_ifla_linkinfo.c: New file.
        * tests/pure_executables.list: Add nlattr_ifla_linkinfo.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (nlattr_ifla_linkinfo): New test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add print_quoted_stringn to print string with a size limit.
        This is similar to print_quoted_cstring, but not quite the same.

        * tests/print_quoted_string.c (print_quoted_stringn): New function.
        * tests/tests.h (print_quoted_stringn): New declaration.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add fallback_func argument to TEST_NESTED_NLATTR_OBJECT_EX_
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_): Add fallback_func
        argument, call it instead of print_quoted_hex.
        (TEST_NESTED_NLATTR_OBJECT_EX, TEST_NESTED_NLATTR_OBJECT): Specify
        print_quoted_hex as a fallback_func.
        * tests/nlattr_ifla_af_spec.c: Specify print_quoted_hex as
        a fallback_func in TEST_NESTED_NLATTR_OBJECT_EX_ calls.

        tests/test_nlattr.h: add ability to provide additional nlattr payload.
        * tests/test_nlattr.h (print_nlattr): Add add_data argument, print
        opening square bracket if add_data is set to true.
        (TEST_NLATTR_EX_): Rename from TEST_NLATTR_, add nla_total_len_
        argument, use it for msg_len calculation, print square brackets
        if nla_total_len_ is greater than nla_data_len_.
        (TEST_NLATTR_): New macro, a wrapper for TEST_NLATTR_EX_.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: decode struct ifla_bridge_id unconditionally.
        Since it is relatively simple.

        * rtnl_link.c (decode_ifla_bridge_id): Provide struct definition for
        the id variable.
        [!HAVE_STRUCT_IFLA_BRIDGE_ID] (decode_ifla_bridge_id): Decode struct
        ifla_bridge_id.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: specify size for ethernet protocol.
        Otherwise it tries to decode payload of size 1, which makes little
        sense.

        * nlattr.c (decode_nla_ether_proto) <opts>: Specify size field.

        Fixes: v4.22-321-gfd0cd65 "nlattr: add ethernet protocol decoder"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: use ARRSZ_PAIR where appropriate.
        It reduces code duplication somewhat and allows avoiding errors like
        the one fixed in the previous commit.

        * rtnl_link.c (decode_ifla_protinfo, decode_nla_linkinfo_data_bridge,
        decode_nla_linkinfo_data_tun, decode_ifla_linkinfo, decode_ifla_port,
        decode_ifla_vf_ports, decode_ifla_xdp,
        DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use ARRSZ_PAIR in
        decode_nlattr call arguments.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: fix incorrect variable names in ARRAY_SIZE arguments.
        * rtnl_link.c (decode_nla_linkinfo_data_bridge): Change
        rtnl_ifla_info_data_bridge_attrs to ifla_info_data_bridge_nla_decoders
        in ARRAY_SIZE call.
        (decode_nla_linkinfo_data_tun): Change rtnl_ifla_info_data_tun_attrs
        to ifla_info_data_tun_nla_decoders in ARRAY_SIZE call.

        Fixes: v4.22-328-g1e6d5a8 "rtnl_link: implement IFLA_INFO_DATA for bridges"
        Fixes: v4.22-329-g4eab3a4 "rtnl_link: implement IFLA_INFO_DATA for tun devices"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mips: add missing pure flag to syscall entries.
        * linux/mips/syscallent-n32.h ([6038], [6100], [6102], [6105], [6106],
        [6108], [6109], [6178]): Add pure flag to getpid, getuid, getgid, geteuid,
        getegid, getpgid, getpgrp, and gttid syscall descriptors.
        * linux/mips/syscallent-n64.h ([5038], [5100], [5102], [5105], [5106],
        [5108], [5109], [5178]): Likewise.
        * linux/mips/syscallent-o32.h ([4020], [4024], [4047], [4049], [4050],
        [4064], [4065], [4222]): Likewise.

        Complements: v4.21~29 "Add pure syscall flag"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mips: add missing "never fails" flag to getpgrp syscall entries.
        * linux/mips/syscallent-n32.h ([6109]): Add NF flag.
        * linux/mips/syscallent-n64.h ([5109]): Likewise.
        * linux/mips/syscallent-o32.h ([4065]): Likewise.

        Complements: v4.21~46 "Add SYSCALL_NEVER_FAILS flag to getpgrp"

2018-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

        xlat: describe IPV4_DEVCONF_* weirdness.
        * xlat/inet_devconf_indices.in: Add a comment about fallback definitions.

2018-06-07  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: fix the check for struct tc_sizespec on old kernel headers
        * configure.ac (AC_CHECK_TYPES): Include <linux/types.h> before
        <linux/pkt_sched.h> to check for struct tc_sizespec on linux kernel
        headers without v2.6.29-rc4~77^2~26 fix.

2018-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        travis: use kernel headers from v4.17.
        There is too much noise when using unreleased kernel uapi.

        * ci/install-dependencies.sh (clone_repo): Add optional "branch"
        argument, pass it to "git clone".
        ($KHEADERS): Pass $KBRANCH as branch argument of clone_repo.
        * .travis.yml (matrix): Specify KBRANCH=v4.17 for
        KHEADERS=torvalds/linux.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of IFLA_AF_SPEC netlink attribute.
        * configure.ac (AC_CHECK_TYPES): Check for struct ifla_cacheinfo in
        <linux/rtnetlink.h>
        (AC_CHECK_DECLS): Check for IFLA_AF_SPEC in <linux/rtnetlink.h>.
        * tests/nlattr_ifla_af_spec.c: New file.
        * tests/pure_executables.list: Add nlattr_ifla_af_spec.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (nlattr_ifla_af_spec): New test.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add TEST_NESTED_NLATTR_ARRAY_EX to test_nlattr.h.
        An ability to specify custom depth is going to be needed later to check
        IFLA_AF_SPEC decoding.

        * configure.ac (AC_CHECK_DECLS): Check for TCA_STAB_DATA in
        <linux/pkt_sched.h>.
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY_EX): Rename from
        TEST_NESTED_NLATTR_ARRAY, add depth_ argument, perform padding and
        output accordingly.
        (TEST_NESTED_NLATTR_ARRAY): New macro, a thin wrapper around
        TEST_NESTED_NLATTR_ARRAY_EX.
        * tests/nlattr_tca_stab.c [!HAVE_DECL_TCA_STAB_DATA] (TCA_STAB_DATA):
        New enumeration declaration.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: pass index to print_elem_ callback in TEST_NLATTR_NESTED_ARRAY.
        * tests/test_nlattr.h (TEST_NLATTR_NESTED_ARRAY): Pass array index
        to the print_elem_ callback.
        * tests/nlattr_tca_stab.c (print_uint16): Add index argument.

        tests: move common ifinfomsg boilerplate into a separate header.
        * configure.ac (AC_CHECK_DECLS): Check for IFLA_PORT_SELF, IFLA_PROTINFO, and
        IFLA_XDP in <linux/rtnetlink.h>.
        * tests/nlattr_ifla.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/nlattr_ifla_brport.c [!HAVE_DECL_IFLA_PROTINFO] (IFLA_PROTINFO):
        New declaration.
        (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
        (IFLA_ATTR): Define to IFLA_PROTINFO.
        Include nlattr_ifla.h.
        * tests/nlattr_ifla_port.c [!HAVE_DECL_IFLA_PORT_SELF] (IFLA_PORT_SELF):
        New declaration.
        (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
        (IFLA_ATTR): Define to IFLA_PORT_SELF.
        Include nlattr_ifla.h.
        * tests/nlattr_ifla_xdp.c
        * tests/nlattr_ifla_xdp.c [!HAVE_DECL_IFLA_XDP] (IFLA_XDP): New
        declaration.
        (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
        (IFLA_ATTR): Define to IFLA_XDP.
        Include nlattr_ifla.h.

        rtnl_link: implement IFLA_INFO_DATA for tun devices.
        * xlat/rtnl_ifla_info_data_tun_attrs.in: New file.
        * xlat/tun_device_types.in: Likewise.
        * rtnl_link.c: Include xlat/rtnl_ifla_info_data_tun_attrs.h and
        xlat/tun_device_types.h.
        (decode_nla_tun_type, decode_nla_linkinfo_data_tun): New functions.
        (ifla_info_data_tun_nla_decoders): New decoder dispatcher table.
        (decode_nla_linkinfo_data): Use decode_nla_linkinfo_data_tun if kind
        is
        "tun".

        rtnl_link: implement IFLA_INFO_DATA for bridges.
        * xlat/rtnl_ifla_info_data_bridge_attrs.in: New file.
        * rtnl_link.c: Include xlat/rtnl_ifla_info_data_bridge_attrs.h.
        (ifla_info_data_bridge_nla_decoders): New decoder dispatcher table.
        (decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data): New
        functions.
        (ifla_linkinfo_nla_decoders) <IFLA_INFO_DATA>: Use
        decode_nla_linkinfo_data as a decoder.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: implement IFLA_INFO_XSTATS decoding.
        So far, only CAN provides it.

        * rtnl_link.c (decode_nla_linkinfo_xstats_can,
        decode_nla_linkinfo_xstats): New function.
        (ifla_linkinfo_nla_decoders) <IFLA_INFO_XSTATS>: Use
        decode_nla_linkinfo_xstats as a decoder.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: add basic IFLA_INFO_* handling.
        Dispatch for IFLA_INFO_* attributes should be performed based on the
        string provided in a IFLA_INFO_KIND attribute.

        * nlattr.h (struct ifla_linkinfo_ctx): New type definition.
        * rtnl_link.c (decode_nla_linkinfo_kind): New function.
        (ifla_linkinfo_nla_decoders) <IFLA_INFO_KIND>: Use
        decode_nla_linkinfo_kind as decoder.
        (decode_ifla_linkinfo): Add struct ifla_linkinfo_ctx context, pass it to
        the decode_nlattr call as opaque data.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: decode IFLA_AF_SPEC.
        * xlat/in6_addr_gen_mode.in: New file.
        * xlat/inet6_devconf_indices.in: Likewise.
        * xlat/inet6_if_flags.in: Likewise.
        * xlat/inet_devconf_indices.in: Likewise.
        * xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise.
        * xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise.
        * xlat/snmp_icmp6_stats.in: Likewise.
        * xlat/snmp_ip_stats.in: Likewise.
        * rtnl_link.c: Include netinet/in.h, xlat/in6_addr_gen_mode.h,
        xlat/inet_devconf_indices.h, xlat/inet6_devconf_indices.h,
        xlat/inet6_if_flags.h, xlat/rtnl_ifla_af_spec_inet_attrs.h,
        xlat/rtnl_ifla_af_spec_inet6_attrs.h, xlat/snmp_icmp6_stats.h,
        and xlat/snmp_ip_stats.h.
        (decode_ifla_inet_conf, decode_ifla_inet6_flags,
        decode_ifla_inet6_conf, decode_ifla_inet6_stats,
        decode_ifla_inet6_cacheinfo, decode_ifla_inet6_icmp6_stats,
        decode_ifla_inet6_token, decode_ifla_inet6_agm, decode_ifla_af,
        decode_ifla_af_spec): New functions.
        (ifla_inet_nla_decoders, ifla_inet6_nla_decoders,
        nla_decoder_table_desc): New static constant variables.
        (ifinfomsg_nla_decoders) <[IFLA_AF_SPEC]>: Change value from NULL to
        decode_ifla_af_spec.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: add size check to decode_nla_xval and decode_nla_flags.
        If the field size is known, do not print as valid numbers those
        attributes that are too short, and ignore extra data.

        This change puts xval/flags printing in line with the reset of attribute
        decoders.

        * nlattr.h (struct decode_nla_xlat_opts): Add size field.
        * nlattr.c (decode_nla_xval, decode_nla_flags): Check that len is at
        least opts->size, limit len to opts->size.
        (decode_nla_ip_proto): Specify size of 1.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: add UID/GID netlink attribute decoders.
        * nlattr.h (DECL_NLA(uid), DECL_NLA(gid)): New declarations.
        * nlattr.c (decode_nla_uid, decode_nla_gid): New functions.

        nlattr: add unsigned int decoders that print in hex form.
        * nlattr.h (DECL_NLA(x8), DECL_NLA(x16), DECL_NLA(x32), DECL_NLA(x64)):
        New declarations.
        * nlattr.c (DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8),
        DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16),
        DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32),
        DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64)): New decoders.

        nlattr: add ethernet protocol decoder.
        * nlattr.h (DECL_NLA(ether_proto)): New declaration.
        * nlattr.c (process_host_order, decode_nla_ether_proto): New functions.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: add value processing support for xlat/flags nlattr decoders.
        Needed for upcoming decoder of ethernet proto which is stored in the
        host order and has to be converted to the network order before printing
        as an xval constant.  This change also adds ability to provide
        prefix/suffix in order to enclose the printed value in something that
        describes the performed conversion.

        * nlattr.h (struct decode_nla_xlat_opts): Add prefix, suffix, and
        process_fn fields.
        * nlattr.c (decode_nla_xval, decode_nla_flags): Handle process_fn,
        prefix, snd uffix parameters.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: introduce decode_nla_flags.
        Similar to decode_nla_xval.

        * nlattr.c (decode_nla_flags): New function.
        * nlattr.h: (DECL_NLA(flags)): New declaration.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: add ability to pass nla_type to decoder in decode_nlattr.
        As of now, it's impossible to introduce a dispatching nlattr decoder
        that performs actions based on the type of the message, so let's use
        a combination of zero decoder list size and non-zero decoder pointer
        for this.

        This is going to be used later in IFLA_AF_SPEC decoding.

        * nlattr.c (decode_nlattr_with_data): Handle zero size and non-NULL
        decoders in a special way.
        (decode_nlattr): Add an error message about ignoring of opaque_data
        argument when zero size and non-NULL decoders are provided.
        * nlattr.h (decode_nlattr): Add a comment about the new special case.

2018-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use STRINGIFY instead of _STR.
        Remove _STR which is essentially the same as STRINGIFY but from
        the namespace where we should not introduce new identifiers.

        * tests/tests.h (_STR): Remove.
        * tests/add_key.c (main): Replace _STR with STRINGIFY.
        * tests/keyctl.c (XARG_STR): Likewise.
        * tests/request_key.c (main): Likewise.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of IFLA_EVENT netlink attribute.
        * tests/nlattr_ifinfomsg.c (main): Add a check for IFLA_EVENT attribute
        decoding.

2018-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: handle xlat constants that are not identifiers.
        Extend xlat generator to support such input lines as
                IPV4_DEVCONF_FORWARDING-1       0

        This is going to be used later in IFLA_AF_SPEC decoding.

        * xlat/gen.sh (cond_def): If the xlat value is not an identifier name,
        extract an identifier name from the beginning of xlat value.

2018-06-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat.c: handle NULL xlat in lookup routines as incremental search.
        This is going to be used later in IFLA_AF_SPEC decoding.

        * xlat.c (xlookup): Add static variable pos, store xlat there when it is
        non-NULL, use pos for lookup.
        (xlat_search, xlat_idx): Add static variables pos and memb_left, store
        xlat and nmemb there when xlat is non-NULL, use them for lookup.
        (printxvals_ex): Store the last non-NULL xlat in static variable "last".
        If the first xlat argument is NULL, use "last" instead.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat.c: cleanup printxvals_ex a bit.
        * xlat.c (printxvals_ex): Change "str" variable visibility to the whole
        function, jump to va_end instead of duplicating call and return, return
        !!str.

        Leverage the fact that inet_protocols xlat is sorted.
        * defs.h (inet_protocols): Move up, add description.
        (inet_protocols_size): New declaration.
        * net.c (inet_protocols_size): New constant variable.
        * nlattr.c (decode_nla_ip_proto): Specify xlat_size, set xt to XT_SORTED.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print arp_hardware_types as a sorted xlat.
        * rtnl_link.c (DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use
        PRINT_FIELD_XVAL_SORTED_SIZED instead of PRINT_FIELD_XVAL for
        arp_hardware_types.
        * sock.c (print_ifreq): Likewise.

        Provide a value for arp_hardware_types_size array.
        * defs.h (arp_hardware_types_size): New declaration.
        * sockaddr.c (arp_hardware_types_size): New variable.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: introduce PRINT_FIELD_XVAL_SORTED_SIZED.
        For those cases when array definition is not readily available
        and should be provided separately.

        * print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED): New macro.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/opipe.test: remove unneeded run_prog call.
        There is no need to invoke grep using run_prog.

        * tests/opipe.test: Remove run_prog decoration for the grep invocation.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check BPF_OBJ_GET_INFO_BY_FD decoding.
        * tests/bpf-obj_get_info_by_fd-prog-v.c: New file.
        * tests/bpf-obj_get_info_by_fd-prog.c: Likewise.
        * tests/bpf-obj_get_info_by_fd-v.c: Likewise.
        * tests/bpf-obj_get_info_by_fd.c: Likewise.
        * configure.ac (AC_CHECK_HEADERS): Check for struct bpf_insn,
        struct bpf_map_info, and struct bpf_prog_info.
        * tests/pure_executables.list: Add bpf-obj_get_info_by_fd,
        bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, and
        bpf-obj_get_info_by_fd-prog-v.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (bpf-obj_get_info_by_fd,
        bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog,
        bpf-obj_get_info_by_fd-prog-v): New tests.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder further.
        * bpf.c (print_ebpf_prog): Remove "decode" argument, all users updated.
        (print_bpf_prog_info): Use the minimum of xlated_prog_len values on
        entering and exiting syscall as the size of xlated_prog_insns array
        to be decoded.  Likewise, use the minimum of nr_map_ids values on entering
        and exiting syscall as the size of map_ids array to be decoded.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder.
        * bpf.c (print_bpf_map_info): Print only those fields that are
        present in the structure, as it has been growing over time.
        (print_bpf_prog_info): Likewise.  Print map_ids field as an array
        of uint32_t instead of uint64_t; print "name" field.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder.
        As it is needed for proper info_len printing on exiting.

        * bpf.c (print_bpf_obj_info_fn): Change return type to void, add "saved"
        argument.
        (struct obj_get_info_saved): New type definition.
        (print_bpf_map_info, print_bpf_prog_info): Change return type to void,
        add "saved" argument, do not handle private tcb data allocation and
        obtainment.
        (print_bpf_obj_info_addr): Change return type to void, add tcb argument,
        print the address only on exiting.
        (print_bpf_obj_info): Change return type to void, add "saved" argument.
        (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Handle private data
        allocation/saving/restoring, use it for storing/printing info_len field.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print log_buf field as a string.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print log_buf field
        as a string.
        * tests/bpf.c: Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print xlated_prog_insns only when xlated_prog_len had not been 0.
        If xlated_prog_len is zero on entering syscall and non-zero on exiting,
        the program itself is not written into xlated_prog_insns.

        * bpf.c (print_ebpf_prog): Add decode argument, print the address only
        if decode is false.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Specify decode == true argument
        to print_ebpf_prog.
        (print_bpf_prog_info): Specify saved xlated_prog_len as decode argument
        to print_ebpf_prog.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: move print_big_u64_addr inside print_ebpf_prog.
        * bpf.c (print_ebpf_prog): Add static qualifier.  Change the type
        of "addr" argument from kernel_ulong_t to uint64_t, print it using
        print_big_u64_addr.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD), print_bpf_prog_info): Do not call
        print_big_u64_addr before print_ebpf_prog.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        bpf_attr.h: add ATTRIBUTE_ALIGNED(8) to all fields of type uint64_t.
        Our policy is that all fields of type uint64_t in this header file
        must have this attribute.

        This shouldn't cause any contradictions with <linux/bpf.h>
        unless the latter is buggy.

        By word "buggy" I mean containing such changes as Linux kernel commit
        v4.16-rc1~123^2~109^2~5^2~4.

        * bpf_attr.h (struct BPF_MAP_UPDATE_ELEM_struct): Add
        ATTRIBUTE_ALIGNED(8) to "flags" field.
        (struct bpf_prog_info_struct): Add ATTRIBUTE_ALIGNED(8) to "load_time"
        field.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: cast printf arguments to short when %h format qualifier is used.
        Reported by clang.

        * tests/mknod.c (main): Cast printf argument for %#03ho format to short.
        * tests/mknodat.c (main): Likewise.
        * tests/net-sockaddr.c (main): Cast printf argument for %hu format
        to short.
        * tests/semop.c (main): Likewise.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/evdev_keycode.in: remove constants with duplicating values.
        Those are used for describing input device category and not specific
        button.

        Reported by clang.

        * xlat/evdev_keycode.in (BTN_MOUSE, BTN_JOYSTICK, BTN_GAMEPAD, BTN_DIGI,
        BTN_WHEEL, BTN_TRIGGER_HAPPY): Remove.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        configure.ac: include <sys/socket.h> before <linux/rtnetlink.h>
        This is needed for old Linux UAPI headers that do no contain commit
        v3.1-rc2~19^2~29.

        * configure.ac: Include <sys/socket.h> before <linux/rtnetlink.h>
        in AC_CHECK_* invocations.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        configure.ac: check for linux/rtnetlink.h instead of linux/if_link.h for declarations
        Historically, type definitions and declarations related to netlink route
        interface attributes were in linux/rtnetlink.h, later they were moved
        elsewhere (first linux/if.h, then linux/if_link.h) with the inclusion
        of the corresponding header file in linux/rtnetlink.h.

        * configure.ac: Use <linux/rtnetlink.h> instead of <linux/if_link.h>
        in checks for interface netlink attributes-related declarations
        and definitions.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        m4: move the gawk script from m4/gen_bpf_attr_m4.sh into a separate file
        As it turns out, old versions of gawk do not support -e option.

        * m4/gen_bpf_attr_m4.sh: Move the gawk script ...
        * m4/gen_bpf_attr_m4.awk: ... here.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: wire up kexec_file_load syscall.
        * linux/s390/syscallent.h ([381]): Add kexec_file_load syscall.
        * linux/s390/syscallent.h ([381]): Likewise.

2018-06-01  Zhibin Li  <08826794brmt@gmail.com>

        tests: check short read of struct flock/flock64.
        * tests/fcntl-common.c (test_flock_einval): Check short read
        of struct flock.
        (test_flock64_einval): Check short read of struct flock64.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend struct flock/flock64 decoding checks.
        * tests/fcntl-common.c (test_flock_einval, test_flock): Create
        struct_kernel_flock object using tail_alloc.
        (test_flock64_einval): Create struct_kernel_flock64 object using
        tail_alloc.
        * tests/fcntl64.c (test_flock64_lk64): Likewise.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend F_OFD_* decoding checks.
        Check that non-faulty F_OFD_* fcntl operations are decoded properly.

        * tests/fcntl-common.c: Include <string.h>.
        (test_flock64_ofd): New function.
        (test_flock64): Invoke it, remove [F_OFD_SETLK].

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests/fcntl-common.c: define and initialize errstr.
        Initialize errstr inside invoke_test_syscall so that its users
        won't have to go into trouble of caring about clobbering errno.

        * tests/fcntl-common.c (errstr): New variable.
        (invoke_test_syscall): Initialize it.
        (test_flock_einval, test_flock64_einval, test_flock,
        test_f_owner_ex_type_pid): Use it.
        * tests/fcntl.c (test_flock64_undecoded): Likewise.
        * tests/fcntl64.c (test_flock64_lk64): Likewise.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests/fcntl-common.c: add fd argument to invoke_test_syscall.
        Extend invoke_test_syscall for later use with different file
        descriptors.

        * tests/fcntl-common.c (invoke_test_syscall): Add fd argument, pass it
        to TEST_SYSCALL_NR syscall.  All users updated.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c.
        This change enables F_OFD_SETLK* tests for fcntl as well.

        * tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64.
        [F_OFD_SETLK]: Remove.
        (test_flock64_einval): Move ...
        * tests/fcntl-common.c: ... here.
        (test_flock64_lk64): New protype.
        (test_flock64_einval, test_flock64): New functions.
        * tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded.
        (TEST_FLOCK64_UNDECODED): New macro.
        (test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL
        with TEST_FLOCK64_UNDECODED.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move F_OWNER_* tests to fcntl-common.c.
        This change enables F_OWNER_* tests for fcntl64 as well.

        * tests/fcntl.c: Move main, [TEST_FLOCK64_EINVAL],
        and [TEST_F_OWNER_EX] ...
        * tests/fcntl-common.c: ... here.
        (test_flock64): New prototype.
        * tests/fcntl64.c (main): Remove.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rename struct_flock.c to fcntl-common.c.
        It is not limited to struct flock, more fcntl tests are going to land
        in this file.

        * tests/struct_flock.c: Rename to fcntl-common.c.
        * tests/Makefile.am (EXTRA_DIST): Rename struct_flock.c
        to fcntl-common.c.
        * tests/fcntl.c: Likewise.
        * tests/fcntl64.c: Likewise.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of new FRA_* netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for struct fib_rule_port_range
        in <linux/fib_rules.h>.
        * tests/nlattr_fib_rule_hdr.c: Include <linux/in.h>.
        (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, FRA_DPORT_RANGE): New
        macro constants.
        [!HAVE_STRUCT_FIB_RULE_PORT_RANGE] (struct fib_rule_port_range): New
        type.
        (main): Check decoding of new FRA_* netlink attributes.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_rule: decode new FRA_* attributes.
        * nlattr.h (DECL_NLA(ip_proto), DECL_NLA(rt_proto)): New declarations.
        * nlattr.c (decode_nla_ip_proto): New function.
        * rtnl_route.c (decode_nla_rt_proto): Likewise.
        * rtnl_rule.c (decode_rule_port_rang): Likewise.
        (fib_rule_hdr_nla_decoders) <[FRA_PROTOCOL]>: New attribute, introduced
        by Linux commit v4.17-rc1~148^2~371.
        (fib_rule_hdr_nla_decoders) <[FRA_IP_PROTO], [FRA_SPORT_RANGE],
        [FRA_DPORT_RANGE]>: New attributes, introduced by Linux commit
        v4.17-rc1~148^2~328^2~4.
        * xlat/rtnl_rule_attrs.in (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE,
        FRA_DPORT_RANGE): New constants.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: introduce decode_nla_xval helper.
        * nlattr.c (decode_nla_xval): New function.
        * nlattr.h: Include "xlat.h".
        (struct decode_nla_xlat_opts): New type.
        (DECL_NLA(xval)): New declaration.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        Move definitions of xlat_type and xlat_style from defs.h to xlat.h.
        * defs.h (enum xlat_type, enum xlat_style, XLAT_STYLE_FORMAT_SHIFT,
        XLAT_STYLE_VERBOSITY_MASK, XLAT_STYLE_FORMAT_MASK, XLAT_STYLE_SPEC_BITS,
        XLAT_STYLE_MASK): Move ...
        * xlat.h: ... here.

        travis: switch from gcc-7 to gcc-8.
        * .travis.yml (matrix): Change gcc-7 to gcc-8.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use syscall() for ioctl() calls with oversized arguments.
        * tests/ioctl_inotify.c (sys_ioctl): New function.
        (main): Use sys_ioctl for ioctl calls with oversized arguments.
        * tests/ioctl_loop.c: Likewise.
        * tests/ioctl_perf.c: Likewise.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_ifindex: respect xlat style settings.
        Print interface indices according to the preferred xlat style settings.

        * print_ifindex.c (INI_PFX, INI_SFX): New helper macros.
        [HAVE_IF_INDEXTONAME] (get_ifname): New function.
        [HAVE_IF_INDEXTONAME] (print_ifindex): Implement as a wrapper around
        get_ifname and print_xlat_ex.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY, take 2
        The old code works only when an array contains exactly two items.

        * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address
        for the case of incomplete read.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: print index names in netlink meminfo array.
        * xlat/netlink_sk_meminfo_indices.in: New file.
        * nlattr.c: Include xlat/netlink_sk_meminfo_indices.h.
        (decode_nla_meminfo): Use print_array_ex, pass
        netlink_sk_meminfo_indices as index xlat table.
        * tests/nlattr_inet_diag_msg.c: Update expected output.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce ARRSZ_PAIR macro.
        A shorthand similar to ARG_STR in its purpose: it provides and ability
        to pass an array an its size without variable name duplication.

        * macros.h (ARRSZ_PAIR): New macro.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_array: add support for printing array indices.
        * defs.h (XLAT_STYLE_SPEC_BITS, XLAT_STYLE_MASK): New macro constants.
        (tfetch_mem_fn, print_fn): New typedefs.
        (enum print_array_flag_bits, enum print_array_flags): New enumerations.
        (print_array_ex): Rename from print_array, add flags, index_xlat,
        index_xlat_size, and index_dflt arguments.
        (print_array): New static inline function, a thin wrapper around
        print_array_ex.
        util.c: Include "xlat.h".
        (print_array): Rename to print_array_ex, add flags, index_xlat,
        index_xlat_size, and index_dflt arguments.  Print array indices
        according to the style settings specified by flags if PAF_PRINT_INDICES
        is set.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance printing of unfetchable object addresses in sequences and arrays
        * btrfs.c (btrfs_print_tree_search): Print the address of unfetchable
        object inside the sequence using printaddr_comment.
        * msghdr.c (decode_msg_control): Likewise.
        * execve.c (printargv): Print the address of unfetchable object inside
        the array using printaddr_comment.
        * netlink.c (fetch_nlmsghdr): Add in_array argument.  When in_array
        is true, print the address of unfetchable object using
        printaddr_comment.
        * nlattr.c (fetch_nlattr): Likewise.
        * tests/execve.c (main): Update expected output.
        * tests/execveat.c (main): Likewise.
        * tests/msg_control.c (test_scm_rights1, test_scm_rights2,
        test_scm_security): Likewise.
        * tests/netlink_protocol.c (send_query): Likewise.
        * tests/nlattr.c (test_nlattr): Likewise.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        print_array: enhance printing of unfetchable object addresses.
        When umoven_func invocation fails to fetch data, it prints the faulty
        address.  If this happens to a subsequent umoven_func invocation,
        the printed address may be undistinguishable from a valid data printed
        by print_func, e.g. when the data is printed in a numeric form like
        [0x1, 0x2, 0x3, 0xdefaced].

        Fix this source of confusion by moving the printing of the faulty
        address from umoven_func to print_array itself.  This change renames
        umoven_func to tfetch_mem_func and changes its semantics, so that
         - tfetch_mem_func never prints anything;
         - tfetch_mem_func returns true if the fetch succeeded,
           and false otherwise.

        * defs.h (print_array): Replace umoven_func argument with
        tfetch_mem_func.
        * util.c (print_array): Replace umoven_func argument with
        tfetch_mem_func, document expected tfetch_mem_func return value
        semantics.  When tfetch_mem_func returns false, print either addr
        or "... /* addr */" depending on the context (inside the array or not).
        * bpf.c (print_ebpf_prog, print_bpf_prog_info,
        BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr
        argument of print_array with tfetch_mem.
        * bpf_filter.c (print_bpf_fprog): Likewise.
        * btrfs.c (btrfs_print_logical_ino_container,
        btrfs_print_ino_path_container, btrfs_print_qgroup_inherit,
        btrfs_ioctl): Likewise.
        * dm.c (dm_decode_dm_target_deps): Likewise.
        * epoll.c (epoll_wait_common): Likewise.
        * file_ioctl.c (file_ioctl): Likewise.
        * ipc_sem.c (tprint_sembuf_array): Likewise.
        * kexec.c (print_kexec_segments): Likewise.
        * mem.c (SYS_FUNC(subpage_prot)): Likewise.
        * net.c (print_getsockopt): Likewise.
        * netlink.c (decode_nlmsgerr_attr_cookie): Likewise.
        * netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise.
        * netlink_packet_diag.c (decode_packet_diag_mclist): Likewise.
        * netlink_unix_diag.c (decode_unix_diag_inode): Likewise.
        * nlattr.c (decode_nla_meminfo): Likewise.
        * numa.c (print_nodemask, SYS_FUNC(move_pages),
        * perf_ioctl.c (perf_ioctl_query_bpf): Likewise.
        * poll.c (decode_poll_entering): Likewise.
        * printsiginfo.c (print_siginfo_array): Likewise.
        * rtnl_tc.c (decode_tca_stab_data): Likewise.
        * sock.c (decode_ifconf): Likewise.
        * uid.c (print_groups): Likewise.
        * io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace
        umoven_or_printaddr argument of print_array with tfetch_mem.
        (tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror
        with tfetch_mem_ignore_syserror.
        * v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument
        of print_array with tfetch_mem.
        (print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror
        with tfetch_mem_ignore_syserror.
        * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename
        to fetch_struct_mmsghdr_for_print, do not print address, return bool.
        (decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr
        with fetch_struct_mmsghdr_for_print.
        * tests/aio.c (main): Update expected output.
        * tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise.
        * tests/ioctl_perf-success.c (main): Likewise.
        * tests/ioctl_v4l2.c (main): Update expected output.
        * tests/kexec_load.c (main): Likewise.
        * tests/mmsg_name.c (test_mmsg_name): Update expected output.
        * tests/move_pages.c (print_page_array, print_node_array): Likewise.
        * tests/poll.c (print_pollfd_array_entering): Likewise.
        * tests/preadv-pwritev.c (main): Likewise.
        * tests/preadv2-pwritev2.c (dumpio): Likewise.
        * tests/process_vm_readv_writev.c (print_iov): Likewise.
        * tests/pwritev.c (print_iovec): Likewise.
        * tests/readv.c (main): Likewise.
        * tests/seccomp-filter-v.c
        * tests/semop.c (main): Likewise.
        * tests/set_mempolicy.c (print_nodes): Likewise.
        * tests/setgroups.c (main): Likewise.
        * tests/test_nlattr.h (print_nlattr) Likewise.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce tfetch_* family of functions and macros.
        These new functions are going to be used instead of umove_or_printaddr*
        as umoven_func argument of print_array.

        * defs.h (tfetch_mem64, tfetch_mem64_ignore_syserror): New
        function prototypes.
        (tfetch_mem, tfetch_mem_ignore_syserror): New static inline
        wrappers.
        (tfetch_obj): New macro wrapper around tfetch_mem.
        * util.c (tfetch_mem64, tfetch_mem64_ignore_syserror): New
        functions.
        (umoven_or_printaddr64, umoven_or_printaddr64_ignore_syserror): Use
        them.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce printaddr_comment.
        * defs.h (printaddr_comment): New static inline wrapper around
        tprintf_comment.

        Turn printaddr into a thin wrapper around printaddr64.
        * util.c (printaddr): Move ...
        * defs.h: ... here, add "static inline" qualifiers.

2018-05-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add comments about umove* return values.
        * defs.h (umoven, umoven_or_printaddr64,
        umoven_or_printaddr64_ignore_syserror, umovestr): Add comments about
        return values.

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use TAIL_ALLOC_OBJECT_CONST_PTR where appropriate.
        * tests/kcmp.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR.
        * tests/modify_ldt.c (main): Likewise.
        * tests/netlink_protocol.c (send_query): Likewise.
        * tests/ptrace.c (test_peeksiginfo, main): Likewise.
        * tests/s390_guarded_storage.c (main): Likewise.
        * tests/s390_sthyi.c (main): Likewise.
        * tests/xet_thread_area_x86.c (main): Likewise.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command.
        * bpf_attr.h [!BPF_TAG_SIZE] (BPF_TAG_SIZE): Define.
        [BPF_TAG_SIZE]: Check that BPF_TAG_SIZE is 8.
        (struct bpf_map_info_struct, struct bpf_prog_info_struct): New
        structures.
        (bpf_map_info_struct_size, expected_bpf_map_info_struct_size,
        bpf_prog_info_struct_size, expected_bpf_prog_info_struct_size): New
        macro constants.
        * bpf.c (print_bpf_obj_info_fn): New type.
        (print_bpf_map_info, print_bpf_prog_info, fetch_bpf_obj_info,
        print_bpf_obj_info_addr, print_bpf_obj_info): New functions.
        (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Print bpf_fd and info_len
        fields only on entering, call print_bpf_obj_info for printing info field.
        * tests/bpf.c (BPF_OBJ_GET_INFO_BY_FD_checks): Print info field
        as a pointer.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for checking structures outside union bpf_attr.
        struct bpf_prog_info and bpf_map_info need essentially the same handling
        as union bpf_attr.

        * gen_bpf_attr_check.sh: Derive type_name from $struct if it doesn't
        start with "BPF_", derive TYPE_NAME from type_name, use them in code
        generation.
        * m4/gen_bpf_attr_m4.sh: Rewrite parsing/generation code into awk,
        add support for structures outside union bpf_attr.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: remove bpf_priv_data.
        As various bpf commands need different data to save between entering
        and exiting of the syscall, do not emulate union bpf_attr approach.

        * bpf.c (struct bpf_priv_data): Remove.
        (DECL_BPF_CMD_DECODER): Remove "struct bpf_priv_data *" argument.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use set_tcb_priv_ulong
        and get_tcb_priv_ulong to keep bpf_attr.query.prog_cnt field.
        (SYS_FUNC(bpf)): Remove priv variable, do not initialize it,
        and do not pass it to bpf_cmd_decoders.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add union bpf_attr.query.prog_ids field decoding checks.
        * tests/bpf-success-v.c: New file.
        * tests/bpf-success.c: Likewise.
        * tests/bpf-success-v.test: New test.
        * tests/bpf-success.test: Likewise.
        * tests/.gitignore: Add bpf-success and bpf-success-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add bpf-success.test and bpf-success-v.test.
        * tests/bpf.c [INJECT_RETVAL] (sys_bpf): Check that retuned value
        is equivalent to the injected one; append "(INJECTED)" string to errstr.
        (prog_load_ids, prog_load_ids_ptr): New variables.
        (init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4,
        init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5): New functions.
        (BPF_PROG_QUERY_checks): Drop "const" qualifier, add new checks.

        bpf: BPF_PROG_QUERY bpf_attr.query.prog_ids printing fixes.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use
        print_uint32_array_member instead of print_uint64_array_member for
        printing prog_ids elements (and change the type of prog_id_buf from
        uint64_t to uint32_t), as they are 32-bit; use common trick with
        print_big_u64_addr for handling possible ambiguity with prog_ids
        address.
        * tests/bpf.c (BIG_ADDR_MAYBE): New macro.
        (BPF_PROG_QUERY_checks): Update expected output.

        bpf: add support for instruction decoding.
        * xlat/ebpf_regs.in: New file.
        * bpf.c (struct ebpf_insn, struct ebpf_insns_data): New type definitions.
        (print_ebpf_insn, print_ebpf_prog): New functions.
        (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Use them.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls
        As these have some argument output on the exit path.

        * tests/ioctl_perf-success.c: New file.
        * tests/ioctl_perf-success.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add it.
        (check_PROGRAMS): Add ioctl_perf-success.
        * tests/.gitignore: Likewise.
        * tests/ioctl_perf.c: Remove TODO.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement PERF_EVENT_IOC_* decoding.
        * perf.c (fetch_perf_event_attr, print_perf_event_attr): Remove "static"
        qualifier.
        * defs.h (fetch_perf_event_attr, print_perf_event_attr): New
        declarations.
        * perf_event_struct.h (struct perf_event_query_bpf): New type
        definition.
        * perf_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/perf_ioctl_cmds.in: New file.
        * xlat/perf_ioctl_flags.in: Likewise.
        * ioctl.c (ioctl_decode) <case '$'>: Call perf_ioctl.
        * tests/gen_tests.in (ioctl_perf): New test.
        * tests/ioctl_perf.c: New file.
        * tests/pure_executables.list: ioctl_perf.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix ipc_msgbuf.test.
        * tests/ipc_msgbuf.test: Fix -a argument.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update IPPROTO_* constants.
        * xlat/inet_protocols.in (IPPROTO_GGP, IPPROTO_HELLO, IPPROTO_ND):
        Remove, not defined in Linux.
        (IPPROTO_BEETPH): New constant, introduced by Linux commit
        v2.6.19-rc1~33^2.
        (IPPROTO_L2TP): New constant, introduced by Linux commit
        v2.6.35-rc1~473^2~594.
        (IPPROTO_MH): New constant, introduced by Linux commit
        v2.6.19-rc1~1272^2~157.
        Add default values to constants, sort the file.

        xlat: add fallback definitions to RTPROT_* constants.
        * xlat/routing_protocols.in: Add default values to constants.

        xlat: add SECCOMP_FILTER_FLAG_SPEC_ALLOW.
        * xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_SPEC_ALLOW): New
        constant, introduced by Linux commit v4.17-rc3-24-g00a02d0.
        * tests/seccomp-filter.c: Update expected output.
        * tests/seccomp-filter-v.c: Likewise.

        prctl: add PR_GET_SPECULATION_CTRL/PR_SET_SPECULATION_CTRL decoding.
        * xlat/pr_spec_cmds.in: New fille.
        * xlat/pr_spec_get_store_bypass_flags.in: Likewise.
        * xlat/pr_spec_set_store_bypass_flags.in: Likewise.
        * xlat/prctl_options.in (PR_GET_SPECULATION_CTRL,
        PR_SET_SPECULATION_CTRL): New constants, introduced by Linux commit
        v4.17-rc3-15-gb617cfc.
        * prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL,
        case PR_SET_SPECULATION_CTRL>: Implement decoding of new prctl options.
        * tests/Makefile.am (check_PROGRAMS): Add prctl-spec-inject.
        (DECODER_TESTS): Add prctl-spec-inject.test.
        * tests/prctl-spec-inject.c: New file.
        * tests/prctl-spec-inject.test: New test.
        * tests/.gitignore: Add prctl-spec-inject.

        tests: add keyctl variants with different xlat verbosity levels.
        * tests/keyctl-Xabbrev.c: New file.
        * tests/keyctl-Xraw.c: Likewise.
        * tests/keyctl-Xverbose.c: Likewise.
        * tests/keyctl.c (XARG_STR): New macro.
        (do_keyctl): Print command in accordance with XLAT_RAW/XLAT_VERBOSE settings.
        (main): Update expected output.
        * tests/pure_executables.list: Add keyctl-Xabbrev, keyctl-Xraw,
        and keyctl-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (keyctl-Xabbrev, keyctl-Xraw, keyctl-Xverbose): New
        tests.

        keyctl: print KEYCTL_SET_REQKEY_KEYRING argument as an integer.
        * xlat/key_reqkeys.in: Add #val_type int.
        * keyctl.c (SYS_FUNC(keyctl)) <case KEYCTL_SET_REQKEY_KEYRING>: Print
        arg2 as an integer.
        * tests/keyctl.c: Update expected output.

        keyctl: respect xlat style when printing errno.
        * keyctl.c (keyctl_reject_key): Use print_xlat_ex for printing error
        argument.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: unify error value printing.
        There's little reason not to decode error code for syscalls printed in
        raw; moreover, it creates inconsistencies for unknown syscall printing.

        Another issue was with error numbers unknown to strace: previously, they
        were printed as "... = -1 1234 (Unknown error 1234)" which looked kinda
        weird.

        * syscall.c (print_err_ret): New function.
        (syscall_exiting_trace): Remove u_error variable, use tcp->u_error
        instead. Remove u_error_str variable.
        (syscall_exiting_trace) <if (raw(tcp))>: Call print_err_ret if u_error
        is non-zero.
        (syscall_exiting_trace) <if (!(sys_res & RVAL_NONE) && tcp->u_error)>:
        Use print_err_ret for default error printing.
        * tests/nsyscalls.c [!LINUX_MIPSO32] (test_syscall): Update expected
        output.
        * tests/qual_fault.c (invoke) <if (is_raw)>: Likewise.
        * strace.1.in (.SH DESCIPTION): Update unknown syscall example.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: implement INOTIFY_IOC_SETNEXTWD decoding.
        * inotify_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (DECL_IOCTL(inotify)): New declaration.
        * ioctl.c (ioctl_decode) <case 'I'>: Call inotify_ioctl.
        * tests/ioctl_inotify.c: New file.
        * tests/.gitignore: Add ioctl_inotify.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ioctl_inotify): New test.

        tests/test_nlattr.h: avoid testing cropped objects of size 1.
        * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_): Check
        "len < sizeof(obj_)" case only if "sizeof(obj_) > 1".

        tests: pass index to print_elem_ callback in TEST_NLATTR_ARRAY.
        * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Pass array index to the
        print_elem_ callback.
        * tests/nlattr_inet_diag_msg.c (print_uint): Add index argument.
        * tests/nlattr_netlink_diag_msg.c (print_xlong): Likewise.
        * tests/nlattr_packet_diag_msg.c (print_packet_diag_mclist,
        print_sock_filter): Likewise.
        * tests/nlattr_unix_diag_msg.c (print_uint): Likewise.

2018-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: further cleanup bpf big address checks.
        Replace BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT with BIG_ADDR().

        * tests/bpf.c (BIG_ADDR): New macro.
        (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): Remove.
        (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
        BPF_RAW_TRACEPOINT_OPEN_checks): Use BIG_ADDR() instead of
        BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT.

2018-05-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup bpf big address checks.
        Introduce BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT to reduce redundancy.

        * tests/bpf.c (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): New macros.
        (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
        BPF_RAW_TRACEPOINT_OPEN_checks): Use them.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for BPF_RAW_TRACEPOINT_OPEN command decoding.
        * bpf_attr.h (struct BPF_RAW_TRACEPOINT_OPEN_struct): New type
        definition.
        (BPF_RAW_TRACEPOINT_OPEN_struct_size,
        expected_BPF_RAW_TRACEPOINT_OPEN_struct_size): New macros.
        * xlat/bpf_commands.in (BPF_RAW_TRACEPOINT_OPEN): New constant,
        introduced by Linux commit v4.17-rc1~148^2~19^2~4^2~3.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_RAW_TRACEPOINT): Likewise.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)): New bpf
        command decoder.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
        BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN).
        * tests/bpf.c (union bpf_attr_data): Add
        BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN).
        (BPF_PROG_LOAD_checks): Update.
        (init_BPF_RAW_TRACEPOINT_attr2): New function.
        (BPF_RAW_TRACEPOINT_OPEN_checks): New checks array.
        (main) <checks>: Add CHK(BPF_RAW_TRACEPOINT_OPEN).

        bpf: add support for decoding struct bpf_attr.expected_attach_type field
        * bpf_attr.h (struct BPF_PROG_LOAD_struct): Add expected_attach_type
        field.
        (BPF_PROG_LOAD_struct_size): Update to offsetofend of
        expected_attach_type field.
        (expected_BPF_PROG_LOAD_struct_size): Update to 72.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode
        expected_attach_type field.
        * tests/bpf.c: Update expected output.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: do not assume that SK_MEMINFO_VARS is constant.
        SK_MEMINFO_VARS changes over time (as it was in Linux commit
        v4.7-rc1~154^2~354^2~4, for example), so we cannot use it
        for sanity checks.

        * nlattr.c (print_meminfo): Remove.
        (decode_nla_meminfo): Use generic print_uint32_array_member element
        printer callback.
        * tests/nlattr_inet_diag_msg.c (main): Update expected output.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce print_uint32_array_member helper function.
        Analogous to print_int32_array_member, this helper is going to be used
        in various decoders, including BPF_PROG_QUERY, PERF_EVENT_IOC_*,
        and netlink meminfo.

        * defs.h (print_uint32_array_member): New declaration.
        * util.c (print_uint32_array_member): New function.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce print_int32_array_member helper function.
        Analogous to print_uint64_array_member, this helper is going to be used
        for IFLA_AF_SPEC decoding.

        * defs.h (print_int32_array_member): New declaration.
        * util.c (print_int32_array_member): New function.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: move print_uint64_array_member and print_array declarations down
        In preparation for the forthcoming changes.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY.
        The old code works only when an array contains exactly two items.

        * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address
        for the case of incomplete read.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: add support for sockaddr_l2 without l2_bdaddr_type.
        Apparently, struct sockaddr_l2 changed over time: the l2_bdaddr_type
        field was added only by commit v3.5-rc1~35^2~3^2~18^2^2~39.

        * configure.ac (AC_CHECK_HEADERS): Move bluetooth/bluetooth.h check into
        a separate check.
        (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): New check, also checks for
        struct sockaddr_l2.l2_bdaddr_type member in case of success.
        * sockaddr.c (print_sockaddr_data_bt) <case offsetof(struct sockaddr_l2,
        l2_bdaddr_type)>: Add to sizeof(struct sockaddr_l2) case. Print
        l2_bdaddr_type field only if the provided sockaddr is big enough.
        * tests/net-sockaddr.c (check_l2): Put l2_bdaddr_type usage/printing
        under HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE ifdef, add a check for the
        sockaddr_l2 structure without the l2_bdaddr_type field.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR.
        And make the output more structured.

        * sock.c: Include xlat/arp_hardware_types.h in XLAT_MACROS_ONLY mode.
        (print_ifreq) <case SIOCSIFHWADDR, case SIOCGIFHWADDR>: Introduce
        hwaddr_sizes array, print ifr_hwaddr.sa_family, print ifr_hwaddr.sa_data
        using hwaddr_sizes and PRINT_FIELD_MAC_SZ.

2018-05-22  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify errnoent and signalent.
        Remove personality support for errnoent and signalent as
        there is nothing personality-specific in these files.

        * linux/aarch64/errnoent1.h: Remove.
        * linux/aarch64/signalent1.h: Likewise.
        * linux/powerpc64/errnoent1.h: Likewise.
        * linux/powerpc64/signalent1.h: Likewise.
        * linux/riscv/errnoent1.h: Likewise.
        * linux/riscv/signalent1.h: Likewise.
        * linux/s390x/errnoent1.h: Likewise.
        * linux/s390x/signalent1.h: Likewise.
        * linux/sparc64/errnoent1.h: Likewise.
        * linux/sparc64/signalent1.h: Likewise.
        * linux/tile/errnoent1.h: Likewise.
        * linux/tile/signalent1.h: Likewise.
        * linux/x32/errnoent1.h: Likewise.
        * linux/x32/signalent1.h: Likewise.
        * linux/x86_64/errnoent1.h: Likewise.
        * linux/x86_64/errnoent2.h: Likewise.
        * linux/x86_64/signalent1.h: Likewise.
        * linux/x86_64/signalent2.h: Likewise.
        * Makefile.am (EXTRA_DIST): Remove them.
        * defs.h (errnoent0): Rename to errnoent.
        (signalent0): Rename signalent.
        (nerrnos, nsignals): Change to const variables unconditionally.
        * syscall.c (errnoent0): Rename to errnoent.
        (signalent0): Rename signalent.
        (nerrnos, nsignals): Change to const variables unconditionally.
        (nerrnos0, nsignals0): Remove.
        [SUPPORTED_PERSONALITIES > 1] (errnoent1, signalent1, nerrnos1,
        nsignals1): Remove.
        [SUPPORTED_PERSONALITIES > 2] (errnoent2, signalent2, nerrnos2,
        nsignals2): Likewise.
        (set_personality): Do not assign errnoent, signalent, nerrnos,
        and nsignals.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: mention -Xraw in -eraw description.
        * strace.1.in (\fB\-e\ raw\fR=\,\fIset\fR): Mention -X raw.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: display -k option description only if it is enabled.
        Leverage the fact that manpage is generated and add condition statements
        around mentions of -k option.

        * strace.1.in (.SH SYNOPSIS): Put option list inside an
        ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind_opt ... .end_unwind_opt"
        condition; add a second list of options without -k and put it inside
        ".if '@ENABLE_STACKTRACE_FALSE@'#' .ig end_no_unwind_opt ... .end_no_unwind_opt"
        condition.
        (.SS Output format) <-k>: Put it inside
        ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind ... .end_unwind"
        condition, remove the mention of --enable-stacktrace configuration
        option requirement.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: format a reference to "open" syscall using bold font.
        * strace.1.in (.SH DESCRIPTION): Format a reference to "open" syscall
        using bold font.

        tests/qual_fault.test: add -efu arguments to the interpreter.
        * tests/qual_fault.test (#!/bin/sh): Add -efu arguments.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/qual_fault.test: swap expected/output files in match_diff calls.
        match_diff expects the first argument as strace output and the second
        argument as expected output.

        * tests/qual_fault.test (check_fault_injection): Swap arguments
        in match_diff calls.

2018-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: convert some macro wrappers into static inline functions.
        * defs.h (pathtrace_select, pathtrace_match, printxval_searchn,
        printxval_indexn, sprintxval, sprintflags, printnum_slong,
        printnum_ulong, printnum_ptr, printnum_kptr): Convert macro wrappers
        into static inline functions.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add support for xlat_styles in printxval_dispatch.
        * defs.h (printxval_dispatch_ex): Rename from printxval_dispatch, add
        style argument.
        (printxval_dispatch): New static inline function, a thin wrapper around
        printxval_dispatch_ex.
        * xlat.c (printxval_dispatch): Rename to printxval_dispatch_ex, add
        style argument, handle it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make printxval_dispatch publicly available.
        * evdev.c (enum xlat_type, printxval_dispatch): Move elsewhere.
        * defs.h (enum_xlat_type): Move from evdev.c.
        (printxval_dispatch): New declaration.
        * xlat.c (printxval_dispatch): Move from evdev.c, drop static qualifier.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Revert "evdev: remove XT_NORMAL"
        This reverts commit cc52da10c6f13feba577a83088f34916c6350165
        in preparation for printxval_dispatch generalisation.

        * evdev.c (enum xlat_type): Add XT_NORMAL back.
        (printxval_dispatch): Handle XT_NORMAL again.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: introduce is_bigendian macro.
        This macro is going to be used in inline checks.

        * defs.h (is_bigendian): New macro constant.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: make memory allocation error messages more informative.
        As those are pretty unusual, let's add some additional information
        that can be reported by users.

        * util.c (print_quoted_string_ex, dumpstr): Add reasons for memory
        allocation errors.
        (sizeof_iov): Change type from size_t to unsigned int.
        (dumpiov_upto): Rewrite size initialisation similarly to the way it's
        done in print_quoted_string_ex, add reasons for memory allocation errors.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: fix -A description.
        * strace.1.in (.SS Output format) <-A>: Add missing .B.

        strace.1.in: document x32 64-bit syscall peculiarity.
        * strace.1.in (.SH NOTES): Document "#64" suffix for 64-bit syscalls on
        x32.

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/x32/syscallent.h: change 64-bit syscall designation.
        The current way of designation of 64-bit specific syscalls in x32
        personality not only conflicts with fault injection specification
        syntax, but also makes it impossible to specify such syscalls at all
        (since everything that starts from a digit is considered a syscall
        number specification).  So, let's change prefix to suffix and use
        octothorpe instead of colon as a separator.

        * linux/x32/syscallent.h (13, 15, 16, 19, 20, 45, 46, 47, 54, 55, 59,
        101, 127, 128. 129, 131, 134, 156, 174, 177, 178, 180, 205, 206, 209,
        211, 214, 215, 222, 236, 244, 246, 247, 273, 274, 278, 279, 295, 296,
        297, 299, 307, 310, 311, 32, 327, 328): Change "64:" prefix to "#64"
        suffix in syscall name.

        Closes: https://github.com/strace/strace/issues/36

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add BPF_PROG_TYPE_SK_MSG.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_MSG): New constant,
        introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13.
        * tests/bpf.c (BPF_PROG_LOAD_checks): Update expected output.

        xlat: update bpf_attach_type constants.
        * xlat/bpf_attach_type.in (BPF_SK_MSG_VERDICT): New constant,
        introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13.
        (BPF_CGROUP_INET4_BIND, BPF_CGROUP_INET6_BIND): New constants,
        introduced by Linux commit v4.17-rc1~148^2~19^2^2~6.
        (BPF_CGROUP_INET4_CONNECT, BPF_CGROUP_INET6_CONNECT): New constants,
        introduced by Linux commit v4.17-rc1~148^2~19^2^2~3.
        (BPF_CGROUP_INET4_POST_BIND, BPF_CGROUP_INET6_POST_BIND): New constants,
        introduced by Linux commit v4.17-rc1~148^2~19^2^2~1.
        * tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output.

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/sock_rds_options.in: make it sorted.
        Define SO_TIMESTAMP twice, for PA-RISC and all the other architectures.

        * xlat/sock_rds_options.in [!__hppa__] (SO_TIMESTAMP): Define to 29.
        [__hppa__] (SO_TIMESTAMP): Define to 0x4012.
        * net.c (print_sockopt_fd_level_name) <case SOL_RDS>: Use
        printxval_search instead of printxval.

2018-05-17  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.17.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.17-rc5
        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/i386/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux 4.17-rc5.
        * maint/ioctls_sym.sh: (x86_list): Add KVM_HYPERV_EVENTFD.

2018-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: use indexed lookups where appropriate.
        * xlat/bpf_attach_type.in: Add "#value_indexed" directive.
        * xlat/bpf_class.in: Likewise.
        * xlat/bpf_map_types.in: Likewise.
        * xlat/bpf_map_update_elem_flags.in: Likewise.
        * xlat/bpf_prog_types.in: Likewise.
        * xlat/ebpf_class.in: Likewise.
        * bpf_filter.c (print_bpf_filter_code): Use printxval_index
        instead of printxval for decoding bpf_class and ebpf_class.
        * print_fields.h (PRINT_FIELD_XVAL_INDEX): New macro.
        * bpf.c: Use it instead of PRINT_FIELD_XVAL for decoding bpf_attach_type,
        bpf_map_types, bpf_map_update_elem_flags, and bpf_prog_types.

2018-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: use printxval_index lookup instead of printxval.
        * xlat/bpf_commands.in: Add "#value_indexed" directive.
        * bpf.c (SYS_FUNC(bpf)): Use printxval_index instead of printxval.

        time: use indexed lookups.
        * defs.h (xlat_idx): New prototype.
        * xlat.c (xlat_idx): Remove static qualifier.
        * time.c (do_adjtimex): Use xlat_idx instead of xlookup.
        (SYS_FUNC(getitimer), SYS_FUNC(setitimer)): Use printxval_index
        instead of printxval.
        [ALPHA] (SYS_FUNC(osf_getitimer), SYS_FUNC(osf_setitimer)): Likewise.
        (printclockname) [CLOCKID_TO_FD]: Likewise.
        * xlat/adjtimex_state.in: Add "#value_indexed" directive.
        * xlat/clocknames.in: Likewise.
        * xlat/cpuclocknames.in: Add "#value_indexed" directive, add default
        values to constants.
        * xlat/itimer_which.in: Likewise.

2018-05-15  Andre McCurdy  <armccurdy@gmail.com>

        linux/arm/raw_syscall.h: avoid r7 specified register variables with Thumb
        If Thumb code is being generated and frame pointers are enabled, the
        Thumb frame pointer in r7 clashes with any local variable which may
        need to be assigned to r7 (e.g. the syscall NR when making a raw
        syscall).

        With gcc, the double use of r7 results in a build error, e.g.

          strace-4.22/tests/inject-nf.c:86:1: error: r7 cannot be used in asm here

        With clang, the double use of r7 can result in the compiler silently
        generating broken code which crashes at run time due to frame pointer
        corruption:

          https://bugs.llvm.org/show_bug.cgi?id=34165

        In most cases the problem isn't visible as frame pointers will be
        disabled automatically due to optimisation level. However to handle
        cases where frame pointers are enabled (e.g. when CFLAGS etc are set
        to support a debug build, etc) provide a version of raw_syscall_0
        which manually saves and restores the frame pointer value in r7
        to a temporary register before setting up the syscall NR in r7
        and invoking the syscall.

        * linux/arm/raw_syscall.h (raw_syscall_0) [__thumb__]: Provide
        an alternative version.

2018-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        sockaddr: use printxval_index lookup instead of printxval.
        * xlat/addrfams.in: Add "#value_indexed" directive.
        * xlat/af_packet_types.in: Likewise.
        * xlat/hci_channels.in: Likewise.
        * sockaddr.c (print_sockaddr_data_bt, print_sockaddr,
        * print_sockaddr_data_ll): Use printxval_index instead of printxval.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: use printxval_search for ARPHRD_* constants.
        This xlat table is quite big.

        * sockaddr.c (print_sockaddr_data_ll): Replace printxval call with
        printxval_search for printing of struct sockaddr_ll.sll_hatype field.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add a common MAC address printing routine.
        * print_mac.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (sprint_mac_addr): New declaration.
        (print_mac_addr): New function, a thin wrapper around sprint_mac_addr.
        * print_fields.h (PRINT_FIELD_MAC, PRINT_FIELD_MAC_SZ): New macros.
        * rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_MAC for bridge
        address printing.
        * sock.c (print_ifreq) <case SIOCGIFHWADDR>: Use print_mac_addr for
        ifr_hwaddr printing.
        * sockaddr.c (print_sockaddr_data_bt): Use print_mac_addr for
        {sco,rc,l2}_bdaddr field printing.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: decode Bluetooth L2 CID values.
        * xlat/bluetooth_l2_cid.in: New file.
        * sockaddr.c: Include xlat/bluetooth_l2_cid.h.
        (print_bluetooth_l2_cid): New function.
        (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_cid
        field.
        * tests/net-sockaddr.c (check_l2): Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: decode Bluetooth L2 PSM values.
        * xlat/bluetooth_l2_psm.in: New file.
        * sockaddr.c: Include xlat/bluetooth_l2_psm.h.
        (print_bluetooth_l2_psm): New function.
        (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_psm
        field.
        * tests/net-sockaddr.c (check_l2): Update expected output.

        sockaddr: decode bluetooth address type names.
        * xlat/bdaddr_types.in: New file.
        * sockaddr.c: Include xlat/bdaddr_types.h.
        (print_sockaddr_data_bt): Decode struct sockaddr_l2.l2_bdaddr_type field
        using constants from bdaddr_types xlat.
        * tests/net-sockaddr.c (check_l2): Check decoding
        of struct sockaddr_l2.l2_bdaddr_type field.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sockaddr: decode Bluetooth socket address unconditionally.
        * sockaddr.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include
        bluetooth/bluetooth.h, bluetooth/hci.h, bluetooth/l2cap.h,
        bluetooth/rfcomm.h, and bluetooth/sco.h.
        [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include xlat/hci_channels.h.
        (btohs): New function.
        (print_sockaddr_data_bt): Define unconditionally, add definitions
        of struct sockaddr_hci, struct bdaddr, struct sockaddr_sco,
        struct sockaddr_rc, and struct sockaddr_l2.
        (sa_printers) <AF_BLUETOOTH>: Define unconditionally.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Avoid using print_array as a local variable name.
        We have a function with the same name.

        * netlink.c (decode_netlink) <print_array>: Rename to is_array, all
        users updated.
        * nlattr.c (decode_nlattr) <print_array>: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update MSG_* constants.
        Sync them with kernel's include/linux/socket.h, since syscalls perform
        almost no checks for incorrect flags.

        * xlat/msg_flags.in (MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
        MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR, MSG_WAITALL, MSG_FIN,
        MSG_SYN, MSG_CONFIRM, MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
        MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC): Add default values
        to all constants.
        (MSG_SENDPAGE_NOTLAST, MSG_NO_SHARED_FRAGS): New constants.  It is
        an internal one, but, apparently, nothing prohibits passing it
        to the kernel.
        (MSG_CMSG_COMPAT): New constant.  Override the value provided
        by system headers.
        (MSG_EOF): Commented out, as it is a synonym for MSG_FIN.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        socketutils: use exact match of unix domain sockets on fresh kernels.
        * socketutils.c (unix_send_query): Do not add NLM_F_DUMP to nlmsg_flags
        when kernel version is 4.4.4 or later, initialize udiag_cookie
        unconditionally.

        Complements: v4.12~536 ("Change unix_diag requests back to use full dump instead of exact match")

2018-05-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketutils: do not request NDIAG_SHOW_MEMINFO.
        This information is not used and it looks like it negatively affects
        ability to find the socket under high load.

        * socketutils.c (netlink_send_query) <req>: Remove NDIAG_SHOW_MEMINFO
        flag from netlink_diag_req.ndiag_show field.
        * tests/netlink_netlink_diag.c (send_query) <req>: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: introduce midtail_alloc and use it in netlink tests.
        netlink tests happen to access memory located before the tail_malloc'ed
        pointers, a practice that doesn't go well with the latest compilers
        because tail_malloc is marked with ATTRIBUTE_MALLOC.
        For example, glibc in -D_FORTIFY_SOURCE=2 mode and gcc 8 with
        -Warray-bounds enabled complain about negative offsets out of bounds.
        Fix this issue by introducing midtail_alloc.

        * tests/tests.h (midtail_alloc): New macro.
        * tests/netlink_crypto.c: Use it instead of tail_malloc for nlh0 allocation.
        * tests/netlink_netfilter.c: Likewise.
        * tests/netlink_protocol.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/netlink_selinux.c: Likewise.
        * tests/netlink_sock_diag.c: Likewise.
        * tests/nlattr_br_port_msg.c: Likewise.
        * tests/nlattr_crypto_user_alg.c: Likewise.
        * tests/nlattr_dcbmsg.c: Likewise.
        * tests/nlattr_fib_rule_hdr.c: Likewise.
        * tests/nlattr_ifaddrlblmsg.c: Likewise.
        * tests/nlattr_ifaddrmsg.c: Likewise.
        * tests/nlattr_ifinfomsg.c: Likewise.
        * tests/nlattr_ifla_brport.c: Likewise.
        * tests/nlattr_ifla_port.c: Likewise.
        * tests/nlattr_ifla_xdp.c: Likewise.
        * tests/nlattr_inet_diag_msg.c: Likewise.
        * tests/nlattr_inet_diag_req_compat.c: Likewise.
        * tests/nlattr_inet_diag_req_v2.c: Likewise.
        * tests/nlattr_mdba_mdb_entry.c: Likewise.
        * tests/nlattr_mdba_router_port.c: Likewise.
        * tests/nlattr_ndmsg.c: Likewise.
        * tests/nlattr_ndtmsg.c: Likewise.
        * tests/nlattr_netconfmsg.c: Likewise.
        * tests/nlattr_netlink_diag_msg.c: Likewise.
        * tests/nlattr_nlmsgerr.c: Likewise.
        * tests/nlattr_packet_diag_msg.c: Likewise.
        * tests/nlattr_rtgenmsg.c: Likewise.
        * tests/nlattr_rtmsg.c: Likewise.
        * tests/nlattr_smc_diag_msg.c: Likewise.
        * tests/nlattr_tc_stats.c: Likewise.
        * tests/nlattr_tca_stab.c: Likewise.
        * tests/nlattr_tcamsg.c: Likewise.
        * tests/nlattr_tcmsg.c: Likewise.
        * tests/nlattr_unix_diag_msg.c: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use MIN where appropriate.
        * netlink.c (decode_nlmsghdr_with_payload): Use MIN.
        * netlink_packet_diag.c (print_packet_diag_mclist): Likewise.
        * nlattr.c (decode_nlattr_with_data): Likewise.
        * rtnl_route.c (decode_rta_multipath): Likewise.

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add fallback definitions to {msg,sem,shm}ctl command constants.
        * xlat/msgctl_flags.in: Add default values to all constants, reorder
        to make them sorted by value.
        * xlat/semctl_flags.in: Likewise.
        * xlat/shmctl_flags.in: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add MSG_STAT_ANY.
        * xlat/msgctl_flags.in (MSG_STAT_ANY): New constant, introduced
        by Linux commit v4.17-rc1~52^2~21.
        * tests/ipc_msg.c: Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add SEM_STAT_ANY.
        * xlat/semctl_flags.in (SEM_STAT_ANY): New constant, introduced
        by Linux commit v4.17-rc1~52^2~22.
        * tests/ipc_sem.c: Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add SHM_STAT_ANY.
        * xlat/shmctl_flags.in (SHM_STAT_ANY): New constant, introduced
        by Linux commit v4.17-rc1~52^2~23.
        * tests/ipc_shm.c: Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: print SO_GET_FILTER in getsockopt.
        SO_ATTACH_FILTER and SO_GET_FILTER have the same value; the former
        constant is intended for use in setsockopt, and the latter is for
        getsockopt.  Handle that the same way as similar SOL_IP/SOL_IPV6 socket
        options are handled.

        * xlat/getsock_options.in: New file.
        * xlat/setsock_options.in: Likewise.
        * xlat/sockoptions.in (SO_ATTACH_FILTER): Move to
        xlat/setsock_options.in.
        * net.c: Include "xlat/setsock_options.h" and "xlat/getsock_options.h".
        (print_sockopt_fd_level_name) <case SOL_SOCKET>: Use
        getsock_options or setsock_options as auxiliary xlats based on the value
        of is_getsockopt flag.
        * tests/sock_filter-v.c: Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add sock_filtrer-v variants with different xlat verbosity levels.
        * tests/sock_filter-v-Xabbrev.c: New file.
        * tests/sock_filter-v-Xraw.c: Likewise.
        * tests/sock_filter-v-Xverbose.c: Likewise.
        * tests/sock_filter-v.c (PRINT_STMT_SYM, PRINT_STMT_SYM_,
        PRINT_STMT_VAL, PRINT_STMT_VAL_, PRINT_JUMP_): Remove.
        (HEX_FMT, XLAT_FMT, XLAT_ARGS, PRINT_STMT): New macros.
        (PRINT_JUMP): Rewrite.
        (print_filter): Rewrite using PRINT_STMT and new PRINT_JUMP.
        (main): Print SOL_SOCKET, SO_ATTACH_FILTER, and SO_ATTACH_REUSEPORT_CBPF
        using XLAT_FMT/XLAT_ARGS macros.
        * tests/pure_executables.list: Add sock_filter-v-Xabbrev,
        sock_filter-v-Xraw, and sock_filter-v-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (sock_filter-v-Xabbrev, sock_filter-v-Xraw,
        sock_filter-v-Xverbose): New tests.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: fix ethernet_protocols comment.
        Starting with commit v4.22~109, sorted xlat tables are terminated
        with XLAT_END.

        * defs.h (ethernet_protocols): Remove the "unterminated" part from
        description.

2018-05-08  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename *sock*options xlat tables.
        Such names as sockrxrpcoptions are incomprehensible.

        * xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in.
        * xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in.
        * xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in.
        * xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in.
        * xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in.
        * xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in.
        * xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in.
        * xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in.
        * xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in.
        * xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in.
        * xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in.
        * xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in.
        * xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in.
        * xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in.
        * xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in.
        * xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in.
        * xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in.
        * xlat/sockoptions.in: Rename to xlat/sock_options.in.
        * xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in.
        * xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in.
        * xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in.
        * xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in.
        * xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in.
        * xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in.
        * xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in.
        * xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in.
        * xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in.
        * xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in.
        * xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in.
        * net.c: Update.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: decode more SOL_* socket options.
        * xlat/sockalgoptions.in: New file.
        * xlat/sockbluetoothoptions.in: Likewise.
        * xlat/sockcaifoptions.in: Likewise.
        * xlat/sockdccpoptions.in: Likewise.
        * xlat/sockiucvoptions.in: Likewise.
        * xlat/sockkcmoptions.in: Likewise.
        * xlat/sockllcoptions.in: Likewise.
        * xlat/socknfcllcpoptions.in: Likewise.
        * xlat/sockpnpoptions.in: Likewise.
        * xlat/sockpppol2tpoptions.in: Likewise.
        * xlat/sockrdsoptions.in: Likewises.
        * xlat/sockrxrpcoptions.in: Likewise.
        * xlat/socktipcoptions.in: Likewise.
        * xlat/socktlsoptions.in: Likewise.
        * xlat/sockudpoptions.in: Likewise.
        * net.c: Include "xlat/sockalgoptions.h", "xlat/sockbluetoothoptions.h",
        "xlat/sockcaifoptions.h", "xlat/sockdccpoptions.h",
        "xlat/sockiucvoptions.h", "xlat/sockkcmoptions.h",
        "xlat/sockllcoptions.h", "xlat/socknfcllcpoptions.h",
        "xlat/sockpnpoptions.h", "xlat/sockpppol2tpoptions.h",
        "xlat/sockrdsoptions.h", "xlat/sockrxrpcoptions.h",
        "xlat/socktipcoptions.h", "xlat/socktlsoptions.h",
        and "xlat/sockudpoptions.h".
        (print_sockopt_fd_level_name): Decode SOL_UDP, SOL_IRDA, SOL_LLC,
        SOL_DCCP, SOL_TIPC, SOL_RXRPC, SOL_PPPOL2TP, SOL_BLUETOOTH, SOL_PNPIPE,
        SOL_RDS, SOL_IUCV, SOL_CAIF, SOL_ALG, SOL_NFC, SOL_KCM, and SOL_TLS
        socket option names.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: decode more AF_* protocol names.
        * xlat/caif_protocols.in: New file.
        * xlat/can_protocols.in: Likewise.
        * xlat/irda_protocols.in: Likewise.
        * xlat/isdn_protocols.in: Likewise.
        * xlat/kcm_protocols.in: Likewise.
        * xlat/nfc_protocols.in: Likewise.
        * xlat/phonet_protocols.in: Likewise.
        * xlat/smc_protocols.in: Likewise.
        * net.c: Include "xlat/irda_protocols.h", "xlat/can_protocols.h",
        "xlat/isdn_protocols.h", "xlat/phonet_protocols.h",
        "xlat/caif_protocols.h", "xlat/nfc_protocols.h",
        "xlat/kcm_protocols.h", and "xlat/smc_protocols.h".
        (SYS_FUNC(socket)): Decode AF_IRDA, AF_CAN, AF_RXRPC, AF_ISDN,
        AF_PHONET, AF_CAIF, AF_NFC, AF_KCM, and AF_SMC protocol names.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove some duplicate fallback definitions.
        There is no need to provide duplicate fallback definitions anymore,
        inclusion of the appropriate xlat header in XLAT_MACROS_ONLY mode
        does the right thing.

        * btrfs.c [!BTRFS_FIRST_FREE_OBJECTID] (BTRFS_FIRST_FREE_OBJECTID):
        Remove, a fallback definition is already provided by included
        "xlat/btrfs_tree_objectids.h".
        * net.c: Include "xlat/addrfams.h" in XLAT_MACROS_ONLY mode.
        [!AF_BLUETOOTH] (AF_BLUETOOTH): Remove.
        * syscall.c: Include "xlat/nt_descriptor_types.h" in XLAT_MACROS_ONLY
        mode.
        [!NT_PRSTATUS] (NT_PRSTATUS): Remove.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: introduce XLAT_MACROS_ONLY macro.
        Sometimes we need just fallback definitions and nothing else.
        This change adds an interface of skipping xlat table prototypes
        and definitions.

        * xlat/gen.sh (gen_header): Place xlat table prototype or definition
        under "#ifndef XLAT_MACROS_ONLY" guard.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_link: print IFLA_NEW_IFINDEX using decode_nla_ifindex.
        As it is an interface index.

        * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_NEW_IFINDEX]>: Change
        the value from decode_nla_s32 to decode_nla_ifindex.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ci: install libbluetooth-dev.
        * ci/install-dependencies.sh (common_packages): Add libbluetooth-dev.

        xlat: provide fallback definitions for HCI_CHANNEL_* constants.
        * xlat/hci_channels.in: Provide fallback definitions.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        s390: simplify s390_runtime_instr command printing.
        As the header with command definitions is now a part of UAPI (since
        Linux commit v4.16-rc1~21^2~11), there's no need for a very special
        printing routine for command names.

        * s390.c (SYS_FUNC(s390_runtime_instr)): Use printxval_d to print
        the command argument.
        * tests/s390_runtime_instr.c: Update expected output.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/init.sh: add run_prog_match_grep.
        * tests/init.sh (run_prog_match_grep): New function, similar
        to run_prog_match_diff.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add so_peercred variants with different xlat verbosity levels.
        * tests/so_peercred-Xabbrev.c: New file.
        * tests/so_peercred-Xraw.c: Likewise.
        * tests/so_peercred-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add so_peercred-Xabbrev,
        so_peercred-Xraw, and so_peercred-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/so_peercred.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/gen_tests.in (so_peercred-Xabbrev, so_peercred-Xraw,
        so_peercred-Xverbose): New tests.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add personality variants with different xlat verbosity levels.
        * tests/personality-Xabbrev.c: New file.
        * tests/personality-Xraw.c: Likewise.
        * tests/personality-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add personality-Xabbrev,
        personality-Xraw, and personality-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/personality.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/personality.test: Add support for accepting test arguments.
        * tests/gen_tests.in (personality-Xabbrev, personality-Xraw,
        personality-Xverbose): New tests.

        tests: add fanotify_mark variants with different xlat verbosity levels.
        * tests/fanotify_mark-Xabbrev.c: New file.
        * tests/fanotify_mark-Xraw.c: Likewise.
        * tests/fanotify_mark-Xverbose.c: Likewise.
        * tests/pure_executables.list: Add fanotify_mark-Xabbev,
        fanotify_mark-Xraw, and fanotify_mark-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/fanotify_mark.c: Add handling of XLAT_RAW and XLAT_VERBOSE
        flags.
        * tests/gen_tests.in (fanotify_mark-Xabbev, fanotify_mark-Xraw,
        fanotify_mark-Xverbose): New tests.

2018-05-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for IFF_* constants.
        * xlat/iffflags.in: Provide fallback definitions.  Mention that
        the array is sorted.

        xlat: update IFF_* constants.
        * xlat/iffflags.in (IFF_DYNAMIC): New constant, had been introduced
        before the current git repository was conceived.
        (IFF_LOWER_UP, IFF_DORMANT): New constants, introduced by Linux commit
        v2.6.17-rc1~1175^2~206.
        (IFF_ECHO): New constant, introduced by Linux commit
        v2.6.25-rc1~1162^2~1415.

        xlat: provide fallback definitions for ARPHRD_* constants.
        * xlat/arp_hardware_types.in: Provide fallback definitions, sort.

        tests: add more v4l2 checks.
        * tests/ioctl_v4l2.c (main): Add more VIDIOC_S_EXT_CTRLS checks.

        tests: add variants of IPC tests with different xlat verbosity levels.
        * tests/.gitignore: Add ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose,
        ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose,
        ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev,
        ipc_shm-Xraw, and ipc_shm-Xverbose.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose,
        ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose,
        ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev,
        ipc_shm-Xraw, ipc_shm-Xverbose): New tests.
        * tests/ipc_msg-Xabbrev.c: New file.
        * tests/ipc_msg-Xraw.c: Likewise.
        * tests/ipc_msg-Xverbose.c: Likewise.
        * tests/ipc_msgbuf-Xabbrev.c: Likewise.
        * tests/ipc_msgbuf-Xraw.c: Likewise.
        * tests/ipc_msgbuf-Xverbose.c: Likewise.
        * tests/ipc_sem-Xabbrev.c: Likewise.
        * tests/ipc_sem-Xraw.c: Likewise.
        * tests/ipc_sem-Xverbose.c: Likewise.
        * tests/ipc_shm-Xabbrev.c: Likewise.
        * tests/ipc_shm-Xraw.c: Likewise.
        * tests/ipc_shm-Xverbose.c: Likewise.
        * tests/ipc.sh: Add support for accepting test arguments.
        * tests/ipc_msgbuf.test: Likewise.
        * tests/ipc_msg.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
        * tests/ipc_msgbuf.c: Likewise.
        * tests/ipc_sem.c: Likewise.
        * tests/ipc_shm.c: Likewise.

        tests: make ipc tests a bit more strict.
        * tests/gen_tests.in (ipc_msg, ipc_sem, ipc_shm): Add -a option.
        * tests/ipc_msg.c: Replace " +" with " " in expected output.
        * tests/ipc_sem.c: Likewise.
        * tests/ipc_shm.c: Likewise.

        ipc_shm: print SHM_HUGE_SHIFT using print_xlat_u.
        * ipc_shm.c (SYS_FUNC(shmget)): Print SHM_HUGE_SHIFT using print_xlat_u.

        tests: check all bits of mtype in ipc_msgbuf test.
        * tests/ipc_msgbuf.c: Include <unistd.h> and <asm/unistd.h>.
        (sys_msgrcv): New function.
        (msgrcv): Use it instead of msgrcv.  Add bits to mtype,
        check for -mtype in msgrcv.

        tests: print expected output by ipc_msgbuf test itself.
        * tests/ipc_msgbuf.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove tests/ipc_msgbuf.expected.
        * tests/ipc_msgbuf.c: Add expected output.
        * tests/ipc_msgbuf.test: Add -a31.  Redirect output to $EXP.  Call
        match_grep with $LOG and $EXP arguments.

2018-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for SKF_*_OFF constants.
        * xlat/skf_off.in: New file.
        * bpf_sock_filter.c: Include "xlat/skf_off.h".

        xlat: provide fallback definitions for BPF_* constants.
        * xlat/bpf_class.in: Add default values for constants.
        * xlat/bpf_miscop.in: Likewise.
        * xlat/bpf_mode.in: Likewise.
        * xlat/bpf_op_alu.in: Likewise.
        * xlat/bpf_op_jmp.in: Likewise.
        * xlat/bpf_rval.in: Likewise.
        * xlat/bpf_size.in: Likewise.
        * xlat/bpf_src.in: Likewise.

2018-05-06  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: fix F_* fallback definitions on mips64.
        * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [__mips64]: Fix
        default values.

        Fixes: v4.22-122-gfa8f486 ("xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc")

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add fallback definitions to SO_* constants.
        Regenerate xlat/sockoptions.in using the following script:

          sed -n 's/^\(SO_[^[:space:]]*\).*/\1/p' xlat/sockoptions.in |
          uniq |
          while read name; do
            sed -rn 's/#define[[:space:]]+('"$name"')[[:space:]]+([[:digit:]]+)$/\2\t\1/p' \
              /path/to/linux/include/uapi/asm-generic/socket.h
          done |
          sort -n |
          while read def name; do
            grep -EH '#define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \
              /path/to/linux/arch/*/include/uapi/asm/socket.h |
            sed -rn 's|^[^#]*/arch/([^/]+)/include/uapi/asm/socket\.h:#define[[:space:]]+'"$name"'[[:space:]]+([^[:space:]]+)([[:space:]].*)?$|\1\t\2|p' |
            sed s/parisc/hppa/ |sort |
            awk -vname="$name" -vdef="$def" '
              {
                i=strtonum($2)
                if (i == def) next
                if (a[i])
                  a[i]=a[i] " || defined __" $1 "__"
                else
                  a[i]="defined __" $1 "__"
              }
              END {
                iftext="#if"
                for (i in a) {
                  printf("%s %s\n%s %u\n",iftext,a[i],name,i)
                  iftext="#elif"
                }
                if (iftext != "#if")
                  print "#else"
                printf("%s %s\n", name, def)
                if (iftext == "#if")
                  print ""
                else
                  print "#endif\n"
              }'
          done

        * xlat/sockoptions.in: Add fallback definitions.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: remove socket options with duplicate names.
        * xlat/sockoptions.in (SO_GET_FILTER): Remove as it is defined
        to SO_ATTACH_FILTER.
        (SO_DETACH_BPF): Remove as it is defined to SO_DETACH_FILTER.

        xlat: remove socket options that do not exist in Linux.
        * xlat/sockoptions.in (SO_ALLRAW, SO_ICS, SO_IMASOCKET, SO_LISTENING,
        SO_MGMT, SO_ORDREL, SO_PARALLELSVR, SO_PROTOTYPE, SO_RDWRSO_SEMA,
        SO_USELOOPBACK): Remove.

        xlat: treat socketlayers as a sorted array.
        * xlat/socketlayers.in: Add a comment that the xlat is sorted.
        * net.c (print_sockopt_fd_level_name): Use printxval_search
        instead of printxval for decoding socket layer name.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: decode Bluetooth protocol names unconditionally.
        As we have all BTPROTO_* constant definitions now, there is no need
        to rely on bluetooth.h header anymore.

        * net.c (AF_BLUETOOTH): Provide a fallback definition.
        [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include <bluetooth/bluetooth.h>.
        [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h".
        [!HAVE_BLUETOOTH_BLUETOOTH_H] (decode_sockbuf): Decode AF_BLUETOOTH.
        (decode_sockbuf) <case AF_BLUETOOTH>: Use printxval_index.
        * xlat/bt_protocols.in: Add "#value_indexed" directive.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: invoke the shell interpreter with -e -u options.
        * xlat/gen.sh: Change interpreter from "/bin/sh" to "/bin/sh -eu".

        xlat: update FPE_* constants.
        * xlat/sigfpe_codes.in (FPE_FLTUNK): New constant, introduced by Linux
        commit v4.17-rc1~107^2~2.
        (FPE_CONDTRAP): New constant, introduced by Linux commit
        v4.17-rc1~31^2~3.

        xlat: add MAP_FIXED_NOREPLACE.
        * xlat/mmap_flags.in (MAP_FIXED_NOREPLACE): New constant, introduced
        by Linux commit v4.17-rc1~52^2~14.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for BTPROTO_* constants.
        As they are architecture-independent.

        * xlat/bt_protocols.in: Add values to constants.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add NETLINK_SMC.
        * xlat/netlink_protocols.in (NETLINK_SMC): New constant, introduced
        by Linux commit v4.11-rc1~94^2~43^2.

        xlat: provide fallback definitions for V4L2_CID_* constants.
        * xlat/v4l2_control_id_bases.in: New file with fallback definitions.
        * xlat/v4l2_control_ids.in: Add fallback definitions.
        * v4l2.c: Reorder includes, include "xlat/v4l2_control_id_bases.h",
        remove legacy V4L2_CID_* constant definitions.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update V4L2_CID_* constants.
        Synchronise v4l2_control_ids list with the one provided by kernel's
        include/uapi/linux/v4l2-controls.h.  A few notes:
         - V4L2_CID_CHROMA_GAIN and V4L2_CID_COLORFX_CBCR moved in accordance
           with their position/values.
         - V4L2_CID_WHITENESS is removed as it has the same value as
           V4L2_CID_GAMMA.
         - V4L2_CID_PRIVATE_BASE is removed.
         - V4L2_CID_HCENTER and V4L2_CID_VCENTER that were removed by Linux
           commit v3.9-rc1~93^2~237, are retained for historical reasons.

        * xlat/v4l2_control_ids.in: Update.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for V4L2_CTRL_CLASS_* constants.
        As those are architecture-independant.  Also note that the xlat
        is sorted.

        * xlat/v4l2_control_classes.in: Add values.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update V4L2_CTRL_CLASS_* constants.
        * xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_DV): New constant,
        introduced by Linux commit v3.7-rc1~101^2^2~322.
        (V4L2_CTRL_CLASS_RF_TUNER): New constant, introduced by Linux commit
        v3.15-rc1~85^2~192.
        (V4L2_CTRL_CLASS_DETECT): New constant, introduced by Linux commit
        v3.17-rc1~112^2~340.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update BPF_F_* constants.
        Apparently, BPF_F_RDONLY and BPF_F_WRONLY are also used in map_flags.
        Moreover, set of flags depends on the type of map, but let's leave that
        for another day.

        * xlat/bpf_map_flags.in (BPF_F_RDONLY, BPF_F_WRONLY): New constants.
        (BPF_F_STACK_BUILD_ID): New constant, introduced by Linux commit
        v4.17-rc1~148^2~156^2~3^2~1.
        * xlat/bpf_map_flags.in: Update expected output.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add V4L2_PIX_FMT_HEVC.
        * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_HEVC): New constant, introduced
        by Linux commit v4.17-rc1~143^2~60.

        xlat: add ETH_P_PREAUTH.
        * xlat/ethernet_protocols.in (ETH_P_PREAUTH): New constant, introduced
        by Linux commit v4.17-rc1~148^2~379^2~3.

        xlat: update SCTP_* constants.
        * xlat/socksctpoptions.in (SCTP_AUTH_DEACTIVATE_KEY): New constant,
        introduced by Linux commit v4.17-rc1~148^2~191^2~2.
        (SCTP_SENDMSG_CONNECT): New constant, introduced by Linux commit
        v4.17-rc1~96^2~9.

        xlat: add SPARC ADI-related SIGSEGV codes.
        * xlat/sigsegv_codes.in (SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR): New
        constants, introduced by Linux commit v4.17-rc1~147^2~4^2~10.

        xlat: add PROT_ADI.
        * xlat/mmap_prot.in (PROT_ADI): New constant, introduced by Linux commit
        v4.17-rc1~147^2~4^2~1.

2018-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        build: rewrite libdw detection without pkg-config.
        pkg-config expected to be more convenient way to configure libdw,
        but in practice it appeared to be less portable than good old
        AC_CHECK_HEADERS and AC_CHECK_LIB.

        * ci/install-dependencies.sh (common_packages): Remove pkg-config.
        (STACKTRACE == "libdw"): Do not install libz-dev and liblzma-dev.
        * debian/control (Build-Depends): Remove pkg-config.
        * m4/st_libdw.m4 (st_ARG_LIBDW, st_LIBDW): Rewrite without pkg-config.

2018-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        ci: add more variants of unwinder to test matrices.
        Check x86_64 builds with libdw, with libunwind, and without stacktrace.
        As Travis CI doesn't provide a suitable libdw, do not test libdw there.

        * ci/install-dependencies.sh (common_packages): Remove libdw-dev.
        Install libdw-dev or libunwind8-dev depending on $STACKTRACE.
        * ci/run-build-and-tests.sh: Specify --with-libdw=yes,
        --with-libunwind=yes, or --without-stacktrace depending on $STACKTRACE.
        * .gitlab-ci.yml (gcc-x86_64): Rename to gcc-x86_64-libdw,
        add STACKTRACE=libdw.
        (gcc-x86): Rename to gcc-x86-nounwind, add STACKTRACE=no.
        (clang-x86_64): Rename to clang-x86_64-libdw, add STACKTRACE=libdw.
        (clang-x86): Rename to clang-x86-nounwind, add STACKTRACE=no.
        (gcc-x86_64-libunwind, gcc-x86_64-nounwind, gcc-x86-nounwind,
        clang-x86_64-libunwind, clang-x86_64-nounwind, clang-x86-nounwind):
        New test matrix entries.
        * .travis.yml: Add STACKTRACE=libunwind to all x86_64 test matrix
        entries except musl-gcc, add STACKTRACE=no to other matrix entries,
        add test matrix entries with STACKTRACE=no variants on x86_64.

2018-05-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update af_packet_types.
        * xlat/af_packet_types.in: Add values.
        (PACKET_USER, PACKET_KERNEL): New constants, introduced by Linux commit
        v3.14-rc1~94^2~349.

        xlat: add values to adjtimex_state, adjtimex_status, advise xlats.
        * xlat/adjtimex_state.in: Add values.
        * xlat/adjtimex_status.in: Likewise.
        * xlat/advise.in: Likewise.

        xlat: update adjtimex_modes.
        * xlat/adjtimex_modes.in: Add values to constants.
        (0): Remove.
        (ADJ_OFFSET_SS_READ): Move to the first place.
        (ADJ_OFFSET_SINGLESHOT): Move to the second place.

2018-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        mmap_cache: do not activate unless requested.
        Do not call mmap_cache functions until mmap_cache_enable is invoked.
        Change struct mmap_cache_t into a proxy structure, move all mmap_cache
        data from struct tcb inside this new structure.

        * Makefile.am (strace_SOURCES): Move mmap_cache.c and mmap_cache.h
        to libstrace_a_SOURCES.
        * defs.h (struct tcb): Remove mmap_cache_size and mmap_cache_generation
        * fields.
        * mmap_cache.h (struct mmap_cache_t): Rename
        to struct mmap_cache_entry_t, create a new struct mmap_cache_t,
        all users updated.
        (mmap_cache_delete): Remove.
        * mmap_cache.c (mmap_cache_delete): Rename to delete_mmap_cache,
        add static qualifier.
        (build_mmap_cache): Merge into mmap_cache_rebuild_if_invalid.
        * strace.c (droptcb): Replace mmap_cache_delete invocation
        with tcp->mmap_cache->free_fn.

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

        mmap_cache: remove mmap_cache_is_enabled.
        This function is no longer used and could be removed.

        * mmap_cache.c (mmap_cache_is_enabled): Remove.
        * mmap_cache.h: Likewise.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

        unwind-libdw: use the mmap_notify subsystem.
        The unwind subsystem uses the mmap_cache subsystem even it uses
        unwind-libdw as backend. unwind-libdw doesn't need the full set of the
        mmap_cache subsystem; libdw has a feature for caching a memory
        mapping.

        This commit does three things.

        (1) Make the unwind subsystem not use the mmap_cache subsystem.
        The unwind subsystem never concern the memory mapping of the target.
        It becomes a thin layer.

        (2) Make unwind-libunwind use the mmap_cache subsystem directly.

        (3) Make unwind-libdw use the mmap_notify subsystem to know when it
        should call dwfl_linux_proc_report/dwfl_report_end for updating the
        cache.

        Here is a subsystem structure that this patch
        introduces:

                +-------------------------------------+
                |            unwind subsys            |
                +------------------+------------------+
                | unwind-libunwind |   unwind-libdw   |
                +------------------+------------------+
                |    mmap_cache    |                  |
                +------------------+                  |
                |               mmap_notify           |
                +-------------------------------------+
                |                syscall              |
                +-------------------------------------+
                       mmap/munmap/mprotect/brk...

        * unwind.c: Don't include "mmap_cache.h".
        (unwind_init): Don't call mmap_cache_enable.
        (unwind_tcb_print, unwind_tcb_capture): Don't call mmap_cache related
        functions, just invoke unwinder.tcb_walk.
        * unwind.h (struct unwind_unwinder_t): Remove tcb_flush_cache field.

        * unwind-libdw.c: Include "mmap_notify.h" instead of "mmap_cache.h".
        (struct ctx): Add last_proc_updating field to record the generation
        of memory mapping that is cached by dwfl_linux_proc_report
        and dwfl_report_end.
        (mapping_generation): A variable counting how many times the memory
        mapping of targets has been changed.
        (updating_mapping_generation): New utility function for updating
        mapping_generation.
        (init): New function for registering updating_mapping_generation
        in the mmap_notify subsystem as a callback function.
        (tcb_init): Initialize ctx::last_proc_updating.
        (tcb_flush_cache): Rename to flush_cache_maybe.  Rebuild the cache data
        only if the data is stale.
        (tcb_walk): Call flush_cache_maybe for avoiding referring staled cache data.
        (unwinder): Set init function, remove tcb_flush_cache field.
        * unwind-libunwind.c (init): Enable the mmap_cache subsystem.
        (tcb_walk): Call mmap_cache_rebuild_if_invalid and unw_flush_cache for
        updating the cache of the memory mapping before walking the stack.
        (tcb_walk): Rename to walk.
        (unwinder): Remove tcb_flush_cache field.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

        unwind-libdw: introduce indirect data structure for storing unwinding context
        unwind-libdw uses Dwfl as the data structure for storing unwinding
        context.  It is raw data that come from libdw.

        This commit introduces "struct ctx" file local data type for allowing
        unwind-libdw to attach strace side data to the unwinding context.

        * unwind-libdw.c (struct ctx): New struct definition.
        (tcb_init, tcb_fin, tcb_walk, tcb_flush_cache): Use struct ctx instead
        of Dwfl directly.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

        mmap_notify: rename the macro for tracking memory mapping.
        * sysent.h (STACKTRACE_INVALIDATE_CACHE): Rename to
        MEMORY_MAPPING_CHANGE.  All users updated.

        mmap_cache: use the mmap_notify subsystem.
        * mmap_cache.c: Include mmap_notify.h.
        (mmap_cache_enable): Call mmap_notify_register_client to use
        the mmap_notify subsystem, mmap_cache_invalidate is specified
        to handle the change of memory mapping.
        (mmap_cache_invalidate): Add static qualifier.
        * mmap_cache.h (mmap_cache_invalidate): Remove.
        * syscall.c: Include mmap_notify.h instead of mmap_cache.h.
        (syscall_exiting_decode): Call mmap_notify_report instead
        of mmap_cache_invalidate.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

        mmap_notify: new subsystem for tracking the changes of memory mappings.
        This subsystem is a spin-off of the mmap_cache subsystem.

        The mmap_cache subsystem had two features: (1) tracking the change
        of memory mapping, and (2) maintaining the cache of memory mapping.

        mmap_notify is a subsystem specialized to provide feature (2).
        unwind-libdw itself has the feature (1).  It needs only (2).

        * mmap_notify.h: New file.
        * mmap_notify.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: add missing braces.
        Reported by Coverity.

        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
        BTRFS_IOC_TREE_SEARCH_V2>: Add missing braces.

        Fixes: v4.22-76-gf766447 "btrfs: use PRINT_FIELD_*"

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: check return code of never failing fcntl call.
        Because the kernel cannot be trusted.

        * strace.c (set_cloexec_flag): Call perror_msg_and_die if fcntl(F_SETFD)
        has failed.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sock: use error_func_msg for printing function name.
        * sock.c (decode_ifconf): Use error_func_msg instead of error_msg with
        manual function name printing.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: add len sanity checks to dumpstr.
        Reported by clang.

        * util.c (dumpstr): Check that len is sane.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mmap_cache: fool-proofing build_mmap_cache.
        Let's try to handle better the situation when build_mmap_cache is called
        without mmap_cache/mmap_cache_size being reset prior to the call.

        Reported by Coverity scan.

        * mmap_cache.c (build_mmap_cache): Set cache_head to tcp->mmap_cache.
        Reset tcp->mmap_cache_size to 0.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        error_prints: add missing va_end() calls.
        These missing va_end() calls are followed by die() calls that never
        return, so the only practical effect of this change is appeasement
        of code checking tools.

        Reported by cppcheck.

        * error_prints.c (error_msg_and_die, error_msg_and_help,
        perror_msg_and_die): Add va_end().

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mem: handle potential error from sysconf(_SC_PAGESIZE)
        Reported by Coverity scan.

        * mem.c (get_pagesize): Handle the case when sysconf(_SC_PAGESIZE)
        returns an error.

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: merge fcntl64cmds into fcntlcmds.
        Since we don't have to workaround old F_[GS]ETOWN_EX == F_[SG]ETLK64
        kernel bug any longer, there is a room for cleanup.

        * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64): Add from
        xlat/fcntl64cmds.in.
        * xlat/fcntl64cmds.in: Remove.
        * fcntl.c: Do not include "xlat/fcntl64cmds.h".
        (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Do not use fcntl64cmds, call
        printxval instead of printxvals.

2018-05-03  Zhibin Li  <08826794brmt@gmail.com>

        tests: check decoding of F_GETOWN_EX and F_SETOWN_EX fcntl commands.
        * tests/fcntl.c (TEST_F_OWNER_EX): New macro.
        [TEST_F_OWNER_EX]: Include "f_owner_ex.h".
        [TEST_F_OWNER_EX] (test_f_owner_ex_type_pid,
        test_f_owner_ex_umove_or_printaddr, test_f_owner_ex): New functions.
        (main) [TEST_F_OWNER_EX]: Use test_f_owner_ex.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce f_owner_ex.h.
        Some headers define struct f_owner_ex, some struct __kernel_f_owner_ex,
        we have to support both variants.

        * configure.ac (AC_CHECK_TYPES): Check for "struct f_owner_ex"
        and "struct __kernel_f_owner_ex" in <linux/fcntl.h>.
        * f_owner_ex.h: New file.
        * Makefile.am (strace_SOURCES): Add it.

2018-05-02  Masatake YAMATO  <yamato@redhat.com>

        tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentry.
        Since Linux 4.16, kernel appends the cpuid as suffix to the entry
        for a kvm vcpu in /proc/$pid/fd like:

            anon_inode:kvm-vcpu:0

        That was

            anon_inode:kvm-vcpu

        This kernel change causes the test case failure on newer kernels.
        Update the test to deal with the new name as well as the old one.

        * tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2).
        (vcpu_dev_should_have_cpuid): New function for detecting whether
        a proc entry for given fd has the cpuid suffix or not.
        (main): Trim vcpu_dev to remove the cpuid suffix if needed.
        (vcpu_dev): Remove const modifier.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: check that system definitions match fallback definitions.
        For each constant that is accompanied by a fallback definition,
        generate a sanity check that the definition provided by system headers
        matches the fallback definition.

        * gcc_compat.h (DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE,
        DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE): New macros.
        * xlat/gen.sh (cond_def): Generate a code that checks the system
        definition against the default.
        (gen_header): Generate a code that includes "gcc_compat.h" and
        "static_assert.h".

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: override values of F_SETOWN_EX and F_GETOWN_EX constants.
        Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX
        and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix
        the conflict with F_GETLK64 and F_SETLK64 constants.

        Looks like the best way to handle this situation is to pretend that
        old values of F_SETOWN_EX and F_GETOWN_EX didn't exist.

        * xlat/fcntlcmds.in (F_SETOWN_EX, F_GETOWN_EX): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc.
        * xlat/fcntlcmds.in (F_GETLK, F_SETLK, F_SETLKW, F_SETOWN, F_GETOWN,
        F_SETSIG, F_GETSIG) [alpha || hppa || mips || sparc]: Fix definitions.
        * xlat/fcntl64cmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [hppa || mips]:
        Likewise.

        xlat: fix SI_* fallback definitions on mips.
        * xlat/siginfo_codes.in [mips] (SI_ASYNCIO, SI_TIMER, SI_MESGQ): Define
        to -2, -3, and -4, respectively.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: override values of KEY_RFKILL and KEY_BRIGHTNESS_MIN constants.
        KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel
        commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively.
        Apparently, RHEL6 introduced an alternative KEY_RFKILL constant
        with the same value as upstream KEY_NUMERIC_A.

        KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced
        by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7.
        Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant
        with the same value as upstream KEY_BRIGHTNESS_MAX.

        Downstream vendors are *not* allowed to do this.
        Ignore the system value of KEY_RFKILL and KEY_BRIGHTNESS_MIN.

        * xlat/evdev_keycode.in (KEY_RFKILL, KEY_BRIGHTNESS_MIN): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: override the value of KEY_DATA constant.
        Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA
        constant introduced by commit v4.7-rc6~32^2~6^2 because the old value
        was already used by KEY_FASTREVERSE.

        Looks like the best way to handle this situation is to pretend that
        the old value of KEY_DATA didn't exist.

        * xlat/evdev_keycode.in (KEY_DATA): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: override the value of AUDIT_FEATURE_CHANGE constant.
        Linux kernel commit v3.15-rc1~18^2~1 has changed the value
        of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20
        which is of course an ABI breakage that affected 3.13 and 3.14 kernel
        releases as well as their LTS derivatives.

        Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value
        of AUDIT_FEATURE_CHANGE was ignored by userspace because of the
        established convention how netlink messages for the audit system
        are divided into blocks.

        Looks like the best way to handle this situation is to pretend that
        the old value of AUDIT_FEATURE_CHANGE didn't exist.

        * xlat/nl_audit_types.in (AUDIT_FEATURE_CHANGE): Undefine.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: fix MCL_* fallback definitions on alpha, ppc, ppc64, and sparc.
        On these architectures, MCL_* constants are different.

        * xlat/socketlayers.in [__alpha__ || __powerpc__ || __powerpc64__
        || __sparc__] (MCL_CURRENT, MCL_FUTURE, MCL_ONFAULT): Define to 0x2000,
        0x4000, and 0x8000, respectively.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: fix SOL_SOCKET fallback definition on alpha, hppa, mips, and sparc
        On these architectures, SOL_SOCKET is 0xffff and not 1.

        * xlat/socketlayers.in [__alpha__ || __hppa__ || __mips__ || __sparc__]
        (SOL_SOCKET): Define to 0xffff.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more mount checks.
        * tests/gen_tests.in (mount, mount-Xabbrev, mount-Xraw, mount-Xverbose):
        Add -a33 option.
        * tests/mount.c: Check printing of flags and pointers.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc in mount test.
        * tests/mount.c (main): Use sprintrc.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add mount variants with different xlat verbosity levels.
        * tests/mount-Xabbrev.c: New file.
        * tests/mount-Xraw.c: Likewise.
        * tests/mount-Xverbose.c: Likewise.
        * tests/mount.c: Add handling of XLAT_RAW and XLAT_VERBOSE macros.
        * tests/pure_executables.list: Add mount-Xabbrev, mount-Xraw,
        and mount-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (mount-Xabbrev, mount-Xraw, mount-Xverbose): New
        tests.

        tests: add old_mmap variants with different xlat verbosity levels.
        * tests/old_mmap-Xabbrev.c: New file.
        * tests/old_mmap-Xraw.c: Likewise.
        * tests/old_mmap-Xverbose.c: Likewise.
        * tests/old_mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE
        macros.
        * tests/pure_executables.list: Add old_mmap-Xabbrev, old_mmap-Xraw,
        and old_mmap-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (old_mmap-Xabbrev, old_mmap-Xraw,
        old_mmap-Xverbose): New tests.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add mmap/mmap64 variants different xlat verbosity levels.
        * tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
        [!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
        * tests/mmap-Xabbrev.c: New file.
        * tests/mmap-Xraw.c: Likewise.
        * tests/mmap-Xverbose.c: Likewise.
        * tests/mmap64-Xabbrev.c: Likewise.
        * tests/mmap64-Xraw.c: Likewise.
        * tests/mmap64-Xverbose.c: Likewise.
        * tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
        * tests/mmap.test: Add handling of optional test arguments that set
        alignment and xlat verbosity options.
        * tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
        mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
        * tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
        mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
        mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        Fix fallback definition of MSG_ZEROCOPY.
        * xlat/msg_flags.in (MSG_ZEROCOPY): Set fallback definition to 0x4000000.

        Fixes: v4.21~316 ("Update MSG_* constants")

2018-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        build: try to use _Static_assert if static_assert is not available.
        * configure.ac: Check for _Static_assert if static_assert
        is not available.
        * static_assert.h [!HAVE_STATIC_ASSERT && HAVE__STATIC_ASSERT]
        (static_assert): Define to _Static_assert.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printmode: add xlat style support to print_symbolic_mode_t.
        * printmode.c (print_symbolic_mode_t): Set ifmt to an empty string,
        print raw and decoded values based on current xlat_verbosity setting.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        evdev: remove XT_NORMAL.
        It is no longer used.

        * evdev.c (enum xlat_type) <XT_NORMAL>: Remove.
        (printxval_dispatch) <case XT_NORMAL>: Remove.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Switch to use of value-indexed xlats for evdev constants.
        * xlat/evdev_abs.in: Add "#value_indexed" directive.
        * xlat/evdev_autorepeat.in: Likewise.
        * xlat/evdev_ff_status.in: Likewise.
        * xlat/evdev_keycode.in: Likewise.
        * xlat/evdev_leds.in: Likewise.
        * xlat/evdev_misc.in: Likewise.
        * xlat/evdev_prop.in: Likewise.
        * xlat/evdev_relative_axes.in: Likewise.
        * xlat/evdev_snd.in: Likewise.
        * xlat/evdev_switch.in: Likewise.
        * xlat/evdev_sync.in: Likewise.
        * xlat/evdev_ff_types.in: Add a comment about sorting.
        * evdev.c (keycode_ioctl, keycode_V2_ioctl): Use printxval_index
        instead of printxval.
        (bit_ioctl): Use XT_SORTED for evdev_ff_types, use XT_INDEXED
        for other xlats.
        (evdev_read_ioctl): Use XT_INDEXED for all xlats.
        * ioctl.c (evdev_decode_number): Use printxval_indexn instead of
        printxval for evdev_abs.

        evdev: support various types of xlats in decode_bitset.
        * evdev.c (enum xlat_type): New enumeration.
        (printxval_dispatch): New function.
        (decode_bitset_): Rename from decode_bitset, add decode_nr_size
        and xt arguments, call printxval_dispatch instead of printxval.
        (decode_bitset): Add a decode_bitset_ wrapper that derives
        decode_nr_size from the ARRAY_SIZE of decode_nr.
        (bit_ioctl, evdev_read_ioctl): Update decode_bitset calls.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move xlat/evdev_abs.h inclusion from ioctl.c to evdev.c.
        Also introduce evdev_abs_size constant, which will be needed later.

        * defs.h (evdev_abs_size): New declaration.
        * ioctl.c: Move xlat/evdev_abs.h inclusion ...
        * evdev.c: ... here.
        (evdev_abs_size): New constant variable.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for value-indexed xlats.
        There are quite a few xlats that start from 0 and not too sparse,
        we can push the search time for them down to O(1).

        * defs.h (printxval_indexn_ex): New declaration.
        (printxval_indexn, printxval_index, printxval_index_ex): New macros.
        * xlat.c (printxval_sized): Rename from printxval_searchn_ex,
        add fn argument, call it instead of xlat_search.
        (printxval_searchn_ex): Implement as a thin wrapper around
        printxval_sized using xlat_search as a search function.
        (xlat_idx): New function.
        (printxval_indexn_ex): New function, a thin wrapper around
        printxval_sized using xlat_idx as a search function.
        * xlat/gen.sh: Add support for "#value_indexed" directive.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        socketcall: use printxval_d for printing call argument.
        * socketcall.c (SYS_FUNC(socketcall)): Use printxval_d instead of manual
        call argument decoding.

        signal: use print_xlat_ex in print_sa_handler.
        * signal.c (print_sa_handler): Call print_xlat_ex instead of tprints
        in order to respect current xlat style setting.

        s390: use printxvals_ex for command printing in s390_runtime_instr.
        * s390.c (SYS_FUNC(s390_runtime_instr)): Replace manual command argument
        decoding with a printxvals_ex call.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printsiginfo: use print_xlat_ex in print_si_code.
        In order to respect current xlat style setting.

        * printsiginfo.c (print_si_code): Use print_xlat_ex instead of manual
        string/value printing.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        open: use print_xlat_ex for printing open modes.
        In order to respect xlat style setting.

        * open.c (tprint_open_modes): Use print_xlat_ex instead of
        tprint_open_modes.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink: use print_xlat_ex in decode_nlmsg_type_netfilter.
        In order to respect current xlat style setting.

        * netlink.c (decode_nlmsg_type_netfilter): Use print_xlat_ex
        instead of tprints.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        net: use print_xlat_ex in tprint_sock_type.
        In order to respect current xlat style setting.

        * next.c (tprint_sock_type): Use print_xlat_ex instead of tprints
        for socket type printing.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: use printxval_d for printing keyring serial number.
        * keyctl.c (print_keyring_serial_number): Use printxval_d instead of
        looking up and printing xlat value manually.
        * xlat/key_spec.in: Add "#val_type int" so the xlat values have sign
        bit propagated.

        ipc: use printxval_u instead of manual xlat value printing.
        * ipc.c (SYS_FUNC(ipc)): Decode call argument using printxval_u.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioprio: use sprintxval instead of xlookup and string/value printing.
        In order to respect current xlat style.

        * ioprio.c (sprint_ioprio): Use sprintxval for producing string
        representation of ioprio class, use the produced string representation
        in resulting xsprintf.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: handle NULL str in print_xlat_ex.
        It allows to use the following code pattern:

                print_xlat_ex(val, xlookup(xlat, val), XLAT_STYLE_FMT_D);

        * xlat.c (print_xlat_ex): Handle str being NULL: print val instead.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: fix typo (Ronald -> Roland)
        A very unfortunate one, though.

        NEWS: mention that -X option addresses Debian bug #692915.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: do not include linux/input.h.
        All the ABS_* and EV_* values are now available internally,
        there's no need to include the header.

        * ioctl.c [HAVE_LINUX_INPUT_H]: Do not include linux/input.h.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more evdev ioctl checks.
        tests/ioctl_evdev.c (TEST_NULL_ARG_EX): Rename from TEST_NULL_ARG, add
        str argument, print it instead of #cmd.
        (TEST_NULL_ARG): Implement as a TEST_NULL_ARG_EX wrapper.
        (main): Add checks for EVIOCSABS and EVIOCGBIT ioctls.

        evdev: decode EV_SW unconditionally.
        * evdev.c (bit_ioctl): Remove [EV_SW] check.
        * tests/ioctl_evdev.c [!EV_SW] (EV_SW): Define.
        (main): Remove [EV_SW] check.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for arch-independent evdev constants.
        * xlat/evdev_abs.in: Add constant values.
        * xlat/evdev_autorepeat.in: Likewise.
        * xlat/evdev_ev.in: Likewise.
        * xlat/evdev_ff_status.in: Likewise.
        * xlat/evdev_ff_types.in: Likewise.
        * xlat/evdev_leds.in: Likewise.
        * xlat/evdev_misc.in: Likewise.
        * xlat/evdev_prop.in: Likewise.
        * xlat/evdev_relative_axes.in: Likewise.
        * xlat/evdev_snd.in: Likewise.
        * xlat/evdev_switch.in: Likewise.
        * xlat/evdev_sync.in: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/evdev_switch.in: update.
        * xlat/evdev_switch.in (SW_RADIO): Remove, as it was renamed to
        SW_RFKILL_ALL and marked as deprecated by Linux commit v2.6.26-rc5~32^2.
        (SW_PEN_INSERTED): New constant, was added by Linux commit v4.7~11^2~7.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: make "Out of memory" messages a bit more informative.
        Since these are emitted in multiple places and are not expected during
        any normal operation, it makes sense to report the caller name.

        * util.c (print_quoted_string_ex, print_quoted_string_ex, dumpiov_upto,
        dumpstr): Replace error_msg with error_func_msg.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ci: reorder travis jobs.
        Run coverage check first as it is the longest one.

        * .travis.yml (matrix): Reorder.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add MS_SUBMOUNT constant.
        * xlat/mount_flags.in (MS_SUBMOUNT): New constant, introduced
        by Linux commit v4.11-rc1~82^2~7.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        fcntl: replace combinations of xlookup and printxval with printxvals.
        After all, that's what printxvals for.

        * fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for
        printing value with multiple xlat tables as constant sources.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move xlat_verbose and xlat_format from xlat.c to defs.h.
        As it will be used elsewhere.

        * xlat.c (xlat_verbose, xlat_format): Move...
        * defs.h: ...here.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: use printxval_u for error types printing.
        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
        BTRFS_IOC_GET_DEV_STATS>: Use printxval_u for error type printing.
        * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output.

        btrfs: print device IDs using PRINT_FIELD_DEV.
        * btrfs.c (btrfs_print_balance_args): Print devid field using
        PRINT_FIELD_DEV.
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_INFO,
        case BTRFS_IOC_GET_DEV_STATS, case BTRFS_IOC_SCRUB,
        case BTRFS_IOC_SCRUB_PROGRESS>: Likewise.
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print
        start.srcdevid field using PRINT_FIELD_DEV.
        * tests/btrfs.c: Update expected output.

        btrfs: print cont_reading_from_srcdev_mode as xlat.
        * xlat/btrfs_cont_reading_from_srcdev_mode.in: New file.
        * btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h".
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print
        named values for the
        struct btrfs_ioctl_dev_replace_args.start.cont_reading_from_srcdev_mode
        field.
        * tests/btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h".
        (btrfs_test_dev_replace_ioctl): Update expected output.

        btrfs: use PRINT_FIELD_*
        * btrfs.c (btrfs_print_balance_args, btrfs_print_balance,
        btrfs_print_features, btrfs_print_qgroup_limit,
        btrfs_print_data_container_header,
        print_btrfs_data_container_logical_ino, btrfs_print_qgroup_inherit,
        btrfs_print_tree_search, print_btrfs_ioctl_space_info, btrfs_ioctl):
        Use PRINT_FIELD_* macros for printing structure fields.

        btrfs: make BTRFS_IOC_GET_DEV_STATS error statistics output more structured
        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
        BTRFS_IOC_GET_DEV_STATS>: Print array index in square brackets before
        the value in order to avoid confusion.
        * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output.

        ioctl: print ioctl number in accordance with xlat verbosity setting.
        * ioctl.c (SYS_FUNC(ioctl)): Print ioctl command name in accordance
        with the current xlat_verbosity setting.
        * tests/btrfs.c (sprint_xlat_): New function.
        (ioc): New macro, a wrapper for sprint_xlat_.
        Update expected output.

        file_ioctl: make abbreviated output more structured.
        * file_ioctl.c (file_ioctl): Print fm_extents field name only in case
        of non-abbreviated output.
        * tests/btrfs.c (btrfs_test_ino_path_ioctls): Update expected output.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args.
        For some reason, he decoder of BTRFS_IOC_QUOTA_CTL command didn't print
        opening curly brace and field name, only the closing curly brace.

        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_QUOTA_CTL>:
        Print "{cmd=".
        * tests/btrfs.c (btrfs_test_quota_ctl_ioctl): Update expected output.

        Fixes: v4.12~100 "ioctl: add decoding support for btrfs ioctls"

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: consistently use PRINT_FIELD_U64.
        * btrfs.c (print_u64, print_member_u64, print_key_value_internal,
        print_key_value): Remove.
        (btrfs_print_balance_args): Use PRINT_FIELD_U64 instead of
        print_member_u64.
        (btrfs_print_tree_search): Use PRINT_FIELD_U64 instead of
        print_key_value.
        (MPERS_PRINTER_DECL(btrfs_ioctl)): Use PRINT_FIELD_U64 instead of manual
        UINT64_MAX printing.
        * tests/btrfs.c: Update expected output in order to account fields that
        are now affected by xlat_verbosity setting.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: print {min,max}_{offset,transid} unconditionally.
        As it looks like there's no reason to skip their printing.

        * btrfs.c (print_key_value_internal): Do not check value argument
        for holding non-zero value.
        * tests/btrfs.c (btrfs_print_search_key): Update expected output.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/btrfs.c: accept possible failure of BTRFS_IOC_BALANCE_V2.
        BTRFS_IOC_BALANCE_V2 ioctl might fail sometimes (for example, if it
        decides that it doesn't have enough free space).

        * tests/btrfs.c (btrfs_test_balance_ioctls): Print expected output for
        the BTRFS_IOC_BALANCE_V2 call based on its return code.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/btrfs.c: support volumes with mixed data/metadata in BTRFS_IOC_BALANCE_V2
        For these volumes, pend/vend should be the same for data and meta.

        * tests/btrfs.c (btrfs_test_balance_ioctls): Set args.meta.pend and
        args.meta.vend to the same values as args.data.pend and args.data.vend,
        respectively.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/btrfs.c: check BTRFS_IOC_SUBVOL_CREATE_V2 result.
        Otherwise the subsequent openat call fails with a cryptic message.

        * tests/btrfs.c (btrfs_test_subvol_ioctls): Check return code of the
        BTRFS_IOC_SUBVOL_CREATE_V2 ioctl call that is supposed to be successful.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/btrfs.c: add pid suffix to the created directory, remove it on exit
        If multiple tests are running simultaneously in the same directory,
        conflicts (and test failures) may happen.

        * tests/btrfs.c (path, dir_name_fmt, dir_name): New variables.
        (btrfs_test_ino_path_ioctls): Use dir_name for printing directory name.
        (rm_test_dir): New function.
        (main): Generate dir_name, use it instead of fixed name, add rm_test_dir
        as an atexit handler.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: duplicate printing of opening braces on entering/exiting.
        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)): Print opening bracket
        on entering and exiting separately.

        btrfs: refactor timespec printing into print_btrfs_timespec.
        * btrfs.c (print_btrfs_timespec): New function.
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SET_RECEIVED_SUBVOL>:
        Use print_btrfs_timespec for printing stime and rtime fields.
        * tests/btrfs.c (btrfs_test_set_received_subvol_ioctl): Update expected
        output.

        btrfs: print abbreviations and field names more consistently.
        * btrfs.c (btrfs_print_data_container_header): Do not print ", val=".
        (btrfs_print_ino_path_container): Print val field name only in case
        of non-abbreviated output.
        (btrfs_print_qgroup_inherit): Print qgroups field name only in case
        of non-abbreviated output.
        (btrfs_print_tree_search): Print buf field name only in case
        of non-abbreviated output.
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SEND>: Print
        clone_sources field name only in case of non-abbreviated output.
        (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SPACE_INFO>: Print
        spaces field name only in case of non-abbreviated output.
        * tests/btrfs.c: Update expected output.

        btrfs: move printing of the field name inside btrfs_print_qgroup_limit.
        * btrfs.c (btrfs_print_qgroup_limit): Print ", lim=".
        (btrfs_print_qgroup_inherit, MPERS_PRINTER_DECL(btrfs_ioctl)): Do not
        print ", lim=" before btrfs_print_qgroup_limit call.

        btrfs: convert btrfs_print_{objectid,key_type} to PRINT_FIELD_XVAL_U.
        * btrfs.c (btrfs_print_key_type, btrfs_print_objectid): Convert into
        thin wrappers around PRINT_FIELD_XVAL_U.
        (btrfs_print_data_container_header, btrfs_print_tree_search,
        MPERS_PRINTER_DECL(btrfs_ioctl)): Update calls to btrfs_print_key_type
        and btrfs_print_objectid in accordance with the new calling convention.
        (print_objectid_callback): Use printxvals_ex directly instead of
        btrfs_print_objectid call.
        * tests/btrfs.c (btrfs_print_objectid, btrfs_print_key_type): Update
        expected output.

        tests: add btrfs tests with verbose xlat decoding.
        * tests/btrfs-X.test: New test.
        * tests/btrfs-vX.test: Likewise.
        * tests/btrfs-vwX.test: Likewise.
        * tests/btrfs-wX.test: Likewise.
        * tests/Makefile.am (DECODER_TESTS): Add them.
        * tests/btrfs.c (verbose_xlat): New static variable.
        (prfl_btrfs, prxval_btrfs): New function.
        (btrfs_print_qgroup_inherit, btrfs_print_vol_args_v2,
        btrfs_print_balance_args, btrfs_test_balance_ioctls,
        btrfs_test_clone_ioctls, btrfs_test_defrag_ioctls,
        btrfs_test_space_info_ioctl, btrfs_print_defrag_range_args,
        btrfs_test_scrub_ioctls, btrfs_test_ino_path_ioctls,
        btrfs_test_send_ioctl, btrfs_test_send_ioctl,
        btrfs_test_quota_ctl_ioctl, btrfs_test_get_dev_stats_ioctl,
        btrfs_test_get_dev_stats_ioctl, btrfs_test_dev_replace_ioctl,
        btrfs_test_dev_replace_ioctl, btrfs_print_features): Use prfl_btrfs and
        prxval_btrfs instead of printflags and printxval, respectively.
        (btrfs_test_balance_ioctls, btrfs_test_ino_path_ioctls,
        btrfs_test_quota_ctl_ioctl, btrfs_test_dev_replace_ioctl,
        btrfs_test_dev_replace_ioctl): Update expected output based on
        verbose_xlat setting.
        (btrfs_print_defrag_range_args): Add compress_type_known arg, pass it
        to prxval_btrfs.
        (main): Handle -X option.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check -X option syntax.
        * tests/options-syntax.test: Add checks for -X option with invalid
        arguments.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add user interface for configuring xlat output style.
        * strace.c (init): Handle -X option, set xlat_verbosity
        according to -X argument.
        * strace.1.in: Document -X option.
        * NEWS: Mention it.

        Closes: https://github.com/strace/strace/issues/27
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print fields that interpreted as pointers using printaddr64.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM),
        BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)): Print key and value
        fields using PRINT_FIELD_ADDR64.
        (BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)): Print key field using
        PRINT_FIELD_ADDR64.
        (BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)): Print key and next_key
        field using PRINT_FIELD_ADDR64.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print insns and log_buf fields
        using PRINT_FIELD_ADDR64.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Print data_in and data_out
        fields using PRINT_FIELD_ADDR64.
        * tests/bpf.c: Update expected output.

2018-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        build: make it even more reproducible.
        * Makefile.am (today): Consistently print the UTC date in C locale.
        * configure.ac (RPM_CHANGELOGTIME, DEB_CHANGELOGTIME): Likewise.
        * maint/update_copyright_years.sh: Likewise.
        * copyright-year-gen: Likewise.  When $SOURCE_DATE_EPOCH is non-empty,
        use it as fallback date before the current system date.

        References: https://github.com/strace/strace/pull/68

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: move unwind_tcb_init invocation to after_successful_attach.
        There is no need to call unwind_tcb_init before the tracee is attached.

        * strace.c (alloctcb) [ENABLE_STACKTRACE]: Move unwind_tcb_init
        invocation ...
        (after_successful_attach) [ENABLE_STACKTRACE]: ... here.
        (init) [ENABLE_STACKTRACE]: Remove unwind_tcb_init invocation loop.
        * unwind.c (unwind_tcb_fin): Skip if tcp->unwind_queue is NULL.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        strace: move setting of post-attach flags inside after_successful_attach
        * strace.c (after_successful_attach): Add "flags" argument.
        Set TCB_ATTACHED, TCB_STARTUP, and "flags" in tcp->flags.
        All users updated.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        strace: rename newoutf to after_successful_attach.
        This function is going to be used for other things that have to be done
        right after a successful attach, hence the rename.

        * strace.c (newoutf): Rename to after_successful_attach,
        all users updated.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: remove stray newline in error diagnostics.
        * unwind-libdw.c (tcb_init): Do not pass trailing "\n" to error_msg
        as the latter prints newline itself.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        build: make it more reproducible.
        * file-date-gen: Consistently print the UTC date in C locale.
        When $SOURCE_DATE_EPOCH is non-empty, use it as fallback date
        before the current system date.

        Reported-by: Chris Lamb <lamby@debian.org>
        Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896016
        Closes: https://github.com/strace/strace/pull/68

2018-04-19  Masatake YAMATO  <yamato@redhat.com>

        unwind: initialize unwind context only if given tcb is initialized.
        With libdw based unwinder, following warnings are reported
        when -p is passed before -k:

           $ ./strace -p 1 -k
           ...
           ./strace: dwfl_linux_proc_attach returned an error for process 0: No such file or directory
           ...

        It seems that commit 54c7792b, "Fix libunwind segfault when -p is
        passed before -k" doesn't fix the original issue.

        * strace.c (init) [ENABLE_STACKTRACE]: Initialize unwind context only
        if given tcb is initialized.

2018-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: harmonize length checks.
        The rest of the decoder uses offsetof to check the length.

        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN),
        BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID),
        BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID),
        BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Use offsetof instead
        of offsetofend.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for map_name and map_ifindex fields in BPF_MAP_CREATE.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode map_name
        and map_ifindex fields that were added in Linux commits
        v4.15-rc1~84^2~605^2~3 and v4.16-rc1~123^2~145^2~5^2~8, respectively.
        * bpf_attr.h (struct BPF_MAP_CREATE_struct): Add map_name
        and map_ifindex fields.
        * tests/bpf.c (init_BPF_MAP_CREATE_attr7): New function.
        (BPF_MAP_CREATE_checks): Remove const qualifier, add two more checks.

        bpf: improve handling of various sizes of BPF_MAP_CREATE attributes.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Skip printing
        the rest of the structure if len is less than the offset of the end
        of max_entries, map_flags, or inner_map_fd field.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks.

        tests: add checks for bpf BPF_MAP_CREATE arguments.
        * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print numa_node using xlat.
        As the value of -1 has a special meaning.  The issue is complicated
        by the fact that this constant is not exported by UAPI.

        * xlat/numa_node.in: New file.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Print numa_node field
        using printxvals_ex with a special xlat style.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: use umove_or_printaddr_ignore_syserror instead of u_error mangling
        * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
        BTRFS_IOC_TREE_SEARCH_V2>: Use umove_or_printaddr_ignore_syserror
        instead of tcp->u_error mangling around umove_or_printaddr call.

        defs.h: introduce umove_or_printaddr{,64}_ignore_syserror wrappers.
        * defs.h (umove_or_printaddr64_ignore_syserror): New macro, a thin
        wrapper around umoven_or_printaddr64_ignore_syserror.
        (umove_or_printaddr_ignore_syserror): New macro, a thin wrapper around
        umoven_or_printaddr_ignore_syserror.

        print_fields.h: add PRINT_FIELD_XVAL_U for printing xlat in %u format.
        * print_fields.h (PRINT_FIELD_XVAL_U): New macro.

        print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling
        * print_fields.h (PRINT_FIELD_U64): New macro.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf_sock_filter: use print_xlat32.
        We can't simply use print_xlat here due to the way those SKF_*_OFF
        constants are defined.

        * bpf_sock_filter.c (print_sock_filter_k): Use print_xlat32 for printing
        SKF_AD_OFF, SKF_NET_OFF, and SKF_LL_OFF named constants.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add print_xlat32 macro.
        For those cases where inadvertent sign extension is possible.

        * defs.h (print_xlat32): New macro, a wrapper for print_xlat_ex.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        open: use print_xlat_d in print_dirfd.
        * open.c (print_dirfd): Use print_xlat_d for printing AT_FDCWD named
        constant.

        fanotify: use print_xlat_d.
        * fanotify.c (SYS_FUNC(fanotify_mark)): Use print_xlat_d for printing
        FAN_NOFD named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add print_xlat_u and print_xlat_d shorthands.
        Add variants of print_xlat with various value printing formats.

        * defs.h (print_xlat_u, print_xlat_d): New macro, a wrapper for
        print_xlat_ex.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: introduce XLAT_STYLE_FMT_D.
        As there are some possible users for it, apparently.

        * defs.h (XLAT_STYLE_FORMAT_MASK): Update the value in order to
        accommodate XLAT_STYLE_FMT_D.
        (enum xlat_style) <XLAT_STYLE_FMT_D>: New enumeration entity.
        (printxval64_d, printxval_d): New function, a shorthand for
        printxvals_ex with a single xlat and XLAT_STYLE_FMT_D xlat style.
        * xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_D.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add shorthands for printing xval with XLAT_STYLE_FMT_U.
        * defs.h (printxval_u, printxval64_u): New function, a shorthand for
        printxvals_ex with a single xlat and XLAT_STYLE_FMT_U as a style.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for various xlat formats.
        Since xlat printing routines now have a notion of "style" that should be
        used for printing xlat values, we can also employ this argument for
        passing information about number printing format (unsigned decimal
        or hexadecimal, so far).

        * defs.h (XLAT_STYLE_FORMAT_SHIFT, XLAT_STYLE_FORMAT_MASK): New macro
        constant.
        (enum xlat_style) <XLAT_STYLE_FMT_X, XLAT_STYLE_FMT_U>: New enumeration
        entities.
        * xlat.c (xlat_verbose, xlat_format): New macro for checking specific
        aspect of style argument.
        (get_xlat_style): Use xlat_verbose for checking xlat verbosity style.
        (sprint_xlat_val, print_xlat_val): New function, for easing printing
        raw constant number with respect to printing format style.
        (printxvals_ex, sprintxval_ex, printxval_searchn_ex,
        printxval_searchn_ex, sprintflags_ex, printflags_ex, print_xlat_ex):
        Use xlat_verbose macro for xlat verbosity style checks. Use
        print_xlat_val instead of direct raw xlat value printing.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: use print_xlat in print_v4l2_queryctrl.
        * v4la.c (print_v4l2_queryctrl): Use print_xlat for printing
        V4L2_CTRL_FLAG_NEXT_CTRL named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: use print_xlat_ex to print PR_SET_PTRACER_ANY.
        We cannot simply use print_xlat as PR_SET_PTRACER_ANY is defined
        differently in kernel headers.

        * prctl.c (SYS_FUNC(prctl)) <case PR_SET_PTRACER>: Use print_xlat_ex
        for printing PR_SET_PTRACER_ANY named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: use print_xlat.
        * nlattr.c (print_nlattr): Use print_xlat for printing NLA_F_NESTED and
        NLA_F_NET_BYTEORDER named constants.

        ipc_defs.h: use print_xlat.
        * ipc_defs.h (PRINTCTL): Use print_xlat for printing IPC_64 named
        constant.

        futex: use print_xlat.
        * futex.c [!FUTEX_OP_OPARG_SHIFT] (FUTEX_OP_OPARG_SHIFT): New macro
        constant.
        (SYS_FUNC(futex)): Use print_xlat for printing FUTEX_OP_OPARG_SHIFT
        named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ipc: use printxval for printing key.
        Convert explicit constant printing logic into a printxval call in order
        to account for xlat style setting.

        * defs.h (ipc_private): New xlat array declaration.
        * ipc_msg.c (SYS_FUNC(msgget)): Use printxval for printing IPC_PRIVATE.
        * ipc_sem.c (SYS_FUNC(semtimedop)): Likewise.
        * ipc_shm.c (SYS_FUNC(shmget)): Likewise.
        * xlat/ipc_private.in: New file.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mount: use print_xlat for printing MS_MGC_VAL.
        * mount.c (SYS_FUNC(mount)): Use print_xlat for printing MS_MGC_VAL
        named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce print_xlat and print_xlat_ex.
        print_xlat_ex prints a named constant in accordance with xlat style
        provided, print_xlat is a thin wrapper around print_xlat_ex that passes
        stringified constant name as a string and XLAT_STYLE_DEFAULT as a style.

        * defs.h (print_xlat_ex): New function prototype.
        (print_xlat): New macro, a thin wrapper around print_xlat_ex.
        * xlat.c (print_xlat_ex): New function.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce XLAT_STYLE_DEFAULT.
        This will be needed later, with the introduction of user-configurable
        xlat style setting (stored in xlat_verbosity variable).

        * defs.h (XLAT_STYLE_VERBOSITY_MASK): New macro constant.
        (enum xlat_style) <XLAT_STYLE_DEFAULT>: New enumeration entity.
        (xlat_verbosity): New external declaration.
        (printxvals, printxval_searchn, printxval_search_ex, sprintxval,
        sprintflags, printflags64): Use XLAT_STYLE_DEFAULT instead of
        XLAT_STYLE_ABBREV.
        * strace.c (xlat_verbosity): New variable.
        * xlat.c (get_xlat_style): New function.
        (printxvals_ex, sprintxval_ex, printxval_searchn_ex, sprintflags_ex,
        printflags_ex): Use it.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce xlat verbosity styles.
        * defs.h (printxvals_ex): Rename from printxvals, add style argument.
        (enum xlat_style): New enumeration.
        (printxvals): New macro, a wrapper for printxvals_ex.
        (printxval_searchn_ex): Rename from printxval_searchn, add style
        argument.
        (printxval_searchn): New macro, a wrapper for printxval_searchn_ex.
        (printxval_search_ex): New macro, a wrapper for printxval_searchn_ex.
        (sprintxval_ex): Rename from sprintxval, add style argument.
        (sprintxval): New macro, a wrapper for sprintxval_ex.
        (printflags_ex): Add style argument.
        (sprintflags_ex): Rename from sprintflags, add style argument.
        (sprintflags): New macro, a wrapper for sprintflags_ex.
        (printflags64): Pass XLAT_STYLE_ABBREV as a style in printflags_ex call.
        * netlink.c (decode_nlmsg_flags): Pass XLAT_STYLE_ABBREV as a style in
        printflags_ex call.
        * xlat.c (printxvals_ex): Rename from printxvals, add style argument,
        handle it.
        (sprintxval_ex): Rename from sprintxval, add style argument, handle it.
        (printxval_searchn_ex): Rename from printxval_searchn, add style
        argument, handle it.
        (sprintflags_ex): Rename from sprintflags, add style argument,
        handle it.
        (printflags_ex): Add style argument, handle it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        References: https://github.com/strace/strace/issues/27

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify signal delivery test against kernel bugs.
        Recent kernel siginfo changes, namely, v4.14-rc1~60^2^2~1,
        v4.16-rc1~159^2~37, and v4.16-rc1~159^2~39, introduced ABI regressions
        that render the whole siginfo interface unreliable.

        Looks like the kernel side is not eager to fix the breakage,
        so here is a workaround.

        * tests/signal_receive.c (s_sig, s_code, s_pid, s_uid): New volatile
        variables.
        (handler): Add siginfo_t parameter, save siginfo_t fields.
        (sig_print): Remove.
        (main): Rewrite.  Use variables saved by handler to print expected
        siginfo output. Print diagnostics in case of siginfo mismatch.
        * strace.spec.in (%check): Extract the diagnostics.

        Closes: https://github.com/strace/strace/issues/21

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Lift experimental status from stack tracing feature.
        * strace.1.in (.SH OPTIONS) <.B \-k>: Remove " (experimental)".
        * strace.c (usage) [ENABLE_STACKTRACE]: Likewise.

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Enable stack tracing in packages on all architectures.
        The stack tracing feature used to be enabled in packages on x86_64 only.
        This change enables -k option on all architectures.

        * debian/control (Build-Depends) [!amd64]: Add pkg-config, libdw-dev,
        and libiberty-dev.
        * strace.spec.in (BuildRequires) [!x86_64]: Add
        %buildrequires_stacktrace.

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Use libdw-based unwinder in ci and packages.
        * ci/install-dependencies.sh (common_packages): Add pkg-config,
        replace libunwind8-dev with libdw-dev.
        * debian/control (Build-Depends) [amd64]: Add pkg-config,
        replace libunwind-dev with libdw-dev.
        * debian/rules (build-udeb/Makefile): Replace --without-libunwind
        with --without-stacktrace.
        * strace.spec.in (buildrequires_libunwind_devel): Rename
        to buildrequires_stacktrace, replace libunwind-devel with
        either elfutils-devel or libdw-devel.

        tests: skip -k tests on unsupported architectures.
        * tests/strace-k.test: When actual strace -k output doesn't match the
        expected output because of limited architecture support, skip the test
        on architectures that are not currently supported by libdw.

2018-04-11  Masatake YAMATO  <yamato@redhat.com>

        unwind: add libdw as an unwinder.
        Implement alternative libdw-based unwinder for stack tracing.
        Add --with-libdw configure option to control whether libdw can be used
        as an unwinder.

        * m4/st_libdw.m4: New file.
        * m4/st_stacktrace.m4 (st_STACKTRACE): Invoke st_ARG_LIBDW and st_LIBDW,
        check for mutually exclusive configure options,
        (AM_CONDITIONAL): Add USE_LIBDW.
        * unwind-libdw.c: New file.
        * Makefile.am [USE_LIBDW] (strace_SOURCES): Append unwind-libdw.c.
        [USE_LIBDW] (strace_CPPFLAGS): Append $(libdw_CPPFLAGS).
        [USE_LIBDW] (strace_CFLAGS): Append $(libdw_CFLAGS).
        [USE_LIBDW] (strace_LDFLAGS): Append $(libdw_LDFLAGS).
        [USE_LIBDW] (strace_LDADD): Append $(libdw_LIBS).
        * NEWS: Mention this improvement.

        Closes: https://github.com/strace/strace/issues/12
        Closes: https://github.com/strace/strace/issues/13
        Co-Authored-by: Mark Wielaard <mjw@redhat.com>
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check corner cases of udev_monitor_netlink_header decoding.
        * tests/netlink_kobject_uevent.c (test_nlmsg_type_kernel): Create
        a tail-allocated udev_monitor_netlink_header object and pass it
        to sys_send.
        (test_nlmsg_type_udev): Likewise.  Check decoding of
        udev_monitor_netlink_header object that ends in unmapped memory region.

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

        tests: check decoding of udev_monitor_netlink_header.
        * tests/netlink_kobject_uevent.c: Include <string.h>, <arpa/inet.h>,
        and "netlink_kobject_uevent.h".
        (test_nlmsg_type_udev, test_nlmsg_type_kernel): New functions.
        (main): Use them.

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

        netlink: decode libudev netlink header.
        * defs.h (decode_netlink_kobject_uevent): New prototype.
        * netlink.c (decode_netlink): Decode family kobject_uevent.
        * netlink_kobject_uevent.h: New file.
        * netlink_kobject_uevent.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

        tests: check basic decoding of PTP_* ioctl commands.
        * tests/ioctl_ptp.c: New file.
        * tests/gen_tests.in (ioctl_ptp): New entry.
        * tests/pure_executables.list: Add ioctl_ptp.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: decode BPF_PROG_QUERY command.
        BPF_PROG_QUERY was introduced in Linux commit v4.15-rc1~84^2~558^2~6.

        * xlat/bpf_commands.in (BPF_PROG_QUERY): New constant.
        * xlat/bpf_query_flags.in: New file.
        * bpf.c: Include it.
        (DECL_BPF_CMD_DECODER): Add priv argument for passing tcb private data.
        (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): New function.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Add BPF_PROG_QUERY entry.
        (SYS_FUNC(bpf)): Fetch buf on entering and exiting, pass buf on exiting,
        retrieve private data on exiting, pass it to decoder as well, explicitly
        rework rc handling logic for size argument printing.
        * bpf_attr.h (struct BPF_PROG_QUERY_struct): New structure declaration.
        (BPF_PROG_QUERY_struct_size, expected_BPF_PROG_QUERY_struct_size): New
        macro.
        * tests/bpf.c: Add checks for BPF_PROG_QUERY command.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make print_uint64 from btrfs.c globally available.
        And rename it to print_uint64_array_member to make the name sensible
        without additional context.

        * defs.h (print_uint64_array_member): New function prototype.
        * btrfs.c (print_uint64): Move...
        * util.c (print_uint64_array_member): ...here, drop "static" qualifier.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce umoven_or_printaddr64* functions.
        Counterparts for umoven_or_printaddr/umoven_or_printaddr_ignore_syserror
        that always print 64 bits of addr (as this is needed in bpf and btrfs
        decoders).

        * util.c (umoven_or_printaddr64): Rename from umoven_or_printaddr,
        change addr argument type to uint64_t, call printaddr64 instead of
        printaddr.
        (umoven_or_printaddr64_ignore_syserror): Rename from
        umoven_or_printaddr_ignore_syserror, change addr argument type to
        uint64_t, call printaddr64 instead of printaddr.
        * defs.h (umoven_or_printaddr64): Rename from umoven_or_printaddr,
        change addr argument type to uint64_t.
        (umoven_or_printaddr64_ignore_syserror): Rename from
        umoven_or_printaddr_ignore_syserror, change addr argument type to
        uint64_t.
        (umove_or_printaddr64): New macro, a wrapper for umoven_or_printaddr64.
        (umoven_or_printaddr): New function, a wrapper for
        umoven_or_printaddr64.
        (umoven_or_printaddr_ignore_syserror): New function, a wrapper for
        umoven_or_printaddr64_ignore_syserror.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf_filter.c: add support for decoding eBPF instruction codes.
        * bpf_filter.c (print_bpf_filter_code): Add extended argument, remove
        static qualifier.  Add support for decoding eBPF instruction code.
        * defs.h (print_bpf_filter_code): New declaration.
        * xlat/ebpf_class.in: New file.
        * xlat/ebpf_mode.in: Likewise.
        * xlat/ebpf_op_alu.in: Likewise.
        * xlat/ebpf_op_jmp.in: Likewise.
        * xlat/ebpf_size.in: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-08  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: prepare configure subsystem for alternative unwinders.
        Introduce --enable-stacktrace configure option to control whether
        -k option support is compiled in, --with-libunwind option remains
        available to control whether libunwind can be used as an unwinder.

        * m4/st_demangle.m4: New file.
        * m4/st_libunwind.m4: Likewise.
        * m4/st_stacktrace.m4: Likewise.
        * configure.ac: Replace all libunwind and libiberty checks
        with a single st_STACKTRACE invocation.
        * Makefile.am: Conditionalize checks for USE_LIBUNWIND and USE_DEMANGLE
        on ENABLE_STACKTRACE.
        [ENABLE_STACKTRACE] (strace_SOURCES): Append unwind.c and unwind.h.
        * strace.1.in: Replace libunwind with an unwinder-agnostic wording.
        * defs.h: Replace USE_LIBUNWIND with ENABLE_STACKTRACE.
        * strace.c: Likewise.
        (print_version): Print stack-trace instead of stack-unwind.
        * syscall.c: Replace USE_LIBUNWIND with ENABLE_STACKTRACE.
        * tests/Makefile.am: Likewise.  Replace LIBUNWIND_TESTS
        with STACKTRACE_TESTS.
        * tests/strace-V.test: Update expected output.

2018-04-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: implement decoding of prog_name and prog_ifindex fields.
        * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Add support for decoding
        of prog_name (introduced in Linux commit v4.15-rc1~84^2~605^2~4) and
        prog_ifindex (introduced as prog_target_ifindex in v4.15-rc1~84^2~127^2~13,
        renamed in v4.15-rc1~15^2~5^2~3^2~7).
        * bpf_attr.h [!BPF_OBJ_NAME_LEN] (BPF_OBJ_NAME_LEN): New macro constant.
        [BPF_OBJ_NAME_LEN]: Check that BPF_OBJ_NAME_LEN is equal to 16.
        (struct BPF_PROG_LOAD_struct): Add prog_name and prog_ifindex fields.
        (BPF_PROG_LOAD_struct_size, expected_BPF_PROG_LOAD_struct_size): Update.
        * tests/bpf.c (init_BPF_PROG_LOAD_attr): Rename
        to init_BPF_PROG_LOAD_attr3.
        (print_BPF_PROG_LOAD_attr): Rename to print_BPF_PROG_LOAD_attr3.
        (init_BPF_PROG_LOAD_attr4, print_BPF_PROG_LOAD_attr4): New functions.
        (BPF_PROG_LOAD_checks): Check new decoding features.

2018-04-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for array fields.
        * gen_bpf_attr_check.sh: Ignore field array size definition.
        * m4/gen_bpf_attr_m4.sh (filter_entries): Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify strace -k tests.
        Allow __getpid as an alternative name for getpid,
        allow __kernel_vsyscall after getpid.

        * tests/strace-k.expected: New file.
        * tests/strace-k-demangle.expected: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/strace-k-demangle.test (expected): Remove.
        * tests/strace-k.test: Likewise.  Use grep to check the output.

2018-04-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ipc_msg: sign extend msgtyp in m32 personality.
        msgtyp has to be treated as a signed type all the way from fetching
        to printing.

        * ipc_msg.c (fetch_msgrcv_args): Sign extend msgtyp when fetching.

2018-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: update Source URL.
        * strace.spec.in (Source): Change to https://strace.io/files/.

        debian: enable mpers support for ppc64el and s390x.
        * debian/control (Build-Depends) [ppc64el, s390x]: Add gcc-multilib.

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.22-1.
        * strace.spec.in: Likewise.

        Prepare for 4.22 release.
        * NEWS: Update for 4.22 release.

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2018-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

        unwind: split unwind code into front-end and back-end.
        This opens the way for alternative unwinder back-ends.

        * unwind.h: New file, defines the unwinder back-end interface.
        * unwind.c: Move all libunwind related code ...
        * unwind-libunwind.c: ... here.
        * Makefile.am [USE_LIBUNWIND] (strace_SOURCES): Add unwind.h
        and unwind-libunwind.c.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

        unwind: rename public functions in an object-oriented fashion.
        This change renames functions exported to strace core part from unwind
        subsystem.

        The new names imply that unwind subsystem exports two types of
        functions.  One is for manipulating back-end itself, "unwind_" prefix
        is used for this type.  Another is for manipulating back-end private data
        structure (unwind_ctx) attached to tcb, "unwind_tcb_" is used for this
        type.

        This naming should help people to understand unwind subsystem
        and the relation between unwind subsystem and back-ends.

        * defs.h (unwind_print_stacktrace): Rename to unwind_tcb_print.
        (unwind_capture_stacktrace): Rename to unwind_tcb_capture.
        * unwind.c: Ditto.
        * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use
        new names.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

        unwind: add unwind_ prefix to struct tcb.queue field and its type.
        The names given to struct tcb.queue field and its type are too common,
        this may cause conflicts in the future if new fields are added
        to struct tcb.

        * defs.h (struct tcb): Rename queue field to unwind_queue,
        rename its type queue_t to unwind_queue_t.
        * unwind.c (struct unwind_queue_t): Rename to unwind_queue_t.
        All users updated.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

        unwind: make the field type of struct tcb independent from libunwind.
        Narrowing the area where the code refers to names associated with
        libunwind is needed to utilize libdw of elfutils as an alternative
        unwinder.

        * defs.h (struct tcb): Rename libunwind_ui field to unwind_ctx, change
        its type to "void *".
        * unwind.c (unwind_tcb_init, unwind_tcb_fin, stracetrace_walk): Reflect
        * the above field renaming.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify options-syntax.test against ash.
        * tests/options-syntax.test: Do not assume that shell provides $UID,
        use "id -u" if it doesn't.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: add support for opening output file in append mode.
        * strace.c (open_append): New variable.
        (init): Handle -A option.
        (strace_fopen): Open file in "a" mode if open_append is set to true.
        * strace.1.in: Document this.
        * NEWS: Mention this.

        Suggested-by: Philipp Marek <philipp.marek@emerion.com>
        Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528488

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: support simultaneous usage of -r and -t options.
        * strace.c (init): Do not set tflag when rflag is set.
        (printleader): Handle rflag and tflag separately.
        * strace.1.in (.SH OPTIONS): Add a note about differences between
        the monotonic clock time  and the wall clock time.
        * tests/options-syntax.test: Remove the check for
        "-tt has no effect with -r" warning.
        * NEWS: Mention this.

        Suggested-by: Josh Triplett <josh@freedesktop.org>
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466195

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: dump write I/O even if error is returned.
        It makes sense to try to dump the argument of write syscalls as they can
        be readily available despite the fact that error has been returned.

        * syscall.c (dumpio): Move check for syserror and check for fd in
        read_set to the end of the function.
        * tests/read-write.c: Add a check for this behaviour.
        * tests/pread64-pwrite64.c: Update expected output.
        * NEWS: Mention this.

        Suggested-by: J. Bruce Fields <bfields@fieldses.org>
        Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=436284

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace: handle possible NULL from localtime() call.
        * strace.c (printleader): Print raw tv_sec value if localtime() returned
        NULL.
        * tests/localtime.c: New file.
        * tests/localtime.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add localtime.
        (MISC_TESTS): Add localtime.test.
        (localtime_LDADD): New variable.
        * tests/.gitignore: Add localtime.
        * ci/install-dependencies.sh (common_packages): Add faketime.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Closes: https://github.com/strace/strace/issues/42

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Return RVAL_STR unconditionally.
        There is no reason to check for auxstr being non-NULL
        because syscall_exiting_trace already does the check.

        * sched.c (SYS_FUNC(sched_getscheduler)): Do not check tcp->auxstr,
        return RVAL_STR unconditionally.
        * time.c (do_adjtimex): Likewise.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        dist/README: s/linux/Linux/
        * dist/README: Replace "linux" with "Linux".

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: fix formatting of -e trace class descriptions.
        Use .TP instead .PP as it is ought to be.

        * strace.1.in (.SS Filtering): Use .TP instead .PP as it is ought to be.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        nlattr: check NLA_TYPE_MASK at compile time.
        * nlattr.c: Include "static_assert.h"
        (print_nlattr): Check the expectations about NLA_TYPE_MASK.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add a comment about bpf_attr decoding.
        * bpf.c: Add comment.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of bpf_attr of size 1.
        * tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: use print_big_u64_addr.
        Since pointers stored in the bpf_attr union are 64-bit regardless
        of architecture bitness.

        * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Call print_big_u64_addr
        for attr.license.
        (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Call print_big_u64_addr
        for attr.pathname.
        * tests/bpf.c (BPF_OBJ_PIN_checks): Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: add support for file mode flags.
        These were introduced by Linux commit v4.15-rc1~84^2~384^2~4.

        * bpf_attr.h (struct BPF_OBJ_PIN_struct): Add file_flags field.
        (struct BPF_PROG_GET_NEXT_ID_struct, struct BPF_PROG_GET_FD_BY_ID_struct,
        struct BPF_MAP_GET_FD_BY_ID_struct): Add open_flags field.
        (BPF_OBJ_PIN_struct_size, expected_BPF_OBJ_PIN_struct_size,
        expected_BPF_PROG_GET_NEXT_ID_struct_size,
        expected_BPF_PROG_GET_FD_BY_ID_struct_size,
        expected_BPF_MAP_GET_FD_BY_ID_struct_size): Update.
        * bpf.c (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Check the length, skip
        printing the rest of attributes if it is less than offset of the
        end of the bpf_fd field, print file_flags field otherwise.
        (DEF_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID),
        DEF_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID),
        DEF_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Check the length, skip
        printing the rest of attributes if it is less than offset of the
        end of the next_id field, print open_flags field otherwise.
        * xlat/bpf_file_mode_flags.in: New file.
        * tests/bpf.c (BPF_OBJ_PIN_checks, BPF_PROG_GET_NEXT_ID_checks,
        BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks): Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: refactor bpf test.
        The aim of this change is to introduce an ability to perform multiple
        checks for a specific bpf command.  In order to achieve so, all the
        related data is stored in check descriptor, and test_bpf iterates over
        it.  There are also some provisions made in regard to future changes
        (specifically, the way bpf_attr_data union is defined).

        * tests/bpf.c (print_bpf_attr): New function, a wrapper around
        struct bpf_check.printer.
        (test_bpf_): Rename to...
        (test_bpf): ...this.  Replace arguments with struct bpf_check pointer.
        Iterate over possible attribute variants. Account for changes in
        attribute initialisation routine: provide a pointer to locally defined
        union bpf_attr_data and perform memcpy afterwards. Initialise memory
        from data each time before a bpf call.
        (TEST_BPF, DEF_*, init_*, print_*): Remove.
        (init_BPF_PROG_LOAD_attr, print_BPF_PROG_LOAD_attr,
        init_BPF_OBJ_PIN_attr): New functions.
        (license, pathname): New variables.
        (BPF_MAP_CREATE_checks, BPF_MAP_LOOKUP_ELEM_checks,
        BPF_MAP_UPDATE_ELEM_checks, BPF_MAP_DELETE_ELEM_checks,
        BPF_MAP_GET_NEXT_KEY_checks, BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
        BPF_PROG_ATTACH_checks, BPF_PROG_DETACH_checks,
        BPF_PROG_TEST_RUN_checks, BPF_PROG_GET_NEXT_ID_checks,
        BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks,
        BPF_OBJ_GET_INFO_BY_FD_checks): New arrays.
        (BPF_OBJ_GET_checks, BPF_MAP_GET_NEXT_ID_checks): New macros.
        (CHK): New macro, a shorthand for initialising array of struct bpf_check.
        (main): New static constant checks, iterate over checks and run test_bpf
        with each element.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: introduce PRINT_FIELD_ADDR and PRINT_FIELD_ADDR64 macros
        * print_fields.h (PRINT_FIELD_ADDR, PRINT_FIELD_ADDR64): New macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: introduce PRINT_FIELD_CSTRING_SZ macro.
        A variant of PRINT_FIELD_CSTRING with an ability to pass string size
        explicitly.

        * print_fields.h (PRINT_FIELD_CSTRING_SZ): New macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: check whether passed field is an array in PRINT_FIELD_CSTRING
        * print_fields.h (PRINT_FIELD_CSTRING): Add MUST_BE_ARRAY to the size
        value in order to check whether (where_).field_ is an array in compile
        time.

        print_fields.h: whitespace fix in PRINT_FIELD_HEX_ARRAY.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        bpf_attr: add more size checks.
        * bpf_attr.h: Add expected sizes of structures.
        * gen_bpf_attr_check.sh: Check them.

        tests: check bpf syscall decoder unconditionally.
        * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Check for
        struct bpf_insn.
        * tests/bpf.c: Remove the test guard, include "scno.h", "bpf_attr.h",
        "xlat.h", and "xlat/bpf_commands.h".  Conditionalize inclusion of
        <linux/bpf.h> on HAVE_LINUX_BPF_H.  Remove all HAVE_UNION_* checks.
        (BPF_ATTR_DATA_FIELD): New macro.
        (bpf_attr_data): New union.  Note that it is larger than modern
        union bpf_attr, this allows more checks to be implemented in the future.
        (sizeof_attr, test_bpf_): Replace union bpf_attr with
        union bpf_attr_data.
        (DEF_BPF_INIT_FIRST): Replace union bpf_attr with the corresponding
        structure.
        (init_BPF_MAP_CREATE_attr): Replace union bpf_attr with
        struct BPF_MAP_CREATE_struct.
        (init_BPF_MAP_LOOKUP_ELEM_attr): Replace union bpf_attr with
        struct BPF_MAP_LOOKUP_ELEM_struct.
        (init_BPF_MAP_UPDATE_ELEM_attr): Replace union bpf_attr with
        struct BPF_MAP_UPDATE_ELEM_struct.
        (init_BPF_MAP_DELETE_ELEM_attr): Replace union bpf_attr with
        struct BPF_MAP_DELETE_ELEM_struct.
        (init_BPF_MAP_GET_NEXT_KEY_attr): Replace union bpf_attr with
        struct BPF_MAP_GET_NEXT_KEY_struct.
        (init_BPF_PROG_LOAD_attr): Replace union bpf_attr with
        struct BPF_PROG_LOAD_struct.
        (init_BPF_OBJ_PIN_attr): Replace union bpf_attr with
        struct BPF_OBJ_PIN_struct.
        (init_BPF_PROG_ATTACH_attr): Replace union bpf_attr with
        struct BPF_PROG_ATTACH_struct.
        (init_BPF_PROG_DETACH_attr): Replace union bpf_attr with
        struct BPF_PROG_DETACH_struct.
        (init_BPF_PROG_GET_NEXT_ID_attr): Replace union bpf_attr with
        struct BPF_PROG_GET_NEXT_ID_struct.
        (sample_BPF_PROG_TEST_RUN_attr): Change type from union bpf_attr to
        struct BPF_PROG_TEST_RUN_struct, all users updated.
        (sample_BPF_OBJ_GET_INFO_BY_FD_attr): Change type from union bpf_attr
        to struct BPF_OBJ_GET_INFO_BY_FD_struct, all users updated.

        Check that structures defined by bpf_attr.h match system union bpf_attr.
        * gen_bpf_attr_check.sh: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        (strace_SOURCES_check): New variable.
        (strace_SOURCES): Add $(strace_SOURCES_check).
        (BUILT_SOURCES, CLEANFILES): Add bpf_attr_check.c.
        (bpf_attr_check.c): New rule.
        (sys_func_h_sources): New variable.
        (sys_func.h): Use it instead of strace_SOURCES_c.
        * .gitignore: Add /bpf_attr_check.c.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        build: generate all union bpf_attr checks automatically.
        Rather than list by hand some members of union bpf_attr that we check
        for availability, automatically list all members of union bpf_attr we
        are aware of.

        * m4/gen_bpf_attr_m4.sh: New file.
        * bootstrap: Invoke it.
        * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Use st_BPF_ATTR.
        * m4/.gitignore: New file.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: move definitions of bpf_attr structures to separate header file.
        This also unifies decoders of bpf commands by moving common code
        to new macros.

        * bpf_attr.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * bpf.c: Include it.
        (DEF_BPF_CMD_DECODER): Rename to BEGIN_BPF_CMD_DECODER, add code common
        to all decoders.  All users updated.
        (END_BPF_CMD_DECODER): New macro, add its invocation to all users
        of BEGIN_BPF_CMD_DECODER macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce print_big_u64_addr.
        This is needed at least for bpf, btrfs, and sg_io, as 32-bit tracer
        cannot figure out whether the kernel is 32-bit or 64-bit,
        and its behaviour differs when it handles u64 as a pointer.

        * linux/arch_defs_.h [!CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL]
        (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): New definition, default to 0.
        * linux/arm/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Define to 1.
        * linux/i386/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/mips/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/powerpc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/riscv/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/s390/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/sparc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * linux/tile/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
        Likewise.
        * defs.h (print_big_u64_addr): New function.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: introduce max_addr and max_kaddr macros.
        In order to check an address against maximum addr/kaddr value
        for the current personality.

        * degs.h (max_addr, max_kaddr): New macros.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce static_assert.
        We are going to use static_assert provided by <assert.h> or,
        if it doesn't work, our cheap imitation that doesn't display
        the message specified as the second argument of static_assert.

        * configure.ac (AC_CACHE_CHECK): Check for static_assert in <assert.h>,
        define HAVE_STATIC_ASSERT if it is available.
        * static_assert.h: New file.
        * Makefile.am (strace_SOURCES): Add it.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: forward SIZEOF_KERNEL_LONG_T and SIZEOF_LONG to C preprocessor.
        * tests/Makefile.am (AM_CPPFLAGS): Forward SIZEOF_KERNEL_LONG_T
        and SIZEOF_LONG as TESTS_SIZEOF_KERNEL_LONG_T and TESTS_SIZEOF_LONG.
        * tests/tests.h [TESTS_SIZEOF_KERNEL_LONG_T] (SIZEOF_KERNEL_LONG_T):
        Redefine to TESTS_SIZEOF_KERNEL_LONG_T.
        [TESTS_SIZEOF_LONG] (SIZEOF_LONG): Redefine to TESTS_SIZEOF_LONG.

        Complements: v4.21~5 ("Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests")

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests/tests.h: fix indentation.

        tests: fix potential errno clobbering in netlink_kobject_uevent.test.
        * tests/netlink_kobject_uevent.c (errstr): New variable.
        (sys_send): New function.
        (main): Use them.

2018-04-03  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Restore kvm ioctl definitions for aarch64 and mips architectures.
        * maint/ioctls_sym.sh: Add aarch64 and mips architectures to the list
        of kvm-capable architectures.
        * linux/aarch64/ioctls_arch0.h: Regenerate.
        * linux/mips/ioctls_arch0.h: Regenerate.

        Fixes: v4.15~92 ("Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h")

2018-04-03  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.16.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.16
        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/arm/ioctls_arch0.h: Likewise.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux 4.16.
        * maint/ioctls_sym.sh: Add workaround for linux/ndctl.h file.
        Update workaround for media/v4l2-common.h file.
        (x86_list): Add KVM_GET_MSR_FEATURE_INDEX_LIST.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: amend sprinttime_ex description a bit.
        * util.c (sprinttime_ex): Document return value.

        tests/bpf.c: add a check for NULL bpf_attr pointer.
        * tests/bpf.c (main): Add a check with 0 passed in the third argument.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print byte range for extra data.
        As it could be not entirely clear what bytes are printed.

        * bpf.c (decode_attr_extra_data): Print a comment about the byte range
        to be printed.
        * tests/bpf.c: Update expected output.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove addflags.
        It has only single user and implementation of xlat styles for it would
        lead to lots of code duplication.

        * defs.h (addflags): Remove declaration.
        * mem.c (print_mmap_flags): Convert addflags call into printflags64 with
        non-zeroeness flags check.
        * xlat.c (addflags): Remove.

2018-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        Add i18n support.
        Let's make a step towards the growing strace userbase all around
        the world and translate something to the language of their choice.

        This change enables translation of error messages corresponding
        to errno codes, making it consistent with error diagnostics of other
        i18n-aware tools, e.g.

        $ LANG=es_ES strace -qq -a38 -P /missing unlink /missing
        unlink("/missing")                    = -1 ENOENT (No existe el fichero o el directorio)
        unlink: no se puede deshacer el enlace '/missing': No existe el fichero o el directorio

        * strace.c: Include <locale.h>.
        (main): Invoke setlocale.
        * tests/init.sh: Export LC_ALL=C.
        * NEWS: Mention this enhancement.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        Remove RVAL_PRINT_ERR_VAL.
        * defs.h (RVAL_PRINT_ERR_VAL): Remove.
        * ldt.c (SYS_FUNC(modify_ldt)): Return 0.
        * syscall.c (syscall_exiting_trace): When printing an error,
        always print struct tcb.u_rval as if RVAL_PRINT_ERR_VAL was set.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        Treat RVAL_DECIMAL the same way as RVAL_UDECIMAL.
        Assuming that syscalls may return negative values only as error codes,
        always print non-error syscall return codes as unsigned.

        * defs.h (RVAL_UDECIMAL): Remove.
        (RVAL_DECIMAL): Rename to RVAL_UDECIMAL.
        * syscall.c (syscall_exiting_trace) <case RVAL_DECIMAL>: Remove.
        * clone.c (SYS_FUNC(fork)): Remove RVAL_UDECIMAL.
        * lseek.c (SYS_FUNC(lseek)): Likewise.
        * prctl.c (SYS_FUNC(prctl)): Likewise.
        * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Likewise.
        * times.c (SYS_FUNC(times)): Always return 0.
        * tests/inject-nf.c (main): Update expected output.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check handling of some invalid delay injection parameters.
        * tests/qual_inject-syntax.test: Check for negative delay injection
        parameters.  Check for overriding delay injection parameters.

2018-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement injection of negative return values.
        Extend the range of injected return value to the maximum, print warnings
        if negative injection value can be clipped in compat personality or can
        inadvertently turn into a fault injection.

        * defs.h (INJECT_F_ERROR): New macro.
        * filter_qualify.c (parse_inject_token): Revert type of intval local
        variable back to int, check INJECT_F_ERROR along with INJECT_F_RETVAL,
        use strtoull to parse retval argument, print warnings in case of retval
        clipping and inadvertent fault injection.
        (qualify_inject_common): Set INJECT_F_ERROR instead of INJECT_F_RETVAL.
        * syscall.c (tamper_with_syscall_exiting): Check inject_data.flags
        to determine whether a fault injection or retval injection has to be
        performed.
        (syscall_exiting_trace) <case RVAL_DECIMAL>: Explicitly print
        tcp->u_rval as int if current_klongsize < sizeof(tcp->u_rval).
        * tests/inject-nf.c (main): Update.
        * tests/inject-nf.test: Test injection of negative return values.
        * tests/qual_inject-syntax.test: Remove retval=-1 check as it is now
        allowed, add checks for invalid retval parameters.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-28  Dmitry V. Levin  <ldv@altlinux.org>

        arch_defs.h: fix typo in comment.

        Move delay interface from defs.h to delay.h.
        * defs.h (alloc_delay_data, fill_delay_data, is_delay_timer_armed,
        delay_timer_expired, arm_delay_timer, delay_tcb): Move...
        * delay.h: ... to new file.
        * Makefile.am (strace_SOURCES): Add it.
        * filter_qualify.c: Include it.
        * strace.c: Likewise.
        * syscall.c: Likewise.

2018-03-28  Dmitry V. Levin  <ldv@altlinux.org>

        Turn struct inject_data.rval into an index.
        Add one level of indirection to decrease the size of struct inject_data
        as hundreds of these structures are created for each process when
        injection mechanism is activated.

        * retval.h: New file.
        * retval.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * defs.h (struct inject_data): Replace rval field with rval_idx.
        * filter_qualify.c: Include "retval.h".
        (parse_inject_token, qualify_inject_common): Initialize
        struct inject_data.rval_idx using retval_new.
        * syscall.c: Include "retval.h".
        (tamper_with_syscall_exiting): Obtain the value that has to be injected
        using retval_get.

2018-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: update comment.
        * defs.h (struct inject_data): Update comment about flags.

        Complements: v4.21-108-gba8e768 ("Implement delay injection")

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: cleanup mmap_flags.in.
        * xlat/mmap_flags.in (_MAP_NEW): Remove SunOS-specific comment, add
        a comment that this is a SPARC-specific constant (from
        arch/sparc/include/uapi/asm/mman.h).
        (MAP_GROWSUP): IA-64-specific constant (from
        arch/ia64/include/uapi/asm/mman.h).
        (MAP_INHERIT): Add a comment that this is a SPARC-specific constant
        (from arch/sparc/include/uapi/asm/mman.h).
        (_MAP_INHERIT): Add a comment that this is an Alpha-specific constant
        (from arch/alpha/include/uapi/asm/mman.h).
        (MAP_ANON): Remove, FreeBSD-specific constant.
        (MAP_HASSEMAPHORE): Rename to...
        (_MAP_HASSEMAPHORE): ...this, add a comment that this is an
        Alpha-specific constant (from arch/alpha/include/uapi/asm/mman.h).
        (MAP_NOSYNC, MAP_NOCORE): Remove.
        (MAP_AUTOGROW, MAP_AUTORSRV, MAP_LOCAL): Add a comment that this is
        an architecture-specific constant (from
        arch/mips/include/uapi/asm/mman.h, arch/xtensa/include/uapi/asm/mman.h).
        (_MAP_UNALIGNED): Add a comment that this is an Alpha-specific constant
        (from arch/alpha/include/uapi/asm/mman.h).

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of kern_features syscall.
        * tests/kern_features.c: New file.
        * tests/kern_features-fault.test: New test.
        * tests/gen_tests.in (kern_features): New entry.
        * tests/Makefile.am (DECODER_TESTS): Add kern_features-fault.test.
        * tests/pure_executables.list: Add kern_features.
        * tests/.gitignore: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sparc, sparc64: implement kern_features decoder.
        * sparc.c: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/sparc/syscallent.h ([340]): Remove NF flag, set kern_features
        decoder.
        * linux/sparc64/syscallent.h ([340]): Likewise.
        * xlat/sparc_kern_features.in: New file.
        * NEWS: Mention this enhancement.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        evdev: move mpers-specific parsers to a separate file.
        This change reduces binary code duplication on mpers platforms
        and prepares evdev parsers to use printxval_bsearch.

        * defs.h (evdev_ioctl, print_evdev_ff_type): New prototypes.
        * evdev.c (evdev_ioctl): Un-mpersify.
        (evdev_write_ioctl) Remove EVIOCSFF case, forward default case
        to evdev_write_ioctl_mpers.
        (decode_envelope, ff_effect_ioctl): Move to...
        * evdev_mpers.c: ... new file.
        * Makefile.am (strace_SOURCES): Add evdev_mpers.c.

2018-03-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ci: install libunwind8-dev.
        While in debian/control we use libunwind-dev in Build-Depends, in case
        of ci we have to be more conservative and use the name portable across
        different ci implementations.

        * ci/install-dependencies.sh (common_packages): Add libunwind8-dev.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check injection of return values into a "never fails" syscall.
        * tests/inject-nf.c: New file.
        * tests/inject-nf.test: New test.
        * tests/.gitignore: Add inject-nf.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add inject-nf.test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce raw syscall invocation wrappers.
        Unfortunately, syscall(3) provided by libc is too smart
        for some of our needs.

        * linux/raw_syscall.h: New file.
        * linux/aarch64/raw_syscall.h: Likewise.
        * linux/alpha/raw_syscall.h: Likewise.
        * linux/arc/raw_syscall.h: Likewise.
        * linux/arm/raw_syscall.h: Likewise.
        * linux/avr32/raw_syscall.h: Likewise.
        * linux/bfin/raw_syscall.h: Likewise.
        * linux/hppa/raw_syscall.h: Likewise.
        * linux/i386/raw_syscall.h: Likewise.
        * linux/ia64/raw_syscall.h: Likewise.
        * linux/m68k/raw_syscall.h: Likewise.
        * linux/metag/raw_syscall.h: Likewise.
        * linux/microblaze/raw_syscall.h: Likewise.
        * linux/mips/raw_syscall.h: Likewise.
        * linux/nios2/raw_syscall.h: Likewise.
        * linux/or1k/raw_syscall.h: Likewise.
        * linux/powerpc/raw_syscall.h: Likewise.
        * linux/powerpc64/raw_syscall.h: Likewise.
        * linux/riscv/raw_syscall.h: Likewise.
        * linux/s390/raw_syscall.h: Likewise.
        * linux/s390x/raw_syscall.h: Likewise.
        * linux/sh/raw_syscall.h: Likewise.
        * linux/sh64/raw_syscall.h: Likewise.
        * linux/sparc/raw_syscall.h: Likewise.
        * linux/sparc64/raw_syscall.h: Likewise.
        * linux/tile/raw_syscall.h: Likewise.
        * linux/x32/raw_syscall.h: Likewise.
        * linux/x86_64/raw_syscall.h: Likewise.
        * linux/xtensa/raw_syscall.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix potentially unbound variable in kernel_version_code.
        Fix the following use case:

                $ sh -uc '. tests/init.sh; kernel_version_code 4.5'
                tests/init.sh: line 242: 3: unbound variable

        * tests/init.sh (kernel_version_code): Fix potentially unbound variable.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        strace: further optimize unblocking of the delay signal handler.
        Do not unblock the delay signal handler unless the delay timer is armed.

        * defs.h (is_delay_timer_created): Remove.
        (is_delay_timer_armed, delay_timer_expired): New prototypes.
        * delay.c (delay_timer_is_armed): New static variable.
        (is_delay_timer_created): Add static qualifier.
        (is_delay_timer_armed, delay_timer_expired): New functions.
        (arm_delay_timer): Set delay_timer_is_armed.
        * strace.c (next_event): Use is_delay_timer_armed instead of
        is_delay_timer_created to check whether the delay signal handler
        has to be unblocked.
        (timer_sighandler): Invoke delay_timer_expired.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        strace: rewrite restart error handling without sigsetjmp/siglongjmp.
        Further simplify and optimize error handling of the delay signal handler
        by replacing sigsetjmp/siglongjmp mechanism with an error flag.

        * strace.c: Do not include <setjmp.h>.
        (restart_failed): New volatile variable.
        (timer_jmp_buf): Remove.
        (next_event): Cache is_delay_timer_created() return value,
        remove sigsetjmp invocation, check restart_failed instead.
        (timer_sighandler): Replace siglongjmp with setting restart_failed.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        strace: do not call sigsetjmp without a delay timer.
        As sigsetjmp costs a syscall, do not call it unless a delay timer
        is already created and its signal handler is going to be unblocked.

        * strace.c (next_event): Move sigsetjmp invocation under
        is_delay_timer_created() condition.

        Optimizes: v4.21-108-gba8e768 ("Implement delay injection")

2018-03-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/bpf.c: convert TEST_BPF_ macro to a function.
        As it looks like there's no compelling reason to keep it as a macro and
        leaving it so quite complicates modification of the routine and makes
        them error-prone.

        * tests/bpf.c (TEST_BPF_): Convert it to...
        (test_bpf): ...this.  Rename cmd_ to cmd, cmd_str_ to cmd_str,
        init_first_ to init_first, print_first_ to print_first, init_attr_
        to init_attr, print_attr_ to print_attr.
        (TEST_BPF): Call test_bpf_ instead of TEST_BPF_.

2018-03-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: btrfs.c whitespace cleanup.
        * tests/btrfs.c: Add spaces after PRI* format specifiers.

2018-03-22  Elvira Khabirova  <lineprinter@altlinux.org>

        tests: check delay injection.
        * tests/delay.c: New file.
        * tests/delay.test: New test.
        * tests/.gitignore: Add delay.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (delay_LDADD): New variable.
        (MISC_TESTS): Add delay.test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-22  Elvira Khabirova  <lineprinter@altlinux.org>

        Implement delay injection.
        Add -e inject=SET:delay_enter= and -e inject=SET:delay_exit= options.

        * configure.ac (AC_SEARCH_LIBS): Check for timer_create -lrt.
        * delay.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        (strace_LDADD): Add $(timer_LIBS).
        * defs.h (INJECT_F_DELAY_ENTER, INJECT_F_DELAY_EXIT,
        TCB_INJECT_DELAY_EXIT, TCB_DELAYED, inject_delay_exit, syscall_delayed):
        New macros.
        (alloc_delay_data, fill_delay_data, is_delay_timer_created,
        arm_delay_timer, delay_tcb): New prototypes.
        (struct inject_data): Replace reserved field with delay_idx.
        (struct tcb): Add delay_expiration_time field.
        * filter_qualify.c (parse_delay_token): New function.
        (parse_inject_token): Use it.
        (qualify_inject_common): Initialize struct inject_opts.data.delay_idx.
        * strace.c: Include <setjmp.h>
        (timer_jmp_buf, timer_set): New static variables.
        (timer_sighandler, restart_delayed_tcb, restart_delayed_tcbs): New
        functions.
        (init): Block SIGALRM, set SIGALRM handler.
        (dispatch_event): Do not restart delayed syscalls.
        (next_event): Unblock SIGALRM during wait4 invocation.
        * syscall.c (tamper_with_syscall_entering): Arm delay timer if
        INJECT_F_DELAY_ENTER injection flag is set, set TCB_INJECT_DELAY_EXIT
        flag if INJECT_F_DELAY_EXIT injection flag is set.
        tamper_with_syscall_exiting): Arm delay timer if inject_delay_exit.
        (syscall_exiting_trace): Call tamper_with_syscall_exiting in case of
        inject_delay_exit.
        (syscall_exiting_finish): Clear TCB_INJECT_DELAY_EXIT flag.
        * strace.1.in: Document delay injection.
        * NEWS: Mention this improvement.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-22  Dmitry V. Levin  <ldv@altlinux.org>

        Do not block handled signals in interactive mode.
        Let these signals be handled asynchronously as they are acted on
        only when waiting for process state changes.

        * strace.c (start_set, blocked_set): Remove.
        (set_sighandler): Do not update blocked_set.
        (startup_attach, init, next_event): Remove all sigprocmask calls.

2018-03-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: improve handling of various sizes of bpf_prog_attr structure.
        As program attributes have been added gradually over kernel versions,
        attribute size less than expected should be printed accordingly.

        * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Do not print structure
        fields if their size is less than the initially introduced (in Linux
        commit v3.18-rc1~52^2~1^2~7) version.  Print fields of union bpf_attr
        introduced in various kernel versions when the length is big enough
        (new fields were introduced in Linux commits v3.18-rc1~52^2~1^2~4,
        v4.1-rc1~84^2~50, and v4.12-rc2~34^2~29^2~2).
        * tests/bpf.c (print_BPF_PROG_LOAD_first): Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: print struct btrfs_ioctl_logical_ino_args.reserved if non-zero.
        * btrfs.c (btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print
        struct btrfs_ioctl_logical_ino_args.reserved field if it is not zero.
        * tests/btrfs.c (btrfs_test_ino_path_ioctls): Check it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move is_filled and IS_ZERO to macros.h, rename IS_ZERO to IS_ARRAY_ZERO.
        * s390.c: Replace all IS_ZERO invocations with IS_ARRAY_ZERO.
        (is_filled, IS_ZERO): Move...
        * macros.h: ...here.
        (is_filled): Add inline qualifier, add const qualifier to ptr.
        (IS_ZERO): Rename to IS_ARRAY_ZERO, cast arr_ to "const char *".

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: enhance workaround for missing gnu/stubs-*.h files.
        Make generated empty gnu stub files available for mpers_test.sh check.

        * m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS for mpers_test.sh
        invocation.

        Complements: v4.11~223 ("mpers.m4: workaround missing gnu/stubs-*.h files")

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        README.md: add references to binary strace packages.
        * README.md: Add references to binary strace packages in OBS,
        Fedora rawhide, and Sisyphus.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        INSTALL-git.md: enhance phrasing.
        * INSTALL-git.md: Enhance phrasing.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        bootstrap: distribute README.
        * bootstrap: Install README before invoking autoreconf to get README
        included into distributed tarball.

        Fixes: v4.21-93-g4bb8454 ("Move README to dist subdirectory")

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        Replace struct timeval with struct timespec in time measurements.
        This is required to implement more precise time measurements.

        * Makefile.am (strace_LDADD): Add $(clock_LIBS).
        * defs.h (struct tcb): Change the type of stime, dtime, and etime fields
        from struct timeval to struct timespec, all users updated.
        (syscall_exiting_decode, syscall_exiting_trace, count_syscall): Change
        the type of "struct timeval *" argument to "struct timespec *", all
        users updated.
        (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): Rename to
        ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.  Change
        the type of all "struct timeval *" arguments to "struct timespec *",
        all users updated.
        * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul):
        Rename to ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.
        Change the type of all "struct timeval *" arguments to "struct timespec *".
        * count.c (struct call_counts): Change the type of "time" field
        from struct timeval to struct timespec, all users updated.
        (overhead): Change type from struct timeval to struct timespec, all
        users updated.
        (count_syscall): Change the type of "struct timeval *" argument to
        "struct timespec *".
        * strace.c (printleader): Change the type of struct timeval variables
        to struct timespec, call clock_gettime instead of gettimeofday.
        (next_event, trace_syscall): Change the type of struct timeval variables
        to struct timespec.
        * syscall.c (syscall_entering_finish, syscall_exiting_decode): Call
        clock_gettime instead of gettimeofday.

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix -O option handling.
        Fast syscalls usually take less than a microsecond of system cpu time
        nowadays, making -O option almost useless.

        * count.c (call_summary_pers): Avoid negative time counts.
        * tests/count.test: Check it.
        * NEWS: Mention it.

2018-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        count: cleanup count_syscall.
        * count.c (shortest): Remove.
        (overhead): Initialize to zero.
        (call_summary_pers): Remove shortest handling.
        (count_syscall): Remove dead code.  The remaining code does the same
        wrong calculations as before the change, though.

        printleader: cleanup tflag handling.
        * strace.c (printleader): Move declarations of variables closer
        to their first use.

2018-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        Move install.texi to maint subdirectory.
        This file comes from GNU Autoconf and is used to generate INSTALL file.

        * install.texi: Move...
        * maint/install.texi: ...here.

2018-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        doc: update commit requirements.
        * README-hacking (Requirements): Enhance phrasing.
        (Commit log requirements): Rename to "Commit requirements",
        describe "absence of whitespace errors" requirement, add references
        to the Linux kernel coding style and scripts/checkpatch.pl script.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move README to dist subdirectory.
        README was originally written for users of distribution tarballs.
        Nowadays it appears to be confusing for those who build strace
        using a GIT version of strace source code.

        * README: Move...
        * dist/README: ...here.
        * bootstrap: Copy README from dist subdirectory to the toplevel
        directory after successful autoreconf.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        References: https://github.com/strace/strace/issues/56

2018-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        README: synchronise with README.md.
        * README: Extend description, reference COPYING.

2018-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        poll.c: remove special INFTIM handling.
        On Linux, poll syscall interprets any negative timeout value as an
        infinite timeout, so no need to handle BSD-specific INFTIM.

        * poll.c (SYS_FUNC(poll)): Remove INFTIM handling.

2018-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        build: do not hardcode -lrt.
        Depending on libc implementation, various -lrt functions can be
        implemented either in -lc or in -lrt.  For example, starting with
        glibc-2.17 the clock_* suite of functions is available directly in -lc.

        Check whether clock_* and mq_* suites of functions are provided
        by -lrt or by the main C library, do not link with -lrt unnecessarily.

        This change affects only tests yet, but this is going to be
        more important as soon as strace starts using clock_gettime.

        * configure.ac (AC_SEARCH_LIBS): Check for clock_gettime and mq_open
        in -lrt.
        (AC_SUBST): Add clock_LIBS and mq_LIBS.
        * tests/Makefile.am (mq_LDADD): Replace -lrt with $(mq_LIBS).
        (threads_execve_LDADD, times_LDADD): Replace -lrt with $(clock_LIBS).

2018-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not link with -lrt unnecessarily.
        * tests/Makefile.am (attach_f_p_LDADD): Remove -lrt.
        (clock_xettime_LDADD, mq_sendrecv_LDADD, mq_sendrecv_read_LDADD,
        mq_sendrecv_write_LDADD): Remove.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Optimize pid2tcb.
        Introduce an internal cache of pid2tcb translations.
        This can save more than 80% of CPU user time spent by strace.

        Tested using the following setup:

                #include <unistd.h>
                #include <sys/stat.h>
                #include <sys/wait.h>
                int main()
                {
                        int i;
                        sleep(1);
                        for (i = 1; i < 1000; ++i) {
                                pid_t pid = fork();
                                if (pid < 0)
                                        return 2;
                                if (pid)
                                        return wait(&i) != pid || i;
                        }
                        sleep(1);
                        for (i = 0; i < 10000000; ++i)
                                umask(0777);
                        return 0;
                }

                old$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \
                  while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \
                  time -f '%Uuser %Ssystem %eelapsed %PCPU' \
                  ../strace -qq -enone -esignal=none -f -p $!
                5.51user 104.90system 122.45elapsed 90%CPU

                new$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \
                  while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \
                  time -f '%Uuser %Ssystem %eelapsed %PCPU' \
                  ../strace -qq -enone -esignal=none -f -p $!
                1.29user 102.78system 114.97elapsed 90%CPU

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Enable USE_SEIZE code unconditionally.
        It is by no means an experimental code.

        * defs.h (USE_SEIZE): Remove.
        * strace.c [!USE_SEIZE]: Remove.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        ci: clone musl from the local server.
        Assume that strace project on the local server contains an appropriate
        musl repository, use this repository instead of hardcoded github
        location.

        * ci/install-dependencies.sh (clone_repo): Use local server by default.
        (musl-gcc): Un-hardcode the location of musl repository.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        ci: refactor cloning of additional repositories.
        * ci/install-dependencies.sh (clone_repo): New function.
        Use it instead of direct invocations of git clone.

        ci: extend error diagnostics when configure invocation fails.
        * ci/run-build-and-tests.sh: Include $CC -dumpspecs output in addition
        to config.log when ./configure fails.

        ci: rename travis-build.sh and travis-install.sh scripts.
        * travis-build.sh: Rename to ci/run-build-and-tests.sh, all callers
        updated.
        * travis-install.sh: Rename to ci/install-dependencies.sh, all callers
        updated.

        tests: extend ioctl.test libc protection to -y output.
        * tests/ioctl.test: Extend the filter of ioctl calls with standard
        descriptor arguments to -y output.

2018-03-12  Harsha Sharma  <harshasharmaiitr@gmail.com>

        ptp.c: print field names and use macros form print_fields.h.
        * ptp.c: Include "print_fields.h".
        (ptp_ioctl): Print field names with field values for PTP_PEROUT_REQUEST,
        use macros from print_fields.h.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

        tests: add check for decoding of netfilter subsystem.
        * tests/netlink_netfilter.c(test_nfgenmsg): Add check for decoding
        of netfilter subsystem.

        nfnetlink: introduce generic netfilter subsystem decoder.
        * netlink_netfilter.c: Include "nlattr.h".
        (decode_netlink_netfilter): Call decode_nlattr.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

        Move nl_netfilter_msg_types definition from netlink.c to netlink_netfilter.c
        The side effect of #include "xlat/nl_netfilter_msg_types.h" is
        NFNL_MSG_BATCH_* constants properly defined in that header file.
        While netlink.c does not use these constants itself,
        netlink_netfilter.c is going to need them soon.

        * defs.h (nl_netfilter_msg_types): New xlat prototype.
        * netlink.c: Move inclusion of "xlat/nl_netfilter_msg_types.h" ...
        * netlink_netfilter.c: ... here.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

        tests: add check for NETLINK_NETFILTER parser.
        * tests/netlink_netfilter.c: Include <netinet/in.h>, <arpa/inet.h>
        and <linux/netfilter/nf_tables.h>.
        Replace "netlink.h" with "test_netlink.h".
        (NFNL_SUBSYS_NFTABLES, NFT_MSG_NEWTABLE): New macros.
        (test_nlmsg_done, test_nfgenmsg): New functions.
        (main): Use them.

        netlink: introduce NETLINK_NETFILTER parser.
        * netlink_netfilter.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (decode_netlink_netfilter): New prototype.
        * netlink.c (netlink_decoders): Add NETLINK_NETFILTER.
        * xlat/netfilter_versions.in: New file.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

        xlat: remove NFNL_SUBSYS_COUNT constant.
        NFNL_SUBSYS_COUNT is not a symbol with some constant value, it changes
        with time, just print it as an unrecognized number.

        * xlat/nl_netfilter_subsys_ids.in (NFNL_SUBSYS_COUNT): Remove.

2018-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        inject_data: make room for more injection features.
        * defs.h (struct inject_data): Squeeze flags and signo fields from
        uint16_t to uint8_t to make room for more injection features.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: sort v4l2_pix_fmts.in and v4l2_sdr_fmts.in.
        * xlat/v4l2_pix_fmts.in: Sort by value, add a comment about sorting.
        * xlat/v4l2_sdr_fmts.in: Likewise.

2018-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add comments to all sorted xlat files.
        Add a short comment describing the method used to sort entries.

        * xlat/ethernet_protocols.in: Update the comment about sorting.
        * xlat/fsmagic.in: Likewise.
        * xlat/evdev_keycode.in: Add a comment about sorting.
        * xlat/hw_breakpoint_type.in: Likewise.
        * xlat/perf_hw_cache_id.in: Likewise.
        * xlat/perf_hw_cache_op_id.in: Likewise.
        * xlat/perf_hw_cache_op_result_id.in: Likewise.
        * xlat/perf_hw_id.in: Likewise.
        * xlat/perf_sw_ids.in: Likewise.
        * xlat/perf_type_id.in: Likewise.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: remove page size caching.
        get_pagesize() has a static cache anyway, no need to duplicate it.

        * bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its
        initialisation, use get_pagesize() as the size of buf directly.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf_filter: fix indentation of the switch clause.
        * bpf_filter.c (print_bpf_filter_code): Fix switch clause indentation.

2018-03-08  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for arch-independent mmap flags.
        This is important for recently introduced MAP_SHARED_VALIDATE flag.

        * xlat/mmap_flags.in (MAP_SHARED, MAP_PRIVATE, MAP_SHARED_VALIDATE):
        Add constant values.

        Fixes: v4.21-67-g8c209d1 ("tests: fix remap_file_pages.test breakage on hppa")

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bpf: print kern_version in the form of KERNEL_VERSION macro.
        * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print
        union bpf_attr.kern_version in the form of KERNEL_VERSION macro call.
        * tests/bpf.c: Update expected output.

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix remap_file_pages.test breakage on hppa.
        Apparently, hppa is the only architecture that has MAP_TYPE
        defined to 0x3 instead of 0xf, and the tests hit that corner case.

        * tests/remap_file_pages.c (main) [MAP_HUGETLB]: Print the value
        of mapping type depending on the architecture (MAP_SHARED_VALIDATE
        for hppa and unknown value for other architectures).

        Fixes: v4.21~59 ("xlat: update MAP_* constants")

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Sort Ethernet protocols xlat.
        * defs.h (ethernet_protocols_size): New declaration.
        * netlink_packet_diag.c (decode_packet_diag_req): Use
        printxval_searchnn to print Ethernet protocols.
        * sockaddr.c (ethernet_protocols_size): New constant, item count
        in ethernet_protocols array.
        (print_sockaddr_data_ll): Use printxval_search instead of
        printxval to print Ethernet protocols.
        * xlat/ethernet_protocols.in: Sort it by value, add comment
        about the fact.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Change sorted arrays to be terminated with XLAT_END like unsorted arrays
        It is quite unwieldy to have this distinction between sorted and
        unsorted arrays when we can just decrement the size in a wrapper.

        * defs.h (printxval_search): Decrement array size.
        * xlat/fsmagic.in (#unterminated): Remove.
        * xlat/hw_breakpoint_type.in (#unterminated): Remove.
        * xlat/perf_hw_cache_id.in (#unterminated): Remove.
        * xlat/perf_hw_cache_op_id.in (#unterminated): Remove.
        * xlat/perf_hw_cache_op_result_id.in (#unterminated): Remove.
        * xlat/perf_hw_id.in (#unterminated): Remove.
        * xlat/perf_sw_ids.in (#unterminated): Remove.
        * xlat/perf_type_id.in (#unterminated): Remove.
        * xlat/gen.sh (gen_header): Remove #unterminated support.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: add a note about tracing of scripts without shebang.
        * strace.1.in (.SH NOTES): Note that tracing of scripts without shebang
        won't work.

        Reported-by: Mike Parker
        Closes: https://github.com/strace/strace/issues/46

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: mention that -c suppresses regular output.
        As the note that -C makes strace "also print regular output" can be
        easily overlooked.

        * strace.1.in (.SS Statistics) <.TP .B \-c>: Mention that -c supresses
        regular output.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        errnoent.h: add ERECALLCONFLICT.
        * linux/errnoent.h ([530]): Add ERECALLCONFLICT error introduced by
        Linux commit v4.7-rc1~40^2~6.
        * linux/alpha/errnoent.h ([530]): Likewise.
        * linux/hppa/errnoent.h ([530]): Likewise.
        * linux/mips/errnoent.h ([530]): Likewise.
        * linux/sparc/errnoent.h ([530]): Likewise.

        xlat: add BPF_F_ALLOW_MULTI constant.
        * xlat/bpf_attach_flags.in (BPF_F_ALLOW_MULTI): New constant, introduced
        by Linux commit v4.15-rc1~84^2~558^2~7.

        xlat: add BPF_MAP_TYPE_CPUMAP constant.
        * xlat/bpf_map_types.in (BPF_MAP_TYPE_CPUMAP): New constant, introduced
        by Linux commit v4.15-rc1~84^2~427^2~4.

        tests/test_printstrn.c: do not declare i again.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/s390_sthyi.c: make utility functions inline.
        When built with --enable-gcc-Werror, s390_sthyi test build fails
        with the following error:

                s390_sthyi.c:63:1: error: ‘print_u8’ defined but not used [-Werror=unused-function]
                 print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
                 ^~~~~~~~

        Apparently, after some back and forth, all occurrences of printing u8
        values landed under verbose printing, so this function is no longer
        used in non-verbose mode.  Let's avoid this in the future by inlining
        all the utility functions in this test.

        * tests/s390_sthyi.c (print_0x8, print_u8, print_u16, print_x32,
        print_weight, ebcdic2ascii, is_empty, print_ebcdic): Add inline
        qualifier.
        [!VERBOSE] (is_empty): Remove "# if VERBOSE" guard.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs: print struct btrfs_ioctl_logical_ino_args.flags field.
        The field has been introduced in Linux commit v4.15-rc1~135^2~17.

        * btrfs.c: Implement decoding of
        struct btrfs_ioctl_logical_ino_args.flags field.
        * configure.ac: Check for struct btrfs_ioctl_logical_ino_args.flags
        presence in linux/btrfs.h.
        * tests/btrfs.c: Update expected output, add additional checks.
        * xlat/btrfs_logical_ino_args_flags.in: New file.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        btrfs.c: print __u64 fields with pointer semantics using printaddr64.
        * btrfs.c (btrfs_ioctl) <case BTRFS_IOC_INO_PATHS>: Print fspath field
        with printaddr64.
        (btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print inodes field with
        printaddr64.
        * tests/btrfs.c: Add checks for NULL in fspath and inodes fields.
        * NEWS: Mention it.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: introduce printaddr64.
        Sometimes, 64-bit value is expected to be interpreted as an address
        (in BTRFS ioctl interface, for example).

        * defs.h (printaddr64): New declaration.
        * util.c (printaddr64): Rename from printaddr, change argument type
        to uint64_t.
        (printaddr): Turn into a thin wrapper around printaddr64.
        (printnum_addr_int, printnum_addr_int64): Use printaddr64 instead of
        printaddr.  printnum_addr_int64 is not used outside the cases where
        kernel_long is less or equal than 64 bit currently, so this change
        should be safe.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: add decoding of PR_SVE_SET_VL and PR_SVE_GET_VL commands.
        These commands were introduced in Linux commit v4.15-rc1~110^2~9.

        * xlat/pr_sve_vl_flags.in: New file.
        * xlat/prctl_options.in: Likewise.
        * prctl.c: Include "xstring.h" and "xlat/pr_sve_vl_flags.h".
        [!PR_SVE_VL_LEN_MASK] (PR_SVE_VL_LEN_MASK): New macro constant.
        (sprint_sve_val): New function.
        (SYS_FUNC(prctl)): Add decoding for PR_SVE_GET_VL and PR_SVE_SET_VL
        commands.
        * NEWS: Mention it.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement PTRACE_SECCOMP_GET_METADATA ptrace request decoding.
        * defs.h (seccomp_filter_flags): New declaration.
        * process.c (SYS_FUNC(ptrace)): Implement PTRACE_SECCOMP_GET_METADATA
        request decoding.
        * ptrace.h [!PTRACE_SECCOMP_GET_METADATA] (PTRACE_SECCOMP_GET_METADATA):
        New macro constant.
        * xlat/ptrace_cmds.in (PTRACE_SECCOMP_GET_METADATA): New constant.
        * tests/ptrace.c (main): Add some checks for PTRACE_SECCOMP_GET_METADATA
        request decoding.
        * NEWS: Mention it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        build: prepare for -Wimplicit-fallthrough=5.
        * gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro.
        * block.c (block_ioctl): Use it instead of "fall through" comment.
        * btrfs.c (btrfs_ioctl): Likewise.
        * loop.c (loop_ioctl): Likewise.
        * mtd.c (mtd_ioctl): Likewise.
        * rtc.c (rtc_ioctl): Likewise.
        * v4l2.c (v4l2_ioctl): Likewise.
        * dm.c (dm_decode_values): Likewise.
        * process.c (SYS_FUNC(ptrace)): Likewise.
        * quota.c (decode_cmd_data): Likewise.
        * ucopy.c (umovestr): Likewise.
        * unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)):
        Likewise.
        * term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH.
        * ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise.
        * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5.
        * tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement
        without implicit fallthrough.

2018-03-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add eBPF-based device controller constants.
        Add new BPF_PROG_TYPE_CGROUP_DEVICE eBPF program type and new
        BPF_CGROUP_DEVICE eBPF program attach type, added in Linux commit
        v4.15-rc1~84^2~120^2~2.

        * xlat/bpf_attach_type.in (BPF_CGROUP_DEVICE): New constant.
        * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_DEVICE): Likewise.
        * NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for input event constants.
        Values added using the following pair of commands:

                $ cat xlat/evdev_keycode.in |
                        while read r; do [ -n "$r" ] &&
                                sed -rn 's/^#define[[:space:]]+('$r'[[:space:]]+[^[:space:]]+).*/\1/p' \
                                ~/dev/linux/include/uapi/linux/input-event-codes.h || echo;
                        done > xlat/evdev_keycode.in.new
                $ sort -s -n -k1,1 \
                        <(awk '{if (NF>1) {last = strtonum($2)}; printf("%d %s\n", last, $0)}' \
                                xlat/evdev_keycode.in.new) \
                        | sed 's/^[0-9]* //'  > xlat/evdev_keycode.in

        It also verifies that the values are sorted and bsearch-ready.

        * xlat/evdev_keycode.in: Add constant values.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update the list of input event constants.
        Remove some duplicating definitions and add the new ones.

        * xlat/evdev_keycode.in (KEY_HANGUEL): Remove, an alternative name for
        KEY_HANGEUL.
        (KEY_DIRECTION): Remove, an alternative name for KEY_ROTATE_DISPLAY.
        (KEY_BRIGHTNESS_ZERO): Remove, an alternative name for
        KEY_BRIGHTNESS_AUTO.
        (KEY_WIMAX): Remove, an alternative name for KEY_WWAN.
        (BTN_A): Remove, an alternative name for BTN_SOUTH.
        (BTN_B): Remove, an alternative name for BTN_EAST.
        (BTN_X): Remove, an alternative name for BTN_NORTH.
        (BTN_Y): Remove, an alternative name for BTN_WEST.
        (BTN_STYLUS3): New constant, added in Linux commit v4.15-rc1~114^2^2~1.
        (KEY_BRIGHTNESS_TOGGLE): Remove, an alternative name for
        KEY_DISPLAYTOGGLE.
        (KEY_ROTATE_LOCK_TOGGLE): New constant, added in Linux commit
        v4.16-rc1~54^2~67.
        (KEY_DATA): New constant, added in Linux commit v4.9-rc8~12^2.
        (KEY_ONSCREEN_KEYBOARD): New constant, added in Linux commit
        v4.12-rc1~126^2~2^12~5.
        * NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for SCTP socket option constants.
        Values for SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
        SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD are reconstructed
        from Linux commit v2.6.33-rc1~388^2~167^2~7.

        xlat/socksctpoptions.in: Add constant values.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update the list of SCTP socket option constants.
        * xlat/socksctpoptions.in (SCTP_DELAYED_ACK): Rename to...
        (SCTP_DELAYED_SACK): ...this, per Linux commit v2.6.38-rc2~33^2.
        (SCTP_SOCKOPT_PEELOFF_FLAGS): New constant, introduced in Linux commit
        v4.13-rc1~157^2~39.
        (SCTP_STREAM_SCHEDULER): New constant, introduced in Linux commit
        v4.15-rc1~84^2~567^2~3.
        (SCTP_STREAM_SCHEDULER_VALUE): New constant, introduced in Linux commit
        v4.15-rc1~84^2~567^2~2.
        (SCTP_INTERLEAVING_SUPPORTED): New constant, introduced in Linux commit
         v4.16-rc1~123^2~384^2~11.
        * NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for Ethernet protocol constants.
        As those are not architecture-specific.

        * xlat/ethernet_protocols.in: Add values to constants.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update the list of Ethernet protocol constants.
        * xlat/ethernet_protocols.in (ETH_P_ERSPAN2): New constant, introduced
        in Linux commit v4.16-rc1~123^2~355^2~2.
        (ETH_P_IBOE): New constant, introduced in commit v4.11-rc1~73^2~74.
        * NEWS: Mention it.

        v4l2: print known pixel/SDR formats.
        * xlat/v4l2_pix_fmts.in: New file.
        * xlat/v4l2_sdr_fmts.in: Likewise.
        * v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): New macro.
        (print_pixelformat): Add xlat parameter, print constant name
        as a comment if it has been found in xlat.
        (print_v4l2_fmtdesc, print_v4l2_frmivalenum): Pass v4l2_pix_fmts
        to print_pixelformat.
        (print_v4l2_format_fmt) <case V4L2_BUF_TYPE_VIDEO_CAPTURE, case
        V4L2_BUF_TYPE_VIDEO_OUTPUT, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
        case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, case V4L2_BUF_TYPE_VBI_CAPTURE,
        case V4L2_BUF_TYPE_VBI_OUTPUT>: Pass v4l2_pix_fmts to print_pixelformat.
        (print_v4l2_format_fmt) <case V4L2_BUF_TYPE_SDR_OUTPUT, case
        V4L2_BUF_TYPE_SDR_CAPTURE>: Pass v4l2_sdr_fmts to print_pixelformat.
        * tests/v4l2.c: Test it, update expected output.
        * NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: v4l2_fourcc is endianness-agnostic.
        v4l2_fourcc(a, b, c, d) is defined as (a | (b << 8) | (c << 16) | (d << 24)
        regardless of endianness (no mnemonic on big-endian architectures),
        so we don't need special handling for WORDS_BIGENDIAN both in decoder
        and in the test.

        * v4l2.c (print_pixelformat): Change initialisation to a simple
        assignment of character array.
        * tests/ioctl_v4l2.c [WORDS_BIGENDIAN]: Remove.
        * NEWS: Mention this fix.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
        Fixes: v4.10~371 "Implement Video4Linux video-input ioctls decoder"

2018-03-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not include <stdbool.h> in files that include "tests.h"
        Starting with commit v4.21-37-g4f63bc70ca95012d72e288fc3c1eeb3ba26068a4,
        <stdbool.h> is included by tests.h, so all tests that already include
        "tests.h" do not need to include <stdbool.h>.

        * tests/btrfs.c: Do not include <stdbool.h>.
        * tests/file_handle.c: Likewise.
        * tests/futex.c: Likewise.
        * tests/ioctl_dm.c: Likewise.
        * tests/ioctl_loop.c: Likewise.
        * tests/ioctl_sock_gifconf.c: Likewise.
        * tests/keyctl.c: Likewise.
        * tests/mq_sendrecv.c: Likewise.
        * tests/perf_event_open.c: Likewise.
        * tests/s390_guarded_storage.c: Likewise.
        * tests/s390_pci_mmio_read_write.c: Likewise.
        * tests/s390_sthyi.c: Likewise.
        * tests/xet_thread_area_x86.c: Likewise.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check printing of block/char device numbers in -yy mode.
        * tests/dev-yy.c: New file.
        * tests/pure_executables.list: Add dev-yy.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (dev-yy): New test.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        printfd: print character/block device number in -yy mode.
        * util.c: Include <sys/stat.h>, <sys/sysmacros.h>,
        and "largefile_wrappers.h".
        (printsocket, printdev): New functions.
        (printfd): Move socket matching/printing logic to printsocket.  Check
        also for printdev.  Escape opening angle bracket in addition to closing angle
        bracket as it can show up as a separator in printdev.
        * tests/fsync-y.c: Update expected output.
        * strace.1.in: Mention this.
        * NEWS: Likewise.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: escape closing angle bracket in printfd.
        * util.c (printfd): Use print_quoted_string_ex instead of
        print_quoted_string, specify ">" as escape_chars argument.
        * tests/fsync-y.c (main): Update expected output.
        * NEWS: Mention it.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: add support for additional escape characters in string_quote.
        Quotes are not always used to denote string limits; printfd uses angle
        brackets for that, for example.  As result, mechanism for supplying
        set of additional characters in order to avoid ambiguities regarding
        the end of the quoted string is needed.

        * defs.h (string_quote): Add escape_chars parameter.
        (print_quoted_string_ex): New function prototype.
        * util.c (string_quote): Add escape_chars parameter.
        (print_quoted_string_ex): Rename from print_quoted_string, add
        escape_chars parameter, pass it to string_quote call.
        (print_quoted_string): Turn into a thin wrapper around
        print_quoted_string_ex.
        (printstr_ex): Pass NULL as escape_chars argument of string_quote call.
        * socketutils.c (unix_parse_response): Pass NULL as escape_chars
        argument of string_quote call.
        * tests/print_quoted_string.c (print_octal): New function.
        print_quoted_memory_ex): Use it.  Add escape_chars parameter.
        (print_quoted_memory): Pass NULL as escape_chars argument
        of print_quoted_memory_ex call.
        * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): Add
        escape_chars parameter.
        * tests/fsync-y.c: Pass NULL as escape_chars argument of
        print_quoted_string_ex call.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check file name printing in strace -y mode.
        * tests/fsync-y.c: New file.
        * tests/.gitignore: Add fsync-y.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (fsync-y): New test.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add print_quoted_string_ex and print_quoted_memory_ex functions.
        * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): New
        declarations.
        * tests/print_quoted_string.c (print_quoted_string_ex): New function,
        a thin wrapper around print_quoted_memory_ex wrapper.
        (print_quoted_memory_ex): Rename from print_quoted_memory, add quote
        argument.
        (print_quoted_memory): Turn into a thin wrapper around
        print_quoted_memory_ex.

        tests: check escaping in string printing.
        * tests/test_printstrn.c (test_print_memory): New function.
        (test_printstrn): Use it.

        Do not go full octal if the next char is '8' or '9'
        * util.c (string_quote): Change the upper limit for the next character
        in unabbreviated octal printing from '9' to '7'.
        * tests/print_quoted_string.c (print_quoted_memory): Likewise.

        tests: fix abbreviated octal escape check in print_quoted_memory.
        * tests/print_quoted_string.c (print_quoted_memory): Check the next
        character after octal-escaped one instead of the first one in the
        string.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: reduce indentation in non-hexadecimal case in string_quote.
        As it is already too deep there.

        * util.c (string_quote): Add string_ended label, jump there
        after the loop in "if (usehex)" case.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util.c: fix switch statement indentation in string_quote.
        While we are here, let's also remove unnecessary break statement
        in the default case.

2018-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Replace fopen_for_input and fopen_for_output with fopen_stream.
        * largefile_wrappers.h (fopen_for_input, fopen_for_output): Replace
        with fopen_stream.
        * mmap_cache.c (fopen_for_input) Likewise.
        * strace.c (fopen_for_output): Likewise.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update the list of INET_DIAG_BC_* operators.
        * linux/inet_diag.h (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New
        enumeration items introduced by linux kernel commit v4.16-rc1~123^2~259.
        * xlat/inet_diag_bytecodes.in (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New
        constants.
        * NEWS: Mention it.

        xlat: update the list of SCHED_FLAG_* constants.
        * xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New
        constants introduced by linux kernel commits v4.13-rc1~205^2~27 and
        v4.16-rc1~164^2~8, respectively.
        (SCHED_FLAG_RESET_ON_FORK): Add constant value.
        * tests/sched_xetattr.c: Update expected output.
        * NEWS: Mention it.

        xlat: provide fallback definitions for arch-independent poll event flags
        * xlat/pollflags.in (POLLIN, POLLPRI, POLLOUT, POLLRDNORM, POLLRDBAND,
        POLLERR, POLLHUP, POLLNVAL, POLL_BUSY_LOOP): Add constant values.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update the list of poll event flags.
        POLL_BUSY_LOOP was introduced by linux kernel commit v3.11-rc1~64^2~129
        as POLL_LL and then renamed in v3.11-rc1~64^2~9.  POLLRDHUP was
        introduced by linux kernel commit v2.6.17-rc1~796.  POLLMSG and
        POLLREMOVE predate git repository.  POLLFREE was introduced by linux
        kernel commit v3.3-rc5~8 for internal use only.

        * xlat/pollflags.in (POLLMSG, POLLREMOVE, POLLRDHUP, POLL_BUSY_LOOP):
        New constants.
        * NEWS: Mention it.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add arch-specific si_codes constants.
        Based on Linux commits v4.16-rc1~159^2~17, v4.16-rc1~159^2~16,
        v4.16-rc1~159^2~15, and v4.16-rc1~159^2~14.

        * xlat/sigbus_codes.in (BUS_OPFETCH): New constant.
        * xlat/sigfpe_codes.in (FPE_MDAOVF, __FPE_DECOVF, __FPE_DECDIV,
        __FPE_DECERR, __FPE_INVASC, __FPE_INVDEC): New constants.
        * xlat/sigill_codes.in (ILL_ILLPARAOP, ILL_ILLEXCPT, ILL_CPLB_VI,
        ILL_CPLB_MISS, ILL_CPLB_MULHIT, ILL_DBLFLT, ILL_HARDWALL, ILL_BADIADDR,
        __ILL_BREAK, __ILL_BNDMOD): Likewise.
        * xlat/sigsegv_codes.in (SEGV_STACKFLOW, __SEGV_PSTKOVF): Likewise.
        * xlat/sigtrap_codes.in (TRAP_STEP, TRAP_TRACEFLOW, TRAP_WATCHPT,
        TRAP_ILLTRAP): Likewise.
        * NEWS: Mention it.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        rtnl_tc: support new TCA_* attributes.
        * xlat/rtnl_tc_attrs.in (TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK,
        TCA_EGRESS_BLOCK): New constants introduced by linux kernel commits
        v4.15-rc4~13^2~5^2~2 and v4.16-rc1~123^2~139^2~5.
        * rtnl_tc.c (tcmsg_nla_decoders) <TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK,
        TCA_EGRESS_BLOCK>: New items.

        rtnl_link: add decoding of new IFLA_* attributes.
        * xlat/rtnl_link_attrs.in (IFLA_NEW_NETNSID, IFLA_IF_NETNSID,
        IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT, IFLA_NEW_IFINDEX): New
        constants introduced by linux kernel commits v4.15-rc1~84^2~557,
        v4.15-rc1~84^2~133^2, v4.16-rc1~123^2~91, and v4.16-rc1~123^2~24^2.
        * rtnl_link.c (ifinfomsg_nla_decoders) <IFLA_NEW_NETNSID,
        IFLA_IF_NETNSID, IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT,
        IFLA_NEW_IFINDEX>: New items.

        rtnl_link: implement IFLA_EVENT_* decoding.
        * rtnl_link.c (decode_ifla_event): New function.
        (ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it.
        * xlat/rtnl_ifla_events.in: New file.
        * NEWS: Mention it.

        xlat: update the list of RWF_* constants.
        * xlat/rwf_flags.in (RWF_APPEND): New constant introduced by linux
        kernel commit v4.16-rc1~145^2~7.
        * NEWS: Mention it.

        tests: check decoding of ip6:port pairs associated with socket descriptors
        * tests/net-yy-inet.c: Generalise test.
        * tests/net-yy-inet6.c: New file.
        * tests/pure_executables.list: Add net-yy-inet6.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (net-yy-inet6): New entry.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print IPv6 addresses in brackets.
        Follow a common practice for printing address:port pair to distinguish
        address parts delimiter from address/port delimiter.

        * socketutils.c (inet_parse_response) <ob, cb>: New variables,
        initialise them to open/closing brackets or empty strings based
        on address family.
        (inet_parse_response): Print ob and cb around src_buf and dst_buf.
        * NEWS: Mention this improvement.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: add gcc to build requirements.
        There are rumors in circulation that some rpm-based distributions
        are going to exclude gcc from their default build environments.
        Workaround this policy silliness by adding gcc to build requirements.

        * strace.spec.in (BuildRequires): Add gcc.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        Move definitions of fopen_for_input to largefile_wrappers.h.
        * largefile_wrappers.h (fopen_for_input): Define along with
        fopen_for_output.
        * mmap_cache.c: Include "largefile_wrappers.h".
        (fopen_for_input): Remove.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce mmap_cache.h.
        Let's avoid bloating defs.h and introduce a separate header for
        mmap_cache.

        * defs.h (struct mmap_cache_t, enum mmap_cache_protection,
        enum mmap_cache_rebuild_result, mmap_cache_enable, mmap_cache_is_enabled,
        mmap_cache_invalidate, mmap_cache_delete, mmap_cache_rebuild_if_invalid,
        mmap_cache_search): Move ...
        * mmap_cache.h: ... to this new file.
        * Makefile.am (strace_SOURCES): Add mmap_cache.h.
        * mmap_cache.c: Include mmap_cache.h.
        * strace.c: Likewise.
        * syscall.c: Likewise.
        * unwind.c: Likewise.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: record device major and minor numbers.
        * defs.h (struct mmap_cache_t): Add major and minor fields.
        * mmap_cache.c (build_mmap_cache): Record device major and minor numbers.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: add function to enable mmap_cache.
        mmap_cache was enabled indirectly via unwind feature.  As now mmap_cache
        can be used by other part of strace, a way to enable mmap_cache directly
        is needed.

        * defs.h (mmap_cache_enable, mmap_cache_is_enabled): New function
        prototypes.
        * mmap_cache.c (use_mmap_cache): New file local variable.
        (mmap_cache_enable, mmap_cache_is_enabled): New functions.
        * syscall.c (syscall_exiting_decode): Use mmap_cache_is_enabled()
        instead of stack_trace_enabled.
        * unwind.c (unwind_init): Invoke mmap_cache_enable.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache, unwind: lift up mmap_cache_delete invocation from unwind.c.
        mmap_cache_delete function used to be called by destructor of unwind
        related code.  Now that other parts can use mmap cache,
        mmap_cache_delete is called separately from unwind_tcb_fin.

        * unwind.c (unwind_tcb_fin): Move mmap_cache_delete invocation ...
        * strace.c (droptcb): ... here.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: record protection bits.
        To make mmap_cache reusable, records protection bits of mmap entries.

        * defs.h (mmap_cache_protection): New enum.
        * mmap_cache.c (build_mmpa_cache): Don't ignore entries that are not
        executable, just record the protection bits here.
        * unwind.c (print_stack_frame): Ignore entries that are not executable.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: move code for searching a mmap cache from unwind.
        print_stack_frame function in unwind.c searches a mmap entry in mmap
        cache.  The found entry is then used for unwinding.  However, a function
        searching for a mmap entry may be useful for other purposes than
        unwinding.

        This change re-factors the function; code for searching an entry is
        now defined as a stand-alone function named mmap_cache_search.

        * defs.h (mmap_cache_search): New function prototype.
        print_stack_frame.
        * mmap_cached.c (mmap_cache_search): New function derived from
        print_stack_frame.
        * unwind.c (print_stack_frame): Use it.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        mmap_cache: new subsystem derived from unwind.c.
        For making mmap cache code reusable from other areas in strace than
        unwind, mmap cache related code and unwind related code should be
        separated.

        This change moves the most of mmap cache code from unwind.c
        to mmap_cache.c, a new file.

        * unwind.c: Move mmap_cache implementation ...
        * mmap_cache.c: ... to this new file.
        * Makefile.am (strace_SOURCES): add mmap_cache.c.
        * defs.h (struct tcb): Move mmap_cache, mmap_cache_size, and
        mmap_cache_generation fields out of [USE_LIBUNWIND] condition.
        (mmap_cache_invalidate, mmap_cache_delete,
        mmap_cache_rebuild_if_invalid): New function prototypes.
        (struct mmap_cache_t, enum mmap_cache_rebuild_result): Move from
        unwind.c.
        * syscall.c (syscall_exiting_decode): Replace unwind_cache_invalidate
        with mmap_cache_invalidate.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

        unwind: lift up unw_flush_cache from mmap cache management code.
        For making mmap cache code reusable from other areas in strace
        than unwind, mmap cache related code and unwind related code
        should be separated.

        This change is one of the steps for the separation.  It moves
        unw_flush_cache function call from the core of mmap cache code
        to upper level code.

        * unwind.c (mmap_cache_rebuild_result): New enum.
        (rebuild_cache_if_invalid): Return MMAP_CACHE_REBUILD_* instead of
        a bool value.
        (build_mmap_cache): Don't call unw_flush_cache here.
        (unwind_print_stacktrace, unwind_capture_stacktrace): Call
        unw_flush_cache here instead.

2018-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        debian: sync with 4.21-1 package.
        Versioned dependency on debhelper is not updated for backwards
        compatibility.

        * debian/changelog.in: Fix ancient changelog entries.
        * debian/control (Build-Depends): Add dependency on libbluetooth-dev.
        (Standards-Version): Update to 4.1.3.
        (Vcs-Git, Vcs-Browser): Move from alioth to salsa.d.o.
        (strace, strace-udeb) <Architecture>: Change to linux-any.
        (strace64, strace-udeb) <Priority>: Change to optional.
        * debian/rules: Use /usr/share/dpkg/architecture.mk instead of manually
        setting build variables.
        (configure): New target.
        (build/Makefile, build-udeb/Makefile, build64/Makefile): Depend on it.
        (binary-arch): Use build64/strace.1 for strace64 subpackage.
        * debian/strace.manpages: Add build/ prefix.
        * debian/strace64.manpages: Add build64/ prefix.

2018-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        m4/mpers.m4: fix mpers name in comments added to config.h.
        * m4/mpers.m4 (st_MPERS_STRUCT_STAT): Use mpers_name instead of
        MPERS_NAME in comments generated by AC_DEFINE.

        Fixes: v4.14~169 ("mpers.m4: check for struct stat64, struct stat, and their members")

2018-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: use stdint.h instead of inttypes.h.
        As <inttypes.h> is included in files generated by mpers.awk to obtain
        definitions of uintNN_t types provided by <stdint.h>, replace the former
        header with the latter.

        * mpers.awk: Use <stdint.h> instead of <inttypes.h>.
        * mpers_test.sh: Update expected output.

2018-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        Wipe out references to defunct sourceforge.
        The old location of strace-devel mailing list is defunct, it used to
        lose email messages and sometimes did not deliver any mails for days.

        The mailing list has been moved to strace-devel@lists.strace.io.

        * CREDITS.in: Update the mailing list address.
        (Zhang Le): Update email address.
        * README: Update the mailing list address.
        * README.md: Likewise.
        * configure.ac (AC_INIT): Likewise.
        * strace.1.in (.SH REPORTING BUGS): Likewise.
        * strace-log-merge.1.in (.SH REPORTING BUGS): Likewise.
        * sched.c (SYS_FUNC(sched_getattr)): Update the mailing list reference.
        * tests/scno_tampering.sh: Likewise.
        * qemu_multiarch_testing/README: Update git repository address.
        * NEWS: Mention the change of the mailing list address.

        Closes: https://github.com/strace/strace/issues/38

2018-02-21  Dmitry V. Levin  <ldv@altlinux.org>

        m68k: fix build.
        When <sys/reg.h> is included after <linux/ptrace.h>, the build fails
        on m68k with the following diagnostics:

          In file included from /usr/include/linux/ptrace.h:101:0,
                           from ptrace.h:51,
                           from sigreturn.c:2:
          /usr/include/m68k-linux-gnu/sys/reg.h:26:3: error: expected identifier
          before numeric constant
             PT_D1 = 0,
             ^

        Apparently, the only architecture where strace needs definitions
        provided by <sys/reg.h> is x86_64, other three (m68k, tile, and x86)
        are fine with definitions already provided by <linux/ptrace.h>.

        Fix the issue by getting rid of <sys/reg.h> and defining necessary
        macros in linux/x86_64/arch_regs.h file.

        * configure.ac (AC_CHECK_HEADERS): Remove sys/reg.h.
        * regs.h: Do not include <sys/reg.h>.
        * linux/x86_64/arch_regs.h (R15, R14, R13, R12, RBP, RBX, R11, R10,
        R9, R8, RAX, RCX, RDX, RSI, RDI, ORIG_RAX, RIP, CS, EFLAGS, RSP, SS,
        FS_BASE, GS_BASE, DS, ES, FS, GS): New macros.
        * NEWS: Mention this fix.

        Fixes: v4.21~21 ("Include <sys/ptrace.h> early")

2018-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        Demote sourceforge.net.
        https://sourceforge.net/p/strace/code/ is defunct: it doesn't accept
        new commits for too long.
        Likewise, https://sourceforge.net/projects/strace/files/ doesn't accept
        new files for too long.

        * README.md: Remove sourceforge.net URL.
        * debian/copyright: Replace the sourceforge.net based strace project URL
        with a github based one.
        * strace.spec.in (Source): Likewise.

2018-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        * COPYING: Update copyright year number range.
        * debian/copyright: Sync with COPYING.

2018-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.21-1.
        * strace.spec.in: Likewise.

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.21 release.
        * NEWS: Update for 4.21 release.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/s390_sthyi.c: skip the test if s390_sthyi returns an error.
        tests/s390_sthyi.c (main): replace error_msg_and_fail with
        error_msg_and_skip if rc is non-zero.

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated automatically using maint/update_copyright_years.sh
        script.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove old and unused maintenance scripts.
        Firewell, last witnesses of bygone era.

        * linux/sparc/gen.pl: Remove.
        * linux/x86_64/gentab.pl: Likewise.
        * xlate.el: Likewise.
        * Makefile.am (EXTRA_DIST): Remove them.

        Suggested-by: Elvira Khabirova <lineprinter@altlinux.org>
        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use MAX_ERRNO_VALUE.
        * filter_qualify.c (parse_inject_token): Replace 4095
        with MAX_ERRNO_VALUE.
        * negated_errno.h (is_negated_errno): Likewise.  Remove redundant
        comment.

        Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests.
        * configure.ac (AC_SUBST): Add SIZEOF_LONG and SIZEOF_KERNEL_LONG_T.
        * tests/Makefile.am (SIZEOF_LONG, SIZEOF_KERNEL_LONG_T): New variables.
        (AM_TEST_LOG_FLAGS): Pass them.
        * bootstrap: Substitute them.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: avoid ioctl_kvm_run test failure when built with gcc -O0.
        When built with -O0, gcc (rightfully) generates function prologue, which
        results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO.
        It could be possible to avoid such problems by "naked" attribute but,
        unfortunately, the latter is not available on x86 with older GCC.
        A trick suggested in [1] is used instead: assembly is moved
        to the global scope.

        [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3

        * tests/ioctl_kvm_run.c (code): Remove function.
        Add globally scoped __asm__ with the function code and its size.
        (code, code_size): New extern symbols declarations.
        (run_kvm): Remove code_size definition and initialization.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnostics.
        As it has proven itself useful.

        * tests/ioctl_kvm_run.c (run_kvm) <case KVM_EXIT_MMIO:>: Fail
        on unexpected KVM_EXIT_MMIO, providing relevant diagnostics.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add compatibility layer for accept call.
        Recent glibc (since version 2.26) uses accept4 syscall for implementing
        accept call on sparc.  Unfortunately, it's impossible to simply fall
        back on raw syscall as it had not been wired up until linux commit
        v4.4-rc8~4^2~1.

        * tests/accept_compat.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/net-y-unix.c: Include accept_compat.h, use do_accept()
        instead of accept() calls.
        * tests/net-yy-inet.c: Likewise.
        * tests/net-yy-unix.c: Likewise.
        * tests/net.expected: Allow accept4.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        debian: build strace-udeb separately.
        * debian/rules (extra_build_targets): Add build-udeb-stamp.
        (build-udeb/Makefile): New rule.
        (clean): Remove build-udeb.
        * debian/strace-udeb.install: Update.

        Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826223

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        Enable symbol demangling in deb- and rpm-driven builds.
        * debian/control (Build-Depends) [amd64]: Add libiberty-dev.
        * strace.spec.in (buildrequires_libunwind_devel): Add binutils-devel.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        debian: re-enable -k option on x86_64.
        This partially reverts commit v4.13~177.

        * debian/control (Build-Depends) [amd64]: Add libunwind-dev.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        Add "strace -V" output to build log.
        * strace.spec.in (%check): Print "strace -V" output before
        running the test suite.
        * debian/rules (%-stamp): Likewise.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update NT_* constants.
        * xlat/nt_descriptor_types.in (NT_PPC_PKEY): New constant introduced
        by linux kernel commit v4.16-rc1~93^2~72.

        Update the list of PKEY_* constants.
        * xlat/pkey_access.in (PKEY_DISABLE_EXECUTE): New constant introduced
        by linux kernel commit v4.16-rc1~93^2~85.
        * tests/pkey_alloc.c: Update expected output.
        * NEWS: Mention it.

        powerpc, powerpc64: wire up pkey_* syscalls.
        * linux/powerpc/syscallent.h [384..386]: Add pkey_alloc,
        pkey_free, and pkey_mprotect syscalls introduced by linux kernel
        commits v4.16-rc1~93^2~70 and v4.16-rc1~93^2~69, respectively.
        * linux/powerpc64/syscallent.h: Likewise.
        * NEWS: Mention it.

        Update NEWS.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/ia64: remove IA-32 mode support.
        There is no compat support in strace and there are no systems
        within reach that would allow to test it.

        * linux/ia64/arch_regs.c (IA64_PSR_IS, ia64_ia32mode): Remove.
        * linux/ia64/get_error.c (get_error): Remove ia64_ia32mode branch.
        * linux/ia64/get_scno.c (arch_get_scno): Likewise.
        * linux/ia64/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/ia64/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/ia64/set_scno.c (arch_set_scno): Likewise.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: parse return code second time after injecting.
        In order to have the same view as tracee has, with regards to
        "never fail" syscalls.

        * syscall.c (tamper_with_syscall_exiting): Call get_error after the
        return value tampering to re-initialise u_rval and u_error fields
        of struct tcb.

2018-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sparc: mark as an architecture that has a dedicated error register.
        * linux/sparc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
        define to 1.

        strace.1.in: ffix.

2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        Include <sys/ptrace.h> early.
        Include "ptrace.h" before any header that can include <signal.h>
        because on some architectures the latter may include <asm/sigcontext.h>
        which in turn may include <asm/ptrace.h> with potentially devastating
        effect on <sys/ptrace.h>.

        * process.c: Include "ptrace.h" before "regs.h".
        * rt_sigframe.c: Likewise.
        * sigreturn.c: Include "ptrace.h" before "nsig.h".
        * syscall.c: Likewise.
        * wait.c: Include "ptrace.h" before <sys/wait.h>.
        * strace.c: Include "ptrace.h" before <signal.h>.
        * tests/ptrace.c: Likewise.
        * tests/test_ucopy.c: Include <sys/ptrace.h> before <signal.h>.

2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        Include <limits.h> instead of <sys/param.h>
        Do not include <sys/param.h> unnecessarily as it includes <signal.h>.

        * pathtrace.c: Include <limits.h> instead of <sys/param.h>.
        * strace.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.
        * tests/getcwd.c: Likewise.
        * tests/group_req.c: Likewise.
        * tests/inode_of_sockfd.c: Likewise.
        * tests/ip_mreq.c: Likewise.
        * tests/printpath-umovestr.c: Likewise.
        * tests/qual_fault.c: Likewise.
        * tests/test_printpath.c: Likewise.
        * tests/umovestr3.c: Likewise.
        * tests/net-y-unix.c: Do not include <sys/param.h>.
        * tests/net-yy-unix.c: Likewise.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        basic_filters.c: introduce scno_by_name.
        As it will be used elsewhere.

        * basic_filters.c (scno_by_name): New function.
        (qualify_syscall_name): Use it.
        * defs.h (scno_by_name): New declaration.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xstring.h: rephrase xappendstr description a bit.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat.c: return NULL in sprintflags if there are no flags.
        Otherwise the auxstr is rather ugly at times.

        * xlat.c (sprintflags): Return NULL if no flags were printed.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Change type of injected rval to kernel_long_t.
        * defs.h (struct inject_data): Change type of rval field to
        kernel_ulong_t.
        * filter_qualify.c (parse_inject_token): Use string_to_kulong instead of
        string_to_uint for rval parsing.  Warn if retval is clipped in compat
        personality.

        Mark architectures that indicate syscall error in a dedicated register.
        * linux/alpha/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
        define to 1.
        * linux/ia64/arch_defs_.h: Likewise.
        * linux/mips/arch_defs_.h: Likewise.
        * linux/powerpc/arch_defs_.h: Likewise.
        * linux/powerpc64/arch_defs_.h: Likewise.
        * linux/sparc64/arch_defs_.h: Likewise.
        * linux/arch_defs_.h [!HAVE_ARCH_DEDICATED_ERR_REG]
        (HAVE_ARCH_DEDICATED_ERR_REG): New macro, define to 0.
        * linux/nios2/arch_defs_.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make string_to_uint_ex more universal.
        And add support for reading of various types.

        * string_to_uint.c (string_to_uint_ex): Change to work with long long.
        (string_to_uint): Move it...
        * string_to_uint.h (string_to_uint): ...here.
        (string_to_uint_upto): Accept long long as max_val, return long long.
        (string_to_ulong, string_to_kulong, string_to_ulonglong): New functions,
        for completeness.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add pure syscall flag.
        * basic_filters.c (lookup_class) <syscall_class>: Add "%pure" for
        TRACE_PURE.
        * sysent.h (TRACE_PURE): New syscall flag.
        * sysent_shorthand_defs.h (PU): New shorthand macro.
        * linux/32/syscallent.h ([172], [173], [174], [175], [176], [177],
        [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
        getegid, gettid syscalls.
        * linux/64/syscallent.h ([172], [173], [174], [175], [176], [177],
        [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
        getegid, gettid syscalls.
        * linux/aarch64/syscallent.h ([1060]): Add PU flag to getpgrp syscalls.
        * linux/alpha/syscallent.h ([20], [24], [47], [63], [64], [89],
        [378]): Add PU flag to getxpid, getxuid, getxgid, getpgrp, getpagesize,
        getdtablesize, gettid syscalls.
        * linux/arc/syscallent.h ([246]): Add PU flag to arc_gettls syscalls.
        * linux/arm/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [224], [ARM_FIRST_SHUFFLED_SYSCALL+1+6]):
        Add PU flag to getpid, getuid, getgid, geteuid, getegid, getppid,
        getpgrp, getuid32, getgid32, geteuid32, getegid32, gettid, get_tls
        syscalls.
        * linux/avr32/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [176]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/bfin/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
        getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/hppa/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [206]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/i386/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
        getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/ia64/syscallent.h ([1041], [1042], [1046], [1047], [1062],
        [1063], [1105], [1171]): Add PU flag to getpid, getppid, getuid,
        geteuid, getgid, getegid, gettid, getpagesize syscalls.
        * linux/m68k/syscallent.h ([20], [24], [47], [49], [50], [64],
        [65], [166], [199], [200], [201], [202], [221], [333]): Add PU flag
        to getpid, getuid, getgid, geteuid, getegid, getppid, getpgrp,
        getpagesize, getuid32, getgid32, geteuid32, getegid32, gettid,
        get_thread_area syscalls.
        * linux/metag/syscallent.h ([248]): Add PU flag to metag_get_tls
        syscalls.
        * linux/microblaze/syscallent.h ([20], [24], [47], [49], [50], [64],
        [65], [199], [200], [201], [202], [224]): Add PU flag to getpid,
        getuid, getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/powerpc64/syscallent.h ([20], [24], [47], [49], [50], [64],
        [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/powerpc/syscallent.h ([20], [24], [47], [49], [50], [64],
        [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/s390/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [236]): Add PU flag to getpid, getuid,
        getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/s390x/syscallent.h ([20], [64], [65], [199], [200], [201],
        [202], [236]): Add PU flag to getpid, getppid, getpgrp, getuid,
        getgid, geteuid, getegid, gettid syscalls.
        * linux/sh64/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [252]): Add PU flag to getpid, getuid,
        getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/sh/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
        [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
        getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
        geteuid32, getegid32, gettid syscalls.
        * linux/sparc64/syscallent.h ([20], [24], [47], [49], [50], [64], [81],
        [143], [197], [340]): Add PU flag to getpid, getuid, getgid, geteuid,
        getegid, getpagesize, getpgrp, gettid, getppid, kern_features syscalls.
        * linux/sparc/syscallent.h ([20], [24], [44], [47], [49], [50], [53],
        [64], [69], [70], [81], [143], [197], [340]): Add PU flag to getpid,
        getuid, getuid32, getgid, geteuid, getegid, getgid32, getpagesize,
        geteuid32, getegid32, getpgrp, gettid, getppid, kern_features syscalls.
        * linux/x32/syscallent.h ([39], [102], [104], [107], [108], [110],
        [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/x86_64/syscallent.h ([39], [102], [104], [107], [108], [110],
        [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
        getppid, getpgrp, gettid syscalls.
        * linux/xtensa/syscallent.h ([120], [127], [137], [139], [140], [141],
        [150], [151]): Add PU flag to getpid, gettid, getuid, getgid, geteuid,
        getegid, getppid, getpgrp syscalls.
        * strace.1.in (.SS Filtering): Document it.
        * NEWS: Mention it.

        syscall.c: warn if tampering failed.

        syscall.c: set errno if syscall is tampered.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/nsyscall-d.test: swap exp and log in diff calls.
        In line with the rest of the tests.

        * tests/nsyscalls-d.test: swap arguments of match_diff calls.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/arm/get_scno.c: use debug_msg.
        * linux/arm/get_scno.c (arch_get_scno): replace if (debug_flag) {
        error_msg() } with debug_msg() call.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Do not shuffle scno inside syscall_name.
        This makes interface a bit irregular otherwise.

        * defs.h (syscall_name): Clarify description.
        * syscall.c (syscall_name): Do not call shuffle_scno.
        * printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Handle very special __ARM_NR_-prefixed syscalls.
        * linux/aarch64/nr_prefix.c: New file.
        * linux/arm/nr_prefix.c: Likewise.
        * linux/nr_prefix.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * printsiginfo.c: Include nr_prefix.c
        (print_si_info): Use nr_prefix.

        Make shuffle_scno globally available.
        * syscall.c (shuffle_scno): Move the declaration...
        * defs.h (shuffle_scno): ...here. Remove static qualifier.
        * linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier.
        * linux/arm/shuffle_scno.c: Likewise.
        * linux/shuffle_scno.c: Likewise.
        * linux/x32/shuffle_scno.c: Likewise.
        * linux/x86_64/shuffle_scno.c: Likewise.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: use shuffle_scno in syscall_name.
        syscall_name() is used only in printsiginfo.c:print_si_info currently,
        and is supplied with raw syscall number (that's why it has this ugly
        __X32_SYSCALL_BIT hack). But since it handled only __X32_SYSCALL_BIT and
        not shuffle_scno(), it was broken on ARM.  Let's replace it with shuffle_scno
        call, as it handles both the case of shuffled ARM syscalls and the
        __X32_SYSCALL_BIT.

        * syscall.c (syscall_name): Call shuffle_scno instead of custom
        __X32_SYSCALL_BIT handling.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use shuffle_scno for x32 syscall numbers.
        This changes behaviour of printing of unknown syscall.

        * linux/x32/shuffle_scno.c: New file.
        * linux/x86_64/shuffle_scno.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * linux/x86_64/get_scno.c (arch_get_scno): Do not clear
        __X32_SYSCALL_BIT.
        * tests/nsyscalls.c: Update expected output.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move shuffle_scno() invocation to get_scno.
        * linux/aarch64/get_scno.c (arch_get_scno): Remove shuffle_scno call.
        * linux/arm/get_scno.c (arch_get_scno): Remove shuffle_scno calls.
        * syscall.c (get_scno): Call shuffle_scno after arch_get_scno.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move shuffle_scno to arch-specific file.
        While we are here, let's fix AArch64 by limiting scno shuffling
        to compat personality only.

        * syscall.c: Include shuffle_scno.c.
        (shuffle_scno): Move it to a...
        * linux/arm/shuffle_scno.c: New file.
        * linux/aarch64/shuffle_scno.c: New file, define arm's shuffle_scno
        as arm_shuffle_scno and call it only for personality 1.
        * linux/shuffle_scno.c: New file, fallback trivial shuffle_scno
        definition.
        * Makefile.am (EXTRA_DIST): Add them.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print unknown syscall number in hexadecimal.
        * syscall.c (struct sysent_buf): Update buf field size.
        (get_scno): Print unknown syscall number in hexadecimal form.
        * tests/nsyscalls.c: Update expected output.
        * strace.1.in: Document it.
        * NEWS: Mention it.

        tests/accept.c: call accept syscall directly, if available.
        * tests/accept.c [__NR_accept && !TEST_SYSCALL_NAME]: Define a wrapper that
        calls accept directly.
        * tests/sockname.c [TEST_SYSCALL_STR]: Do not define TEST_SYSCALL_STR.

        printsiginfo.c: add a comment about personality detection for SIGSYS.
        Looks like it is not necessary, after all.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/x86_64/set_error.c: update eax for compat personality.
        Since this is where get_error gets the return value from in the compat case.

        linux/x86_64/set_error.c (set_error, set_success): Update i386_regs.eax
        if tracee is in compat personality.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Mark various arch-specific syscalls with SYSCALL_NEVER_FAILS.
        * linux/alpha/syscallent.h (getpagesize, getdtablesize): Add NF flag.
        * linux/arc/syscallent.h (arc_gettls): Likewise.
        * linux/arm/syscallent.h (get_tls): Likewise.
        * linux/ia64/syscallent.h (getpagesize): Likewise.
        * linux/m68k/syscallent.h (getpagesize, get_thread_area): Likewise.
        * linux/sparc/syscallent.h (getpagesize): Likewise.
        * linux/sparc64/syscallent.h (getpagesize): Likewise.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add SYSCALL_NEVER_FAILS flag to getpgrp.
        As glibc, at least, treats it this way.

        * linux/aarch64/syscallent.h (getpgrp): Add NF flag.
        * linux/alpha/syscallent.h: Likewise.
        * 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/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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/x86_64/get_error.c: do not sign-extend if no error happened.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/membarrier.c: fix expected output on nohz_full systems.
        If nohz_full is enabled, MEMBARRIER_CMD_GLOBAL is not available.

        * tests/membarrier.c: check availability of MEMBARRIER_CMD_GLOBAL
        separately.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update MEMBARRIER_CMD_* constants.
        * xlat/membarrier_cmds.in: Add new constants, rename
        MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL.
        * NEWS: Mention this.
        * tests/membarrier.c (main): Update expected output.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf.c: print group_fd argument of perf_event_open syscall as fd.
        * perf.c (SYS_FUNC(perf_event_open)): Print 4th argument using printfd.

        syscall.c: print higher bits of syscall return value on x32 personality.
        * syscall.c (syscall_exiting_trace): Check for current_klongsize instead
        of current_wordsize to determine the size of tcp->u_rval.

        strace.1.in: history update.
        strace.1.in (.SH HISTORY): Some amendments based on
        https://github.com/strace/strace-talks/blob/master/2012-ossdevconf-obninsk-strace_from_upstream_PoV/ossdevconf_2012-slides-strace_from_upstream_PoV.tex

        strace.1.in: minor changes.
        * strace.1.in (.SH DESCRIPTION): s/a passion/passion/,
        s/Here the/Here, the/, s/Where traditional/Where the traditional/,
        s/output has proven/output is proven/, s/In all cases/In most cases,/¸
        embolden st_mode, lstat, SIGCHLD, and SIGTTOU mentions,
        s/In some cases /In some cases, /
        (.SS Output format) <-o>: de-italicize dot in "filename.pid", convert
        the sentence's voice to passive, some other rephrasing.  Mention
        incompatibility of output piping with -ff mode.
        (.SS Output options) <-t>: s/time of day/wall clock time/.
        (.SS Statistics) <-c>: Remove "on Linux" mention, -F option mention.

        README.md: add information about git repository location.
        * README.md: Mention URLs for SourceForge, GitHub, and GitLab
        repositories.

2018-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite net-accept-connect.c without strncpy.
        gcc8 -Wall -Werror rejects our method of struct sockaddr_un.sun_path
        initialization because the field lacks __nonstring__ attribute.

        As we calculate the length of the string being copied anyway,
        workaround this gcc+glibc bug by changing the code to use this
        pre-calculated length and get rid of strncpy completely.

        * tests/net-accept-connect.c (main): Use memcpy to initialize sun_path.

2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        Use kernel's fcntl.h header instead of libc's for open_mode_flags.
        As definitions of O_* macros provided by various libc implementations
        are usually less reliable than those provided by kernel headers, switch
        to use kernel's fcntl.h header.

        * open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
        O_LARGEFILE fallback definitions assuming that the kernel headers
        provide them.
        * xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC.  Add O_TMPFILE
        and __O_TMPFILE before O_DIRECTORY.  Remove "O_TMPFILE & ~O_DIRECTORY".
        * tests/open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
        workarounds for libc O_TMPFILE implementations.
        * tests/openat.c: Include <asm/fcntl.h> instead of <fcntl.h>.
        (test_mode_flag): New function.
        (main): Use it to check decoding of all access modes and file flags.
        * tests/gen_tests.in (openat): Add -a option.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: update TCP_* constants.
        * xlat/socktcpoptions.in: Add TCP_FASTOPEN_KEY and
        TCP_FASTOPEN_NO_COOKIE introduced by linux kernel commits
        v4.15-rc1~84^2~387 and v4.15-rc1~84^2~339, respectively.
        * NEWS: Mention this.

        xlat: update IPV6_* constants.
        * xlat/sockipv6options.in: Add IPV6_FREEBIND introduced by linux kernel
        commit v4.15-rc1~84^2~601.
        * NEWS: Mention this.

        xlat: update MAP_* constants.
        * xlat/mmap_flags.in: Add MAP_SHARED_VALIDATE and MAP_SYNC introduced
        by linux kernel commits v4.15-rc1~71^2^2~23 and v4.15-rc1~71^2^2~12,
        respectively.
        * NEWS: Mention this.

2018-02-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: avoid triggering -Wstringop-truncation in ioctl_dm.c.
        * tests/ioctl_dm.c: Replace strncpy calls with memcpy as the character
        arrays being copied are not C strings.

        Makefile.am: minor EXTRA_DIST formatting changes.

        Move large file-related wrappers to a separate header.
        * strace.c [_LARGEFILE64_SOURCE]: Move the definitions under it to a...
        * largefile_wrappers.h: ... new file.
        * Makefile.am (strace_SOURCES): Add it.

2018-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix wording about setuid installation.
        * strace.1.in (SETUID INSTALLATION): Fix wording.

        Closes: https://github.com/strace/strace/issues/24

2018-01-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Add KVM_PPC_GET_CPU_CHAR ioctl definition from linux v4.15.
        * linux/powerpc/ioctls_arch0.h: Update from linux v4.15
        using ioctls_gen.sh.

2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

        tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders.
        * tests/s390_pci_mmio_read_write.c: New file.
        * tests/.gitignore: Add s390_pci_mmio_read_write.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (s390_pci_mmio_read_write): New test.

        Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders.
        * linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
        ([353]): Change decoder to s390_pci_mmio_read.
        * linux/s390x/syscallent.h: Likewise.
        * s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
        New function.

        tests: check s390_runtime_instr system call decoder.
        * tests/s390_runtime_instr.c: New file.
        * tests/.gitignore: Add s390_runtime_instr.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (s390_runtime_instr): New test.

        Introduce s390_runtime_instr system call decoder.
        * linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr.
        * linux/s390x/syscallent.h: Likewise.
        * s390.c (SYS_FUNC(s390_runtime_instr)): New function.
        * xlat/s390_runtime_instr_commands.in: New file.

        tests: check s390_guarded_storage system call decoder.
        * configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h.
        * tests/s390_guarded_storage-v.c: New file.
        * tests/s390_guarded_storage.c: Likewise.
        * tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v):
        New tests.

        Introduce s390_guarded_storage system call decoder.
        * linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage.
        * linux/s390x/syscallent.h: Likewise.
        * s390.c (struct guard_storage_control_block,
        struct guard_storage_event_parameter_list): New structure type
        definition.
        (guard_storage_print_gsepl, guard_storage_print_gscb,
        SYS_FUNC(s390_guarded_storage)): New function.
        (DIV_ROUND_UP): New macro.
        * xlat/s390_guarded_storage_commands.in: New file.

        tests: check s390_sthyi system call decoder.
        * configure.ac (AC_CHECK_FUNCS): Add iconv_open.
        (AC_CHECK_HEADERS): Add iconv.h.
        * tests/s390_sthyi-v.c: New file.
        * tests/s390_sthyi.c: Likewise.
        * tests/.gitignore: Add s390_sthyi, s390_sthyi-v.
        * tests/pure_executables.list: Likewise.
        * tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests.

        Introduce s390_sthyi system call decoder.
        * s390.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
        * linux/s390x/syscallent.h: Likewise.
        * xlat/s390_sthyi_function_codes.in: New file.

        print_fields.h: add macro to print hexadecimal array field.
        * print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
        array with QUOTE_FORCE_HEX.

2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add print_quoted_string flag to generate comment.
        Because there are never enough print_quoted_string flags.

        * defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant.
        * util.c (string_quote): Emit " /* " in the beginning and " */" in the
        end if QUOTE_EMIT_COMMENT is passed.
        (print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is
        passed.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: make ioctl.test more flexible, use it for the rest of ioctl tests
        As the remaining non-generated ioctl tests differ from ioctl.test only
        in strace options, and since gen_tests.sh can pass arguments to sourced
        tests, replace the remaining non-generated ioctl tests with invocations
        of ioctl.test with appropriate parameters.

        * tests/ioctl.test: Pass script arguments to the strace invocation.
        * tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9.
        (ioctl_dm-v): New entry, invoke ioctl.test with -v -s9.
        (ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y.
        (ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none.
        (ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none.
        (ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1.
        (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test
        with -v option instead of ioctl-v.sh.
        * tests/ioctl_dm-v.test: Remove.
        * tests/ioctl_dm.test: Likewise.
        * tests/ioctl_kvm_run.test: Likewise.
        * tests/ioctl_loop-nv.test: Likewise.
        * tests/ioctl_nsfs.test: Likewise.
        * tests/ioctl_sock_gifconf.test: Likewise.
        * tests/ioctl-v.sh: Likewise.
        * tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/gen_tests.sh: enable passing arguments to sourced tests.
        * tests/gen_tests.sh: Read first argument separately, put it in $arg0,
        and the rest of the arguments in $args.
        (case "$arg0" in) <+*)>: Set command line to $args and source $arg0.

        xlat/gen.sh: add some rudimentary support for comments.
        * xlat/gen.sh: Trim parts of the string abbreviated in "/*" and "*/"

        configure.ac: sort architectures in lexicographical order.
        * configure.ac (case "$host_cpu"): sort architectures in alphabetical
        order.

2018-01-25  Dmitry V. Levin  <ldv@altlinux.org>

        Drop non-functional CRIS architecture support.
        From the very first commit when CRIS architecture support was introduced
        and up to this comment that ends the agony of this non-functional code,
        this support was incomplete and could never be compiled.

        * Makefile.am (EXTRA_DIST): Remove linux/crisv*.
        * clone.c: Remove CRISV* checks.
        * configure.ac ($host_cpu == cris*): Remove.
        * linux/crisv10: Remove.
        * linux/crisv32: Likewise.

        Fixes: v4.5.18-77-gea0e6e8 ("CRIS support by Hinko Kocevar ...")

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83.
        * futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions.
        (main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit
        being set, check that the existing behaviour preserved with VALP/VAL2P
        where higher bit is unset.

        tests/futex.c: improve error diagnostics.
        * tests/futex.c (futex_error): Add func and line arguments, print them.
        (CHECK_FUTEX_GENERIC): Pass __func__ and __LINE__ to futex_error.

        Add syscall entry for ARM-specific get_tls syscall.
        * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+6]): New entry.
        (ARM_LAST_SPECIAL_SYSCALL): Update to 6.
        * NEWS: Mention it.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Fix syscall descriptions for ARM-specific system calls.
        Based on an analysis of arm_syscall in arch/arm/kernel/traps.c.

        * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+2]): Update
        argument number, add TM flag.
        ([ARM_FIRST_SHUFFLED_SYSCALL+1+1], [ARM_FIRST_SHUFFLED_SYSCALL+1+3],
        [ARM_FIRST_SHUFFLED_SYSCALL+1+4], [ARM_FIRST_SHUFFLED_SYSCALL+1+5]):
        Update argument number.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check riscv_flush_icache syscall decoder.
        * tests/riscv_flush_icache.c: New file.
        * tests/.gitignore: Add riscv_flush_icache.
        * tests/gen_tests.in: Likewise.
        * tests/pure_executables.list: Likewise.

        Implement decoding of riscv_flush_icache syscall.
        * linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry.
        * riscv.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/riscv_flush_icache_flags.in: New file.
        * NEWS: Mention it.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Workaround stray PTRACE_EVENT_EXEC.
        We (apparently) had a long-standing test failure inside strace-ff.test
        with the symptom that it misses exit_group call.  As it turned out, it
        was PTRACE_EVENT_EXEC followed by execve syscall exiting stop.  That
        behaviour indeed screwed all the syscall state tracking for the tracee.
        Let's try to patch it up by calling trace_syscall when we receive
        PTRACE_EVENT_EXEC outside syscall.

        * defs.h (TCB_RECOVERING): New tcb flag.
        * strace.c (dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke
        trace_syscall with TCB_RECOVERING flag being set for the current_tcp
        if the tracee is not on exiting syscall.
        * syscall.c (get_scno): Set QUAL_RAW if we are recovering.
        (tamper_with_syscall_entering): Do not perform actual tampering during
        recovery as it's already too late.
        * NEWS: Mention it.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify set_ptracer_any.
        * tests/set_ptracer_any.c (main) [HAVE_PRCTL]: Provide fallback
        definitions for PR_SET_PTRACER and PR_SET_PTRACER_ANY constants,
        set all unused prctl arguments to 0.

2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: do not bail out in get_syscall_args if umove fails with EPERM.
        If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
        both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
        process dumpable flag is cleared, on ia64 this results to all syscall
        arguments being unavailable.

        Recognize this situation and do not treat it as get_syscall_args error
        because the latter leaves the tracee in a ptrace stop.

        This condition used to be triggered by prctl-dumpable test that caused
        strace to hang indefinitely.

        * linux/ia64/get_syscall_args.c (get_syscall_args): Do not bail out
        if umove fails.
        * tests/prctl-dumpable.c [__ia64__]: Skip the test.

2018-01-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: reset printing_tcp on print_event_exit.
        print_event_exit should have printing_tcp setup analogous to printleader and
        syscall_exit_trace before printing its part, otherwise it spuriously resets
        curcol in line_ended for the stale printing_tcp if followfork == 2.

        * strace.c (print_event_exit): Set printing_tcp to tcp before printing
        exiting event line and calling line_ended.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check path tracing of old select syscall.
        * tests/xselect.c [xselect] (xselect): Turn into prototype.
        * tests/oldselect-P.c: New file.
        * tests/oldselect-efault-P.c: Likewise.
        * tests/oldselect-efault.c: Likewise.
        * tests/oldselect.c: Use xselect.c
        * tests/pure_executables.list: Add oldselect-efault.
        * tests/gen_tests.in (oldselect, oldselect-P, oldselect-efault,
        oldselect-efault-P): New entries.
        * tests/oldselect.expected: Remove.
        * tests/oldselect.test: Remove.
        * tests/Makefile.am (check_PROGRAMS): Add oldselect-P
        and oldselect-efault-P.
        (DECODER_TESTS): Remove oldselect.test.
        (EXTRA_DIST): Remove oldselect.expected.
        * tests/.gitignore: Add oldselect-P, oldselect-efault,
        and oldselect-efault-P.

        tests: check path tracing of select/_newselect syscalls.
        * tests/xselect.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
        is not available.  Add test calls that use PATH_TRACING_FD.
        (main): Conditionalize expected output for those calls
        that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
        * tests/_newselect-P.c: New file.
        * tests/select-P.c: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add _newselect-P and select-P.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (_newselect-P, select-P): New entries.

        tests: extend the check of select/_newselect syscalls decoding.
        * tests/xselect.c: Rewrite for better coverage.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: redirect stdin to /dev/null.
        Ensure that stdin descriptor is not available for output
        by reopening it to input from /dev/null.

        * tests/run.sh: Redirect test's stdin to /dev/null.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add file:line to perror_msg_and_fail/error_msg_and_fail output.
        * tests/tests.h [!perror_msg_and_fail] (perror_msg_and_fail): New macro
        wrapper around the homonymous function.
        [!error_msg_and_fail] (error_msg_and_fail): Likewise.
        * tests/error_msg.c (perror_msg_and_fail, error_msg_and_fail): New
        macros defined to themselves.

        Rework decoding and pathtrace of old select syscall.
        * linux/arch_defs_.h [!HAVE_ARCH_OLD_SELECT] (HAVE_ARCH_OLD_SELECT): New
        macro.
        * linux/aarch64/arch_defs_.h (HAVE_ARCH_OLD_SELECT): Likewise.
        * linux/arm/arch_defs_.h: Likewise.
        * linux/bfin/arch_defs_.h: Likewise.
        * linux/i386/arch_defs_.h: Likewise.
        * linux/m68k/arch_defs_.h: Likewise.
        * linux/microblaze/arch_defs_.h: Likewise.
        * linux/powerpc64/arch_defs_.h: Likewise.
        * linux/sh/arch_defs_.h: Likewise.
        * linux/x32/arch_defs_.h: Likewise.
        * linux/x86_64/arch_defs_.h: Likewise.
        * linux/powerpc/arch_defs_.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * desc.c (SYS_FUNC(oldselect)): Rewrite using
        fetch_indirect_syscall_args, move under [HAVE_ARCH_OLD_SELECT].
        * pathtrace.c (match_xselect_args): New function.
        (pathtrace_match_set): Use it.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

        Transform fetch_old_mmap_args into fetch_indirect_syscall_args.
        As there are more than one old style syscall that take their arguments
        via array, generalize fetch_old_mmap_args into a function that could
        fetch variable number of arguments.

        * mem.c (fetch_old_mmap_args): Transform into ...
        * fetch_indirect_syscall_args.c: ... fetch_indirect_syscall_args
        in this new file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Remove.
        (fetch_indirect_syscall_args): New prototype.
        * pathtrace.c (pathtrace_match_set) [HAVE_ARCH_OLD_MMAP]: Use
        fetch_indirect_syscall_args instead of fetch_old_mmap_args.

2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        signal.c: remove excess semicolon after the end of the function.
        * signal.c (rt_sigtimedwait): Remove semicolon after the function body.

        Use char * for pointer arithmetics.
        * netlink_inet_diag.c (decode_inet_diag_req_compat,
        decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char *
        instead of void *.
        * netlink_netlink_diag.c (decode_netlink_diag_req,
        decode_netlink_diag_msg): Likewise.
        * netlink_packet_diag.c (decode_packet_diag_req,
        decode_packet_diag_msg): Likewise.
        * netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg):
        Likewise.
        * rtnl_addr.c (decode_ifaddrmsg): Likewise.
        * rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise.
        * rtnl_dcb.c (decode_dcbmsg): Likewise.
        * rtnl_link.c (decode_ifinfomsg): Likewise.
        * rtnl_mdb.c (decode_br_port_msg): Likewise.
        * rtnl_neigh.c (decode_ndmsg): Likewise.
        * rtnl_route.c (decode_rtmsg): Likewise.
        * rtnl_rule.c (decode_fib_rule_hdr): Likewise.
        * rtnl_tc.c (decode_tcmsg): Likewise.

2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        netlink_inet_diag.c: remove unnecessary return.
        decode_inet_diag_req, as well as the functions it calls, returns void.

        * netlink_inet_diag.c (decode_inet_diag_req): Do not return anything.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        Move decoder of getpagesize syscall to libstrace.
        As only five architectures have getpagesize syscall, moving the decoder
        to libstrace allows to get rid of getpagesize related ifdefs and check
        build of getpagesize decoder on other architectures.

        * mem.c (SYS_FUNC(getpagesize)): Move ...
        * getpagesize.c: ... to this new file.
        * Makefile.am (libstrace_a_SOURCES): Add it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mpers: implement gawk 3 support.
        Some old systems that still make some sense to be supported have only
        gawk 3, so let's support them for now.

        In order to achieve that, multiple changes have been implemented:
         - Multidimensional arrays are replaced with single-dimensional ones.
           In most places it's a "][" -> ", " replacement, as awk allows some
           kind of emulation of multidimensional arrays that way, but in several
           occasions (specifically for storing name and special fields) we have
           to iterate over them later, so we store that information in
           additional arrays in order to get the keys.
         - "switch" statements are replaced with sets of "if ... else if ...
           else" statements.  This change is trivial, except we've added
           a temporary variable in what_is order to store expression value, for
           readability purposes.
         - No support for array iteration ordering.  This one is most ugly of
           them all.  Luckily, not that ugly, we've just had to process index a
           bit in order to make it lexicographically sortable and add two
           temporary arrays containing sorted indices in order to sort over them
           instead of those two arrays that we've added in order to work around
           lack of multidimensional array support.

        * mpers.awk (compare_indices): Remove unused function.
        (array_get, update_upper_bound, /^DW_AT_data_member_location/,
        /^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array
        access with comma-concatenated index.
        (norm_idx): New function.
        (array_seq): Replace multidimensional array access with
        comma-concatenated index.  Use comma-concatenated pair of (array_idx,
        "seq") in order to check presence of the item in an array.
        (what_is): Add enc and i local variables.  Store the value of
        array[what_idx, "encoding"] in it.  Replace "switch" statements with
        sets of "if ... else if ... else" statements.  Replace multidimensional
        array access with comma-concatenated index. Use for (... ; ...; ...)
        iteration over aparents_keys instead of iteration over array.
        (/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]).  Replace
        multidimensional array access with comma-concatenated index.  Store an
        additional flag in array_names array.
        (/^DW_AT_name/): Replace multidimensional array access with
        comma-concatenated index.  Add a flag to array_names for that idx.
        (/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise
        the captured group.  Replace multidimensional array access with
        comma-concatenated index.
        (/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access
        with comma-concatenated index.  Store additional flags in
        array_special and array_parents arrays.
        (END): Remove PROCINFO["sorted_in"] setup.  Sort array_parents.  Replace
        multidimensional array access with comma-concatenated index.  Iterate
        over array_special to go over all the items that have "special" field.
        Iterate over array_names to go over all items that have "name" field.
        * NEWS: Mention it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        dm: add support for event_nr in DM_LIST_DEVICES result.
        Commit v4.13-rc1~137^2~13 (and a follow-up fix v4.14-rc4~20^2~3
        that changed alignment) introduced an additional hidden field
        in the structure returned by DM_LIST_DEVICES ioctl command
        that contains event_nr information.

        Unfortunately, we can't test it for now, but looks like it kinda works:

          # ./strace -v -eioctl -y dmsetup ls
          ioctl(3</dev/mapper/control>, DM_VERSION, {version=4.0.0,
          data_size=16384, flags=DM_EXISTS_FLAG} => {version=4.37.0,
          data_size=16384, flags=DM_EXISTS_FLAG}) = 0
          ioctl(3</dev/mapper/control>, DM_LIST_DEVICES, {version=4.0.0,
          data_size=16384, data_start=312, flags=DM_EXISTS_FLAG} =>
          {version=4.37.0, data_size=408, data_start=312, flags=DM_EXISTS_FLAG,
          {dev=makedev(253, 1), name="fedoratesting--30-swap", event_nr=0},
          {dev=makedev(253, 0), name="fedoratesting--30-root"}}) = 0
          fedoratesting--30-swap        (253:1)
          fedoratesting--30-root        (253:0)

        * dm.c (dm_decode_dm_name_list): Obtain the amount of bytes copied
        during printing device name, print event number if there's a suitable
        gap present and the DM version is high enough.
        * NEWS: Mention it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move definition of personality macros to arch_defs_.h.
        * supported_personalities.h: Remove.
        * defs.h: Do not include it.
        * linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New
        macro.
        [!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise.
        * linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro.
        * linux/riscv/arch_defs_.h: Likewise.
        * linux/s390x/arch_defs_.h: Likewise.
        * linux/sparc64/arch_defs_.h: Likewise.
        * linux/x32/arch_defs_.h: Likewise.
        * linux/x86_64/arch_defs_.h: Likewise.
        * linux/powerpc64/arch_defs_.h: New file.
        * linux/tile/arch_defs_.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        (strace_SOURCES): Remove supported_personalities.h.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce HAVE_ARCH_SA_RESTORER.
        In order to simplify HAVE_SA_RESTORER logic a bit.

        * linux/ia64/arch_defs_.h (HAVE_ARCH_SA_RESTORER): New macro.
        * linux/m68k/arch_defs_.h: Likewise.
        * linux/sparc/arch_defs_.h: Likewise.
        * linux/sparc64/arch_defs_.h: Likewise.
        * linux/hppa/arch_defs_.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * signal.c [HAVE_ARCH_SA_RESTORER]: Define HAVE_SA_RESTORER to it.
        [!HAVE_ARCH_SA_RESTORER && SA_RESTORER]: Define HAVE_SA_RESTORER to 1.
        [!HAVE_ARCH_SA_RESTORER && !SA_RESTORER]: Define HAVE_SA_RESTORER to 0.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        Replace NEED_UID16_PARSERS with HAVE_ARCH_UID16_SYSCALLS.
        * linux/arch_defs_.h [!HAVE_ARCH_UID16_SYSCALLS]
        (HAVE_ARCH_UID16_SYSCALLS): New macro.
        * linux/aarch64/arch_defs_.h (HAVE_ARCH_UID16_SYSCALLS): New macro.
        * linux/arm/arch_defs_.h: Likewise.
        * linux/i386/arch_defs_.h: Likewise.
        * linux/ia64/arch_defs_.h: Likewise.
        * linux/m68k/arch_defs_.h: Likewise.
        * linux/s390/arch_defs_.h: Likewise.
        * linux/s390x/arch_defs_.h: Likewise.
        * linux/sh/arch_defs_.h: Likewise.
        * linux/sparc/arch_defs_.h: Likewise.
        * linux/sparc64/arch_defs_.h: Likewise.
        * linux/syscall.h: Likewise.
        * linux/x32/arch_defs_.h: Likewise.
        * linux/x86_64/arch_defs_.h: Likewise.
        * linux/bfin/arch_defs_.h: New file.
        * linux/microblaze/arch_defs_.h: Likewise.
        * linux/riscv/arch_defs_.h: Likewise.
        * linux/sh64/arch_defs_.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * defs.h (NEED_UID16_PARSERS): Remove.
        * linux/syscall.h: Check for HAVE_ARCH_UID16_SYSCALLS instead of
        NEED_UID16_PARSERS.
        * uid.c: Likewise.

        Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2.
        * linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New
        macro.
        * linux/alpha/arch_defs_.h: New file.
        * linux/ia64/arch_defs_.h: Likewise.
        * linux/mips/arch_defs_.h: Likewise.
        * linux/sh/arch_defs_.h: Likewise.
        * linux/sparc/arch_defs_.h: Likewise.
        * linux/sparc64/arch_defs_.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * defs.h (HAVE_GETRVAL2): Remove.
        (getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks.
        * net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of
        HAVE_GETRVAL2.
        * syscall.c: Likewise.

        Use #if idiom instead of #ifdef for HAVE_ARCH_* macros.
        * linux/arch_defs_.h [!HAVE_ARCH_OLD_MMAP] (HAVE_ARCH_OLD_MMAP): New
        macro.
        [!HAVE_ARCH_OLD_MMAP_PGOFF] (HAVE_ARCH_OLD_MMAP_PGOFF): Likewise.
        * defs.h: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP.
        * mem.c: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP
        and HAVE_ARCH_OLD_MMAP_PGOFF
        * pathtrace.c: Likewise.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        Rename arch-specific arch_defs.h files to arch_defs_.h.
        Introduce a new arch_defs.h header that includes the corresponding
        arch-specific arch_defs_.h file followed by generic arch_defs_.h file.

        * linux/arch_defs.h: Rename to linux/arch_defs_.h.
        * linux/aarch64/arch_defs.h: Rename to linux/aarch64/arch_defs_.h.
        * linux/arm/arch_defs.h: Rename to linux/arm/arch_defs_.h.
        * linux/i386/arch_defs.h: Rename to linux/i386/arch_defs_.h.
        * linux/m68k/arch_defs.h: Rename to linux/m68k/arch_defs_.h.
        * linux/s390/arch_defs.h: Rename to linux/s390/arch_defs_.h.
        * linux/s390x/arch_defs.h: Rename to linux/s390x/arch_defs_.h.
        * linux/x32/arch_defs.h: Rename to linux/x32/arch_defs_.h.
        * linux/x86_64/arch_defs.h: Rename to linux/x86_64/arch_defs_.h.
        * arch_defs.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        (EXTRA_DIST): Rename linux/*/arch_defs.h to linux/*/arch_defs_.h.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix ANY_WORDSIZE_LESS_THAN_KERNEL_LONG definition.
        * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): Rewrite without undefined
        behaviour.

        Fixes: f916793 ("Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro")

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: return string size in printstr.
        As umovestr now returns something useful, let's propagate it further.

        * defs.h (printstr_ex, printpathn, printpath): Change return type from
        void to int.
        (printstrn, printstr): Change return type from void to int, return
        printstr_ex result.
        * util.c (printpathn): Return -1 on NULL addr, nul_seen (exit code of
        umovestr) on success.
        (printpath): Return printpathn result.
        (printstr_ex): Return -1 on NULL addr, umoven/umovestr result otherwise.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ucopy: return string size in umovestr.
        We return the size that includes \0 in order to preserve existing
        behaviour (return 0 when \0 haven't been seen, return positive number
        when it has been seen).

        * ucopy.c (umovestr_peekdata, umovestr): Return string length
        including \0 instead of 1 when \0 is found.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: avoid redefinition of mpers_ptr_t.
        Older versions of gcc like those found in RHEL6 fail with the following
        diagnostics:

          In file included from block.c:32:
          ./mpers-m32/struct_blk_user_trace_setup.h:2: error: redefinition of typedef ‘mpers_ptr_t’
          mpers_type.h:44: note: previous declaration of ‘mpers_ptr_t’ was here

        * mpers.awk (END): Add #ifndef guard to mpers_ptr_t typedef.
        * mpers_test.sh: Update expected output.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for --enable-mpers=m32|mx32.
        * configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values
        for --enable-mpers option.
        * m4/mpers.m4 (st_MPERS): Check for personality support if personality
        name is provided as an option.  Fail if the requested personality
        support is not available.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: improve setugid error diagnostics a bit.
        * tests/setugid.c (main): Print unexpected code returned by syscall.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: do not mpersify struct v4l2_create unless it is used by other code
        This fixes build with mpers support on older systems that lack
        definition of struct v4l2_create.

        * v4l2.c: Wrap references to struct v4l2_create with
        [VIDIOC_CREATE_BUFS].

2018-01-18  Dmitry V. Levin  <ldv@altlinux.org>

        btrfs: use uint32_t instead of __u32.
        * btrfs.c (btrfs_ioctl) [!HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE]:
        Replace __u32 with uint32_t.  Remove useless cast.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: clarify mpers flags in strace -V output.
        The previous description was a bit dated.

        * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove "no-m32" and
        "no-mx32", describe the situation when some of mpers flags are not
        present in strace -V output.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add compat support for s390x.
        By very popular demand.

        While we are here, let's refactor the condition for old_mmap_pgoff into
        an arch-specific one, as it is used more than in one place.

        * NEWS: Mention this.
        * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Likewise.
        * configure.ac (case "$host_cpu" in) <s390x>: Set arch_m32 to s390, set
        cc_flags_m32 to -m31.
        (st_MPERS([m32])): Add s390x.
        * defs.h [S390X]: Define NEED_UID16_PARSERS.
        * linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New
        macro, define to s390_frame_ptr.
        [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to
        __SIGNAL_FRAMESIZE.
        [!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long.
        (arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE
        instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type,
        respectively.
        * linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define
        * to s390_regset.
        (get_error): Use it instead of s390_regset.
        * linux/s390/get_scno.c (arch_get_scno): Likewise.
        * linux/s390/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/s390/set_scno.c (arch_set_scno): Likewise.
        * linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs,
        s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New
        variables.
        (s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET,
        ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE,
        ARCH_PERSONALITY_1_IOV_SIZE): New macros.
        * linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New
        prototypes.
        * linux/s390x/arch_rt_sigframe.c: Conditionalize on tcp->currpers.
        * linux/s390x/arch_sigreturn.c: Likewise.
        * linux/s390x/get_error.c: Likewise.
        * linux/s390x/get_scno.c: Likewise.
        * linux/s390x/get_syscall_args.c: Likewise.
        * linux/s390x/set_error.c: Likewise.
        * linux/s390x/set_scno.c: Likewise.
        * linux/s390x/errnoent1.h: New file.
        * linux/s390x/ioctls_arch1.h: Likewise.
        * linux/s390x/ioctls_inc1.h: Likewise.
        * linux/s390x/signalent1.h: Likewise.
        * linux/s390x/syscallent1.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add new files added to linux/s390x.
        * supported_personalities.h [S390X] (SUPPORTED_PERSONALITIES): Define
        to 2.
        * tests/strace-V.test: Add s390 to the list of architectures that have
        m32 personality.
        * linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New macro.
        * linux/s390x/arch_defs.h: Likewise.
        * mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF.
        * pathtrace.c: Likewise.

2018-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check path tracing of ppoll syscall.
        * tests/ppoll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
        is not available.  Add a test call that use PATH_TRACING_FD.
        (main): Conditionalize expected output for those calls
        that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
        * tests/ppoll-P.c: New file.
        * tests/pure_executables.list: Add ppoll-P.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (ppoll-P): New entry.

        tests: check path tracing of poll syscall.
        * tests/poll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
        is not available.  Add tests calls that use PATH_TRACING_FD.
        (main): Conditionalize expected output for those calls
        that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
        * tests/poll-P.c: New file.
        * tests/pure_executables.list: Add poll-P.
        * tests/.gitignore: Likewise.
        * tests/poll-P.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add poll-P.test.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: enable old_mmap-P.test on s390x.
        As s390x is the only 64-bit architecture that has old_mmap,
        the test needs some adjustments there.

        * tests/old_mmap.c: Update condition.
        (main): Change int types to long, extend numerals to 64 bit, change
        printing format qualifiers to corresponding long types.

        Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check path tracing of old mmap syscall.
        * tests/old_mmap.c [!TEST_FD]: Define TEST_FD.
        (main) <args1_c>: Replace 5th argument with TEST_FD.
        (main): Wrap the output for the calls that do not use TEST_FD
        with #ifndef PATH_TRACING.
        * tests/old_mmap-P.c: New file.
        * tests/pure_executables.list: Add old_mmap-P.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in: Add old_mmap-P test.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Fix pathtrace for old_mmap/old_mmap_pgoff.
        As these system calls have only one argument that points to the
        location in memory containing actual arguments, current path tracing
        implementation is incorrect.  In order to fix this, let's use recently
        introduced fetch_old_mmap_args in order to get actual arguments suitable
        for path matching.

        * pathtrace.c [HAVE_ARCH_OLD_MMAP] <case SEN_old_mmap,
        case SEN_old_mmap_pgoff>: Retrieve actual old_mmap arguments with
        fetch_old_mmap_args, pass the value from the retrieved args if it's
        available.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Test non-verbose old_mmap output.
        * tests/old_mmap-v-none.c: New file.  Include old_mmap.c.
        * tests/pure_executables.list: Add old_mmap-v-none.
        * tests/.gitignore: Likewise.
        * tests/gen_tests.in (old_mmap-v-none): New entry.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mem.c: use runtime check in fetch_old_mmap_args.
        This makes code a bit cleaner and makes it compatible with the upcoming
        s390x compat support.

        * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Replace
        ANY_WORDSIZE_LESS_THAN_KERNEL_LONG check with current_wordsize == 4
        check.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mem.c: introduce fetch_old_mmap_args.
        Move common old_mmap/old_mmap_pgoff argument fetching code into a
        separate function.

        As it is, it also fixes the case of non-verbose printing of old_mmap
        arguments (see the new test in the next commit).  Also, it is a
        preparation for the fix of path tracing for these syscalls.

        * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New prototype.
        * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New function.
        [HAVE_ARCH_OLD_MMAP] (old_mmap, old_mmap_pgoff): Use it.

        Fixes: 3db07f11 "Fix old_mmap output when mmap arguments are unfetchable"
        Suggested-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce arch-specific define HAVE_ARCH_OLD_MMAP.
        * linux/arch_defs.h: New file.
        * linux/aarch64/arch_defs.h: New file.  Define HAVE_ARCH_OLD_MMAP.
        * linux/arm/arch_defs.h: Likewise.
        * linux/i386/arch_defs.h: Likewise.
        * linux/m68k/arch_defs.h: Likewise.
        * linux/s390/arch_defs.h: Likewise.
        * linux/s390x/arch_defs.h: Likewise.
        * linux/x32/arch_defs.h: Likewise.
        * linux/x86_64/arch_defs.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * defs.h: Include "arch_defs.h"
        * mem.c: Replace condition for SYS_FUNC(old_mmap) with #ifdef
        HAVE_ARCH_OLD_MMAP.

        Suggested-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>
            Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        tests: improve descriptor set syntax testing.
        * tests/filtering_fd-syntax.test: New file.
        * tests/options-syntax.test: Move descriptor set syntax testing
        to filtering_fd-syntax.test.
        * tests/Makefile.am (MISC_TESTS): Add filtering_fd-syntax.test.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: print correct out file name in error messages in case of -ff.
        * strace.c (outf_perror): New function.
        (tvprintf, tprints, flush_tcp_output): Use it.

        aarch64: use ARCH_SET_PERSONALITY_FROM_IOV_SIZE.
        * linux/aarch64/arch_regs.c (ARCH_PERSONALITY_0_IOV_SIZE,
        ARCH_PERSONALITY_1_IOV_SIZE): New macros.
        * linux/aarch64/get_scno.c (arch_get_scno): Do not call
        update_personality as it is handled by the generic get_regs code now.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: add ability to set personality based on GETREGSET iov size.
        Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface
        and use its size to detect current personality. Let's generalise this
        approach and also avoid subtle errors when we get register but forget to
        update personality, at least for those architectures.

        Note that in order to employ this behaviour, architecture has to use
        PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare
        appropriate ARCH_PERSONALITY_*_IOV_SIZE macros.

        * syscall.c (get_regs) [ptrace_getregset_or_getregs &&
        !HAVE_GETREGS_OLD]: Call update_personality based on the value returned
        in the iov_len field by PTRACE_GETREGSET.  Warn once if the returned
        iov_len is unknown.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: add sanity check for the target personality number.
        We can never be cautious enough.

        * defs.h (set_personality): Change argument type to unsigned int.
        * syscall.c (set_personality): Change argument type to unsigned int,
        check whether requested personality is sane, die otherwise.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: move current_personality check to set_personality.
        As all the personality-dependent entries are initially in sync, we can
        move the check whether we are setting the same personality as we
        currently are inside set_personality out of update_personality.

        * syscall.c (current_wordsize, current_klongsize): Initialise to 0'th
        personality value in order to make the statement about "all the
        personality-dependent entries are initially in sync" true.
        (set_personality): Check whether requested personality differs from
        current_personality.
        (update_personality): Call set_personality unconditionally.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: always update tcp->currpers in update_personality.
        Sometimes (for example, switching from a process with one personality
        to a process that previously had different personality but returning
        from execve to that same personality into) it is possible that
        current_personality is not changed, but tcp->currpers is different.
        So, let's not return from update_personality and always update
        tcp->currpers if it differs from the target personality.

        * syscall.c (update_personality): Do not exit early if personality ==
        current_personality.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update current_personality on tcb switch.
        * strace.c (set_current_tcp): New function.
        (printleader, droptcb, print_event_exit, next_event, dispatch_event):
        Call set_current_tcp instead of setting current_tcp manually.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for specifying compiler options for mpers builds.
        Because some architectures are very, very special.

        * configure.ac (cc_flags_m32, cc_flags_mx32): New variables. AC_SUBST
        them.
        * m4/mpers.m4 (MPERS_CFLAGS): Use instead of CFLAG, pushdef as
        $cc_flags_$1.
        Use mpers_name instead of CFLAG in AC_CACHE_CHECK messages.
        Pass MPERS_CFLAGS as the second argument to mpers_test.sh
        * mpers.sh: Add CC_ARCH_FLAGS as the second argument (PARSER_FILE
        is moved to the third one). Do not expect leading dash in ARCH_FLAG
        anymore.
        * mpers_test.sh (mpers_cc_flags): New variable, initialise to the second
        command line argument.
        Pass $mpers_name without leading dash to mpers.sh.
        Pass $mpers_cc_flags as the second argument to mpers.sh ($sample is
        the third argument now).
        * Makefile.am (mpers-m%.stamp:): Pass $(mpers_CC_FLAGS) as the second
        argument to mpers.sh ($$f is now the third argument).
        ($(mpers_m32_targets)): Define target variable mpers_CC_FLAGS with the
        value of @cc_flags_m32@
        ($(mpers_mx32_targets)): Define target variable mpers_CC_FLAGS with the
        value of @cc_flags_mx32@
        * tests/Makefile.am (MERS_CC_FLAGS): New variable.
        * bootstrap: Append @cc_flags_$1@ to MPERS_CC_FLAGS. Append
        $(MPERS_CC_FLAGS) to ARCH_MFLAGS.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>
            Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        tests: improve syscall set syntax testing.
        * tests/filtering_syscall-syntax.test: New file.
        * tests/options-syntax.test: Move syscall set syntax testing
        to filtering_syscall-syntax.test.
        * tests/qual_fault-syntax.test: Likewise.
        * tests/qual_inject-syntax.test: Likewise.
        * tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance error diagnostics about invalid syscalls in fault injection syntax
        Validate syscall set before the whole fault injection syntax.

        * filter_qualify.c (parse_inject_expression): Add const qualifier to
        return type.  Return an empty string when no syscall set is specified.
        (qualify_inject_common): Add const qualifier to "name".  Move
        qualify_syscall_tokens invocation right after parse_inject_expression.
        * tests/qual_fault-syntax.test: Update expected output.
        * tests/qual_inject-syntax.test: Likewise.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>

        basic_filters: use loop initial declarations.
        * basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
        lookup_class, qualify_syscall_class, qualify_syscall_tokens,
        qualify_tokens): Use "for" loop initial declarations.

        filter_qualify: use loop initial declarations.
        * filter_qualify.c (sigstr_to_uint, find_errno_by_name,
        parse_inject_expression, qualify_inject_common, qualify): Use "for" loop
        initial declarations.

        configure: try to set the C compiler mode to accept ISO Standard C.
        * configure.ac: Use AC_PROG_CC_STDC.
        * NEWS: Mention this.

2018-01-15  Dmitry V. Levin  <ldv@altlinux.org>

        pathtrace: update the list of unrelated syscalls.
        * pathtrace.c (pathtrace_match_set) <SEN_accept4, SEN_accept,
        SEN_signalfd4, SEN_signalfd>: Skip matching.

        basic_filters: move legacy tracing class names to the end of table.
        * basic_filters.c (lookup_class) <syscall_class>: Move names that do not
        start with % to the end of table.

        Enhance decoding of mq_* syscalls.
        * mq.c (SYS_FUNC(mq_open)): Add RVAL_FD to return value.
        (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive), SYS_FUNC(mq_notify),
        SYS_FUNC(mq_getsetattr)): Print the first argument using printfd.
        * NEWS: Mention this change.
        * pathtrace.c (pathtrace_match_set) <SEN_mq_getsetattr, SEN_mq_notify,
        SEN_mq_open, SEN_mq_timedreceive, SEN_mq_timedsend>: Skip matching.
        * linux/32/syscallent.h (mq_getsetattr, mq_notify, mq_open,
        mq_timedreceive, mq_timedsend): Add TD flag.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

        Enhance error diagnostics about invalid syscalls in fault injection syntax
        * basic_filters.c (qualify_syscall_tokens): Remove "name" argument,
        assume its value is "system call".
        * filter.h (qualify_syscall_tokens): Remove "name" argument.
        All callers updated.
        * tests/qual_fault-syntax.test: Update expected output.

        basic_filters: handle "all" in a more readable way.
        * basic_filters.c (qualify_syscall_tokens, qualify_tokens): Remove
        handle_inversion label, handle "all" by invoking invert_number_set_array
        directly.

        filter: remove redundant braces around single line expressions.
        * basic_filters.c (qualify_syscall_class, qualify_syscall_name):
        Rearrange the inner loop body.
        (qualify_syscall_number, lookup_class, qualify_syscall_tokens,
        qualify_tokens): Remove redundant braces around single line expressions.
        * filter_qualify.c (qualify_inject_common): Likewise.

        filter_qualify: move memory allocation from parse_inject_expression.
        * filter_qualify.c (parse_inject_expression): Replace "s" and "buf"
        arguments with "str" argument, use it instead of "s" and "*buf".
        (qualify_inject_common): Rename "buf" to "copy", initialize it to a copy
        of "str", pass "copy" to parse_inject_expression instead of "str" and
        "buf".

2018-01-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update NT_* constants.
        Update NT_* descriptor types with the values borrowed from
        kernel's include/uapi/linux/elf.h and glibc's elf.h.

        * xlat/nt_descriptor_types.in (NT_PRSTATUS, NT_FPREGSET, NT_PRPSINFO,
        NT_PRXREG, NT_TASKSTRUCT, NT_PLATFORM, NT_AUXV, NT_GWINDOWS, NT_ASRS,
        NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS,
        NT_LWPSINFO, NT_PRFPXREG, NT_PRXFPREG, NT_PPC_VMX, NT_PPC_SPE,
        NT_PPC_VSX, NT_386_TLS, NT_386_IOPERM, NT_X86_XSTATE): Add fallback
        definitions.
        (NT_SIGINFO, NT_FILE, NT_PPC_*, NT_S390_*, NT_ARM_*, NT_METAG_*,
        NT_ARC_V2): New constants.
        * NEWS: Mention this.

2018-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        configure: use AC_MSG_ERROR and AC_MSG_FAILURE consistently.
        * configure.ac [$arch = mips]: Use AC_MSG_FAILURE instead of
        AC_MSG_ERROR when _MIPS_SIM cannot be determined.  Use AC_MSG_ERROR
        instead of AC_MSG_FAILURE when syscallent stubs cannot be generated.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        configure: add --disable-mpers and --enable-mpers=check options.
        On architectures supporting multiple personalities, multiple
        personalities support in strace is required for proper decoding of
        structures used by tracees with personalities that differ from the
        personality of strace.

        New configure options control whether multiple personalities support
        in strace is mandatory, optional, or disabled.

        The default is changed from what is now equivalent of
        --enable-mpers=check (automatically detect whether required mpers
        support could be enabled) to --enable-mpers (terminate the build
        if required mpers support could not be enabled).

        * configure.ac (AC_ARG_ENABLE([mpers])): New option.
        * m4/mpers.m4 (st_MPERS): Use enable_mpers.  Terminate the build
        if mpers could not be enabled and enable_mpers==yes.
        * strace.spec.in: Specify --enable-mpers=check to %configure.
        * debian/rules (build/Makefile, build64/Makefile): Specify
        --enable-mpers=check to configure.

        Suggested-by: DJ Delorie <dj@redhat.com>

2018-01-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.15-rc7.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 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.
        * NEWS: Mention this.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Issue a warning when strace lacks tracee personality support.
        * defs.h (HAVE_PERSONALITY_1_MPERS, HAVE_PERSONALITY_2_MPERS): New
        macros.
        * syscall.c (update_personality): Add need_mpers_warning array
        initialized with mpers support data.  Use it for printing the mpers
        unavailability warning once per personality.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more checks of reboot syscall decoding.
        In particular, check for the recent fixes in reboot syscall decoder.

        * tests/gen_tests.in (reboot): Provide -s 256 option.
        * tests/reboot.c (STR32, STR128): New macros.
        (main): Add more checks.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use sprintrc in reboot.test.
        * test/reboot.c (main): Use sprintrc instead of old-style manual
        printing of return code.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        reboot.c: limit printing of the fourth argument to 255 bytes.
        The size of kernel buffer is 256 bytes and the last byte is always zero.

        * reboot.c (SYS_FUNC(reboot)): Replace printstr call with printstr_ex
        with size of 255 and style flag QUOTE_0_TERMINATED.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        reboot.c: use printxval instead of printflags.
        Numeric arguments of reboot syscall are not flags but magic values.

        * reboot.c (SYS_FUNC(reboot)): Replace printflags with printxval.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Search for <libiberty/demangle.h> in addition to <demangle.h>
        This is the location where this header is installed on Debian-based
        systems.

        * configure.ac: Check for libiberty/demangle.h in addition to
        demangle.h.
        * unwind.c [USE_DEMANGLE]: Include either <demangle.h> or
        <libiberty_demangle.h> based on the presence of HAVE_DEMANGLE_H and
        HAVE_LIBIBERTY_DEMANGLE_H macros.

2018-01-11  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix typo.
        * strace.1.in (.SH NOTES): Replace prlimit with prlimit64.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Document multiple personalities support.
        * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): New section.

        Add indication of mpers support to strace -V output.
        * strace.c (print_version): Append information about m32 and mx32
        decoding support.
        * tests/strace-V.test: Update expected output.

        Provide strace's native arch to the test framework.
        * configure.ac (arch_native): New variable, set to arch.
        * tests/Makefile.am (NATIVE_ARCH): New variable, set to @arch_native@.
        (AM_TEST_LOG_FLAGS): Pass NATIVE_ARCH as STRACE_NATIVE_ARCH environment
        variable.

        Add indication of optional demangle feature strace -V output.
        * strace.c (print_version) [USE_DEMANGLE]: Append " stack-demangle"
        to the features string.
        * tests/strace-V.test: Update expected output.

        configure.ac: check for mpers support on RISC-V.
        * confgure.ac (st_MPERS([m32])): Add riscv.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Use xappendstr instead of xsnprintf where suitable.
        Replace occurrences of

            outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...)

        with much more sleek

            outptr = xappendstr(outstr, outptr, ...)

        * desc.c (decode_select): Replace xsnprintf with xappendstr.
        * open.c (sprint_open_modes): Likewise.
        * poll.c (decode_poll_exiting): Likewise.
        * signal.c (sprintsigmask_n): Likewise.
        * xlat.c (sprintflags): Likewise.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xstring.h: add xappendstr.
        Introduce a macro for handling common case of partial writes
        to a character array.

        * xstring.h (get_pos_diff_): New function.
        (xappendstr): New macro.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update perf-related flags.
         - PERF_SAMPLE_BRANCH_TYPE_SAVE, added in v4.14-rc1~173^2~33^2~6
         - PERF_SAMPLE_PHYS_ADDR, added in v4.14-rc1~173^2~2

        * xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_TYPE_SAVE): New
        flag.
        * xlat/perf_event_sample_format.in (PERF_SAMPLE_PHYS_ADDR): Likewise.
        * tests/perf_event_open.c: Update expected output.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        perf.c: add support for struct perf_event_attr.namespaces.
        This field was introduced by linux kernel commit v4.12-rc1~152^2~42^2~10.

        * configure.ac (AC_CHECK_MEMBERS): Add  perf_event_attr.namespaces.
        * perf_event_struct.h (struct perf_event_attr): Add namespaces field.
        * perf.c (print_perf_event_attr): Print namespaces field.
        Update comment for __reserved_1 field.
        * tests/perf_event_open.c (struct pea_flags): Add namespaces field.
        (print_event_attr): Update expected output.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of [gs]et_thread_area syscalls on x86.
        * tests/xet_thread_area_x86.c: New file.
        * tests/xet_thread_area_x86.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add it.
        * tests/.gitignore: Add xet_thread_area_x86.
        * tests/pure_executables.list: Likewise.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of modify_ldt with for 4-byte-available user_desc.
        Since there is possibility now that strace read only entry_number field
        of the user_desc struct, let's check that it doesn't do it with
        modify_ldt syscall.

        * tests/modify_ldt.c (main): Add 4-byte-sized tail_alloc'ed variable.
        Try to provide it as an argument to modify_ldt.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Allow separate printing of struct user_desc.entry_number.
        Kernel reads only entry_number field in the beginning of the
        get_thread_area syscall handler.  Let's replicate this behaviour.

        * defs.h (enum user_desc_print_filter): New enumeration.
        (print_user_desc): Add an argument for signalling which part of the
        structure should be printed.
        * clone.c (print_tls_arg): Update print_user_desc call.
        * ldt.c (print_user_desc): Add filter argument.  Print entry_number on
        entering and the rest on exiting. Store entering value of the
        entry_number field in order to print the updated value in the impossible
        case of changed entry_number value.
        (SYS_FUNC(modify_ldt), SYS_FUNC(set_thread_area)): Update
        print_user_desc call.
        (SYS_FUNC(get_thread_area)): Call print_user_desc with
        USER_DESC_ENTERING format argument on entering and with
        USER_DESC_EXITING on exiting.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move struct user_desc printing function into a separate file.
        As part of preparation for the introduction of [gs]et_thread_area test.

        * tests/modify_ldt.c (print_user_desc): Move it ...
        * tests/print_user_desc.c: ... to new file.
        * tests/Makefile.am (EXTRA_DIST): Add print_user_desc.c.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of modify_ldt syscall.
        * tests/modify_ldt.c: New file.
        * tests/gen_tests.in: Add modify_ldt test.
        * tests/pure_executables.list: Add modify_ldt.
        * tests/.gitignore: Likewise.

        ldt.c: manually set modify_ldt's error code.
        * ldt.c (modify_ldt): Move parsing under entering(tcp). Check whether
        return code is erroneous and set tcp->u_error appropriately along with
        RVAL_PRINT_ERR_VAL flag.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall.c: add support for printing return value and error code.
        Some weird syscalls (like modify_ldt) return value that doesn't indicate
        an error (less than -4096), but it is, in fact, erroneous (because they
        decide to clip the return value to 32-bit, for example).

        Add a flag to print decoded error code along with syscall return value.

        * defs.h (RVAL_PRINT_ERR_VAL): New rval flag.
        * syscall.c (syscall_exiting_trace): Handle it.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ldt.c: print the first argument of modify_ldt as int.
        * ldt.c (SYS_FUNC(modify_ldt)): Print the first argument as %d.

        ldt.c: print lm field for 64-bit tracees.
        * configure.ac (AC_CHECK_MEMBERS): Add struct user_desc.lm.
        * ldt.c (print_user_desc) [HAVE_STRUCT_USER_DESC_LM]: Print lm field
        for non-compat tracees (it is ignored for compat ones).

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ldt.c: make struct user_desc output more structured.
        Also, while we are here, let's fix print qualifiers (which should be %u
        and not %d).

        * ldt.c (print_user_desc): Use PRINT_FIELD_* macros for printing
        structure.
        (SYS_FUNC(set_thread_area)): Change field key-value separator from ":"
        to "=", change print format qualifier from %d to %u.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: add PRINT_FIELD_U_CAST.
        Add a macro for printing fields explicitly casted to specific type.
        This is useful for bit fields, as otherwise the magic of *_extend_to_*
        macros breaks.

        * print_field.h (PRINT_FIELD_U_CAST): New macro.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_fields.h: rename PRINT_FIELD_UID to PRINT_FIELD_ID.
        As uid is not the only thing that has a special treatment of the -1
        value (and, as a result, needs special care), let's rename
        PRINT_FIELD_UID to PRINT_FIELD_ID and make PRINT_FIELD_UID its alias.

        * print_fields.h (PRINT_FIELD_ID): Rename from PRINT_FIELD_UID.
        (PRINT_FIELD_UID): Define to PRINT_FIELD_ID.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems without linux/genetlink.h.
        * socketutils.c [!HAVE_LINUX_GENETLINK_H] (genl_families_xlat): Add
        tcp argument.

        Fixes: v4.20-134-gc46fefc ("Add tcp arguments to netlink calls")

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count.c: whitespace.

        count.c: cleanup types and sizeof usage.
        * count.c (call_summary_pers): Change the type of sorted_count
        to "unsigned int *".  Replace sizeof(int) with  sizeof(sorted_count[0]).
        Change the type of idx to unsigned int.

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count.c: collect definitions of format strings in one place.
        In an attempt to make it more readable.

        * count.c (call_summary_pers): Put all format strings in static
        constants. Use them.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        Add tcp arguments to netlink calls.
        Since they call tracee-specific socket/sendmsg/recvmsg, we'd like to
        pass tcp there.

        * defs.h (genl_families_xlat): Add tcp argument.
        * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_generic,
        decode_nlmsg_type_netfilter, typedef nlmsg_types_decoder_t): Likewise.
        (decode_nlmsg_type): Add tcp argument. Pass tcp to decoder call.
        (print_nlmsghdr): Pass tcp to the decode_nlmsg_type call.
        * socketutils.c (send_query, receive_responses): Add tcp argument.
        (inet_send_query, unix_send_query, netlink_send_query, ): Add tcp argument.
        Pass tcp to the send_query call.
        (unix_get): Add tcp argument. Pass tcp to the unix_send_query and
        receive_responses calls.
        (inet_get): Add tcp argument. Pass tcp to the inet_send_query and
        receive_responses calls.
        (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Add tcp argument. Pass
        tcp to the inet_get call.
        (netlink_get): Add tcp argument. Pass tcp to the netlink_send_query and
        receive_responses calls.
        (protocols): Add tcp argument to the get field.
        (get_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
        the protocols[].get calls.
        (print_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
        the get_sockaddr_by_inode_uncached call.
        (get_sockaddr_by_inode): Pass tcp to the get_sockaddr_by_inode_uncached
        call.
        (print_sockaddr_by_inode): Pass tcp to the
        print_sockaddr_by_inode_uncached call.
        (genl_send_dump_families): Add tcp argument. Pass tcp to the send_query
        call.
        (genl_families_xlat): Add tcp argument. Pass tcp to the
        genl_send_dump_families and receive_responses calls.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        Add tcp argument to clear_regs.
        * defs.h (clear_regs): Add argument struct tcb *tcp.
        * syscall.c (clear_regs): Likewise.
        * strace.c (next_event): Pass tcp to clear_regs() call.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        Pass tcp argument to get_optmem_max/read_int_from_file.
        In preparation to passing tcp to all tracee-related syscalls.

        * defs.h (read_int_from_file): Add "struct tcb *" as the first argument.
        * util.c (read_int_from_file): Likewise.
        * msghdr.c (get_optmem_max): Add "struct tcb *tcp" as the first
        argument, pass it to read_int_from_file call.
        (decode_msg_control): Pass tcp to get_optmem_max.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        Include paths.h if it is available.
        Use the OS definition of _PATH_BSHELL macro if it is available.

        * configure.ac (AC_CHECK_HEADERS): Add paths.h.
        * strace.c [HAVE_PATHS_H]: Include paths.h.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: avoid duplication of a format string in attach_tcb.
        * strace.c (attach_tcb): Add task_path variable with the output format.
        Use it for the procdir declaration and xsprintf format string argument.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

        Move syscall_tampered to defs.h.
        * syscall.c (syscall_tampered): Move ...
        * defs.h: ... here.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

        strace.c: rename set_sigaction to set_sighandler.
        Since set_sigaction() actually specifies sa_handler and not sa_sigaction,
        rename set_sigaction() to set_sighandler() for future definition of
        set_sigaction() function as specifying sa_sigaction.

        * strace.c (set_sigaction): Rename to set_sighandler.
        All callers updated.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

        .gitignore: ignore "gnu" directory created by st_MPERS m4 macro.

        Update .mailmap.
        * .mailmap (Elvira Khabirova): Add @altlinux.org.

2018-01-07  Chen Jingpiao  <chenjingpiao@gmail.com>

        .mailmap: add canonical name for Chen Jingpiao.
        * .mailmap: Add canonical name for Chen Jingpiao.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        personality.c: use sprintxval.
        * personality.c (SYS_FUNC(personality)): Use sprintxval instead of local
        implementation.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

        xlat.c: add sprintxval for printing xval to string.
        * defs.h (sprintxval): New declaration.
        (sprintxval): New function.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        desc.c: use xsnprintf instead of sprintf.
        * desc.c: Include "xstring.h".
        (decode_select): Replace sprintf with xsnprintf.

        xlat.c: use xsnprintf instead of sprintf.
        * xlat.c: Include "xstring.h".
        (sprintflags): Replace sprintf with xsnprintf.

        open.c: use xsnprintf instead of sprintf.
        * open.c: Include "xstring.h".
        (sprint_open_modes): Replace sprintf with xsnprintf.

        poll.c: use xs*printf instead of sprintf.
        * poll.c: Include "xstring.h".
        (decode_poll_exiting): Replace sprintf with xsnprintf and xsprintf.

        signal.c: use xs*printf instead of sprintf.
        * signal.c: Include "xstring.h".
        (signame): Replace sprintf with xsprintf.
        (sprintsigmask_n): Replace sprintf with xsnprintf.

        print_timeval.c: use xsprintf instead of snprintf.
        * print_timeval.c: Include "xstring.h".
        (sprint_timeval, sprint_timeval32): Replace snprintf with xsprintf.

        print_timespec.c: use xsprintf instead of snprintf.
        * print_timespec.c: Include "xstring.h".
        (sprint_timespec): Replace snprintf with xsprintf.

        mmsghdr.c: use xsprintf instead of snprintf.
        * mmsghdr.c: Include "xstring.h".
        (SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf.

        socketutils.c: use xsprintf instead of snprintf.
        * socketutils.c: Include "xstring.h".
        (unix_parse_response): Replace snprintf with xsprintf.

        alpha.c: use xsprintf instead of snprintf.
        * alpha.c: Include "xstring.h".
        (decode_getxxid): Replace snprintf with xsprintf.

        v4l2.c: use xsprintf instead of sprintf.
        * v4l2.c: Include "xstring.h".
        (print_v4l2_create_buffers): Replace sprintf with xsprintf.

        util.c: use x*sprintf instead of s*printf.
        * util.c: Include "xstring.h".
        (sprinttime_ex): Replace snprintf with xsnprintf.
        (getfdproto): Replace sprintf with xsprintf.

        unwind.c: use xsprintf instead of sprintf.
        * unwind.c: Include "xstring.h".
        (build_mmap_cache): Replace sprintf with xsprintf.

        syscall.c: use xsprintf instead of sprintf.
        * syscall.c: Include "xstring.h".
        (get_scno): Replace sprintf with xsprintf.

        resource.c: use xsprintf instead of sprintf.
        * resource.c: Include "xstring.h".
        (sprint_rlim64, sprint_rlim32): Replace sprintf with xsprintf.

        pathtrace.c: use xsprintf instead of sprintf.
        * pathtrace.c: Include "xstring.h".
        (getfdpath): Replace sprintf with xsprintf.

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ldt.c: replace sprintf with xsprintf.
        * ldt.c: Include "xstring.h".
        (SYS_FUNC(set_thread_area)): Replace sprintf with xsprintf.

2018-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        strace.c: use xsprintf instead of sprintf.
        * strace.c: Include "xstring.h".
        (strerror, newoutf, attach_tcb, print_debug_info): Replace sprintf
        with xsprintf.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioprio.c: use xsprintf instead of sprintf.
        * ioprio.c: Include "xstring.h".
        (sprint_ioprio): Replace sprintf with xsprintf.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce hardened xsprintf/xsnprintf macros.
        Let's try to future/fool-proof code a bit by introducing variants
        of sprintf/snprintf that die if an overflow (or an error) occurs.
        They are deemed to be the default choice for printing to some local
        string buffer where no sensible error handling is implemented.

        * xstring.h: New file.
        * Makefile.am (strace_SOURCES): Add it.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count.c: use %9.u conversion specification.
        Instead of printing to a temporary string.  This also fixes a subtle bug
        when the output for a billion errors and more is cut and shown
        incorrectly.

        * count.c (struct call_counts): Change type of calls and errors fields
        to unsigned int since they are used and printed as unsigned anyway.
        (call_summary_pers): Remove error_str.  Print cc->errors
        and error_cum using %9.u conversion specification.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        count.c: use personality_names in call_summary report caption.
        Otherwise the title is quite misleading for x32 personality.

        * count.c (call_summary): Use personality_names.

2018-01-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Move personality names to a global variable.
        This is a part of "Prepare for adding support for Lua scripting"
        commit.

        * defs.h (personality_names): New external constant declaration.
        * syscall.c: (personality_names): New global variable.
        (update_personality): Use personality_names for reporting personality
        name.

        Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-01-04  Lubomir Rintel  <lkundrak@v3.sk>

        strace.spec.in: include Bluetooth headers for AF_BLUETOOTH sockets decoding
        * strace.spec.in (BuildRequires): Add pkgconfig(bluez).

2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        Lift artificial limit on output file names in -ff mode.
        Starting with commit v4.5.19~88 strace imposed an artificial limit
        on output file names in -ff mode, leading to the following absurd
        behaviour:

        $ strace -ff -o"$(perl -e 'print "/" x 510')/$PWD/log" /bin/true
        strace: Can't fopen '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.12345': Permission denied

        * strace.c (newoutf): Raise buffer size to PATH_MAX.
        (init) <followfork >= 2>: Check output file name prefix length.
        * tests/options-syntax.test: Check it.

2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: fix typo.
        * configure.ac: Replace CPPFALGS with CPPFLAGS.

        Fixes: v4.20-85-gf9c8e8a ("unwind: demangle symbol names")

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

        Change the first argument of upeek from pid to tcp.
        All users were changed automatically by:

                for i in `git grep -l 'upeek(tcp->pid'`; do \
                        sed -i 's/upeek(tcp->pid/upeek(tcp/g' "$i"; \
                done

        * upeek.c (upeek): Change the first argument from pid_t pid to struct
        tcb *tcp. Use tcp->pid instead of pid in the function's body.
        * defs.h (upeek): Update declaration.
        * linux/alpha/arch_getrval2.c: Pass tcp instead of tcp->pid to the
        upeek calls.
        * linux/alpha/arch_rt_sigframe.c: Likewise.
        * linux/alpha/arch_sigreturn.c: Likewise.
        * linux/alpha/get_scno.c: Likewise.
        * linux/alpha/get_syscall_args.c: Likewise.
        * linux/alpha/get_syscall_result.c: Likewise.
        * linux/bfin/arch_rt_sigframe.c: Likewise.
        * linux/bfin/get_scno.c: Likewise.
        * linux/bfin/get_syscall_args.c: Likewise.
        * linux/bfin/get_syscall_result.c: Likewise.
        * linux/crisv10/arch_rt_sigframe.c: Likewise.
        * linux/crisv10/get_scno.c: Likewise.
        * linux/crisv10/get_syscall_args.c: Likewise.
        * linux/crisv10/get_syscall_result.c: Likewise.
        * linux/hppa/arch_rt_sigframe.c: Likewise.
        * linux/hppa/get_scno.c: Likewise.
        * linux/hppa/get_syscall_args.c: Likewise.
        * linux/hppa/get_syscall_result.c: Likewise.
        * linux/microblaze/arch_rt_sigframe.c: Likewise.
        * linux/microblaze/arch_sigreturn.c: Likewise.
        * linux/microblaze/get_scno.c: Likewise.
        * linux/microblaze/get_syscall_args.c: Likewise.
        * linux/microblaze/get_syscall_result.c: Likewise.
        * linux/powerpc/getregs_old.c: Likewise.
        * linux/sh/arch_getrval2.c: Likewise.
        * linux/sh/arch_rt_sigframe.c: Likewise.
        * linux/sh/get_scno.c: Likewise.
        * linux/sh/get_syscall_args.c: Likewise.
        * linux/sh/get_syscall_result.c: Likewise.
        * linux/sh64/get_scno.c: Likewise.
        * linux/sh64/get_syscall_args.c: Likewise.
        * linux/sh64/get_syscall_result.c: Likewise.
        * linux/xtensa/arch_rt_sigframe.c: Likewise.
        * linux/xtensa/get_scno.c: Likewise.
        * linux/xtensa/get_syscall_args.c: Likewise.
        * linux/xtensa/get_syscall_result.c: Likewise.
        * syscall.c: Likewise.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

        Change argument of getregs_old from pid to tcp.
        * linux/powerpc/getregs_old.c (getregs_old): Change the first argument
        from pid_t pid to struct tcb *tcp. Replace all instances of pid with
        tcp->pid.
        * linux/x86_64/getregs_old.c (getregs_old): Likewise.
        * linux/x86_64/getregs_old.h (getregs_old): Update declaration.
        * syscall.c (get_regs) [HAVE_GETREGS_OLD]: Pass tcp to the getregs_old
        call instead of tcp->pid.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

        Change the first argument of upoke from pid to tcp.
        Users were updated automatically by:

                for i in `git grep -l 'upoke(tcp->pid'`; do \
                        sed -i 's/upoke(tcp->pid/upoke(tcp/g' "$i"; \
                done

        * upoke.c (upoke): Change the first argument from pid_t pid to struct
        tcb *tcp. Use tcp->pid instead of pid in the function's body.
        * defs.h (upoke): Update declaration.
        * linux/alpha/set_error.c (arch_set_error, arch_set_success): Provide
        tcp in the first argument of the upoke call instead of tcp->pid.
        * linux/alpha/set_scno.c (arch_set_scno): Likewise.
        * linux/bfin/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/bfin/set_scno.c (arch_set_scno): Likewise.
        * linux/crisv10/set_error.c (arch_set_error, arch_set_success):
        Likewise.
        * linux/crisv10/set_scno.c (arch_set_scno): Likewise.
        * linux/hppa/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/hppa/set_scno.c (arch_set_scno): Likewise.
        * linux/i386/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/i386/set_scno.c (arch_set_scno): Likewise.
        * linux/microblaze/set_error.c (arch_set_error, arch_set_success):
        Likewise.
        * linux/microblaze/set_scno.c (arch_set_scno): Likewise.
        * linux/powerpc/set_error.c (arch_set_error, arch_set_success):
        Likewise.
        * linux/powerpc/set_scno.c (arch_set_scno): Likewise.
        * linux/sh/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/sh/set_scno.c (arch_set_scno): Likewise.
        * linux/sh64/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/sh64/set_scno.c (arch_set_scno): Likewise.
        * linux/x86_64/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/x86_64/set_scno.c (arch_set_scno): Likewise.
        * linux/xtensa/set_error.c (arch_set_error, arch_set_success): Likewise.
        * linux/xtensa/set_scno.c (arch_set_scno): Likewise.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

        Move enum trace_event into a separate header.
        As it will have users outside strace.c in the future.

        * trace_event.h (enum trace_event): Move it from...
        * strace.c (enum trace_event): ...here.
        (#include "trace_event.h"): New header, for enum trace_event.
        * Makefile.am (strace_SOURCES): Add trace_event.h.

2018-01-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Call get_scno during startup_tcb only for forcibly attached processes.
        Otherwise it makes little sense on most arches to try to get syscall
        number.

        * defs.h (TCB_GRABBED): New tcb flag.
        * strace.c (attach_tcb): Set TCB_GRABBED for the tcb.
        (startup_tcb): Call get_scno() only if process is grabbed and its
        registers may contain syscall number information.

        Reported-by: Dmitry V. Levin <ldv@altlinux.org>
        Closes: https://github.com/strace/strace/issues/22

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: sort getopt switch branches alphabetically.
        There's no reason to have them out of order. This also (almost) matches
        their order in the getopt call argument, introduced in
        v4.20-64-g61c03be.

        * strace.c (init): Sort branches in the getopt switch routine.

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: check for (non)zero argc instead of argv[0]
        Since we can never be sure that we have NULL behind the last entry of
        the argv array.

        * strace.c (init): Check for non-zero argc before/instead of argv[0].

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: advertise strace-log-merge.
        In order to raise awareness about strace-log-merge, mention it in
        SEE ALSO section and -ff option description.

        * strace.1.in (.SS Filtering) <.TP .B \-ff>: Mention strace-log-merge.
        (.SH "SEE ALSO"): Likewise.

2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: demangle function arguments.
        * unwind.c (print_stack_frame): Specify demangling style.
        * tests/strace-k.test (result): Update regexp.
        * tests/strace-k-demangle.test (expected): Update expected output.

        tests: check strace -k symbol names demangling.
        * tests/strace-k-demangle.test: New test.
        * tests/stack-fcall-mangled.c: New file.
        * tests/stack-fcall-mangled-0.c: Likewise.
        * tests/stack-fcall-mangled-1.c: Likewise.
        * tests/stack-fcall-mangled-2.c: Likewise.
        * tests/stack-fcall-mangled-3.c: Likewise.
        * tests/stack-fcall.h [MANGLE] (f0, f1, f2, f3): New macros.
        * tests/.gitignore: Add stack-fcall-mangled.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (stack_fcall_mangled_SOURCES): New variable.
        (EXTRA_DIST): Add strace-k-demangle.test.
        [USE_LIBUNWIND && USE_DEMANGLE] (LIBUNWIND_TESTS): Likewise.

2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: parametrize strace-k.test.
        Prepare for the check of strace -k symbol names demangling.

        * tests/strace-k.test: Parametrize $test_prog and $expected.
        * tests/stack-fcall.h: New file.
        * tests/stack-fcall.c: Include "stack-fcall.h"
        * tests/stack-fcall-0.c: Likewise.
        * tests/stack-fcall-1.c: Likewise.
        * tests/stack-fcall-2.c: Likewise.
        * tests/stack-fcall-3.c: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h.

2017-12-26  Masatake YAMATO  <yamato@redhat.com>

        unwind: demangle symbol names.
        Implement demangling of C++ symbol names in stack trace
        using cplus_demangle function from GNU libiberty library.

        This is an example demangled stack trace output:

        fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
         > /usr/lib64/libc-2.25.so(__fxstat64+0x12) [0xffd62]
         > /usr/lib64/libc-2.25.so(_IO_file_doallocate+0x5f) [0x717ff]
         > /usr/lib64/libc-2.25.so(_IO_doallocbuf+0x79) [0x81699]
         > /usr/lib64/libc-2.25.so(_IO_file_overflow+0x198) [0x807b8]
         > /usr/lib64/libc-2.25.so(_IO_file_xsputn+0xbd) [0x7ed5d]
         > /usr/lib64/libc-2.25.so(fwrite_unlocked+0x60) [0x7d800]
         > /usr/lib64/libleveldb.so.1.18(leveldb::EnvWrapper::StartThread+0x3b6) [0x48656]
         > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::EmitPhysicalRecord+0x89) [0x28bc9]
         > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::AddRecord+0x9e) [0x28d9e]
         > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Write+0x208) [0x1ce18]
         > /usr/lib64/libleveldb.so.1.18(leveldb::DB::Put+0x59) [0x192b9]
         > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Put+0x1d) [0x1931d]
         > /home/yamato/var/leveldb/doc/a.out(main+0x120) [0x1107]
         > /usr/lib64/libc-2.25.so(__libc_start_main+0xea) [0x2088a]
         > /home/yamato/var/leveldb/doc/a.out(_start+0x2a) [0xf3a]

        * Makefile.am [USE_DEMANGLE] (strace_CPPFLAGS, strace_LDFLAGS,
        libiberty_LDADD): Append libiberty_CPPFLAGS, strace_LDFLAGS, and
        libiberty_LIBS, respectively.
        * configure.ac: Add --with-libiberty option.  Check cplus_demangle
        support in libiberty.
        * unwind.c [USE_DEMANGLE]: Include <demangle.h>.
        (print_stack_frame) [USE_DEMANGLE]: Use cplus_demangle.

2017-12-26  Masatake YAMATO  <yamato@redhat.com>

        Define macros for renaming xmalloc and xcalloc.
        I'm planning to link strace with libiberty for mangling C++
        symbol names in stack trace enabled with -k option.

        Both names, xmalloc and xcalloc, are already defined and used
        in libiberty, and they conflict with functions in strace.
        Rename xmalloc and xcalloc functions defined in strace
        to strace_xmalloc and strace_xcalloc, respectively,
        to avoid this conflict.

        * xmalloc.h (xcalloc, xmalloc): New macros.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: move a sparc specific include to an arch specific file.
        * syscall.c [SPARC64]: Do not include <asm/psrcompat.h>.
        [SPARC]: Do not include <asm/psr.h>.
        * linux/sparc/get_error.c: Include <asm/psr.h>.

        syscall: move all ia64 specific includes to an arch specific file.
        * syscall.c [IA64]: Remove.
        * linux/ia64/get_syscall_args.c: Include <asm/rse.h>.

        syscall: simplify get_syscall_result.
        * syscall.c [ptrace_getregset_or_getregs] (get_syscall_result_regs):
        Define to get_regs.
        (get_syscall_result): Use get_syscall_result_regs unconditionally.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: change get_regs argument type.
        This opens the way for future changes related to get_regs.

        * syscall.c (get_regs): Change argument type from "pid_t"
        to "struct tcb *", all callers changed.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: move get_regs call from syscall_exiting_decode to get_syscall_result
        This make the code less confusing and opens the way for future changes
        related to get_regs.

        * syscall.c (syscall_exiting_decode): Move get_regs invocation ...
        (get_syscall_result) [ptrace_getregset_or_getregs]: ... here.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: rework subcall decoding on mips o32.
        Move syscall subcall handling to the same switch statement that
        handles ipc and socket subcalls.

        * linux/mips/syscallent-o32.h [LINUX_MIPSO32] (SYS_syscall_subcall):
        Define.
        * syscall.c (decode_mips_subcall): Rename to decode_syscall_subcall,
        conditionalize on SYS_syscall_subcall instead of LINUX_MIPSO32.
        (syscall_entering_decode) [LINUX_MIPSO32]: Remove.
        (syscall_entering_decode) [SYS_syscall_subcall]: Handle SEN_syscall
        using decode_syscall_subcall.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: tweak shuffle_scno ifdefery.
        * syscall.c (shuffle_scno): Check for ARM_FIRST_SHUFFLED_SYSCALL
        instead of ARM || AARCH64.  This does not result to any code change
        but looks more comprehensible.

        syscall: change get_regs to return an error code.
        * syscall.c (get_regs_error) [!ptrace_getregset_or_getregs]: Do not
        define.
        (clear_regs) [!ptrace_getregset_or_getregs]: Do not set get_regs_error.
        (get_regs) [ptrace_getregset_or_getregs]: Return get_regs_error, all
        callers changed to test get_regs return code instead of get_regs_error
        static variable, which is now internally used by get_regs() and
        clear_regs() only.
        (USE_GET_SYSCALL_RESULT_REGS): Do not define.
        Use "#ifndef ptrace_getregset_or_getregs"
        instead of "#ifdef USE_GET_SYSCALL_RESULT_REGS".

2017-12-24  Harsha Sharma  <harshasharmaiitr@gmail.com>

        tests: enhance run.sh usage error diagnostics.
        * tests/run.sh: Execute timeout command only when invoked with
        an argument, otherwise print an error message.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip nsyscalls-d.test on mips o32.
        On mips o32, nsyscalls test is implemented using syscall #4000,
        so nsyscalls-d cannot work there.

        * tests/nsyscalls-d.test: Skip on mips o32.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Remove linux/ptp_clock.h.
        As linux kernel provides a compatible linux/ptp_clock.h header since
        commit v3.8-rc1~139^2~514, there is no need for a local copy.

        * linux/ptp_clock.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * configure.ac (AC_CHECK_TYPES): Check for struct ptp_sys_offset
        in <linux/ptp_clock.h>.
        * ioctl.c (ioctl_decode) <case '='>: Conditionalize
        on [HAVE_STRUCT_PTP_SYS_OFFSET].
        * ptp.c: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Remove linux/ubi-user.h.
        As linux kernel provides a compatible mtd/ubi-user.h header since
        commit v3.7-rc1~85^2~17, there is no need for a local copy.

        * linux/ubi-user.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * configure.ac (AC_CHECK_MEMBERS): Check
        for struct ubi_attach_req.max_beb_per1024 in <mtd/ubi-user.h>.
        * ioctl.c (ioctl_decode) <case 'o', case 'O'>: Conditionalize
        on HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024.
        * ubi.c: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Remove linux/mtd-abi.h.
        As linux kernel provides a compatible mtd/mtd-abi.h header since
        commit v3.2-rc1~14^2~33, there is no need for a local copy.

        * linux/mtd-abi.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * configure.ac (AC_CHECK_TYPES): Check for struct mtd_write_req
        in <mtd/mtd-abi.h>.
        * ioctl.c (ioctl_decode) <case 'M'>: Conditionalize
        on [HAVE_STRUCT_MTD_WRITE_REQ].
        * mtd.c: Likewise.
        * tests/ioctl_mtd.c: Likewise.
        * tests/ioctl.c (main): Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Remove linux/personality.h.
        * linux/personality.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * personality.c: Do not include <linux/personality.h>, include
        "xlat/personality_flags.h" before "xlat/personality_types.h".
        * xlat/personality_flags.in: Provide fallback definitions.
        * xlat/personality_types.in: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch from clang-3.8 to clang.
        As travis provides a relatively fresh clang by default nowadays,
        it makes sense to use default clang in clang-based test builds.

        * .travis.yml (matrix): Change clang-3.8 to clang.

2017-12-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1.in: mention perf and ftrace in SEE ALSO.
        * strace.1.in (.SH SEE ALSO): Add references to perf-trace(1) and
        trace-cmd(1).

        strace.1.in: clarify -F option behaviour.
        * strace.1.in <.TP \-F>: Extend deprecation warning.  Describe behaviour
        of multiple instances of -F and interoperability of -F and -f.

2017-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: consistently use $STRACE_EXE instead of local alternatives.
        * tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE".
        * tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE".
        * tests/syntax.sh: Likewise.

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        strace.c: inform the user about -F option obsolescence.
        * strace.c (init): Print an error message if the option is used.

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.c: sort option arguments alphabetically.
        Except for the ones that enabled by configure options.

        While we are here, let's also change the indentation of while expression
        continuation in order to separate it from the following switch clause.

        * strace.c (init): Reorder options in getopt() call.

2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: use _exit() instead of exit() in child's die()
        Let's keep child's death routine as minimalistic as possible for the
        cases when vfork() is used instead of fork() on systems that lack MMU.

        * strace.c (die) <!(strace_tracer_pid == getpid())>: Call _exit().

2017-12-20  Harsha Sharma  <harshasharmaiitr@gmail.com>

        syscall: replace if (debug_flag) ... with debug_msg macro.
        * syscall.c (get_scno): Use debug_msg instead of
        "if (debug_flag) error_msg".

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check (some) debugging output generated during nsyscalls test.
        * tests/nsyscalls-d.c: New file.
        * tests/.gitignore: Add it.
        * tests/nsyscalls-d.test: New test, variant of nsyscalls.test with debug
        output check.
        * tests/nsyscalls-nd.test: Likewise.
        * tests/nsyscalls.c: Add expected debug output.
        * tests/Makefile.am (check_PROGRAMS): Add nsyscalls-d.
        (DECODER_TESTS): Add nsyscalls-d.test and nsyscalls-nd.test.

2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>

        pathtrace.c: use xgrowarray.
        * defs.h <struct path_set>: Change type of num_selected field to size_t.
        Add size field.
        * pathtrace.c (storepath): Rewrite to utilise xgrowarray.

2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        dyxlat: use xgrowarray.
        * dyxlat.c (dyxlat_alloc): Use xgrowarray instead of xcalloc.
        (dyxlat_add_pair): Use xgrowarray instead of xreallocarray.

        unwind: use xgrowarray.
        * unwind.c (get_symbol_name): Use xgrowarray instead of manual
        dynamic array management using xreallocarray.

2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: use xgrowarray.
        * strace.c (tcbtabsize): Change type to size_t.
        (expand_tcbtab): Rewrite in order to utilise xgrowarray
        instead of manual dynamic array management.

        unwind: use xgrowarray.
        * unwind.c (build_mmap_cache): Use xgrowarray instead of manual dynamic
        array management.

2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>

        xmalloc.c: introduce xgrowarray helper function.
        In order to simplify dynamic array management code.

        * xmalloc.h (xgrowarray): New declaration.
        * xmalloc.c (xgrowarray): New function.

2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check error diagnostics when exec file name is too long.
        * tests/options-syntax.test: Check error diagnostics when
        exec file name length equals to PATH_MAX.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: minor style fixes.
        * strace.c (test_ptrace_seize): Remove excess braces.
        (init): Wrap overly long string literal.  Add braces
        to the else if branch.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: use *_func_* message printing macros where appropriate.
        In order to provide some additional bits of information in weird error
        cases or just replace existing usages of __func__/literal function name.

        * strace.c (detach): Use perror_func_msg() instead of perror_msg().
        (startup_attach, open_dummy_desc, startup_child, test_ptrace_seize): Use
        perror_func_msg_and_die() instead of perror_msg_and_die().
        (test_ptrace_seize): Use error_func_msg_and_die() instead of
        error_msg_and_die().

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        unwind.c: more verbose mapping overlapping diagnostic message.
        * unwind.c (build_mmap_cache): Change error_msg() to debug_msg(), add
        information about region names and the respective start and end
        addresses.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        unwind.c: non-fatal handling of asprintf error.
        An error returned by asprintf is a poor excuse for dying.

        * unwind.c (asprintf_error_str): New string constant.
        (sprint_call_or_error): Replace error_msg_and_die() with
        perror_func_msg() and usage of asprintf_error_str for a return value.
        (queue_print): Free tmp->output line only if it is not
        asprintf_error_str.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        unwind.c: eliminate DPRINTF.
        Since DPRINTF is simply a macro that provides debugging information
        along with some information about printing routine call site, now standard
        debug_func_* macros are deemed to be a suitable replacement.

        * unwind.c (DPRINTF): Remove.
        (build_mmap_cache, delete_mmap_cache, unwind_cache_invalidate,
        unwind_print_stacktrace, unwind_captiure_stacktrace): Replace
        DPRINTF(fmt, str, ...) with debug_func_msg(fmt, ...)/

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        strace.c: replace if (debug_flag) ... with suitable debug printing macros
        * strace.c (alloc_tcb, droptcb, detach, attach_tcb, test_ptrace_seize,
        init, startup_tcb): Replace if (debug_flag) error_msg(...) occurrences
        with debug_error_msg(...).
        (attach_tcb): Replace if (debug_flag) perror_msg(...) with
        debug_perror_msg(...).
        (cleanup, startup_tcb): Replace if (debug_flag) error_msg(...)
        occurrences with debug_func_msg() in attempt to provide additional
        information.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        error_prints.h: add *_func_* printing macros.
        In order to reduce boilerplate for the cases when __func__ is desired
        to be printed.

        * error_prints.h (error_func_msg, perror_func_msg, debug_func_msg,
        debug_func_perror_msg, error_func_msg_and_die, perror_func_msg_and_die):
        New macro definitions.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

        error_prints.h: add debug print macros.
        * defs.h (debug_flag): Move the declaration...
        * error_prints.h (debug_flag): ... here.
        (debug_msg, debug_perror_msg): New macro definitions.
        Include <stdbool.h> for the debug_flag declaration.

2017-12-04  Masatake YAMATO  <yamato@redhat.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of KVM ioctl commands.
        * tests/ioctl_kvm_run.c: New file.
        * tests/ioctl_kvm_run.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test.
        * tests/pure_executables.list: Add ioctl_kvm_run.
        * tests/.gitignore: Likewise.

2017-12-04  Masatake YAMATO  <yamato@redhat.com>

        kvm: decode the argument of KVM_{SET, GET}_SREGS ioctl command.
        * configure.ac (AC_CHECK_TYPES): Add struct kvm_sregs.
        * kvm.c [HAVE_STRUCT_KVM_SREGS] (kvm_ioctl_decode_sregs): New function.
        (kvm_ioctl) [HAVE_STRUCT_KVM_SREGS] <KVM_SET_SREGS, KVM_GET_SREGS>:
        Use it.
        * linux/arch_kvm.c (arch_print_kvm_sregs): New function.
        * linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): New macro.
        (kvm_ioctl_decode_regs_dtable, kvm_ioctl_decode_regs_segment,
        arch_print_kvm_sregs): New functions.

        kvm: decode the argument of KVM_{SET, GET}_REGS ioctl command.
        * configure.ac (AC_CHECK_TYPES): Add struct kvm_regs.
        * linux/arck_kvm.c: New file.
        * linux/x86_64/arch_kvm.c: Likewise.
        * linux/i386/arch_kvm.c: Likewise.
        * linux/x32/arch_kvm.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * kvm.c: Include "arch_kvm.c".
        [HAVE_STRUCT_KVM_REGS] (kvm_ioctl_decode_regs): New function.
        (kvm_ioctl) [HAVE_STRUCT_KVM_REGS] <KVM_SET_REGS, KVM_GET_REGS>: Use it.

        kvm: decode the argument of KVM_SET_USER_MEMORY_REGION ioctl command.
        * configure.ac (AC_CHECK_TYPES): Add struct kvm_userspace_memory_region.
        * xlat/kvm_mem_flags.in: New file.
        * kvm.c: Include print_fields.h.
        [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]: Include xlat/kvm_mem_flags.h,
        (kvm_ioctl_set_user_memory_region): New function.
        (kvm_ioctl) [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]
        <KVM_SET_USER_MEMORY_REGION>: Use it.

2017-12-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add strace mascot.
        * strace.svg: New file.

        Co-Authored-by: Vitaly Chaykovsky <mgspeker@gmail.com>

2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify attach-p-cmd.test against buggy kernels.
        From time to time various kernels, old and new, just go nuts
        and fail attach-p-cmd.test with the following diagnostics:

         12345 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
        -12345 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or directory)
        +12345 syscall_4294967295(0xffe60934, 0x1c0, 0xffe60934, 0x1, 0xffe609b4, 0xffe60a58) = -1 (errno 38)
        +12345 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented)

        Let's workaround this kernel madness by rewriting the test
        without use of SIGALRM.

        * tests/attach-p-cmd.h: New file.
        * tests/Makefile.am (EXTRA_DIST): Add attach-p-cmd.h.
        * tests/attach-p-cmd-cmd.c: Include "attach-p-cmd.h".
        (write_pidfile, wait_for_peer_invocation): New functions.
        (main): Use them.
        * tests/attach-p-cmd-p.c: Include <time.h> and "attach-p-cmd.h".
        (wait_for_peer_invocation, wait_for_peer_termination): New functions.
        (main): Use them.  Do not raise SIGALRM, use nanosleep after peer
        termination.

2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify ipc_msgbuf.test against broken libc.
        glibc between commits glibc-2.25~130 and glibc-2.26~740 had broken
        msgctl(IPC_RMID) on hppa: this operation always failed with EINVAL
        because of inappropriate use of IPC_64 flag.  Similar issues were
        fixed on other niche architectures.  Let's workaround these issues
        by skipping the test in case of msgctl(IPC_RMID) failure.

        * tests/ipc_msgbuf.c (cleanup): Change return type to int,
        return 77 in case of msgctl(IPC_RMID) failure.
        (main): Explicitly invoke cleanup() at the end.

2017-12-01  Masatake YAMATO  <yamato@redhat.com>

        kvm: decode the argument of KVM_CREATE_VCPU ioctl command.
        * kvm.c (kvm_ioctl_create_vcpu): New function.
        (kvm_ioctl) <KVM_CREATE_VCPU>: Use it.

        kvm: handle KVM_CREATE_VM ioctl command.
        * kvm.c (kvm_ioctl): Handle KVM_CREATE_VM command.

        kvm: handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, and KVM_GET_API_VERSION ioctl commands
        * kvm.c (kvm_ioctl): Handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE,
        and KVM_GET_API_VERSION commands.

        ioctl: add a stub for decoding kvm related ioctls.
        * kvm.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/kvm.h.
        * defs.h (kvm_ioctl): New prototype.
        * ioctl.c (ioctl_decode) HAVE_LINUX_KVM_H]: Use kvm_ioctl.

2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace-log-merge: work around corner cases of strace -ttt parsing.
        Employing strace -ttt for the logs destined to be fed to
        strace-log-merge is ultimately the best solution except for the logs
        that pass the following dates:

        Thu Jan  1 00:00:09 UTC 1970
        Thu Jan  1 00:01:39 UTC 1970
        Thu Jan  1 00:16:39 UTC 1970
        Thu Jan  1 02:46:39 UTC 1970
        Fri Jan  2 03:46:39 UTC 1970
        Mon Jan 12 13:46:39 UTC 1970
        Sun Apr 26 17:46:39 UTC 1970
        Sat Mar  3 09:46:39 UTC 1973
        Sun Sep  9 01:46:39 UTC 2001
        Sat Nov 20 17:46:39 UTC 2286
        Wed Nov 16 09:46:39 UTC 5138
        Fri Sep 27 01:46:39 UTC 33658
        Sun May 20 17:46:39 UTC 318857
        Sat Nov  7 09:46:39 UTC 3170843
        Sun Jul  5 01:46:39 UTC 31690708
        Sat Jan 25 17:46:39 UTC 316889355

        Let's lift this limitation.

        * strace-log-merge: Generate numeric-only key for sorting, use sort -n
        option.

2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        debian: add strace-log-merge to the list of installed files.
        * debian/strace.install: Add strace-log-merge.

        Add strace-log-merge man page.
        * strace-log-merge.1.in: New file.
        * NEWS: Mention this.
        * .gitignore: Add strace-log-merge.1.
        * Makefile.am (man_MANS): Likewise.
        * configure.ac (AC_CONFIG_FILES): Likewise.
        * debian/strace.manpages: Likewise.

        strace-log-merge: add copyright header.

2017-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        Add initial GitLab CI support.
        * .gitlab-ci.yml: New file.
        * travis-build.sh: Print $CC -print-multi-lib.  Print config.log
        in case of configure failure.
        * travis-install.sh: Check sudo availability.  Install autoconf,
        automake, file, gawk, gcc-multilib, git, gzip, make, and xz-utils
        for all targets.
        (musl-gcc): Install ca-certificates.

2017-11-25  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: fix cross-compiling.
        In cross builds, a target version of readelf has to be used
        instead of a native one.

        * configure.ac (AC_CHECK_TOOL): Add readelf.
        * Makefile.am (READELF): New variable.
        (mpers-m%.stamp): Pass it to $(srcdir)/mpers.sh.
        * m4/mpers.m4 (st_MPERS): Pass READELF environment variable
        to $srcdir/mpers_test.sh.
        * mpers.sh (READELF): New variable.
        Use it instead of readelf.
        * maint/ioctls_sym.sh: Likewise.
        * NEWS: Mention this fix.

        Reported-by: Rolf Eike Beer <eb@emlix.com>

2017-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix llseek test.
        * tests/llseek.test: Fix typo.

        INSTALL-git.md: fix typo.

        tests: simplify bpf test a bit.
        * tests/bpf.c (DEF_BPF_INIT_FIRST): New macro.
        (init_BPF_MAP_CREATE_first, init_BPF_MAP_LOOKUP_ELEM_first,
        init_BPF_PROG_LOAD_first, init_BPF_OBJ_PIN_first,
        init_BPF_PROG_ATTACH_first, init_BPF_PROG_TEST_RUN_first,
        init_BPF_PROG_GET_NEXT_ID_first, init_BPF_OBJ_GET_INFO_BY_FD_first):
        Use it.

2017-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of BPF_OBJ_GET_INFO_BY_FD command of bpf syscall.
        * configure.ac (AC_CHECK_MEMBERS): Add union bpf_attr.info.info.
        * bpf.c (decode_BPF_OBJ_GET_INFO_BY_FD): New function.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
        * NEWS: Mention this.
        * tests/bpf.c: Add macro guard for BPF_OBJ_GET_INFO_BY_FD decoder test.
        [HAVE_UNION_BPF_ATTR_INFO_INFO] (sample_BPF_OBJ_GET_INFO_BY_FD_attr):
        New variable.
        [HAVE_UNION_BPF_ATTR_INFO_INFO] (init_BPF_OBJ_GET_INFO_BY_FD_first,
        print_BPF_OBJ_GET_INFO_BY_FD_first, init_BPF_OBJ_GET_INFO_BY_FD_attr,
        print_BPF_OBJ_GET_INFO_BY_FD_attr): New functions.
        (main) [HAVE_UNION_BPF_ATTR_INFO_INFO]: Use them.

        Simplify union bpf_attr field checks.
        * configure.ac: Use AC_CHECK_MEMBERS instead of st_CHECK_UNION_BPF_ATTR
        for union bpf_attr field checks as the former seems to be enough
        for the case.
        * m4/st_bpf.m4: Remove.

        Implement decoding of BPF_*_GET_*_ID commands of bpf syscall.
        * configure.ac: Check for union bpf_attr.next_id.
        * bpf.c (decode_BPF_PROG_GET_NEXT_ID, decode_BPF_PROG_GET_FD_BY_ID,
        * decode_BPF_MAP_GET_FD_BY_ID): New functions.
        (decode_BPF_MAP_GET_NEXT_ID): New macro.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use them.
        * NEWS: Mention this.
        * tests/bpf.c: Add macro guard for BPF_*_GET_*_ID decoder tests.
        [HAVE_UNION_BPF_ATTR_NEXT_ID] (init_BPF_PROG_GET_NEXT_ID_first,
        print_BPF_PROG_GET_NEXT_ID_first, init_BPF_PROG_GET_NEXT_ID_attr,
        print_BPF_PROG_GET_NEXT_ID_attr, print_BPF_PROG_GET_FD_BY_ID_first,
        print_BPF_PROG_GET_FD_BY_ID_attr, print_BPF_MAP_GET_NEXT_ID_first,
        print_BPF_MAP_GET_NEXT_ID_attr): New functions.
        (init_BPF_MAP_GET_NEXT_ID_first, print_BPF_MAP_GET_NEXT_ID_first,
        init_BPF_MAP_GET_NEXT_ID_attr, print_BPF_MAP_GET_NEXT_ID_attr,
        init_BPF_PROG_GET_FD_BY_ID_first, init_BPF_PROG_GET_FD_BY_ID_attr,
        init_BPF_MAP_GET_FD_BY_ID_first, init_BPF_MAP_GET_FD_BY_ID_attr):
        New macros.
        (main) [HAVE_UNION_BPF_ATTR_NEXT_ID]: Use them.

2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of BPF_PROG_TEST_RUN command of bpf syscall.
        * configure.ac: Check for union bpf_attr.test.duration.
        * bpf.c (decode_BPF_PROG_TEST_RUN): New function.
        (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
        * NEWS: Mention this.
        * tests/bpf.c: Include "print_fields.h".
        Add macro guard for BPF_PROG_TEST_RUN decoder test.
        [HAVE_UNION_BPF_ATTR_TEST_DURATION] (sample_BPF_PROG_TEST_RUN_attr):
        New variable.
        [HAVE_UNION_BPF_ATTR_TEST_DURATION] (init_BPF_PROG_TEST_RUN_first,
        print_BPF_PROG_TEST_RUN_first, init_BPF_PROG_TEST_RUN_attr,
        print_BPF_PROG_TEST_RUN_attr): New functions.
        (main) [HAVE_UNION_BPF_ATTR_TEST_DURATION]: Use them.

2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: update BPF_MAP_CREATE decoding.
        Implement decoding of union bpf_attr.numa_node field for BPF_MAP_CREATE
        command introduced by linux kernel commit v4.14-rc1~130^2~196^2~1.

        * configure.ac: Check for numa_node member of union bpf_attr
        instead of inner_map_fd.
        (decode_BPF_MAP_CREATE): Add numa_node field to the structure, print it.
        * NEWS: Mention this.
        * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test.
        (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected
        output.
        (init_BPF_MAP_CREATE_attr): Initialize numa_node field, update offset.

2017-11-20  Eugene Syromiatnikov  <esyr@redhat.com>

        unwind.c: cleanup.
        * unwind.c (rebuild_cache_if_invalid): Simplify return statement.

        unwind.c: fix typo in comment.
        * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace,
        unwind_capture_stacktrace): Replace strack with stack.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        ipc_shm: decode hugetlb page size in shmget flags.
        Decode alternative hugetlb page sizes introduced by kernel commit
        v3.8-rc1~175^2~36.

        * ipc_shm.c [!SHM_HUGE_SHIFT] (SHM_HUGE_SHIFT): New macro.
        [!SHM_HUGE_MASK] (SHM_HUGE_MASK): Likewise.
        (SYS_FUNC(shmget)): Print hugetlb page size.
        * tests/ipc_shm.c: Check it.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        memfd_create: decode hugetlb page size.
        Decode alternative hugetlb page sizes introduced by kernel commit
        v4.14-rc1~126^2~17.

        * configure.ac (AC_CHECK_HEADERS): Add linux/memfd.h.
        * memfd_create.c [HAVE_LINUX_MEMFD_H]: Include it.
        [!MFD_HUGE_SHIFT] (MFD_HUGE_SHIFT): New macro.
        [!MFD_HUGE_MASK] (MFD_HUGE_MASK): Likewise.
        (SYS_FUNC(memfd_create)): Print hugetlb page size.
        * tests/memfd_create.c: Check it.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        Print the first argument of memfd_create syscall as a path.
        The limit imposed by the kernel on the length of memfd_create first
        argument is NAME_MAX - strlen("memfd:").

        * memfd_create.c (SYS_FUNC(memfd_create)): Print the first argument
        using printpathn.
        * tests/memfd_create.c: Check it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        mem: decode hugetlb page size in mmap flags.
        Decode alternative hugetlb page sizes introduced by kernel commit
        v3.8-rc1~175^2~36.

        * mem.c [!MAP_HUGE_SHIFT] (MAP_HUGE_SHIFT): New macro.
        [!MAP_HUGE_MASK] (MAP_HUGE_MASK): Likewise.
        (print_mmap_flags): Print hugetlb page size.
        * NEWS: Mention it.
        * tests/remap_file_pages.c: Check it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        mem: assume that MAP_TYPE is defined.
        Since linux kernel provided a definition of MAP_TYPE in <asm/mman.h>
        as long ago as in v2.4.0, it's safe to assume that MAP_TYPE is defined.

        * mem.c (print_mmap_flags) [!MAP_TYPE]: Remove.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        mem: move printing of mmap_flags to a separate function.
        * mem.c (print_mmap_flags): New function.
        (print_mmap, SYS_FUNC(remap_file_pages)): Use it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Provide fallback definitions for SHM_EXEC constant.
        Although SHM_EXEC is available in <linux/shm.h> since kernel commit
        v2.6.9-rc2~23^2~93^2~78, the glibc version of <sys/shm.h> did not
        provide SHM_EXEC until commit glibc-2.10~238.

        * xlat/shm_flags.in (SHM_EXEC): Add fallback definition.
        * tests/shmxt.c (SHM_EXEC): Likewise.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update SHM_* constants.
        * xlat/shm_flags.in: Add SHM_EXEC introduced by kernel commit
        v2.6.9-rc2~23^2~93^2~78.
        * xlat/shm_resource_flags.in: Add SHM_NORESERVE introduced by kernel
        commit v2.6.15-rc1~622.
        * NEWS: Mention this.
        * tests/ipc_shm.c (main): Update expected output.
        * tests/shmxt.c (main): Update expected output, check SHM_EXEC decoding.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Remove fallback definitions for SHM_STAT and SHM_INFO constants.
        These constants are universally available for quite a long time
        and are used unconditionally in tests without any complaints.

        * xlat/shmctl_flags.in: Remove fallback definitions.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding.
        NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests
        not just a single integer but an array of integers.  The kernel also
        supports a zero optlen NETLINK_LIST_MEMBERSHIPS request.

        * net.c (print_uint32): New function.
        (print_getsockopt): Add ulen argument, rename len argument to rlen,
        <SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array
        and print_uint32.
        (SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt.
        * tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS
        decoding.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check [gs]etsockopt SOL_NETLINK decoding.
        * tests/sockopt-sol_netlink.c: New file.
        * tests/gen_tests.in (sockopt-sol_netlink): New entry.
        * tests/pure_executables.list: Add sockopt-sol_netlink.
        * tests/.gitignore: Likewise.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK.
        Tweak the parser to follow the kernel behaviour.

        * net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and
        print returned value as integer iff the length is >= sizeof(int),
        otherwise print the address.
        * NEWS: Mention this.

2017-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        net: decode optname argument of [gs]etsockopt for SOL_NETLINK level.
        * xlat/socknetlinkoptions.in: New file.
        * net.c: Include "xlat/socknetlinkoptions.h".
        (print_sockopt_fd_level_name) <SOL_NETLINK>: Print name using
        socknetlinkoptions.
        * NEWS: Metnion this.

        Update MSG_* constants.
        * xlat/msg_flags.in: Add MSG_ZEROCOPY introduced by kernel commit
        v4.14-rc1~130^2~376^2~6.
        * NEWS: Mention this.

        netlink: print descriptor attributes using printfd.
        * nlattr.h (DECL_NLA(fd)): New prototype.
        * nlattr.c (decode_nla_fd): New function.
        * rtnl_link.c (ifla_xdp_nla_decoders) <IFLA_XDP_FD>: Use it.
        (ifinfomsg_nla_decoders) <IFLA_NET_NS_FD>: Likewise.
        * rtnl_nsid.c (rtgenmsg_nla_decoders) <NETNSA_FD>: Likewise.
        * NEWS: Mention this.

2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint/update_copyright_years.sh: implement concurrent execution.
        Analogous to the way it is done in xlat/gen.sh.

        * maint/update_copyright_years.sh (MAX_JOBS): New variable, initialize
        it to double the CPU count.
        <while [ -n "${1:-}" ]; do case "$1" in>: Add -j option parsing.
        (jobs, pids): New variables.
        <git ls-files -- "$@" | grep -vFx "$IGNORED_FILES" | while read f; do>:
        Execute process_file in background, count background jobs and wait
        if there are too many.

2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint/update_copyright_years.sh: use -efu shell mode.
        * maint/update_copyright_years.sh: Add -efu to shebang.  Adjust
        the script for -efu shell mode.

2017-11-14  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.20-1.
        * strace.spec.in: Likewise.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.20 release.
        * NEWS: Update for 4.20 release.

        CREDITS.in: remove entries listed by maint/gen-contributors-list.sh.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Makefile.am: use gen-contributors-list.sh for CREDITS.
        * Makefile.am ($(srcdir)/CREDITS): Employ maint/gen-contributors-list.sh
        for the contributor list generation.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        maint: make gen-contributors-list.sh suitable for generation of CREDITS.
        Implement various features in order to make it suitable for the
        generation of the CREDITS file:
        - add an option for including contributor e-mail;
        - add an option to read additional list of contributors from stdin;
        - add shorthand for referring to the initial commit of the branch;
        - document all of the above in a help message.

        * maint/gen-contributors-list.sh (print_help): New function.
        (script): Rename to SCRIPT.
        (SCRIPT_NORM_EMAILS, MATCH_OUT, OUT_EMAILS, OUT_NO_EMAILS, read_stdin,
        include_email): New variables.
        Add parsing of options, rewrite input processing.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        .mailmap: add more entries to avoid duplication in CREDITS.

        .mailmap: sort entries.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        .mailmap: more deduplication.
        Of course there are no two persons in the whole world that share
        the same name.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        CREDITS.in: use UTF-8 consistently.
        In particular, do not use " symbols in names.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        CREDITS.in: add Jiri Slaby as a contributor.
        Unfortunately, he wasn't mentioned in the message of the commit
        v4.19-68-g48cb633, so let's fix that omission.

        References: https://github.com/strace/strace/pull/16

2017-11-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        s390, s390x: update ioctl entries from linux 4.14.
        * linux/s390/ioctls_arch0.h: Update from linux v4.14 using ioctls_gen.sh.
        * linux/s390x/ioctls_arch0.h: Likewise.

        s390x: remove some of non-s390 KVM ioctls.
        * linux/s390x/ioctls_arch0.h: Regenerate.

        maint: remove KVM_PPC_CONFIGURE_V3_MMU ioctl from non-powerpc arches.
        * maint/ioctls_sym.sh (ppc_list): Update.

2017-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Update copyright headers.
        Headers updated semi-automatically using
        maint/update_copyright_years.sh script.

        * m4/mpers.m4: Update copyright years.
        * tests/kcmp.c: Likewise.
        * tests/membarrier.c: Likewise.

2017-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        maint/update_copyright_years.sh: fix typo in help output.
        * maint/update_copyright_years.sh (print_help): Fix typo, disable
        here-document expansion.

2017-11-10  Eugene Syromiatnikov  <esyr@redhat.com>

        Move MIN, MAX, and CLAMP to macros.h.
        We shouldn't have to include the whole defs.h to get them.

        * defs.h (MIN, MAX, CLAMP): Move ...
        * macros.h: ... here.

2017-11-10  Eugene Syromiatnikov  <esyr@redhat.com>

        Update .mailmap.
        * .mailmap (Eugene Syromyatnikov): Add work address.

2017-11-07  Steve McIntyre  <steve@einval.com>

        debian: update debhelper compat level to 10, replace -s with -a in some calls

        debian: update Standards-Version to 3.9.8.

2017-11-06  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: check for size of long and kernel_long_t.
        The primary purpose of this new check is diagnostics.

        * m4/mpers.m4 (st_MPERS): Check for size of long and kernel_long_t.

2017-11-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat/gen.sh: speedup xlat generation.
        This commit implements the following changes:
        - increases the number of concurrent jobs to twice the CPU count;
        - creates a circular buffer, so instead of running multiple jobs
          at once, the generator tries to keep about the same number of jobs
          being run concurrently;
        - runs gen_git and gen_make concurrently in order to squeeze in
          one more bit of concurrency.

        With my deeply scientific measurements, this approach achieves
        up to 15% speedup with dash and about 30-40% with bash as /bin/sh
        on a 4-core machine.

        * xlat/gen.sh (main): Declare pids local variable, append pid of every
        run job to it; increase the limit of jobs to ncpus * 2; when the limit
        is reached, wait for the first pid in pids instead of resetting jobs
        to zero and waiting for all the run jobs; put gen_git and gen_make
        into background.

2017-11-05  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: wire up statx syscall.
        * linux/hppa/syscallent.h [349]: Add statx entry.

2017-11-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check signal mask transparency.
        Starting with commit v4.17-5-gf83b49b strace is expected
        to forward the signal mask to tracees unchanged.

        * tests/check_sigblock.c: New file.
        * tests/set_sigblock.c: Likewise.
        * tests/sigblock.test: New test.
        * tests/.gitignore: Add check_sigblock and set_sigblock.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add sigblock.test.

2017-11-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check signal disposition transparency.
        Starting with commit v4.17-8-ge97a66f strace is expected
        to forward the signal disposition to tracees unchanged.

        * tests/check_sigign.c: New file.
        * tests/list_sigaction_signum.c: Likewise.
        * tests/set_sigign.c: Likewise.
        * tests/sigign.test: New test.
        * tests/.gitignore: Add check_sigign, list_sigaction_signum,
        and set_sigign.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add sigign.test.

2017-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: update futex test to accommodate the recent kernel change.
        Kernel commit v4.14-rc1~162^2~8 refactored futex implementation and
        introduced checks for invalid shift sizes.  Accommodate this change
        by allowing EINVAL in the corresponding futex checks.

        * tests/futex.c (CHECK_FUTEX_GENERIC): Reset errno before the syscall.
        (main) <wake_ops>: Add err2 field, describe err/err2 fields.
        Add EINVAL as a possible errno to the checks that contain invalid
        shift values.
        Update return value check so it checks that values are strictly
        as expected.

        Closes: https://github.com/strace/strace/pull/16

2017-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: cleanup futex test.
        * tests/futex.c (main) <wake_ops>: Remove unused errstr field
        from the structure type definition.

2017-11-02  Dmitry V. Levin  <ldv@altlinux.org>

        seccomp: decode SECCOMP_GET_ACTION_AVAIL operation.
        * defs.h (seccomp_ret_action): New xlat prototype.
        * seccomp.c (decode_seccomp_set_mode_strict): Remove.
        (SYS_FUNC(seccomp)): Decode SECCOMP_GET_ACTION_AVAIL operation.
        * NEWS: Mention this.
        * tests/seccomp_get_action_avail.c: New file.
        * tests/gen_tests.in (seccomp_get_action_avail): New entry.
        * tests/pure_executables.list: Add seccomp_get_action_avail.
        * tests/.gitignore: Likewise.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

        Add SECCOMP_RET_KILL_PROCESS decoding support.
        * bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove.
        [!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define.
        (print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL
        instead of SECCOMP_RET_ACTION.
        * xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced
        by linux kernel commit v4.14-rc2~15^2~3.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

        Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD.
        Follow linux kernel commit v4.14-rc2~15^2~4 and rename SECCOMP_RET_KILL
        to SECCOMP_RET_KILL_THREAD.

        * xlat/seccomp_ret_action.in (SECCOMP_RET_KILL): Rename
        to SECCOMP_RET_KILL_THREAD.
        * tests/prctl-seccomp-filter-v.c (main): Update expected output.
        * tests/seccomp-filter-v.c (main): Likewise.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

        Update SECCOMP_* constants.
        * xlat/seccomp_filter_flags.in: Add SECCOMP_FILTER_FLAG_LOG introduced
        by kernel commit v4.14-rc2~15^2~6.
        * xlat/seccomp_ops.in: Add SECCOMP_GET_ACTION_AVAIL introduced
        by kernel commit v4.14-rc2~15^2~9.
        * xlat/seccomp_ret_action.in: Add SECCOMP_RET_LOG introduced
        by kernel commit v4.14-rc2~15^2~5.
        * NEWS: Mention this.
        * tests/seccomp-filter.c (main): Update expected output.
        * tests/seccomp-filter-v.c (main): Likewise.

        Provide fallback definitions for SECCOMP_RET_* constants.
        * xlat/seccomp_ret_action.in: Add fallback definitions.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify options-syntax.test against inquisitive musl.
        Workaround musl >= 1.1.17 ability to use AT_EXECFN during
        program_invocation_name initialization.

        * tests/options-syntax.test: Check for two valid variants
        of "zeroargc strace" expected output.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

        Update MEMBARRIER_CMD_* constants.
        * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED
        introduced by kernel commit v4.14-rc6~26.
        * tests/membarrier.c (main): Update expected output.

2017-10-31  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags.
        * tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags.
        * tests/nfnetlink_nftables.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags.
        * tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags
        * tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags.
        * tests/nfnetlink_acct.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags
        * tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function.
        (main): Use it.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags.
        * tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function.
        (main): Use it.

2017-10-26  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode NETLINK_NETFILTER netlink message flags.
        * netlink.c (decode_nlmsg_flags_netfilter): New function.
        (nlmsg_flags): Add NETLINK_NETFILTER.
        * NEWS: Mention this.

        netlink: decode netlink message delete flags.
        * netlink.c: Include "xlat/netlink_delete_flags.h".
        (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
        decode_nlmsg_flags_xfrm): Decode delete flags.
        * netlink.h (NLM_F_NONREC): New macro.
        * xlat/netlink_delete_flags.in: New file.
        * tests/netlink_crypto.c (test_nlmsg_flags): Check this.
        * tests/netlink_route.c (test_nlmsg_flags): Likewise.
        * tests/netlink_xfrm.c (test_nlmsg_flags): Likewise.

2017-10-26  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: refactor decode_nlmsg_flags.
        Refactor decode_nlmsg_flags to make it family-specific, just like
        decode_nlmsg_type and decode_payload.

        * netlink.c (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
        decode_nlmsg_flags_sock_diag, decode_nlmsg_flags_xfrm): New functions.
        (nlmsg_flags_decoder_t): New typedef.
        (nlmsg_flags): New array.
        (decode_nlmsg_flags): Use it.

2017-10-14  JingPiao Chen  <chenjingpiao@gmail.com>

        Workaround historic linux/netfilter/xt_osf.h deficiencies.
        When using linux kernel headers without commit v4.5-rc1~128^2~115^2~22
        ("netfilter: fix include files for compilation"), both <linux/ip.h>
        and <linux/tcp.h> have to be included before <linux/netfilter/xt_osf.h>.

        * configure.ac (AC_CHECK_HEADERS): Include <linux/ip.h>
        and <linux/tcp.h> when checking for linux/netfilter/xt_osf.h header.
        * tests/nfnetlink_osf.c: Include <linux/ip.h> and <linux/tcp.h>
        before <linux/netfilter/xt_osf.h>.

2017-09-24  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nf_tables_compat.h.
        * tests/nfnetlink_nft_compat.c: New file.
        * tests/gen_tests.in (nfnetlink_nft_compat): New entry.
        * tests/pure_executables.list: Add nfnetlink_nft_compat.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nf_tables.h.
        * tests/nfnetlink_nftables.c: New file.
        * tests/gen_tests.in (nfnetlink_nftables): New entry.
        * tests/pure_executables.list: Add nfnetlink_nftables.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_cthelper.h.
        * tests/nfnetlink_cthelper.c: New file.
        * tests/gen_tests.in (nfnetlink_cthelper): New entry.
        * tests/pure_executables.list: Add nfnetlink_cthelper.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_cttimeout.h.
        * tests/nfnetlink_cttimeout.c: New file.
        * tests/gen_tests.in (nfnetlink_cttimeout): New entry.
        * tests/pure_executables.list: Add nfnetlink_cttimeout.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_ACCT netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_acct.h.
        * tests/nfnetlink_acct.c: New file.
        * tests/gen_tests.in (nfnetlink_acct): New entry.
        * tests/pure_executables.list: Add nfnetlink_acct.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_IPSET netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/ipset/ip_set.h.
        * tests/nfnetlink_ipset.c: New file.
        * tests/gen_tests.in (nfnetlink_ipset): New entry.
        * tests/pure_executables.list: Add nfnetlink_ipset.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_OSF netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/xt_osf.h.
        * tests/nfnetlink_osf.c: New file.
        * tests/gen_tests.in (nfnetlink_osf): New entry.
        * tests/pure_executables.list: Add nfnetlink_osf.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_ULOG netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_log.h.
        * tests/nfnetlink_ulog.c: New file.
        * tests/gen_tests.in (nfnetlink_ulog): New entry.
        * tests/pure_executables.list: Add nfnetlink_ulog.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_QUEUE netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_queue.h.
        * tests/nfnetlink_queue.c: New file.
        * tests/gen_tests.in (nfnetlink_queue): New entry.
        * tests/pure_executables.list: Add nfnetlink_queue.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types
        * tests/nfnetlink_ctnetlink_exp.c: New file.
        * tests/gen_tests.in (nfnetlink_ctnetlink_exp): New entry.
        * tests/pure_executables.list: Add nfnetlink_ctnetlink_exp.
        * tests/.gitignore: Likewise.

        tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types.
        * configure.ac (AC_CHECK_HEADERS): Add
        linux/netfilter/nfnetlink_conntrack.h.
        * tests/nfnetlink_ctnetlink.c: New file.
        * tests/gen_tests.in (nfnetlink_ctnetlink): New entry.
        * tests/pure_executables.list: Add nfnetlink_ctnetlink.
        * tests/.gitignore: Likewise.

        netlink: decode NETLINK_NETFILTER netlink message types.
        * netlink.c: Include "xlat/nf_acct_msg_types.h",
        "xlat/nf_cthelper_msg_types.h", "xlat/nf_ctnetlink_exp_msg_types.h",
        "xlat/nf_ctnetlink_msg_types.h", "xlat/nf_cttimeout_msg_types.h",
        "xlat/nf_ipset_msg_types.h", "xlat/nf_nft_compat_msg_types.h",
        "xlat/nf_nftables_msg_types.h", "xlat/nf_osf_msg_types.h",
        "xlat/nf_queue_msg_types.h", and "xlat/nf_ulog_msg_types.h".
        (nf_nlmsg_types): New array.
        (decode_nlmsg_type_netfilter): Use it.
        * NEWS: Mention this.
        * xlat/nf_acct_msg_types.in: New file.
        * xlat/nf_cthelper_msg_types.in: Likewise.
        * xlat/nf_ctnetlink_exp_msg_types.in: Likewise.
        * xlat/nf_ctnetlink_msg_types.in: Likewise.
        * xlat/nf_cttimeout_msg_types.in: Likewise.
        * xlat/nf_ipset_msg_types.in: Likewise.
        * xlat/nf_nft_compat_msg_types.in: Likewise.
        * xlat/nf_nftables_msg_types.in: Likewise.
        * xlat/nf_osf_msg_types.in: Likewise.
        * xlat/nf_queue_msg_types.in: Likewise.
        * xlat/nf_ulog_msg_types.in: Likewise.
        * tests/netlink_netfilter.c (test_nlmsg_type): Update expected output.

2017-09-20  Dmitry V. Levin  <ldv@altlinux.org>

        ppc64: fix sigreturn parser for ppc personality.
        * linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite.

        ppc64: truncate syscall args for 32-bit personality tracees.
        * linux/powerpc/get_syscall_args.c (get_syscall_args): Clear upper
        32 bits of syscall args for 32-bit personality tracees.
        * NEWS: Mention this fix.

        ppc64: fix PRI__64 macro definition when compiled with -m32.
        * kernel_types.h [SIZEOF_LONG != 4]: Check for __powerpc64__ instead
        of POWERPC to handle -m32 case properly.

2017-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        loop: decode LOOP_SET_BLOCK_SIZE.
        * loop.c (loop_ioctl) <LOOP_SET_BLOCK_SIZE>: Handle LOOP_SET_BLOCK_SIZE.
        * tests/ioctl_loop.c (main): Check it.

        Update ioctl entries from linux v4.14-rc1.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.14-rc1
        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.
        * xlat/loop_cmds.in: Add LOOP_SET_BLOCK_SIZE introduced
        by kernel commit v4.13-rc7-176-g89e4fde.
        * NEWS: Mention this.
        * tests/ioctl_loop.c (main): Update.

2017-09-19  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        maint: generate ioctl entries without target architecture code execution
        ioctls_sym.sh used to generate and invoke target architecture
        executables that limited its applicability.
        After this change, the generated code is just compiled to the target
        architecture object files and all required information is obtained
        from the dwarf sections.
        This approach allows to generate ioctl entries for any target
        architecture supported by compiler.

        * maint/ioctls_sym.awk: New file.
        * maint/ioctls_sym.sh (LC_ALL): Define to C and export.
        (uname_m): Make configurable.
        (CFLAGS): Add -gdwarf-2.
        (LDFLAGS): Remove.
        Do not use print_ioctlent.c.
        Change asm-generic/ioctl.h and asm/ioctl.h hook.
        Dump and process dwarf sections of generated object files.
        * maint/print_ioctlent.c: Remove.

2017-09-18  Dmitry V. Levin  <ldv@altlinux.org>

        Remove KVM_S390_* ioctls from non-s390 architectures.
        * maint/ioctls_sym.sh <linux/kvm.h> (s390_list): New variable.
        Use it to exclude KVM_S390_* ioctls on non-s390 architectures.
        * linux/arm/ioctls_arch0.h: Regenerate.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Remove some of arch-specific KVM ioctls from non-matching architectures.
        * maint/ioctls_sym.sh (arm_list, ppc_list, x86_list): Use bracket
        expressions to generalize arch-specific regular expressions.
        * linux/arm/ioctls_arch0.h: Regenerate.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        dm: add support for DM_DEV_ARM_POLL.
        Added in Linux commit v4.13-rc1~137^2~14.

        * dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero.
        [!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise.
        [!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise.
        [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
        (dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL.
        * tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
        (main) <dummy_check_cmds>: Add DM_DEV_ARM_POLL.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kcmp: add KCMP_EPOLL_TFD support.
        * configure.ac (AC_CHECK_TYPES): Add check for struct kcmp_epoll_slot.
        * kcmp.c (SYS_FUNC(kcmp)) <case KCMP_EPOLL_TFD>: Implement idx1/idx2
        argument parsing.
        * tests/kcmp.c: Update test.
        * xlat/kcmp_types.in (KCMP_EPOLL_TFD): New entry.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add kcmp-y test.
        It is not very useful as of now, but it will allow tracking changes
        in fd output once they are implemented.

        * tests/gen_tests.in (kcmp-y): New test.
        * tests/kcmp-y.c: New file, wrapper for kcmp.c
        * tests/kcmp.c: Add opening of some files for which info may be printed
        in the future.
        * tests/pure_executables.list: Add kcmp-y.
        * tests/.gitignore: Likewise.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kcmp: output fds using a separate function.
        This is a preparation for the future introduction of cross-NS PID
        derivation, which would enable us to print fd information for fds
        related to all processes, not just traced ones.

        Note the change in output type for idx1/idx2 in KCMP_FILE command from
        unsigned to int, it follows printfd output format.

        * kcmp.c (printpidfd): New function.
        (PRINT_FIELD_PIDFD): New macro.
        (SYS_FUNC(kcmp)) <case KCMP_FILE>: Use printpidfd for printing
        idx1/idx2, as they are fds, after all.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/kcmp: add more checks.
        Let's check all kcmp commands that they indeed do not print idx1/idx2.
        Also, check that upper bits of pid arguments are ignored.

        * tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22.
        * tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all
        kcmp types not tested before.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/kcmp: use <linux/kcmp.h> if it is available.
        I see it as a good idea to stick to system headers whenever possible
        in order to also check for possible discrepancies between strace's
        internal definitions and definitions present in the system headers.

        * configure.ac (AC_CHECK_HEADERS): Add linux/kcmp.h.
        * tests/kcmp.h [HAVE_LINUX_KCMP_H]: Include <linux/kcmp.h>,
        do not define KCMP_FILE and KCMP_SYSVSEM.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of MDBA_ROUTER_PORT netlink attribute.
        * tests/nlattr_mdba_router_port.c: New file.
        * tests/gen_tests.in (nlattr_mdba_router_port): New entry.
        * tests/pure_executables.list: Add nlattr_mdba_router_port.
        * tests/.gitignore: Likewise.

        tests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes.
        * tests/nlattr_mdba_mdb_entry.c: New file.
        * tests/gen_tests.in (nlattr_mdba_mdb_entry): New entry.
        * tests/pure_executables.list: Add nlattr_mdba_mdb_entry.
        * tests/.gitignore: Likewise.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: extend TEST_NESTED_NLATTR_OBJECT macro.
        Extend TEST_NESTED_NLATTR_OBJECT macro for multi-nested netlink
        attributes, such as

                [MDBA_MDB] = {
                        [MDBA_MDB_ENTRY] = {
                                [MDBA_MDB_ENTRY_INFO] {
                                        struct br_mdb_entry
                                        [MDBA_MDB_EATTR attributes]
                                }
                        }
                }

        * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_,
        TEST_NESTED_NLATTR_OBJECT_EX): New macros.
        (TEST_NESTED_NLATTR_OBJECT): Use TEST_NESTED_NLATTR_OBJECT_EX_.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

        rtnl_mdb: decode br_port_msg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for struct br_mdb_entry
        in <linux/if_bridge.h>.
        (AC_CHECK_MEMBERS): Check for flags and vid fields in struct br_mdb_entry.
        * rtnl_mdb.c: Include "xlat/mdb_flags.h", "xlat/mdb_states.h",
        "xlat/rtnl_mdba_mdb_attrs.h", "xlat/rtnl_mdba_mdb_eattr_attrs.h",
        "xlat/rtnl_mdba_mdb_entry_attrs.h" ,"xlat/rtnl_mdba_router_attrs.h"
        and "xlat/rtnl_mdba_router_pattr_attrs.h".
        (decode_mdba_mdb_entry_info, decode_mdba_mdb_entry,
        decode_mdba_mdb, decode_multicast_router_type,
        decode_mdba_router_port, decode_mdba_router): New functions.
        (mdba_mdb_eattr_nla_decoders, mdba_mdb_entry_nla_decoders,
        mdba_mdb_nla_decoders, mdba_router_pattr_nla_decoders,
        mdba_router_nla_decoders, br_port_msg_nla_decoders): New arrays.
        (decode_br_port_msg): Use br_port_msg_nla_decoders.
        * xlat/mdb_flags.in: New file.
        * xlat/mdb_states.in: Likewise.
        * xlat/multicast_router_types.in: Likewise.
        * xlat/rtnl_mdba_mdb_attrs.in: Likewise.
        * xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
        * xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
        * xlat/rtnl_mdba_router_attrs.in: Likewise.
        * xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: implement decoding of INET_DIAG_CLASS_ID attribute.
        This is a new netlink attribute introduced by linux kernel commit
        v4.14-rc1~130^2~207.

        * linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum.
        * netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add
        INET_DIAG_CLASS_ID.
        * xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID.
        * xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1).
        * tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID
        decoding.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update MEMBARRIER_CMD_* constants.
        * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED
        introduced by kernel commit v4.14-rc1~174^2^2^4.
        * NEWS: Mention this.
        * tests/membarrier.c (main): Update expected output.

        Update UFFD_FEATURE_* constants.
        * xlat/memfd_create_flags.in: Remove UFFD_FEATURE_EVENT_EXIT removed
        by kernel commit v4.11-rc2~15^2~18.
        Add UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID introduced by kernel
        commits v4.14-rc1~126^2~28 and v4.14-rc1~126^2~23, repsectively.
        * NEWS: Mention this.

        Update MFD_* constants.
        * xlat/memfd_create_flags.in: Add MFD_HUGETLB introduced
        by kernel commit v4.14-rc1~126^2~17.
        * NEWS: Mention this.
        * tests/memfd_create.c (main): Update expected output.

        Update ETH_P_* constants.
        * xlat/ethernet_protocols.in: Add ETH_P_ERSPAN, ETH_P_NSH, ETH_P_IFE,
        and ETH_P_MAP introduced by kernel commits v4.14-rc1~130^2~164,
        v4.14-rc1~130^2~89^2~3, v4.14-rc1~130^2~90^2~2, and
        v4.14-rc1~130^2~78^2~2, respectively.
        * NEWS: Mention this.

        Update ARPHRD_* constants.
        * xlat/arp_hardware_types.in: Add ARPHRD_RAWIP introduced
        by kernel commit v4.14-rc1~130^2~78^2~1.
        * NEWS: Mention this.

        Update BPF_* constants.
        * xlat/bpf_attach_type.in: Add BPF_SK_SKB_STREAM_PARSER
        and BPF_SK_SKB_STREAM_VERDICT introduced by kernel commit
        v4.14-rc1~130^2~123^2~8.
        * xlat/bpf_map_flags.in: Add BPF_F_NO_COMMON_LRU and BPF_F_NUMA_NODE
        introduced by kernel commits v4.10-rc1~202^2~271^2~2
        and v4.14-rc1~130^2~196^2~1, respectively.
        * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_DEVMAP
        and BPF_MAP_TYPE_SOCKMAP introduced by kernel commits
        v4.14-rc1~130^2~497^2~4 and v4.14-rc1~130^2~234^2~4,
        respectively.
        * xlat/bpf_op_jmp.in: Add BPF_JLT, BPF_JLE, BPF_JSLT, and BPF_JSLE
        introduced by kernel commit v4.14-rc1~130^2~309^2~8.
        * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SK_SKB introduced
        by kernel commit v4.14-rc1~130^2~234^2~6.
        * NEWS: Mention this.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit
        v4.14-rc1~130^2~376^2~5.
        * NEWS: Mention this.

        Update MADV_* constants.
        * xlat/madvise_cmds.in: Add MADV_WIPEONFORK and MADV_KEEPONFORK
        introduced by kernel commit v4.14-rc1~126^2.
        * NEWS: Mention this.

2017-09-08  Baruch Siach  <baruch@tkos.co.il>

        error_prints: fix potential program_invocation_name type conflict.
        uClibc-ng declares program_invocation_name as const.
        This causes the build failure below:

        error_prints.c:40:14: error: conflicting types for ‘program_invocation_name’
         extern char *program_invocation_name;
                      ^~~~~~~~~~~~~~~~~~~~~~~
        In file included from error_prints.c:32:0:
        .../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of ‘program_invocation_name’ was here
         extern const char *program_invocation_name, *program_invocation_short_name;
                            ^~~~~~~~~~~~~~~~~~~~~~~

        * error_prints.c (program_invocation_name): Declare only in case
        of [!HAVE_PROGRAM_INVOCATION_NAME].

2017-09-07  JingPiao Chen  <chenjingpiao@gmail.com>

        rtnl_tc_action: decode tcamsg netlink attributes.
        * rtnl_tc_action.c (tcamsg_nla_decoders): New array.
        (decode_tcamsg): Use it.

        tests: check decoding of TCA_STAB netlink attribute of tcmsg.
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro.
        * tests/nlattr_tca_stab.c: New file.
        * tests/gen_tests.in (nlattr_tca_stab): New entry.
        * tests/pure_executables.list: Add nlattr_tca_stab.
        * tests/.gitignore: Likewise.

        tests: check decoding of TCA_STATS2 netlink attribute of tcmsg.
        * tests/nlattr_tc_stats.c: New file.
        * tests/gen_tests.in (nlattr_tc_stats): New entry.
        * tests/pure_executables.list: Add nlattr_tc_stats.
        * tests/.gitignore: Likewise.

        tests: check decoding of tcmsg netlink attributes.
        * tests/nlattr_tcmsg.c: Include <stddef.h> and <linux/pkt_sched.h>.
        (main): Check decoding of TCA_STATS and TCA_RATE.

        rtnl_tc: decode tcmsg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic,
        gnet_stats_queue, gnet_stats_rate_est,
        and gnet_stats_rate_est64 structures in <linux/gen_stats.h>.
        And check for struct tc_sizespec in <linux/pkt_sched.h>.
        * nlattr.h (tc_stats): New prototype.
        * rtnl_tc.c: Include <linux/gen_stats.h>, <linux/pkt_sched.h>,
        "xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h".
        (decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic,
        decode_gnet_stats_rate_est, decode_gnet_stats_queue,
        decode_gnet_stats_rate_est64, decode_nla_tc_stats,
        decode_tc_sizespec, print_stab_data, decode_tca_stab_data,
        decode_tca_stab): New functions.
        (tca_stats_nla_decoders, tca_stab_nla_decoders,
        tcmsg_nla_decoders): New arrays.
        (decode_tcmsg): Use tcmsg_nla_decoders.
        * xlat/rtnl_tca_stab_attrs.in: New file.
        * xlat/rtnl_tca_stats_attrs.in: Likewise.

2017-09-07  Dmitry V. Levin  <ldv@altlinux.org>

        Update TCP_* constants.
        * xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT.
        * NEWS: Mention this.

        Update SOL_* constants.
        * xlat/socketlayers.in: Add SOL_TLS.
        * NEWS: Mention this.

2017-09-06  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.19-1.
        * strace.spec.in: Likewise.

2017-09-05  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.19 release.
        * NEWS: Update for 4.19 release.

        .mailmap: add canonical name and address of Edgar Kaziakhmedov.
        * .mailmap: Add canonical name and address of Edgar Kaziakhmedov here
        to avoid duplications in CREDITS file.

        maint: add gen-tag-message.sh script.
        * maint/gen-tag-message.sh: New file.

        maint: add gen-contributors-list.sh script.
        * maint/gen-contributors-list.sh: New file.

2017-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update copyright headers.
        Headers updated automatically with

            maint/update_copyright_headers.sh -c

2017-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        update_copyright_years.sh: add ability to automatically commit results.
        * maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE,
        GIT_COMMIT_MESSAGE): New variables.
        <-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string
        as a template.

2017-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        configure.ac: specify minimal GNU Automake version.
        In order to provide better diagnostics.

        * configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as
        1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro.

        Closes: https://github.com/strace/strace/issues/11

2017-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2017-09-03  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of IFLA_XDP netlink attribute of ifinfomsg.
        * tests/nlattr_ifla_xdp.c: New file.
        * tests/gen_tests.in (nlattr_ifla_xdp): New entry.
        * tests/pure_executables.list: Add nlattr_ifla_xdp.
        * tests/.gitignore: Likewise.

        tests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg.
        * tests/nlattr_ifla_port.c: New file.
        * tests/gen_tests.in (nlattr_ifla_port): New entry.
        * tests/pure_executables.list: Add nlattr_ifla_port.
        * tests/.gitignore: Likewise.

        tests: check decoding of more ifinfomsg netlink attributes.
        * tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS,
        IFLA_INFO_KIND, IFLA_VF_PORT): New macros.
        (main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS.

        rtnl_link: decode more ifinfomsg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi
        in <linux/if_link.h>.
        * rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h",
        "xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h",
        "xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h".
        (decode_ifla_linkinfo, decode_ifla_port_vsi,
        decode_ifla_port, decode_ifla_vf_ports,
        decode_ifla_xdp_flags, decode_ifla_xdp): New functions.
        (ifla_linkinfo_nla_decoders, ifla_port_nla_decoders,
        ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays.
        (ifinfomsg_nla_decoders) <IFLA_LINKINFO>: Use decode_ifla_linkinfo.
        <IFLA_VF_PORTS>: Use decode_ifla_vf_ports.
        <IFLA_PORT_SELF>: Use decode_ifla_port.
        <IFLA_XDP>: Use decode_ifla_xdp.
        * xlat/rtnl_ifla_info_attrs.in: New file.
        * xlat/rtnl_ifla_port_attrs.in: Likewise.
        * xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
        * xlat/rtnl_ifla_xdp_attrs.in: Likewise.
        * xlat/xdp_flags.in: Likewise.

2017-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE.
        * fetch_struct_keyctl_kdf_params.c: New file.
        * keyctl_kdf_params.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * configure.ac: Add check for struct keyctl_kdf_params presence in
        <linux/keyctl.h>.
        * defs.h (struct strace_keyctl_kdf_params): Add forward declaration.
        * keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it
        on exiting.
        (SYS_FUNC(keyctl)) <case KEYCTL_DH_COMPUTE>: Pass arg5 to
        keyctl_dh_compute.
        * tests/keyctl.c: Include assert.h.
        (struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New
        definition.
        (STR32): New definition, copied from ioctl_dm.c.
        (append_str, kckdfp_to_str): New functions.
        (main): Update expected output, add checks for struct keyctl_kdf_params
        decoding.

        tests/keyctl: improve readability.
        * tests/keyctl.c: Since do_keyctl() has so convoluted calling convention
        and keyctl test is so complex, let's try to improve readability a bit
        with some conventions regarding do_keyctl() call formatting: arguments
        representing single keyctl argument should be put on the separate line,
        continuations of arguments related to the same keyctl argument should
        have additional indentation and termination 0UL should always be
        on a separate line.  Also, while we are here, let's add spaces
        to two type casts that are missing them.

2017-09-01  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        s390: update ioctl entries from linux 4.13.
        * linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh.

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: fix regression introduced by the previous cleanup.
        * mpers.awk (what_is): Remove returned_size from local variables.

        Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently")

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_link: enhance decoding of struct rtnl_link_stats{,64}
        Enhance runtime detection of struct rtnl_link_stats.rx_nohandler
        and struct rtnl_link_stats64.rx_nohandler.

        * rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length
        greater than min_size but less than sizeof(struct rtnl_link_stats).
        (decode_rtnl_link_stats64): Likewise, so not accept structure length
        greater than min_size but less than sizeof(struct rtnl_link_stats64).

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_neightbl: enhance decoding of struct ndt_stats.
        Add support of kernels that operate with older definition of
        struct ndt_stats than the definition used to build strace.

        * rtnl_neightbl.c (decode_ndt_stats): Add runtime detection
        of struct ndt_stats.ndts_table_fulls field, print the field
        when it is available.

2017-09-01  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg.
        * tests/nlattr_ifla_brport.c: New file.
        * tests/gen_tests.in (nlattr_ifla_brport): New entry.
        * tests/pure_executables.list: Add nlattr_ifla_brport.
        * tests/.gitignore: Likewise.
        * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro.

        rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg.
        * configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id
        and rtnl_link_stats64 structures in <linux/if_link.h>.
        * rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h".
        (decode_ifla_bridge_id, decode_ifla_protinfo): New functions.
        (ifla_brport_nla_decoders): New array.
        (ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo.
        * xlat/rtnl_ifla_brport_attrs.in: New file.

        tests: check decoding of ndtmsg netlink attributes.
        * tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros.
        (main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS.

        rtnl_neightbl: decode ndtmsg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for ndt_config
        and ndt_stats structures in <linux/neighbour.h>.
        (AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats.
        * rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h".
        (decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions.
        (ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays.
        (decode_ndtmsg): Use ndtmsg_nla_decoders.
        * xlat/rtnl_neightbl_parms_attrs.in: New file.

        tests: check decoding of ifaddrlblmsg netlink attributes.
        * tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS.

        rtnl_addrlabel: decode ifaddrlblmsg netlink attributes.
        * rtnl_addrlabel.c (decode_ifal_address): New function.
        (ifaddrlblmsg_nla_decoders): New array.
        (decode_ifaddrlblmsg): Use it.

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: wire up new syscalls.
        * linux/alpha/syscallent.h [514..522]: New entries.

2017-08-31  JingPiao Chen  <chenjingpiao@gmail.com>

        tests/.gitignore: add missing files that should be ignored.
        * tests/.gitignore: Add is_linux_mips_n64.

2017-08-31  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: declare local variables consistently.
        * mpers.awk (compare_indices): Make c1 and c2 variables local.
        (enter): Make item variable local.
        (what_is): Make loc_diff, returned_size, and to_return local.

2017-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: separate local variables from real parameters by newline.
        * mpers.awk (array_get, update_upper_bound): Separate local variables
        from real parameters by newline.

2017-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_rule: enhance FRA_TABLE decoding.
        The attribute of FRA_TABLE is not just a 32-bit integer, some constants
        have well-known symbolic names like RT_TABLE_DEFAULT.

        * rtnl_rule.c (fib_rule_hdr_nla_decoders) <FRA_TABLE>:
        Use decode_nla_rt_class.
        * tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro.
        (main): Check FRA_TABLE decoding.

2017-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_route: enhance RTA_TABLE decoding.
        The attribute of RTA_TABLE is not just a 32-bit integer, some constants
        have well-known symbolic names like RT_TABLE_DEFAULT.

        * nlattr.h (decode_nla_rt_class): New prototype.
        * rtnl_route.c (decode_nla_rt_class): New function.
        (rtmsg_nla_decoders) <RTA_TABLE>: Use it.
        * tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding.

2017-08-29  JingPiao Chen  <chenjingpiao@gmail.com>

        rtnl_nsid: decode rtgenmsg netlink attributes.
        * rtnl_nsid.c (rtgenmsg_nla_decoders): New array.
        (decode_rtgenmsg): Use it.

        rtnl_netconf: decode netconfmsg netlink attributes.
        * rtnl_netconf.c (netconfmsg_nla_decoders): New array.
        (decode_netconfmsg): Use it.

        tests: check decoding of ndmsg netlink attributes.
        * tests/nlattr_ndmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
        (NDA_PORT): New macro.
        (main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT.

        rtnl_neigh: decode ndmsg netlink attributes.
        * nlattr.c: Include <netinet/in.h> and <arpa/inet.h>.
        (decode_nla_be16): New function.
        * nlattr.h (decode_nla_be16): New prototype.
        * rtnl_neigh.c (decode_neigh_addr,
        decode_nda_cacheinfo): New functions.
        (ndmsg_nla_decoders): New array.
        (decode_ndmsg): Use it.

        tests: check decoding of fib_rule_hdr netlink attributes.
        * tests/nlattr_fib_rule_hdr.c: Include <inttypes.h>.
        (FRA_TUN_ID, FRA_UID_RANGE): New macros.
        (main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID.

        rtnl_rule: decode fib_rule_hdr netlink attributes.
        * configure.ac (AC_CHECK_FUNCS): Add be64toh.
        (AC_CHECK_TYPES): Check for struct fib_rule_uid_range
        in <linux/fib_rules.h>.
        * nlattr.c: Include <endian.h>.
        (decode_nla_be64): New function.
        * nlattr.h (decode_nla_be64): New prototype.
        * rtnl_rule.c (decode_rule_addr,
        decode_fib_rule_uid_range): New functions.
        (fib_rule_hdr_nla_decoders): New array.
        (decode_fib_rule_hdr): Use it.

        rtnl_neigh: fix ndm_type field decode in struct ndmsg.
        * defs.h (routing_types): New xlat prototype.
        * rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
        * xlat/nda_types.in: Remove it.
        * tests/netlink_route.c (test_rtnl_neigh): Update the test.
        * tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        Disallow more than one signal= specification in an injection expression.
        Specifying several signal= specifications in an injection expressions
        makes no sense.

        * filter_qualify.c (parse_inject_token): Disallow second
        signal= specification.
        * strace.1.in: Document it.
        * tests/qual_inject-syntax.test: Check it.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        Add "flags" field to struct inject_data.
        Introduce "flags" field to struct inject_data and use it instead
        of magic rval and signo constants.
        Due to layout of struct inject_data, this new field does not change
        sizeof(struct inject_data).

        * defs.h (INJECT_F_RETVAL, INJECT_F_SIGNAL): New macros.
        (INJECT_OPTS_RVAL_DEFAULT): Remove macro.
        (struct inject_data): Add "flags" field.
        * filter_qualify.c (parse_inject_token, qualify_inject_common): Check
        struct inject_data.flags instead of inject_data.rval
        and inject_data.signo, do not initialize inject_opts.data.
        * syscall.c (tamper_with_syscall_entering): Check struct
        inject_data.flags instead of inject_data.rval and inject_data.signo.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>
            Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Move inject data of struct inject_opts to inject_data substructure.
        * defs.h (inject_data): New structure.
        (struct inject_opts): Replace "signo" and "rval" fields with "data"
        field of type "struct inject_data".
        * filter_qualify.c (parse_inject_token, qualify_inject_common): Update
        for the new layout of struct inject_opts.
        * syscall.c (tamper_with_syscall_entering, tamper_with_syscall_exiting):
        Likewise.

2017-08-28  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.13-rc7.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.13-rc7 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/arm/ioctls_arch0.h: Likewise.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

2017-08-28  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of ifinfomsg netlink attributes.
        * tests/nlattr_ifinfomsg.c: Include <stddef.h> and <linux/if_link.h>.
        (IFLA_LINK_NETNSID): New macro.
        (main): Check decoding of IFLA_LINK_NETNSID,
        IFLA_STATS, IFLA_MAP and IFLA_STATS64.

        rtnl_link: decode ifinfomsg netlink attributes.
        * configure.ac (AC_CHECK_HEADERS): Add linux/if_link.h.
        (AC_CHECK_TYPES): Check for struct rtnl_link_stats64
        in <linux/if_link.h>.
        (AC_CHECK_MEMBERS): Check for rx_nohandler field
        in struct rtnl_link_stats/rtnl_link_stats64.
        * rtnl_link.c: Include <linux/if_link.h>.
        (decode_rtnl_link_stats, decode_rtnl_link_ifmap,
        decode_rtnl_link_stats64): New functions.
        (ifinfomsg_nla_decoders): New array.
        (decode_ifinfomsg): Use it.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>
            Eugene Syromyatnikov  <evgsyr@gmail.com>

        Imply RVAL_DECODED when RVAL_IOCTL_PARSED is returned on entering.
        Also, rename RVAL_IOCTL_PARSED to RVAL_IOCTL_DECODED as the latter
        is a more suitable name.

        * defs.h (RVAL_IOCTL_PARSED): Rename to RVAL_IOCTL_DECODED.
        * ioctl.c (ioctl_decode): Update comment.
        (SYS_FUNC(ioctl)): Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED,
        add convertation of RVAL_IOCTL_DECODED to RVAL_DECODED.
        * block.c (block_ioctl): Replace RVAL_DECODED | RVAL_IOCTL_PARSED
        with RVAL_IOCTL_DECODED on entering.  Replace RVAL_IOCTL_PARSED
        with RVAL_IOCTL_DECODED on exiting.
        * btrfs.c (btrfs_ioctl): Likewise.
        * evdev.c: Likewise.
        * file_ioctl.c: Likewise.
        * fs_x_ioctl.c: Likewise.
        * hdio.c: Likewise.
        * loop.c: Likewise.
        * mtd.c: Likewise.
        * nsfs.c: Likewise.
        * print_sg_req_info.c: Likewise.
        * ptp.c: Likewise.
        * rtc.c: Likewise.
        * scsi.c: Likewise.
        * sg_io_v3.c: Likewise.
        * sg_io_v4.c: Likewise.
        * sock.c: Likewise.
        * term.c: Likewise.
        * ubi.c: Likewise.
        * userfaultfd.c: Likewise.
        * dm.c (dm_known_ioctl): Return RVAL_IOCTL_DECODED on exiting and 0
        on entering.  Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED
        on exiting.
        * v4l2.c: Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Replace return 1 ioctl sub-decoder hack with proper flag.
        * defs.h (RVAL_IOCTL_PARSED): Introduce new flag for ioctl sub-decoders
        * to signalise that they have successfully printed argument.
        * ioctl.c (SYS_FUNC(ioctl)): Check for RVAL_IOCTL_PARSED flag, remove
        un-set it before returning the value.
        * block.c: Use RVAL_IOCTL_PARSED instead of 1.
        * btrfs.c: Likewise.
        * dm.c: Likewise.
        * evdev.c: Likewise.
        * file_ioctl.c: Likewise.
        * fs_x_ioctl.c: Likewise.
        * hdio.c: Likewise.
        * loop.c: Likewise.
        * mtd.c: Likewise.
        * nsfs.c: Likewise.
        * print_sg_req_info.c: Likewise.
        * ptp.c: Likewise.
        * rtc.c: Likewise.
        * scsi.c: Likewise.
        * sg_io_v3.c: Likewise.
        * sg_io_v4.c: Likewise.
        * sock.c: Likewise.
        * term.c: Likewise.
        * ubi.c: Likewise.
        * userfaultfd.c: Likewise.
        * v4l2.c: Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: streamline logic.
        Move exiting path out of if (entering(tcp)) { ... return 0; } else,
        provide common exit point in v4l2_ioctl handler, use break instead of
        return in specific command handlers.

        * v4l2.c (print_v4l2_format, print_v4l2_buffer, print_v4l2_standard,
        print_v4l2_input, print_v4l2_frmivalenum): Move exiting path out of else
        par of the entering(tcp) condition.
        (v4l2_ioctl): Add return RVAL_DECODED | 1 at the end of function.
        (v4l2_ioctl) <case VIDIOC_S_STD, case VIDIOC_S_INPUT>: Replace return
        with break.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: reorder field printing in order to avoid auxstr usage.
        Also rework flow a little in order to reduce amount of indentation.

        * v4l2.c (print_v4l2_requestbuffers): Print count as the last field on
        entering, append it with updated value on exiting.
        * tests/ioctl_v4l2.c: Update expected output.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        userfaultfd: streamline logic.
        Make userfaultfd ioctl handling more in line with other ioctl decoders.

        * userfaultfd.c (uffdio_ioctl): Return RVAL_DECODED | 1, break instead
        of returning in specific command handlers, return 0 on entering paths,
        move exiting paths out of else branch of entering(tcp) condition.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Do not return RVAL_DECODED on exiting path of ioctl decoders.
        * print_sg_req_info.c (decode_sg_req_info): Return 1 instead of
        RVAL_DECODED | 1 on exiting path.
        * scsi.c (decode_sg_scsi_id): Likewise.
        * sg_io_v3.c (decode_response): Likewise.
        * sg_io_v4.c (decode_response): Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        dm: return RVAL_DECODED instead of 0 if we can't decode command.
        Return RVAL_DECODED if we can't decode command in order to avoid being
        called on exiting.

        * dm.c (dm_ioctl): Return RVAL_DECODED instead of 0 if command can't be
        decoded.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Return 0 instead of 1 on entering path of ioctl decoders.
        As returning 1 (without RVAL_DECODED) on entering makes no sense.

        * block.c (block_ioctl) <case BLKTRACESETUP>: Replace return 1 with
        return 0 on entering path.
        * ptp.c (ptp_ioctl) <case PTP_SYS_OFFSET>: Likewise.
        * sg_io_v3.c (decode_request): Likewise.
        * sg_io_v4.c (decode_request): Likewise.
        * sock.c (decode)ifconf, sock_ioctl) <case SIOCGIFMAP>: Likewise.
        * ubi.c (ubi_ioctl) <case UBI_IOCMKVOL, case UBI_IOCATT>: Likewise.
        * v4l2.c (print_v4l2_ext_controls): Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: simplify ioctl_decode handling, document its return value semantics
        * ioctl.s (SYS_FUNC(ioctl.c)): Unconditionally unset 1, simply print arg
        when (ret & RVAL_DECODED) && !(ret & 1).

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: define personality names for all multi-personality architectures
        I see no reason for not having these definitions for SPARC64 and RISC-V.
        Also, borrow the check template from supported_personalities.h.

        * syscall.c (update_personality) [defined RISCV, defined SPARC64]
        <PERSONALITY_NAMES>: Define it for these architectures.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        copyright-year-gen: workaround for old git versions.
        Apply the same treatment to this script as the one in
        v4.18-278-g295cf32.

        * copyright-year-gen <year>: Change format to format:%cD, remove --date,
        supply output as a -d option argument to date +%Y.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ubi: trim overly long lines.

        term: use print_quoted_string.
        * term.c (decode_termios): Use print_quoted_string for printing c_cc field
        instead of writing the printing code by hand.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        update_copyright_years.sh: workaround for old git versions.
        Old git versions (like the one shipped in Debian 8) do not support setting
        date format with --date, working this around by processing git log output
        with date +%Y.

        * main/update_copyright_years.sh (process_file) <first_commit_year,
        last_commit_year>: Change format to format:%aD, remove --date, supply
        output as a -d option argument to date +%Y.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        syscall: use spaces in tile personality names, de-duplicate definition.
        As Chris Metcalf, the author of v4.7-40-g0b99a8a, told in private, there
        is no strong reason for having tile's personality name different from
        personality names on other architectures, so let's use spaces instead of
        dashes here. And, while we are here, remove duplication of personality
        name definitions for various architectures.

        * syscall.c (update_personality) [defined TILE]: Change dashes to spaces
        in personality names.

2017-08-26  JingPiao Chen  <chenjingpiao@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of rtmsg netlink attributes.
        * tests/nlattr_rtmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
        (LWTUNNEL_ENCAP_NONE, RTA_ENCAP_TYPE): New macros.
        (main): Check decoding of RTA_DST, RTA_OIF, RTA_METRICS, RTA_MULTIPATH,
        RTA_CACHEINFO, RTA_MFC_STATS, RTA_VIA, and RTA_ENCAP_TYPE.

        rtnl_route: decode rtmsg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for
        rta_mfc_stats and rtvia structures in <linux/rtnetlink.h>.
        * nlattr.c (decode_nla_ifindex): New function.
        * nlattr.h (decode_nla_ifindex): New prototype.
        * rtnl_route.c (decode_route_addr, decode_rta_metrics,
        decode_rta_multipath, decode_rta_cacheinfo,
        decode_rta_mfc_stats, decode_rtvia,
        decode_rta_encap_type): New functions.
        (rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays.
        (decode_rtmsg): Use rtmsg_nla_decoders.
        * xlat/lwtunnel_encap_types.in: New file.
        * xlat/route_nexthop_flags.in: Likewise.
        * xlat/rtnl_rta_metrics_attrs.in: Likewise.

2017-08-25  Dmitry V. Levin  <ldv@altlinux.org>

        s390: wire up s390_guarded_storage syscall.
        * linux/s390/syscallent.h [378]: Add s390_guarded_storage entry.
        * linux/s390x/syscallent.h: Likewise.

        microblaze: wire up statx syscall.
        * linux/microblaze/syscallent.h [398]: Add statx entry.

2017-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        alloc_number_set_array: add ATTRIBUTE_MALLOC.
        * number_set.h: Include "gcc_compat.h".
        (alloc_number_set_array): Add ATTRIBUTE_MALLOC.

2017-08-24  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        Add macros for testing QUAL_* flags.
        * defs.h (traced, raw, inject): Add macros for testing QUAL_TRACE,
        QUAL_RAW, and QUAL_INJECT flags.
        * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use them.

2017-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        Remove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE.
        Remove these flags that are unused since commit v4.15~26.
        They might be introduced later with a different meaning.

        * defs.h (QUAL_SIGNAL, QUAL_READ, QUAL_WRITE): Remove.

2017-08-24  Eugene Syromiatnikov  <evgsyr@gmail.com>

        xstrdup, xtrndup: allow NULL argument.
        Accept NULL argument in xstrdup and xtrndup functions to allow use
        of "xstrdup(str)" instead of "str ? xstrdup(str) : NULL".

        * xmalloc.c (xstrdup, xstrndup): Handle NULL argument.
        * xmalloc.h: Add comment regarding this deviation from the behaviour
        of the POSIX counterparts of these functions.

2017-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: really skip mips o32 scno tampering tests on mips n64.
        * tests/is_linux_mips_n64.c: New file.
        * tests/Makefile.am (check_PROGRAMS): Add it.
        * tests/scno_tampering.sh <$STRACE_ARCH == mips>:
        In case of mips o32 abi, skip the test if is_linux_mips_n64 says
        that the kernel is mips n64, even if "uname -m" claims it's mips.

2017-08-22  Dmitry V. Levin  <ldv@altlinux.org>

        Hide struct number_set implementation details from users.
        * number_set.h (number_slot_t, struct number_set): Move to number_set.c.
        (struct number_set): Add forward declaration.
        (read_set, write_set, signal_set): Change prototypes from objects
        to pointers.
        * filter_qualify.c (read_set, write_set, signal_set): Change definitions
        from objects to pointers.
        (abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change
        definitions from arrays to pointers.
        (qualify_read): Initialize read_set before first use.
        (qualify_write): Initialize write_set before first use.
        (qualify_signals): Initialize signal_set before first use.
        (qualify_trace): Initialize trace_set before first use.
        (qualify_abbrev): Initialize abbrev_set before first use.
        (qualify_verbose): Initialize verbose_set before first use.
        (qualify_raw): Initialize raw_set before first use.
        (qualify_inject_common): Initialize inject_set before first use.
        * strace.c (print_signalled, print_stopped): Update signal_set usage.
        * syscall.c (dumpio): Update usage of read_set and write_set.

        Extend number_set interface.
        * number_set.h (number_set_array_is_empty, is_number_in_set_array,
        add_number_to_set_array, clear_number_set_array,
        invert_number_set_array, alloc_number_set_array, free_number_set_array):
        New function prototypes.
        * number_set.c (number_set_array_is_empty, is_number_in_set_array,
        add_number_to_set_array, clear_number_set_array,
        invert_number_set_array, alloc_number_set_array, free_number_set_array):
        New functions.
        * basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
        qualify_syscall_class, qualify_syscall_name): Use
        add_number_to_set_array.
        (qualify_syscall_tokens, qualify_tokens): Use
        clear_number_set_array and invert_number_set_array.
        * filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
        number_set_array_is_empty, is_number_in_set_array,
        add_number_to_set_array, and free_number_set_array.
        (qual_flags): Use is_number_in_set_array.

        Move number_set interface to separate files.
        * number_set.c: New file.
        * number_set.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * basic_filters.c: Include "number_set.h".
        (number_slot_t, struct number_set): Move to number_set.h.
        (BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
        add_number_to_set, is_number_in_set): Move to number_set.c.
        * defs.h (struct number_set): Remove forward declaration.
        (read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
        * filter.h (add_number_to_set): Move to number_set.h.
        * filter_qualify.c: Include "number_set.h".
        (number_slot_t, struct number_set): Remove.
        * strace.c: Include "number_set.h".
        * syscall.c: Likewise.

2017-08-22  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

        Move SUPPORTED_PERSONALITIES to a separate file.
        Since the defs.h contains unrelated declarations which are
        redundant (and sometimes conflicting) for other binaries included
        in the strace package, move SUPPORTED_PERSONALITIES defintions
        to a separate file.

        * defs.h: Include "supported_personalities.h".
        (SUPPORTED_PERSONALITIES): Move ...
        * supported_personalities.h: ... to the new file.
        * Makefile.am (strace_SOURCES): Add it.

2017-08-22  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

        Move string_to_uint* functions to a separate file.
        Make string_to_uint* functions available to other binaries
        included in the strace package.

        * string_to_uint.h: New file.
        * defs.h: Include it.
        (string_to_uint_ex, string_to_uint_upto, string_to_uint): Move
        to string_to_uint.h.
        * util.c (string_to_uint_ex, string_to_uint): Move ...
        * string_to_uint.c: ... to the new file.
        * Makefile.am (strace_SOURCES): Add string_to_uint.h and string_to_uint.c.

2017-08-22  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of ifaddrmsg netlink attributes.
        * tests/nlattr_ifaddrmsg.c: Include <arpa/inet.h>.
        (IFA_FLAGS, SET_IFA_FAMILY): New macros.
        (init_ifaddrmsg): Set ifaddrmsg.ifa_family field from ifa_family.
        (print_ifaddrmsg): Print ifaddrmsg.ifa_family field using ifa_family_str.
        (main): Check decoding of IFA_ADDRESS, IFA_CACHEINFO, and IFA_FLAGS.

        rtnl_addr: decode ifaddrmsg netlink attributes.
        * rtnl_addr.c (decode_ifa_address,
        decode_ifa_cacheinfo, decode_ifa_flags): New functions.
        (ifaddrmsg_nla_decoders): New array.
        (decode_ifaddrmsg): Use it.

2017-08-22  Dmitry V. Levin  <ldv@altlinux.org>

        Export decode_inet_addr.
        * defs.h (decode_inet_addr): New prototype.
        * netlink_inet_diag.c (decode_inet_addr): Remove static keyword, move ...
        * sockaddr.c: ... here.

        netlink_inet_diag: prepare decode_inet_addr for export.
        * netlink_inet_diag.c (decode_inet_addr): Change return type to bool,
        parametrize field name using new var_name argument.
        (decode_inet_diag_hostcond): Specify "addr" field name
        to decode_inet_addr.

2017-08-20  Dmitry V. Levin  <ldv@altlinux.org>

        print_inet_addr: add support of invocations without field name.
        Prepare print_inet_addr for use in structureless contexts where
        no structure field name is available.

        * sockaddr.c (print_inet_addr): Handle var_name == NULL.

2017-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        print_inet_addr: print address of unsupported family in hex.
        * sockaddr.c (print_inet_addr): Specify QUOTE_FORCE_HEX
        to print_quoted_string.

2017-08-18  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: do not bail out in get_syscall_args if umoven fails.
        If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
        both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
        process dumpable flag is cleared.  As the first 4 syscall arguments are
        still available via registers, do not treat this as get_syscall_args
        error.

        This condition is triggered and therefore tested by prctl-dumpable test.

        * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSO32]:
        Do not bail out if umoven fails.

2017-08-17  Dmitry V. Levin  <ldv@altlinux.org>

        configure: cleanup struct statfs/statfs64 member checks.
        * configure.ac <AC_CHECK_TYPES([struct statfs])>: Merge several
        AC_CHECK_MEMBERS checks of struct statfs members into a single check.
        <AC_CHECK_TYPES([struct statfs64])>: Likewise, for checks
        of struct statfs64 members.

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix a few harmless -Woverflow compilation warnings.
        Fix the following compilation warnings on platforms where
        sizeof(struct timeval.tv_usec) < sizeof(long):

        xettimeofday.c: In function ‘main’:
        xettimeofday.c:76:16: warning: overflow in implicit constant conversion [-Woverflow]
          tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
        xetitimer.c: In function ‘main’:
        xetitimer.c:170:28: warning: overflow in implicit constant conversion [-Woverflow]
          p_new->it_value.tv_usec = (long) 0xbadc0dedfacefeedLL;
        In file included from utimes.c:38:0:
        xutimes.c: In function ‘main’:
        xutimes.c:110:18: warning: overflow in implicit constant conversion [-Woverflow]
          tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
        futimesat.c: In function ‘main’:
        futimesat.c:121:18: warning: overflow in implicit constant conversion [-Woverflow]
          tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
        In file included from _newselect.c:35:0:
        xselect.c: In function ‘main’:
        xselect.c:94:16: warning: overflow in implicit constant conversion [-Woverflow]
          tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
                        ^
        * tests/futimesat.c (main): In initialization of struct timeval.tv_usec,
        change explicit cast from (long) to (suseconds_t).
        * tests/xetitimer.c: Likewise.
        * tests/xettimeofday.c: Likewise.
        * tests/xselect.c: Likewise.
        * tests/xutimes.c: Likewise.

        Reported-by: Anatoly Pugachev <matorola@gmail.com>

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix sigaction.test on sparc.
        On sparc, the first argument of old sigaction syscall has negated
        semantics, compared to other architectures.  While sigaction.test
        was aware about this arch-specific detail from the beginning, in one
        of many sigaction syscall invocations a non-negative signal number
        was erroneously passed on sparc.

        * tests/sigaction.c (ADDR_INT, SIGNO_INT): New arch-specific macros.
        (signo, addr): Use them.

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        nlattr: fix printing of unrecognized attribute data.
        Do not print more than "nlattr.nla_len - NLA_HDRLEN" bytes
        of unrecognized attribute data.

        * nlattr.c (decode_nlattr_with_data): Specify "nla_len - NLA_HDRLEN"
        instead of "len - NLA_HDRLEN" as the size of unrecognized attribute
        data.
        * tests/nlattr.c (test_nlattr): Check it.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE rtgenmsg attributes.
        * tests/nlattr_rtgenmsg.c: New file.
        * tests/gen_tests.in (nlattr_rtgenmsg): New entry.
        * tests/pure_executables.list: Add nlattr_rtgenmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes.
        * rtnl_nsid.c: Include "nlattr.h" and "xlat/rtnl_nsid_attrs.h".
        (decode_rtgenmsg): Call decode_nlattr.
        * xlat/rtnl_nsid_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE br_port_msg attributes.
        * tests/nlattr_br_port_msg.c: New file.
        * tests/gen_tests.in (nlattr_br_port_msg): New entry.
        * tests/pure_executables.list: Add nlattr_br_port_msg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes.
        * rtnl_mdb.c: Include "netlink.h", "nlattr.h".
        and "xlat/rtnl_mdb_attrs.h".
        (decode_br_port_msg): Call decode_nlattr.
        * xlat/rtnl_mdb_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE netconfmsg attributes.
        * tests/nlattr_netconfmsg.c: New file.
        * tests/gen_tests.in (nlattr_netconfmsg): New entry.
        * tests/pure_executables.list: Add nlattr_netconfmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes.
        * rtnl_netconf.c: Include "netlink.h", "nlattr.h",
        and "xlat/rtnl_netconf_attrs.h".
        (decode_netconfmsg): Call decode_nlattr.
        * xlat/rtnl_netconf_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE dcbmsg attributes.
        * tests/nlattr_dcbmsg.c: New file.
        * tests/gen_tests.in (nlattr_dcbmsg): New entry.
        * tests/pure_executables.list: Add nlattr_dcbmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes.
        * rtnl_dcb.c: Include "netlink.h", "nlattr.h",
        and "xlat/rtnl_dcb_attrs.h".
        (decode_dcbmsg): Call decode_nlattr.
        * xlat/rtnl_dcb_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes.
        * tests/nlattr_ifaddrlblmsg.c: New file.
        * tests/gen_tests.in (nlattr_ifaddrlblmsg): New entry.
        * tests/pure_executables.list: Add nlattr_ifaddrlblmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes.
        * rtnl_addrlabel.c: Include "netlink.h", "nlattr.h",
        and "xlat/rtnl_addrlabel_attrs.h".
        (decode_ifaddrlblmsg): Call decode_nlattr.
        * xlat/rtnl_addrlabel_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE tcamsg attributes.
        * tests/nlattr_tcamsg.c: New file.
        * tests/gen_tests.in (nlattr_tcamsg): New entry.
        * tests/pure_executables.list: Add nlattr_tcamsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE tcamsg attributes.
        * rtnl_tc_action.c: Include "nlattr.h" and "xlat/rtnl_tc_action_attrs.h".
        (decode_tcamsg): Call decode_nlattr.
        * xlat/rtnl_tc_action_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE tcmsg attributes.
        * tests/nlattr_tcmsg.c: New file.
        * tests/gen_tests.in (nlattr_tcmsg): New entry.
        * tests/pure_executables.list: Add nlattr_tcmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE tcmsg attributes.
        * rtnl_tc.c: Include "nlattr.h" and "xlat/rtnl_tc_attrs.h".
        (decode_tcmsg): Call decode_nlattr.
        * xlat/rtnl_tc_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE ndtmsg attributes.
        * tests/nlattr_ndtmsg.c: New file.
        * tests/gen_tests.in (nlattr_ndtmsg): New entry.
        * tests/pure_executables.list: Add nlattr_ndtmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes.
        * rtnl_neightbl.c: Include "nlattr.h" and "xlat/rtnl_neightbl_attrs.h".
        (decode_ndtmsg): Call decode_nlattr.
        * xlat/rtnl_neightbl_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE ndmsg attributes.
        * tests/nlattr_ndmsg.c: New file.
        * tests/gen_tests.in (nlattr_ndmsg): New entry.
        * tests/pure_executables.list: Add nlattr_ndmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes.
        * rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h".
        (decode_ndmsg): Call decode_nlattr.
        * xlat/rtnl_neigh_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes.
        * tests/nlattr_fib_rule_hdr.c: New file.
        * tests/gen_tests.in (nlattr_fib_rule_hdr): New entry.
        * tests/pure_executables.list: Add nlattr_fib_rule_hdr.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes.
        * rtnl_rule.c: Include "nlattr.h" and "xlat/rtnl_rule_attrs.h".
        (decode_fib_rule_hdr): Call decode_nlattr.
        * xlat/rtnl_rule_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE rtmsg attributes.
        * tests/nlattr_rtmsg.c: New file.
        * tests/gen_tests.in (nlattr_rtmsg): New entry.
        * tests/pure_executables.list: Add nlattr_rtmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE rtmsg attributes.
        * rtnl_route.c: Include "nlattr.h" and "xlat/rtnl_route_attrs.h".
        (decode_rtmsg): Call decode_nlattr.
        * xlat/rtnl_route_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE ifaddrmsg attributes.
        * tests/nlattr_ifaddrmsg.c: New file.
        * tests/gen_tests.in (nlattr_ifaddrmsg): New entry.
        * tests/pure_executables.list: Add nlattr_ifaddrmsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes.
        * rtnl_addr.c: Include "nlattr.h" and "xlat/rtnl_addr_attrs.h".
        (decode_ifaddrmsg): Call decode_nlattr.
        * xlat/rtnl_addr_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_ROUTE ifinfomsg attributes.
        * tests/nlattr_ifinfomsg.c: New file.
        * tests/gen_tests.in (nlattr_ifinfomsg): New entry.
        * tests/pure_executables.list: Add nlattr_ifinfomsg.
        * tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes.
        * rtnl_link.c: Include "nlattr.h" and "xlat/rtnl_link_attrs.h".
        (decode_ifinfomsg): Call decode_nlattr.
        * xlat/rtnl_link_attrs.in: New file.

2017-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests/test_nlattr.h: include <stdint.h>
        * tests/test_nlattr.h: Include <stdint.h> for definition of uint16_t
        used by init_nlattr.

        tests: use ifindex_lo and IFINDEX_LO_STR.
        * tests/netlink_route.c: Do not check for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (test_rtnl_link, test_rtnl_addr, test_rtnl_neigh, test_rtnl_tc,
        test_rtnl_addrlabel, test_rtnl_mdb): Use ifindex_lo instead
        of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
        * tests/netlink_sock_diag.c: Do not check for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2,
        test_inet_diag_msg, test_smc_diag_req): Use ifindex_lo instead
        of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
        * tests/nlattr_inet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (init_inet_diag_msg): Use ifindex_lo instead of if_nametoindex.
        (print_inet_diag_msg): Use IFINDEX_LO_STR instead of hardcoded string.
        * tests/nlattr_inet_diag_req_compat.c: Do not check
        for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (init_inet_diag_req): Use ifindex_lo instead of if_nametoindex.
        (print_inet_diag_req): Use IFINDEX_LO_STR instead of hardcoded string.
        * tests/nlattr_inet_diag_req_v2.c: Do not check for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (init_inet_diag_req_v2, print_inet_diag_req_v2,
        test_inet_diag_bc_dev_cond): Use ifindex_lo instead of if_nametoindex,
        use IFINDEX_LO_STR instead of hardcoded string.
        * tests/nlattr_packet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
        (if_nametoindex, IFINDEX_LO): Remove.
        (main): Use ifindex_lo instead of if_nametoindex.
        (print_packet_diag_mclist): Use IFINDEX_LO_STR instead of hardcoded
        string.

        tests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR.
        * tests/net-sockaddr.c (if_nametoindex): Remove declaration.
        (check_in6_linklocal, check_ll): Remove HAVE_IF_INDEXTONAME checks,
        Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR instead
        of hardcoded string.

        tests/msg_control: use ifindex_lo and IFINDEX_LO_STR.
        * tests/msg_control.c (test_ip_pktinfo): Use ifindex_lo instead
        of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.

        tests/inet-cmsg: use IFINDEX_LO_STR.
        * tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead
        of hardcoded string.

        tests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR.
        * tests/ip_mreq.c: Do not check for HAVE_IF_INDEXTONAME.
        (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
        instead of hardcoded string.

        tests/group_req: use ifindex_lo and IFINDEX_LO_STR.
        * tests/group_req.c: Do not check for HAVE_IF_INDEXTONAME.
        (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
        instead of hardcoded string.

        tests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests.
        * tests/ifindex.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/tests.h (ifindex_lo): New prototype.
        (IFINDEX_LO_STR): New macro.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

        configure.ac: remove redundant linux/dcbnl.h header check.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/dcbnl.h.
        * rtnl_dcb.c: Replace HAVE_LINUX_DCBNL_H with HAVE_STRUCT_DCBMSG.
        * tests/netlink_route.c: Likewise.

2017-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

        pathtrace: fix typo in comment.

        pathtrace: limit amount of checked poll fds similarly to select limit.
        * pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number
        checked for fd match in poll family syscalls to 1024 * 1024.

        pathtrace: fail poll path match on first failed umove.
        * pathtrace.c (pathtrace_match_set): When checking descriptors of poll
        family syscalls for fd match, break the loop on first failed umove call.

2017-08-14  JingPiao Chen  <chenjingpiao@gmail.com>

        Update NEWS.

2017-08-14  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        tests: check decoding of rtnetlink nsid messages.
        * tests/netlink_route.c (test_rtnl_nsid): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of nsid messages.
        * rtnl_nsid.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_rtgenmsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_DELNSID, RTM_GETNSID,
        and RTM_NEWNSID.

        tests: check decoding of rtnetlink mdb messages.
        * tests/netlink_route.c: Include <netinet/in.h>
        and <linux/if_bridge.h>.
        (test_rtnl_mdb): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of mdb messages.
        * rtnl_mdb.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_br_port_msg): New prototype.
        * configure.ac (AC_CHECK_TYPES): Check for struct br_port_msg
        in <linux/if_bridge.h>.
        * netlink_route.c (route_decoders): Add RTM_DELMDB, RTM_GETMDB,
        and RTM_NEWMDB.

        tests: check decoding of rtnetlink netconf messages.
        * tests/netlink_route.c: Include <linux/netconf.h>.
        (test_rtnl_netconf): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of netconf messages.
        * rtnl_netconf.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_netconfmsg): New prototype.
        * configure.ac (AC_CHECK_TYPES): Check for struct netconfmsg
        in <linux/netconf.h>.
        * netlink_route.c (route_decoders): Add RTM_GETNETCONF
        and RTM_NEWNETCONF.

        tests: check decoding of rtnetlink dcb messages.
        * tests/netlink_route.c: Include <linux/dcbnl.h>.
        (test_rtnl_dcb): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of dcb messages.
        * rtnl_dcb.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_dcbmsg): New prototype.
        * configure.ac (AC_CHECK_HEADERS): Add linux/dcbnl.h.
        (AC_CHECK_TYPES): Check for struct dcbmsg in <linux/dcbnl.h>.
        * netlink_route.c (route_decoders): Add RTM_GETDCB and RTM_SETDCB.
        * xlat/dcb_commands.in: New file.

        tests: check decoding of rtnetlink addrlabel messages.
        * tests/netlink_route.c: Include <linux/if_addrlabel.h>.
        (test_rtnl_addrlabel): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of addrlabel messages.
        * rtnl_addrlabel.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_ifaddrlblmsg): New prototype.
        * configure.ac (AC_CHECK_TYPES): Check for struct ifaddrlblmsg
        in <linux/if_addrlabel.h>.
        * netlink_route.c (route_decoders): Add RTM_DELADDRLABEL,
        RTM_GETADDRLABEL, and RTM_NEWADDRLABEL.

        tests: check decoding of rtnetlink tc action messages.
        * tests/netlink_route.c (test_rtnl_tca): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of tc action messages.
        * rtnl_tc_action.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_tcamsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_DELACTION, RTM_GETACTION,
        and RTM_NEWACTION.

        tests: check decoding of rtnetlink tc messages.
        * tests/netlink_route.c (test_rtnl_tc): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of tc messages.
        * rtnl_tc.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_tcmsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_DELQDISC,
        RTM_GETQDISC, RTM_NEWQDISC, RTM_DELTCLASS, RTM_GETTCLASS,
        RTM_NEWTCLASS, RTM_DELTFILTER, RTM_GETTFILTER, and RTM_NEWTFILTER.

        tests: check decoding of rtnetlink neightbl messages.
        * tests/netlink_route.c (test_rtnl_neightbl): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of neightbl messages.
        * rtnl_neightbl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_ndtmsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_GETNEIGHTBL,
        RTM_NEWNEIGHTBL, and RTM_SETNEIGHTBL.

        tests: check decoding of rtnetlink neigh messages.
        * tests/netlink_route.c: Include <linux/neighbour.h>.
        (test_rtnl_neigh): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of neigh messages.
        * rtnl_neigh.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes.
        * configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h.
        * netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH,
        and RTM_NEWNEIGH.
        * xlat/nda_types.in: New file.
        * xlat/neighbor_cache_entry_flags.in: Likewise.
        * xlat/neighbor_cache_entry_states.in: Likewise.

        tests: check decoding of rtnetlink rule messages.
        * tests/netlink_route.c: Include <linux/fib_rules.h>.
        (test_rtnl_rule): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of rule messages.
        * defs.h (routing_table_ids): New xlat prototype.
        * rtnl_rule.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (ip_type_of_services, routing_table_ids): New xlat prototypes.
        * netlink_route.h (decode_fib_rule_hdr): New prototype.
        * configure.ac (AC_CHECK_HEADERS): Add linux/fib_rules.h.
        * netlink_route.c (route_decoders): Add RTM_DELRULE, RTM_GETRULE,
        and RTM_NEWRULE.
        * xlat/fib_rule_actions.in: New file.
        * xlat/fib_rule_flags.in: Likewise.

        tests: check decoding of rtnetlink route messages.
        * tests/netlink_route.c: Include <linux/ip.h>.
        (test_rtnl_route): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of route messages.
        * defs.h (routing_scopes): New xlat prototype.
        * rtnl_route.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_route.h (decode_rtmsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_DELROUTE, RTM_GETROUTE,
        and RTM_NEWROUTE.
        * xlat/ip_type_of_services.in: New file.
        * xlat/routing_flags.in: Likewise.
        * xlat/routing_protocols.in: Likewise.
        * xlat/routing_table_ids.in: Likewise.
        * xlat/routing_types.in: Likewise.

        tests: check decoding of rtnetlink addr messages.
        * tests/netlink_route.c: Include <linux/if_addr.h>.
        (test_rtnl_addr): New function.
        (main): Use it.

2017-08-13  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add a basic rtnetlink parser of addr messages.
        * rtnl_addr.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h.
        * netlink_route.h (decode_ifaddrmsg): New prototype.
        * netlink_route.c (route_decoders): Add RTM_DELADDR,
        RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST, and RTM_NEWADDR.
        * xlat/ifaddrflags.in: New file.
        * xlat/routing_scopes.in: Likewise.

2017-08-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Make description of discrepancies between libc and kernel APIs more relevant
        Looks like this part was untouched since the days strace supported OSes
        other than Linux. Well, it's time to make it more contemporary.

        * strace.1.in (.SH NOTES): Use faccessat(2) and setrlimit(2)/prlimit(2)
        instead of time(2) and stat(2)/xstat(2) as examples of libc/kernel API
        discrepancies.

2017-08-11  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE.
        * tests/netlink_route.c (test_nlmsg_done): New function.
        (main): Use it.

2017-08-11  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        Add TF flag to inotify_add_watch syscall entries.
        The second argument of the inotify_add_watch syscall is a file name,
        but inotify_add_watch has no TF flag set.

        * linux/32/syscallent.h (inotify_add_watch): Add TF flag.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2017-08-11  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        pathtrace: fix matching of execveat syscall.
        * pathtrace.c (pathtrace_match_set): Add testing of SEN_execveat.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: add indentation to examples.
        * strace.1 (.de CW): Add .in +4n.
        (.de CE): Add .in.

        Generate date for the man page.
        * Makefile.am (dist-hook): Add .strace.1.in.date generation.
        * strace.spec.in (%setup): Likewise.
        * configure.ac (manpage_date): New m4 define.
        (MANPAGE_DATE): New define/subst.
        * strace.1 (.TH): Add manpage date and strace's version.

        Add script for generating date of the last commit for specific file.
        * file-date-gen: New auxiliary script.

        Make strace.1 generated.
        * .gitignore (/strace.1): New entry.
        * configure.ac (AC_CONFIG_FILES): Add strace.1.
        * strace.1.in: Rename from strace.1.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: format synopsis using .SY/.OP macros.
        Also, add .OM and .OR macros and use { ... | ... } syntax for indicating
        possible options regarding mandatory arguments.

        * strace.1 (.OM, .OR): New macro definitions, based on .OP
        (.SH SYNOPSYS): Format using .SY/.OP/.OM/.OR. Put -p/command inside
        { ... | ... } block.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: remove date from .TH, as it is no longer relevant.
        * strace.1 (.TH): Remove date.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: remove .IX definition.
        It is present in groff macros nowadays.

        * strace.1 (.de IX): Remove.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: replace .TP with .TQ between command-line option variants.
        In order to eliminate unneeded space between them.

        * strace.1 (Filtering): Replace .TP with .TQ between different variants
        of the same option.

2017-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        rtnl_link: include "netlink.h" before <linux/rtnetlink.h>
        <sys/socket.h> has to be included before <linux/netlink.h> because
        the latter used to be incomplete in older kernel headers.

        As a local wrapper file called netlink.h was introduced earlier
        to workaround this and related portability issues, include it before
        <linux/rtnetlink.h> that in turn includes <linux/netlink.h>.

        This fixes build on systems with older kernel headers.

        * rtnl_link.c: Include "netlink.h" before <linux/rtnetlink.h>.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        tests: check decoding of rtnetlink link messages.
        * tests/netlink_route.c: Include <linux/if_arp.h>.
        (TEST_NL_ROUTE): New macro.
        (test_rtnl_link): New function.
        (main): Use it.

        netlink: add a basic rtnetlink parser of link messages.
        * netlink_route.h: New file.
        * rtnl_link.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * defs.h (arp_hardware_types, iffflags): New xlat prototypes.
        * netlink_route.c: Include "netlink_route.h"
        and <linux/rtnetlink.h>.
        (netlink_route_decoder_t): New typedef.
        (route_decoders): New array.
        (decode_netlink_route): Use it.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>

        Move nl_route_types definition from netlink.c to netlink_route.c.
        The side effect of #include "xlat/nl_route_types.h" is
        RTM_* constants properly defined in that header file.
        While netlink.c does not use these constants itself,
        netlink_route.c is going to need them soon.

        * defs.h (nl_route_types): New xlat prototype.
        * netlink.c: Move inclusion of "xlat/nl_route_types.h" ...
        * netlink_route.c: ... here.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        tests: check netlink family specific decoder of NETLINK_ROUTE.
        * tests/netlink_route.c: Include <stdint.h>,
        include "test_netlink.h" instead of "netlink.h".
        (test_rtnl_unspec): New function.
        (main): Use it.

        netlink: introduce family specific decoder of NETLINK_ROUTE.
        * netlink_route.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (decode_netlink_route): New prototype.
        * netlink.c (netlink_decoders): Add NETLINK_ROUTE.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of NETLINK_KOBJECT_UEVENT messages.
        * tests/netlink_kobject_uevent.c: New file.
        * tests/gen_tests.in (netlink_kobject_uevent): New entry.
        * tests/pure_executables.list: Add netlink_kobject_uevent.
        * tests/.gitignore: Likewise.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: add decoding of NETLINK_KOBJECT_UEVENT messages.
        * netlink.c (decode_netlink): Print NETLINK_KOBJECT_UEVENT messages
        as a string using printstrn.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: call get_fd_nl_family before nlmsghdr decoding.
        Prepare for decoding of NETLINK_KOBJECT_UEVENT.  Messages of the latter,
        unlike traditional netlink families, don't contain a header at all.

        * netlink.c (NL_FAMILY_*): Remove enum.
        (get_fd_nl_family): Replace NL_FAMILY_ERROR with -1.
        (decode_nlmsg_type): Update the comment.
        Skip family specific type decoders for type < NLMSG_MIN_TYPE.
        (decode_nlmsghdr_with_payload): Skip family specific decoders
        for type < NLMSG_MIN_TYPE && type != NLMSG_DONE.
        (print_nlmsghdr): Move get_fd_nl_family invocation ...
        (decode_nlmsghdr_with_payload): ... here.

2017-08-07  Dmitry V. Levin  <ldv@altlinux.org>

        Make sysent_shorthand_defs.h suitable for tests.
        * sysent_shorthand_defs.h [STRACE_TESTS_H]: Add shorthand notations from
        tests/ksysent.c and tests/nsyscalls.c.
        * tests/ksysent.c: Remove shorthand notations.
        * tests/nsyscalls.c: Likewise.

2017-08-07  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

        Move sysent shorthand notations to separate files.
        Avoid proliferation of exactly the same definitions of shorthand
        notations for macros defined in sysent.h by moving definitions
        and undefs of these shorthand notations to separate files.

        * sysent_shorthand_defs.h: New file.
        * sysent_shorthand_undefs.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * syscall.c: Use them.

2017-08-07  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink.c: fix indentation.
        * netlink.c (print_cookie): Fix indentation.

2017-08-07  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

        Move err/mem subroutines to separate files.
        In order to allow usage of utility functions by other binaries
        included in the strace package (like the upcoming asinfo utility),
        these functions should be moved to separate files.

        * error_prints.h: New file.
        * xmalloc.h: Likewise.
        * defs.h: Include "xmalloc.h" and "error_prints.h".
        (error_msg, error_msg_and_die, error_msg_and_help, perror_msg,
        perror_msg_and_die): Move to error_prints.h.
        (xcalloc, xmalloc, xreallocarray, xstrdup, xstrndup): Move to xmalloc.h.
        * strace.c (die): Remove static quialifier to make visible
        by error_prints.c.
        (error_msg, error_msg_and_die, error_msg_and_help, perror_msg,
        perror_msg_and_die, verror_msg): Move ...
        * error_prints.c: ... to the new file.
        * xmalloc.c: Include "config.h", <stdlib.h>, <string.h>,
        "error_prints.h", and "xmalloc.h" instead of "defs.h".
        Use int instead of bool.  Fix codestyle.
        * Makefile.am (strace_SOURCES): Add error_prints.c, error_prints.h,
        and xmalloc.h.

2017-08-07  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        tests: move check_* functions from options-syntax.test to separate file.
        * tests/options-syntax.test: Move check_* functions to ...
        * tests/syntax.sh: ... new file.
        * tests/Makefile.am (EXTRA_DIST): Add syntax.sh.

2017-08-07  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        Split qualify.c into basic_filters.c and filter_qualify.c.
        This change also exports add_number_to_set, qualify_tokens,
        and qualify_syscall_tokens.

        * basic_filters.c: New file, part of qualify.c.
        * filter_qualify.c: Likewise.
        * filter.h: New file.
        * qualify.c: Remove.
        * Makefile.am (strace_SOURCES): Add new files, remove qualify.c.

2017-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify handling of unexpected tracees.
        * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
        Remove the dance around possible re-injection of WSTOPSIG(status)
        as the only observable stop here is the initial ptrace-stop.

        Fix handling of unexpected tracees when PTRACE_SEIZE is not in use.
        * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
        The expected ptrace stop signal in case of !use seize is not
        syscall_trap_sig but SIGSTOP.  An idea of using PTRACE_GETSIGINFO to
        distinguish signal stops that should be re-injected from other kinds
        of stops didn't work out due to kernel implementation peculiarities
        of initial ptrace-stop.

        pathtrace: fix matching of symlinkat syscall.
        * pathtrace.c (pathtrace_match_set) <SEN_symlinkat>: The first argument
        of symlinkat syscall is not a path but an arbitrary string, ignore it.

2017-08-06  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        pathtrace: fix missing syscalls.
        * pathtrace.c (pathtrace_match_set): Fix symlink decoding,
        disable pathtracing for inotify_init.

2017-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance fflush error diagnostics.
        * strace.c (flush_tcp_output): New function.
        (line_ended, droptcb, print_event_exit): Use it to flush tcp->outf.
        * tests/fflush.c: New file.
        * tests/fflush.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.
        * tests/.gitignore: Add fflush.
        * tests/pure_executables.list: Likewise.

        tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes.
        * tests/clone_parent.c: New file.
        * tests/clone_ptrace.c: Likewise.
        * tests/clone_parent.test: New test.
        * tests/clone_ptrace.test: Likewise.
        * tests/.gitignore: Add clone_parent and clone_ptrace.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add clone_parent.test and clone_ptrace.test.

        tests: export a path to the trace executable to check_PROGRAMS.
        * tests/init.sh (STRACE_EXE): Initialize from $STRACE and export.

2017-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Makefile.am: build top directory first.
        This solves potential issues when tests run first and strace is rebuilt
        only after they have finished.  As noted in [1], providing the current
        directory explicitly should help.

        [1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html

        * Makefile.am (SUBDIRS): Prepend the current directory.

2017-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Improve handling of unexpected tracees.
        When receiving a ptrace stop of an unexpected child, handle it
        in the most transparent way possible:
        - detach it instead of PTRACE_CONT'ing;
        - send it the signal with which it has been stopped.
        This should hopefully help to deal with processes that have been created
        with misused CLONE_PTRACE flag set.

        * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
        Calculate the signal similarly to the way next_event does,
        forward it to the unexpected tracee, and detach the tracee.

2017-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix unaligned access in nlattr.test.
        * tests/nlattr.c (test_nlattr): Use SET_STRUCT
        to initialize potentially unaligned struct nlattr.

        tests: fix unaligned access in nlattr_packet_diag_msg.test.
        * tests/nlattr_packet_diag_msg.c (init_packet_diag_msg): Use SET_STRUCT
        to initialize potentially unaligned struct packet_diag_msg.

2017-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: do not bail out in get_scno if PTRACE_PEEKTEXT fails.
        If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
        PTRACE_PEEKTEXT becames unavailable when the process dumpable flag is
        cleared.  As this is not a fatal condition for get_scno, do not bail out
        if PTRACE_PEEKTEXT fails.

        This condition is triggered and therefore tested by prctl-dumpable test.

        * linux/sparc64/get_scno.c (arch_get_scno): Do not bail out
        if PTRACE_PEEKTEXT fails.

2017-08-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance test coverage of printstrn and umoven.
        * tests/printstrn-umoven.c: New file.
        * tests/printstrn-umoven-peekdata.c: Likewise.
        * tests/printstrn-umoven-undumpable.c: Likewise.
        * tests/printstrn-umoven-legacy.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add printstrn-umoven-legacy.test.
        * tests/gen_tests.in (printstrn-umoven, printstrn-umoven-peekdata,
        printstrn-umoven-undumpable): New entries.
        * tests/pure_executables.list: Add printstrn-umoven,
        printstrn-umoven-peekdata, and printstrn-umoven-undumpable.
        * tests/.gitignore: Likewise.

        tests: add test_printstrn function to libtests.
        * tests/test_ucopy.h (test_printstrn): New prototype.
        * tests/test_printstrn.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

2017-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance test coverage of printpath and umovestr.
        * tests/init.sh (TIMEOUT_DURATION): Raise from 300 to 600.
        * tests/printpath-umovestr.c: New file.
        * tests/printpath-umovestr-peekdata.c: Likewise.
        * tests/printpath-umovestr-undumpable.c: Likewise.
        * tests/printpath-umovestr-legacy.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add printpath-umovestr-legacy.test.
        * tests/gen_tests.in (printpath-umovestr, printpath-umovestr-peekdata,
        printpath-umovestr-undumpable): New entries.
        * tests/pure_executables.list: Add printpath-umovestr,
        printpath-umovestr-peekdata, and printpath-umovestr-undumpable.
        * tests/.gitignore: Likewise.

        tests: add test_printpath function to libtests.
        * tests/test_ucopy.h (test_printpath): New prototype.
        * tests/test_printpath.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

        tests: add test_process_vm_readv and test_ptrace_peekdata to libtests.
        * tests/test_ucopy.c: New file.
        * tests/test_ucopy.h: Likewise.
        * tests/Makefile.am (libtests_a_SOURCES): Add them.

2017-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        printpath: do not fetch more than PATH_MAX bytes from tracee's memory.
        The kernel does not copy more than PATH_MAX bytes from userspace
        pathnames, treating non-NUL-terminated pathnames as ENAMETOOLONG.

        * util.c (printpathn): Decrease buffer size to PATH_MAX.
        (printpath): Specify PATH_MAX - 1 as the maximum pathname length
        to match the kernel behaviour.  The underlying umovestr call will fetch
        up to PATH_MAX bytes from tracee's memory, but no more than first
        PATH_MAX - 1 bytes will be printed.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

        ucopy: cleanup umoven_peekdata and umovestr_peekdata.
        * ucopy.c (umoven_peekdata, umovestr_peekdata): Merge aligned
        and unaligned tracee address cases.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

        ucopy: move legacy fallbacks of umoven and umovestr to separate functions
        Move legacy PTRACE_PEEKDATA-based support to separate functions.

        * ucopy.c (umoven_peekdata, umovestr_peekdata): New functions.
        (umoven, umovestr): Use them.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

        ucopy: move process_vm_readv ENOSYS check to vm_read_mem.
        * ucopy.c (vm_read_mem): Set process_vm_readv_not_supported in case
        of ENOSYS.
        * ucopy.c (umoven, umovestr): Do not set process_vm_readv_not_supported.

2017-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print enabled optional features in strace version output.
        In order to provide information to user what optionally built features
        are available.

        * strace.c (print_version): New variable "features".  Print features string
        after non-liability disclaimer (or "(none)" in case it is empty).
        (print_version) [USE_LIBUNWIND]: Concatenate "stack-unwind" into features
        string.
        * tests/strace-V.tests (getoption): New function.
        Update check in accordance with updated output.

2017-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/strace-V.test: rename getval to getstr.
        As this name is more suitable.

        * tests/strace-V (getval): Rename to getstr, update all call sites.

2017-07-30  Dmitry V. Levin  <ldv@altlinux.org>

        ucopy: refactor the check for invalid tracee addresses.
        * ucopy.c (tracee_addr_is_invalid): New function.
        * ucopy.c (umoven, umovestr): Use it.

        ucopy: enhance vm_read_mem error diagnostics.
        * ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics
        to match PTRACE_PEEKDATA case.

2017-07-29  Dmitry V. Levin  <ldv@altlinux.org>

        ucopy: skip redundant tracee address truncation check.
        * ucopy.c (vm_read_mem): Skip raddr != truncated_raddr check
        if these variables have the same data size.

2017-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        util: move umoven and umovestr to a separate file.
        These functions are more kernel-specific compared to all other functions
        defined in util.c.

        * ucopy.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * util.c (umoven, umovestr): Move to ucopy.c.

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY.
        Print union bpf_attr.value field of BPF_MAP_LOOKUP_ELEM command
        and union bpf_attr.next_key field of BPF_MAP_GET_NEXT_KEY command
        on entering syscall.  These fields are addresses specified to the
        kernel from userspace.  The amount of data written by the kernel
        to these addresses is specified at the map creation time
        by BPF_MAP_CREATE command and is not available at this point.

        * bpf.c (decode_BPF_MAP_LOOKUP_ELEM): Print union bpf_attr.value
        on entering syscall.
        (decode_BPF_MAP_GET_NEXT_KEY): Print union bpf_attr.next_key
        on entering syscall.
        (bpf_map_io): Remove.
        * tests/bpf.c (print_BPF_MAP_DELETE_ELEM_first,
        print_BPF_MAP_DELETE_ELEM_attr, print_BPF_MAP_GET_NEXT_KEY_first,
        print_BPF_MAP_GET_NEXT_KEY_attr): Replace macro redirects with
        new functions.
        (print_BPF_MAP_LOOKUP_ELEM_first, print_BPF_MAP_LOOKUP_ELEM_attr,

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: update BPF_MAP_CREATE decoding.
        Implement decoding of map_flags and inner_map_fd fields of union bpf_attr
        for BPF_MAP_CREATE command introduced by linux kernel commits
        v4.6-rc1~91^2~108^2~6 and v4.12-rc1~64^3~373^2~2, respectively.

        * configure.ac: Check for inner_map_fd member of union bpf_attr
        instead of max_entries.
        * xlat/bpf_map_flags.in: New file.
        * bpf.c: Include "xlat/bpf_map_flags.h".
        (decode_BPF_MAP_CREATE): Add map_flags and inner_map_fd fields
        to the structure, print them.
        * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test.
        (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected
        output.
        (init_BPF_MAP_CREATE_attr): Initialize map_flags and inner_map_fd
        fields, update offset.

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: update BPF_PROG_LOAD decoding.
        Implement decoding of union bpf_attr.prog_flags field for BPF_PROG_LOAD
        command introduced by linux kernel commit v4.12-rc2~34^2~29^2~2.

        * configure.ac: Check for prog_flags member of union bpf_attr
        instead of kern_version.
        * xlat/bpf_prog_flags.in: New file.
        * bpf.c: Include "xlat/bpf_prog_flags.h".
        (decode_BPF_PROG_LOAD): Add prog_flags field to the structure, print it.
        * tests/bpf.c: Update macro guards of BPF_PROG_LOAD decoder test.
        (init_BPF_PROG_LOAD_first, print_BPF_PROG_LOAD_attr): Update expected
        output.
        (init_BPF_PROG_LOAD_attr): Initialize prog_flags field, update offset.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance test coverage of bpf syscall parser.
        * configure.ac: Update union bpf_attr member checks.
        * tests/bpf.c: Rewrite.
        * tests/bpf-v.c: New file.
        * tests/gen_tests.in (bpf-v): New entry.
        * tests/pure_executables.list: Add bpf-v.
        * tests/.gitignore: Likewise.

        m4: macroize union bpf_attr field checks.
        * m4/st_bpf.m4: New file.
        * configure.ac: Use st_CHECK_UNION_BPF_ATTR.

        Move offsetofend from defs.h to macros.h.
        * defs.h (offsetofend): Move ...
        * macros.h: ... here.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: print unused fields of union bpf_attr if one of them is non-zero.
        When the size argument specifies more data than necessary for the given
        command, kernel checks that all unused fields of union bpf_attr are
        zero.  Print this extra data when it contains non-zero bytes to enhance
        debugging experience.

        * bpf.c (decode_attr_extra_data): New function.
        (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM,
        decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD,
        decode_BPF_OBJ_PIN, decode_BPF_OBJ_GET, decode_BPF_PROG_ATTACH,
        decode_BPF_PROG_DETACH): Use it to print extra data passed
        via bpf_attr pointer.
        (bpf_obj_manage, bpf_prog_attach_detach): Remove.
        * tests/bpf.c (map_delete_elem): New function.
        (main): Use it.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: change handling of big and unaccessible data to match the kernel.
        When the size argument exceeds PAGE_SIZE, the kernel fails with E2BIG
        without parsing union bpf_attr.
        When the whole chunk of memory specified by addr and size arguments is
        not readable, the kernel fails with EFAULT.

        * bpf.c (DECL_BPF_CMD_DECODER) <bpf_cmd_decoder>: Add const qualifier
        to size argument, add data argument.
        (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM,
        decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD,
        bpf_obj_manage, bpf_prog_attach_detach): Move size argument check and
        memory fetching ...
        (SYS_FUNC(bpf)) ... here, add PAGE_SIZE check, pass fetched memory
        to command-specific parsers.

2017-07-25  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: replace big switch statement with a dispatch table.
        * bpf.c (DECL_BPF_CMD_DECODER, DEF_BPF_CMD_DECODER, BPF_CMD_ENTRY):
        New macros.
        (bpf_cmd_decoder_t): New typedef.
        Rename static parser functions using DEF_BPF_CMD_DECODER.
        (decode_BPF_MAP_LOOKUP_ELEM, decode_BPF_MAP_GET_NEXT_KEY): New proxy
        functions.
        (SYS_FUNC(bpf)): Replace big switch statement with a dispatch table.

        bpf: use PRINT_FIELD_* macros.
        * print_fields.h (PRINT_FIELD_STR, PRINT_FIELD_PATH): New macros.
        * bpf.c: Include "print_fields.h".
        (bpf_map_create): Use PRINT_FIELD_U and PRINT_FIELD_XVAL.
        (bpf_map_update_elem): Use PRINT_FIELD_FD, PRINT_FIELD_X, and
        PRINT_FIELD_XVAL.
        (bpf_map_delete_elem, bpf_map_io): Use PRINT_FIELD_FD and PRINT_FIELD_X.
        (bpf_prog_load): Use PRINT_FIELD_STR, PRINT_FIELD_U, PRINT_FIELD_X,
        and PRINT_FIELD_XVAL.
        (bpf_obj_manage): Use PRINT_FIELD_FD and PRINT_FIELD_PATH.
        (bpf_prog_attach_detach): Use PRINT_FIELD_FD, PRINT_FIELD_FLAGS,
        and PRINT_FIELD_XVAL.

2017-07-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add terminating comment after each DECL_* macro definition.
        In an attempt to improve readability.

        * defs.h (DECL_IOCTL, DECL_NETLINK, DECL_PRINTNUM, DECL_PRINTNUM_ADDR,
        ATTRIBUTE_FORMAT): Add comment that marks end of macro definition.
        * netlink_sock_diag (DECL_NETLINK_DIAG_DECODER): Likewise.
        * nlattr.h (DECL_NLA): Likewise.

2017-07-24  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce print_quoted_cstring.
        In many places where kernel expects a NUL-terminated string of length
        up to a known fixed limit, e.g. when a NUL-terminated string is
        a fixed-size field of a structure, strace does not print the last byte
        assuming it is NUL, which is not always the case.

        Change output format for such strings to distinguish NUL-terminated
        strings from non-NUL-terminated ones: append ellipsis to the output
        when the string is not NUL-terminated.

        * defs.h (print_quoted_cstring): New prototype.
        * util.c (print_quoted_cstring): New function.
        (printpathn): Use it instead of print_quoted_string with
        QUOTE_0_TERMINATED argument.
        * print_fields.h (PRINT_FIELD_CSTRING): Likewise.
        * btrfs.c (btrfs_ioctl): Likewise.
        * dirent.c (SYS_FUNC(getdents)): Likewise.
        * dirent64.c (SYS_FUNC(getdents64)): Likewise.
        * print_ifindex.c (print_ifindex): Likewise.
        * sysmips.c (SYS_FUNC(sysmips)): Likewise.
        * ubi.c (ubi_ioctl): Likewise.
        * tests/tests.h (print_quoted_cstring): New prototype.
        * tests/print_quoted_string.c (print_quoted_cstring): New function.
        * tests/ioctl_block.c (main): Update expected output.
        * tests/ioctl_dm.c (main): Likewise.
        * tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise.
        * tests/netlink_crypto.c (test_crypto_msg_newalg): Likewise.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_CRYPTO crypto_user_alg attributes.
        * tests/nlattr_crypto_user_alg.c: New file.
        * tests/gen_tests.in (nlattr_crypto_user_alg): New entry.
        * tests/pure_executables.list: Add nlattr_crypto_user_alg.
        * tests/.gitignore: Likewise.

        tests: extend TEST_NLATTR_OBJECT macro.
        * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_,
        TEST_NLATTR_OBJECT_EX): New macros.
        (TEST_NLATTR_OBJECT): Use TEST_NLATTR_OBJECT_EX_.

        netlink: decode NETLINK_CRYPTO crypto_user_alg netlink attributes.
        * configure.ac (AC_CHECK_TYPES): Check for crypto_report_aead,
        crypto_report_blkcipher, crypto_report_cipher, crypto_report_hash,
        and crypto_report_rng structures in <linux/cryptouser.h>.
        * netlink_crypto.c (decode_crypto_report_generic,
        decode_crypto_report_hash, decode_crypto_report_blkcipher,
        decode_crypto_report_aead, decode_crypto_report_rng,
        decode_crypto_report_cipher): New functions.
        (crypto_user_alg_nla_decoders): New array.
        (decode_crypto_user_alg): Use it.
        * xlat/crypto_nl_attrs.in: New file.
        * NEWS: Mention this.

        tests: check decoding of NETLINK_CRYPTO messages.
        * tests/netlink_crypto.c: Include "test_netlink.h"
        instead of "netlink.h".
        (test_crypto_msg_newalg, test_crypto_msg_unspec): New functions.
        (main): Use them.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: extend TEST_NETLINK_OBJECT macro.
        As the first field of NETLINK_CRYPTO messages is a string, print
        unrecognized data as a string.  Extend TEST_NETLINK_OBJECT macro
        to test this case.

        * tests/test_netlink.h (TEST_NETLINK_OBJECT_EX_,
        TEST_NETLINK_OBJECT_EX): New macros.
        (TEST_NETLINK_OBJECT): Use TEST_NETLINK_OBJECT_EX_.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: add a basic parser of NETLINK_CRYPTO messages.
        * netlink_crypto.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (decode_netlink_crypto): New prototype.
        * netlink.c (netlink_decoders): Add NETLINK_CRYPTO.
        * NEWS: Mention this.

2017-07-23  Dmitry V. Levin  <ldv@altlinux.org>

        Unify PRINT_FIELD_XVAL and PRINT_FIELD_XVAL64.
        * print_fields.h (PRINT_FIELD_XVAL64): Unify with PRINT_FIELD_XVAL.

        Unify PRINT_FIELD_FLAGS and PRINT_FIELD_FLAGS64.
        * print_fields.h (PRINT_FIELD_FLAGS64): Unify with PRINT_FIELD_FLAGS.
        * userfaultfd.c (uffdio_ioctl): Replace PRINT_FIELD_FLAGS64 with
        PRINT_FIELD_FLAGS.

2017-07-23  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        pathtrace: fix fanotify_mark path tracing on 32-bit architectures.
        The fanotify_mark syscall takes a 64-bit mask, and on 32-bit
        architectures it is split up into two syscall arguments.

        * pathtrace.c (pathtrace_match_set): Use getllval to properly decode
        arguments after mask.

2017-07-22  Dmitry V. Levin  <ldv@altlinux.org>

        travis: add valgrind check support.
        * travis-build.sh [CHECK == valgrind]: Pass --enable-valgrind
        to configure and appropriate check-valgrind-* to make.
        * travis-install.sh [CHECK == valgrind]: Install valgrind.

2017-07-22  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN.
        In several netlink_sock_diag parsers NLA_ALIGN was used instead of
        NLMSG_ALIGN to align the length of netlink messages.  Fortunately,
        both macros round the given length to the closest multiple of 4,
        so technically there is no difference, but the use of wrong macro
        is misleading.

        * netlink_inet_diag.c (decode_inet_diag_req_compat,
        decode_inet_diag_req_v2, decode_inet_diag_msg): Replace
        NLA_ALIGN with NLMSG_ALIGN.
        * netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise.
        * netlink_packet_diag.c (decode_packet_diag_msg): Likewise.
        * netlink_smc_diag.c (decode_smc_diag_msg): Likewise.

2017-07-22  Dmitry V. Levin  <ldv@altlinux.org>

        travis: configure build with dependency tracking disabled.
        Dependency tracking is completely useless for one-time builds,
        so configure build with dependency tracking disabled.

        * travis-build.sh (DISTCHECK_CONFIGURE_FLAGS): Add
        --disable-dependency-tracking.

2017-07-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        m4: remove equal sign from define directive in ax_valgrind_check.m4.
        Support for providing equal sign in define directives has been added
        only in GNU Make 3.82 [1] and it provides the same semantics (variables
        should be recursively expanded) as when it is omitted at all, so let's
        remove it in order to preserve compatibility with older GNU Make
        versions (like the one used on Travis).

        [1] https://git.savannah.gnu.org/cgit/make.git/tree/ChangeLog?h=3.82#n766

        * m4/ax_valgrind_check.m4 <define valgrind_tool_rule>: Remove equal
        sign.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        keyctl: add support for KEYCTL_RESTRICT_KEYRING operation.
        * keyctl.c (keyctl_restrict_keyring): New function.
        (SYS_FUNC(keyctl)): Use it to implement KEYCTL_RESTRICT_KEYRING support.
        * NEWS: Mention this.
        * tests/keyctl.c (main): Check KEYCTL_RESTRICT_KEYRING decoding.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify strace-t.test.
        If strace -t is running too long, it might happen that time stamps
        before and after its invocation differ for more than a second.
        Adjust expected output to handle this rare but possible case.

        * tests/strace-t.test: Allow any time stamp between start and finish
        of strace invocation.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        x86: wire up arch_prctl syscall.
        * linux/i386/syscallent.h [384]: Add arch_prctl entry.
        * xlat/archvals.in: Add fallback definitions for constants.
        * prctl.c: Stop including <asm/prctl.h>.
        (SYS_FUNC(arch_prctl)): Enable for [I386].
        * NEWS: Mention this.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tweak strace-ff.test for slow startup case.
        strace starts up much slower when invoked under valgrind control.
        Increase the tracee's sleep delay to let strace more time to attach.

        * tests/strace-ff.test: Increase sleep delay.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: update valgrind suppressions.
        * tests/strace.supp: Add a suppression for the memleak before
        error_msg_and_die in qualify_tokens.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        Do not copy optarg unnecessarily.
        There is no need to copy the optarg string since it is a pointer
        into the original argv array, not into a static area
        that might be overwritten.

        * strace.c (username, outfname): Add const qualifier.
        (init): Do not xstrdup optarg to initialize outfname and username.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        travis: add build environment information to the travis log.
        * travis-build.sh: Print build environment information.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        build: add check-valgrind-* to recursive targets.
        As make -j$N check-valgrind cannot parallelize properly, add
        recursive targets for each of valgrind checks.  This way one can run
                for t in $valgrind_enabled_tools; do
                        make -k check-valgrind-$n || rc=$?
                done
        in $top_builddir.

        * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Remove.
        * m4/ax_valgrind_check.m4 (AX_VALGRIND_CHECK): Add check-valgrind
        and check-valgrind-* to AM_EXTRA_RECURSIVE_TARGETS.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add check-valgrind-local make rule.
        This guarantees that $(check_LIBRARIES) and $(check_PROGRAMS)
        are made on 'make check-valgrind' before its recipe is processed.

        * tests/Makefile.am (check-valgrind-local): New rule.
        (.PHONY): Add it.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        Add ksysent.h and scno.h to BUILT_SOURCES.
        This guarantees that ksysent.h and scno.h, along with other targets
        listed in BUILT_SOURCES, are made on 'make all', 'make check',
        and 'make check-valgrind' before other targets are processed.

        * scno.am (BUILT_SOURCES): Add scno.h.
        * tests/Makefile.am (BUILT_SOURCES): Add ksysent.h.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix valgrind suppression file path.
        * tests/Makefile.am (VALGRIND_SUPPRESSIONS_FILES): Replace srcdir
        with abs_srcdir.

        Fixes: v4.16-74-g16036030 ("tests: run every test except ksysent.test in its own subdirectory")

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        Update AX_VALGRIND_CHECK.
        * m4/ax_valgrind_check.m4: Update to serial 15.  In particular,
        this version does not eat check-valgrind errors.

        Update AX_CODE_COVERAGE.
        * m4/ax_code_coverage.m4: Update to serial 24.  In particular,
        this version has no lcov version check.
        * Makefile.am (strace_LDADD): Rename CODE_COVERAGE_LDFLAGS
        to CODE_COVERAGE_LIBS.

        Update input event KEY_* constants.
        * xlat/evdev_keycode.in: Add KEY_ASSISTANT introduced by linux kernel
        commit v4.13-rc1~13^2~1^2~1.
        * NEWS: Mention this.

        Update fs *_MAGIC constants.
        * xlat/fsmagic.in: Add AAFS_MAGIC introduced by linux kernel commit
        v4.13-rc1~161^2~87.
        * NEWS: Mention this.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        Move family-specific NETLINK_SOCK_DIAG parsers to separate files.
        Split netlink_sock_diag.c that grew too big.

        * defs.h (tcp_states, tcp_state_flags): New xlat prototypes.
        * netlink_sock_diag.h: New file.
        * netlink_inet_diag.c: Likewise.
        * netlink_netlink_diag.c: Likewise.
        * netlink_packet_diag.c: Likewise.
        * netlink_smc_diag.c: Likewise.
        * netlink_unix_diag.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * netlink_sock_diag.c: Move family-specific parsers and associated
        header includes to separate files.
        * nlattr.h (DECL_NLA(meminfo)): New prototype.
        * nlattr.c: Include <linux/sock_diag.h>.
        (print_meminfo, decode_nla_meminfo): New functions from
        netlink_sock_diag.c.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        Adjust prototypes of netlink parsing functions.
        Change the type of "len" argument that is based
        on struct nlmsghdr.nlmsg_len from kernel_ulong_t to unsigned int.

        * defs.h (netlink_decoder_t, DECL_NETLINK): Change "len" argument type
        from kernel_ulong_t to unsigned int.
        * netlink.c (decode_nlmsgerr_attr_cookie, decode_nlmsgerr,
        decode_payload): Likewise.
        * netlink_selinux.c (decode_netlink_selinux): Likewise.
        * netlink_sock_diag.c (decode_family, decode_unix_diag_req,
        decode_meminfo, decode_unix_diag_vfs, decode_unix_diag_inode,
        decode_unix_diag_rqlen, decode_unix_diag_msg, decode_netlink_diag_req,
        print_group, decode_netlink_diag_ring, decode_netlink_diag_flags,
        decode_netlink_diag_msg, decode_packet_diag_req,
        decode_packet_diag_info, decode_packet_diag_mclist,
        decode_packet_diag_ring, decode_packet_diag_filter,
        decode_packet_diag_msg, decode_inet_addr, decode_inet_diag_hostcond,
        decode_inet_diag_markcond, decode_bytecode_data, decode_inet_diag_bc_op,
        decode_inet_diag_req_compat, decode_inet_diag_req_v2,
        decode_inet_diag_req, decode_inet_diag_meminfo, decode_tcpvegas_info,
        decode_tcp_dctcp_info, decode_tcp_bbr_info, decode_inet_diag_msg,
        decode_smc_diag_req, decode_smc_diag_conninfo, decode_smc_diag_lgrinfo,
        decode_smc_diag_msg, netlink_diag_decoder_t, decode_netlink_sock_diag):
        Likewise.
        * nlattr.c (fetch_nlattr, decode_nlattr_with_data, decode_nlattr,
        decode_nla_str, decode_nla_strn, DECODE_NLA_INTEGER): Likewise.
        * nlattr.h (nla_decoder_t, DECL_NLA, decode_nlattr): Likewise.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of nlmsgerr attributes.
        * tests/nlattr_nlmsgerr.c: New file.
        * tests/gen_tests.in (nlattr_nlmsgerr): New entry.
        * tests/pure_executables.list: Add nlattr_nlmsgerr.
        * tests/.gitignore: Likewise.

        netlink: decode nlmsgerr attributes.
        * netlink.c: Include "nlattr.h" and "xlat/nlmsgerr_attrs.h".
        (print_cookie, decode_nlmsgerr_attr_cookie): New functions.
        (nlmsgerr_nla_decoders): New array.
        (decode_nlmsgerr): Use it.
        * xlat/nlmsgerr_attrs.in: New file.
        * NEWS: Mention this.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: adjust decode_nlmsgerr for extended ACK reporting.
        Extended ACK reporting introduced by linux kernel commit
        v4.11-rc5-1382-g2d4bc93.

        * netlink.h (NLM_F_CAPPED): New macro.
        * netlink.c (decode_payload): Pass
        nlmsghdr->nlmsg_flags & NLM_F_CAPPED to decode_nlmsgerr.
        (decode_nlmsgerr): Adjust the length pass to
        decode_nlmsghdr_with_payload.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode netlink message ack flags.
        * netlink.c: Include "xlat/netlink_ack_flags.h".
        (decode_nlmsg_flags): Decode ack flags when type == NLMSG_ERROR.
        * xlat/netlink_ack_flags.in: New file.
        * NEWS: Mention this.
        * tests/netlink_protocol.c (test_ack_flags): New function, check this.
        (main): Use it.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance error diagnostics.
        * tests/init.sh (dump_log_and_fail_with): Dump $LOG to stderr instead
        of stdout as the latter is more likely to be redirected to a temporary
        file in the context where this function is called.

        tests: enhance timeout diagnostics.
        * tests/init.sh: Trap SIGXCPU.
        * tests/run.sh: Send SIGXCPU instead of SIGKILL in case of timeout, send
        SIGKILL if the command is still running 5 seconds after SIGXCPU.

        userfaultfd: decode struct uffdio_api.features as flags.
        * xlat/uffd_api_features.in: New file.
        * userfaultfd.c: Include "xlat/uffd_api_features.h".
        (uffdio_ioctl): Print struct uffdio_api.features using
        PRINT_FIELD_FLAGS64 and uffd_api_features.
        * NEWS: Mention this.
        * tests/ioctl_uffdio.c: Include "xlat.h" and "xlat/uffd_api_features.h".
        (main): Update expected output.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        userfaultfd: enhance decoding of struct uffdio_api.features.
        As struct uffdio_api.features has read-write semantics,
        print the value returned by the kernel only when it differs
        from the value passed to the kernel.

        * userfaultfd.c (uffdio_ioctl) <UFFDIO_API>: On entering syscall,
        save the value of struct uffdio_api.features.  On exiting syscall, do
        not print struct uffdio_api.features when it's the same as on entering.
        * tests/ioctl_uffdio.c (main): Update expected output.

2017-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        userfaultfd: use PRINT_FIELD_* macros.
        This also fixes output correctness for struct uffdio_api.features.

        * userfaultfd.c: Include "print_fields.h".
        (tprintf_uffdio_range): Use PRINT_FIELD_X.
        (PRINT_FIELD_UFFDIO_RANGE): New macro.
        (uffdio_ioctl): Use it, PRINT_FIELD_FLAGS64, and PRINT_FIELD_X.
        * tests/ioctl_uffdio.c (main): Update expected output.

2017-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce PRINT_FIELD_FLAGS64 and PRINT_FIELD_XVAL64.
        * print_fields.h (PRINT_FIELD_FLAGS64, PRINT_FIELD_XVAL64): New macros.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

        aio: change struct iocb.aio_lio_opcode output format.
        * aio.c (tprint_lio_opcode): Change opcode output format to match
        the kernel.
        * tests/aio.c (main): Update expected output.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

        aio: use PRINT_FIELD_* macros.
        This also fixes output correctness for struct iocb.

        * aio.c: Include "print_fields.h".
        (print_common_flags, print_iocb_header, print_iocb, print_io_event):
        Use PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_FD,
        and PRINT_FIELD_STRN.
        * tests/aio.c (main): Update expected output.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce PRINT_FIELD_FD and PRINT_FIELD_STRN.
        * print_fields.h (PRINT_FIELD_FD, PRINT_FIELD_STRN): New macros.

2017-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        Update BPF_* constants.
        * xlat/bpf_commands.in: Add BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID,
        BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
        and BPF_OBJ_GET_INFO_BY_FD introduced by linux kernel commits
        v4.12-rc1~64^3~287^2~5, v4.13-rc1~157^2~271^2~5,
        v4.13-rc1~157^2~271^2~4, v4.13-rc1~157^2~271^2~3, and
        v4.13-rc1~157^2~271^2~1, respectively.
        * xlat/bpf_attach_type.in: Add BPF_CGROUP_SOCK_OPS introduced
        by linux kernel commit v4.13-rc1~157^2~37^2~15.
        * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SOCK_OPS introduced
        by the same commit.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_PEERGROUPS introduced by linux kernel
        commit v4.13-rc1~157^2~124.

        Update SCM_* constants.
        * xlat/scmvals.in: Add SCM_TIMESTAMPING_PKTINFO introduced
        by linux kernel commit v4.13-rc1~157^2~405^2~3.

2017-07-16  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_SELINUX protocol.
        * test_netlink.h (TEST_NETLINK_OBJECT): New macro.
        * tests/netlink_selinux.c: Include "test_netlink.h"
        instead of "netlink.h".
        (test_selnl_msg_unspec, test_selnl_msg_setenforce,
        test_selnl_msg_policyload): New functions.
        (main): Use them.

        netlink: decode NETLINK_SELINUX protocol.
        * netlink_selinux.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (decode_netlink_selinux): New prototype.
        * netlink.c (netlink_decoders): Add NETLINK_SELINUX.

2017-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v3: use PRINT_FIELD_* macros.
        * sg_io_v3.c: Include "print_fields.h".
        (PRINT_FIELD_SG_IO_BUFFER): New macro.
        (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U,
        PRINT_FIELD_X, PRINT_FIELD_PTR, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL.

        Introduce PRINT_FIELD_PTR.
        * print_fields.h (PRINT_FIELD_PTR): New macro.

2017-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        Provide mpers_ptr_t definition for non-mpers case.
        In mpers case, mpers_ptr_t is already defined by DEF_MPERS_TYPE(...).
        This allows use of mpers_ptr_t regardless of IN_MPERS state.

        * mpers_type.h [!IN_MPERS] (mpers_ptr_t): New typedef.

2017-07-14  Lazar Trsic  <Lazar.Trsic@imgtec.com>

        Move is_negated_errno() to new header negated_errno.h.
        Move is_negated_errno() to a separate new header file negated_errno.h
        and include it just for architectures which require it.

        is_negated_errno() is not used on those architectures
        that have a dedicated register to signal a syscall error.

        The issue was raised when compiling with clang, which is more
        strict regarding semantics of unused static inline functions
        defined in C files and will issue a -Wunused-function warrning
        if they are not used anywhere.

        * syscall.c (is_negated_errno): Move to ...
        * negated_errno.h: ... new file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/aarch64/get_error.c: Include it.
        * linux/arc/get_error.c: Likewise.
        * linux/arm/get_error.c: Likewise.
        * linux/avr32/get_error.c: Likewise.
        * linux/bfin/get_error.c: Likewise.
        * linux/crisv10/get_error.c: Likewise.
        * linux/hppa/get_error.c: Likewise.
        * linux/i386/get_error.c: Likewise.
        * linux/ia64/get_error.c: Likewise.
        * linux/m68k/get_error.c: Likewise.
        * linux/metag/get_error.c: Likewise.
        * linux/microblaze/get_error.c: Likewise.
        * linux/or1k/get_error.c: Likewise.
        * linux/riscv/get_error.c: Likewise.
        * linux/s390/get_error.c: Likewise.
        * linux/sh/get_error.c: Likewise.
        * linux/sh64/get_error.c: Likewise.
        * linux/tile/get_error.c: Likewise.
        * linux/x86_64/get_error.c: Likewise.
        * linux/xtensa/get_error.c: Likewise.

2017-07-14  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: use PRINT_FIELD_* macros.
        * sg_io_v4.c: Include "print_fields.h".
        (PRINT_FIELD_SG_IO_BUFFER): New macro.
        (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U,
        PRINT_FIELD_X, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL.

        dm: use PRINT_FIELD_* macros.
        * dm.c (dm_decode_values, dm_decode_dm_target_spec,
        dm_decode_dm_target_deps, dm_decode_dm_target_msg, dm_known_ioctl): Use
        PRINT_FIELD_D, PRINT_FIELD_U, and PRINT_FIELD_FLAGS.

2017-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        Move macros related to kernel types to kernel_types.h.
        Some macros related to kernel types are defined both in defs.h and
        tests/tests.h.  Avoid this redundancy by moving these definitions
        to kernel_types.h.

        * defs.h (PRI_kl, PRI_kld, PRI_klu, PRI_klx, PRI__64, PRI__d64,
        PRI__u64, PRI__x64): Move ...
        * kernel_types.h: ... here.
        * tests/tests.h (PRI__64, PRI__d64, PRI__u64, PRI__x64): Remove.

2017-07-13  Lazar Trsic  <Lazar.Trsic@imgtec.com>

        mips64: fix PRI__64 macro definition when compiled for Android.
        By default for MIPS64 in Android __u64 type is exported
        as unsigned long long.  This caused compilation -Wformat warnings
        and would break the build if -Werror is used.

        * defs.h [SIZEOF_LONG != 4 && MIPS && __ANDROID__] (PRI__64): Change
        from "l" to "ll".

2017-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        block: use PRINT_FIELD_* macros.
        This also fixes output correctness for struct blkpg_ioctl_arg.

        * block.c (print_blkpg_req): Use PRINT_FIELD_D and PRINT_FIELD_XVAL.
        (block_ioctl): Use PRINT_FIELD_U.
        * tests/ioctl_block.c (main): Update expected output.

2017-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: enhance decoding of long meminfo arrays.
        Print trailing dots instead of silent truncation if the array
        is too long.

        * netlink_sock_diag.c (decode_meminfo): Do not apply SK_MEMINFO_VARS
        limit to nmemb, specify element count to print_array instead.
        (print_meminfo): Check element count and terminate printing
        if the element count exceeds SK_MEMINFO_VARS.
        * tests/nlattr_inet_diag_msg.c (main): Check it.

2017-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend coverage of netlink_diag_req decoder.
        Add one more NETLINK_SOCK_DIAG check to ressurrect full coverage
        of netlink_diag_req decoder that was lost after commit
        v4.18-58-g37ef2d0d.

        * tests/netlink_sock_diag.c (test_netlink_diag_req): Add a check for
        sdiag_protocol != NDIAG_PROTO_ALL.

2017-07-12  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_CRYPTO nlmsg_flags.
        * tests/netlink_crypto.c (test_nlmsg_flags): New function.
        (main): Use it.

        netlink: add decoding of NETLINK_CRYPTO nlmsg_flags.
        * netlink.c (decode_nlmsg_flags): Add NETLINK_CRYPTO.

        tests: check decoding of NETLINK_CRYPTO message types.
        * configure.ac (AC_CHECK_HEADERS): Add linux/cryptouser.h.
        * tests/netlink_crypto.c: New file.
        * tests/gen_tests.in (netlink_crypto): New entry.
        * tests/pure_executables.list: Add netlink_crypto.
        * tests/.gitignore: Likewise.

        netlink: add decoding of NETLINK_CRYPTO message types.
        * xlat/nl_crypto_types.in: New file.
        * netlink.c: Include "xlat/nl_crypto_types.h".
        (nlmsg_types): Add NETLINK_CRYPTO.

        tests: introduce TEST_NETLINK and TEST_NETLINK_ macros.
        * tests/test_netlink.h: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/netlink_sock_diag.c: Include "test_netlink.h"
        instead of "netlink.h".
        (TEST_SOCK_DIAG): New macro.
        (test_unix_diag_req, test_unix_diag_msg,
        test_netlink_diag_req, test_netlink_diag_msg,
        test_packet_diag_req, test_packet_diag_msg,
        test_inet_diag_req, test_inet_diag_req_v2,
        test_inet_diag_msg, test_smc_diag_req,
        test_smc_diag_msg): Use it.
        (test_odd_family_req, test_odd_family_msg,
        test_inet_diag_sockid): Use TEST_NETLINK macro.

2017-07-11  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of nlattr_inet_diag_req_v2 attributes.
        * tests/nlattr_inet_diag_req_v2.c: New file.
        * tests/gen_tests.in (nlattr_inet_diag_req_v2): New entry.
        * tests/pure_executables.list: Add nlattr_inet_diag_req_v2.
        * tests/.gitignore: Likewise.

        tests: check decoding of nlattr_inet_diag_req_compat attributes.
        * tests/nlattr_inet_diag_req_compat.c: New file.
        * tests/gen_tests.in (nlattr_inet_diag_req_compat): New entry.
        * tests/pure_executables.list: Add nlattr_inet_diag_req_compat.
        * tests/.gitignore: Likewise.

        netlink: decode AF_INET inet_diag_req_* attributes.
        * linux/inet_diag.h (inet_diag_bc_op, inet_diag_hostcond,
        inet_diag_markcond): New structures.
        (INET_DIAG_BC_*): New enum.
        * netlink_sock_diag.c: Include "xlat/inet_diag_bytecodes.h".
        (decode_inet_addr, decode_inet_diag_hostcond,
        print_inet_diag_bc_op, decode_inet_diag_markcond,
        decode_bytecode_data, decode_inet_diag_bc_op): New functions.
        (inet_diag_req_nla_decoders): New array.
        (decode_inet_diag_req_compat, decode_inet_diag_req_v2): Use it.
        * xlat/inet_diag_bytecodes.in: New file.

2017-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce PRINT_FIELD_CSTRING.
        * print_fields.h (PRINT_FIELD_CSTRING): New macro.
        * block.c (print_blkpg_req, block_ioctl): Use PRINT_FIELD_CSTRING
        instead of print_quoted_string.
        * btrfs.c (btrfs_ioctl): Likewise.
        * dm.c (dm_decode_device, dm_decode_dm_target_spec): Likewise.
        * loop.c (decode_loop_info, decode_loop_info64): Likewise.
        * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc,
        print_v4l2_standard, print_v4l2_input, print_v4l2_tuner,
        print_v4l2_queryctrl): Likewise.
        * netlink_sock_diag.c (decode_smc_diag_lgrinfo): Use PRINT_FIELD_CSTRING
        instead of PRINT_FIELD_STRING.
        * uname.c (PRINT_UTS_MEMBER): Remove.
        (SYS_FUNC(uname)): Use PRINT_FIELD_CSTRING instead of PRINT_UTS_MEMBER.

2017-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        Rename PRINT_FIELD_QUOTED_STRING to PRINT_FIELD_STRING.
        As string fields are always qouted when printed, choose a shorter name
        for the helper macro.

        * print_fields.h (PRINT_FIELD_QUOTED_STRING): Rename
        to PRINT_FIELD_STRING.  All callers updated.

2017-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        Update RWF_* constants.
        * xlat/rwf_flags.in: Add RWF_NOWAIT introduced by linux kernel
        commit v4.12-rc5-150-gb745fafa.

        Intorduce PRINT_FIELD_0X.
        * print_fields.h (PRINT_FIELD_0X): New macro.
        * sockaddr.c (print_sockaddr_data_ipx, print_sockaddr_data_nl): Use it
        instead of manual tprintf statements.
        * netlink_sock_diag.c (PRINT_FIELD_SMC_DIAG_CONNINFO_FLAGS): Remove.
        (decode_smc_diag_conninfo): Replace it with PRINT_FIELD_0X.

        print_inet_addr: use inet_addr-based output format for IPv4.
        * sockaddr.c (print_inet_addr): Remove af_name variable.
        <AF_INET>: Use inet_addr-based output format.
        * tests/netlink_sock_diag.c (test_inet_diag_sockid, test_inet_diag_req,
        test_inet_diag_req_v2, test_inet_diag_msg, test_smc_diag_req,
        test_smc_diag_msg): Update expected output.
        * tests/nlattr_inet_diag_msg.c (print_inet_diag_msg): Likewise.
        * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.

2017-07-10  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of netlink smc_diag_msg attributes.
        * tests/nlattr_smc_diag_msg.c: New file.
        * tests/gen_tests.in (nlattr_smc_diag_msg): New entry.
        * tests/pure_executables.list: Add nlattr_smc_diag_msg.
        * tests/.gitignore: Likewise.

        netlink: decode AF_SMC smc_diag_msg attributes.
        * linux/smc_diag.h (smc_diag_cursor, smc_diag_conninfo
        smc_diag_linkinfo, smc_diag_lgrinfo): New structures.
        * netlink_sock_diag.c: Include "xlat/smc_link_group_roles.h".
        (decode_smc_diag_conninfo, decode_smc_diag_lgrinfo): New functions.
        (smc_diag_msg_nla_decoders): New array.
        (decode_smc_diag_msg): Use it.
        * xlat/smc_link_group_roles.in: New file.

2017-07-10  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        pathtrace.c: introduce user-provided sets of paths.
        * defs.h (struct path_set): New structure.
        (global_path_set): New variable prototype.
        (tracing_paths): Change macro body to use global_path_set variable.
        (pathtrace_select_set): Add "struct path_set *" argument.
        (pathtrace_match_set): Likewise.  Change return type to bool.
        (pathtrace_select, pathtrace_match): Change into thin macro wrappers
        around pathtrace_select_set and pathtrace_match_set, repsectively.
        * pathtrace.c (global_path_set): New variable.
        (storepath, pathtrace_select_set): Add "struct path_set *" argument.
        (pathmatch, upathmatch, fdmatch, pathtrace_match_set): Likewise.
        Change return type to bool.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP.
        * tests/group_req.c: New file.
        * tests/gen_tests.in (group_req): New entry.
        * tests/pure_executables.list: Add group_req.
        * tests/.gitignore: Likewise.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify struct group_req.
        The size of struct group_req depends on alignment of long and therefore
        has to be mpersified.

        * print_group_req.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * net.c (print_group_req): Move to print_group_req.c, wrap into
        MPERS_PRINTER_DECL.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP.
        * net.c (print_group_req): Allow option length greater than
        sizeof(struct group_req) to match the kernel behaviour.
        When the option length is invalid, print the address.
        * NEWS: Mention this.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        net: hook up MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP decoding for SOL_IPV6.
        As multicast socket options are shared between IPv4 and IPv6,
        they should be decoded both for SOL_IP and SOL_IPV6.

        * net.c (print_setsockopt) <SOL_IPV6> [MCAST_JOIN_GROUP]: Handle
        MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add MCAST_* to sockipv6options.
        Multicast socket options are shared between IPv4 and IPv6.

        * xlat/sockipv6options.in: Add MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE,
        MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP,
        MCAST_LEAVE_SOURCE_GROUP, and MCAST_MSFILTER.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        net: enhance decoding of IP_ADD_MEMBERSHIP et al socket options.
        * net.c (print_mreq, print_mreq6): Treat negative option length
        as invalid to match the kernel behaviour.  When the option length
        is invalid, print the address.
        * NEWS: Mention it.
        * tests/ip_mreq.c (main): Check it.  Update expected output.

        net: enhance decoding of setsockopt's SO_LINGER negative option length.
        * net.c (print_set_linger): Treat negative option length as invalid
        to match the kernel behaviour.
        * tests/so_linger.c (main): Check it.

        msghdr: use PRINT_FIELD_* macros.
        * msghdr.c (print_scm_creds): Use PRINT_FIELD_U and PRINT_FIELD_UID.
        (print_cmsg_ip_recverr): Use PRINT_FIELD_U.
        (print_struct_msghdr): Use PRINT_FIELD_U and PRINT_FIELD_FLAGS.

        Intorduce PRINT_FIELD_SOCKADDR.
        * print_fields.h (PRINT_FIELD_SOCKADDR): New macro.
        * msghdr.c (print_cmsg_ip_recverr): Use it instead of print_sockaddr.
        * net.c (print_group_req): Likewise.
        * sock.c (PRINT_IFREQ_ADDR): Remove.
        (print_ifreq, print_ifconf_ifreq): Use PRINT_FIELD_SOCKADDR
        instead of PRINT_IFREQ_ADDR.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        print_sockaddr: remove "struct tcb *" argument.
        print_sockaddr does not use its first argument, remove it.

        * defs.h (print_sockaddr): Remove argument.
        * sockaddr.c (print_sockaddr): Remove argument.  All callers updated.
        * sock.c (PRINT_IFREQ_ADDR): Likewise.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        net: use PRINT_FIELD_* macros.
        * net.c (print_tpacket_stats, print_tpacket_req): Use PRINT_FIELD_U.
        (print_group_req): Use PRINT_FIELD_IFINDEX.
        (print_packet_mreq): Use PRINT_FIELD_IFINDEX, PRINT_FIELD_U,
        and PRINT_FIELD_XVAL.

        netlink_sock_diag: introduce PRINT_FIELD_INET_DIAG_SOCKID.
        * netlink_sock_diag.c (PRINT_FIELD_INET_DIAG_SOCKID): New macro.
        (decode_inet_diag_req_compat, decode_inet_diag_req_v2,
        decode_inet_diag_msg, decode_smc_diag_req, decode_smc_diag_msg): Use it
        instead of print_inet_diag_sockid.

        Intorduce PRINT_FIELD_DEV.
        * print_fields.h (PRINT_FIELD_DEV): New macro.
        * dm.c (dm_decode_device, dm_decode_dm_name_list): Use it
        instead of print_dev_t.
        * loop.c (decode_loop_info, decode_loop_info64): Likewise.
        * netlink_sock_diag.c (decode_unix_diag_vfs): Likewise.

        Intorduce PRINT_FIELD_INET4_ADDR.
        * print_fields.h (PRINT_FIELD_INET4_ADDR): New macro.
        * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of manual
        tprintf statements.
        * net.c (print_mreq): Likewise.
        * sockaddr.c (print_sockaddr_data_in): Likewise.

        Intorduce PRINT_FIELD_NET_PORT.
        * print_fields.h (PRINT_FIELD_NET_PORT): New macro.
        * netlink_sock_diag.c (print_inet_diag_sockid): Use it
        instead of a manual tprintf statement.
        * sockaddr.c (print_sockaddr_data_in, print_sockaddr_data_in6,
        print_sockaddr_data_ipx): Likewise.

        Intorduce PRINT_FIELD_IFINDEX.
        * print_fields.h (PRINT_FIELD_IFINDEX): New macro.
        * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of print_ifindex.
        * net.c (print_mreq6): Likewise.
        * netlink_sock_diag.c (print_packet_diag_mclist,
        print_inet_diag_sockid): Likewise.
        * sockaddr.c (print_sockaddr_data_in6, print_sockaddr_data_ll):
        Likewise.

        Intorduce PRINT_FIELD_INET_ADDR.
        * print_fields.h (PRINT_FIELD_INET_ADDR): New macro.
        * net.c (print_mreq6): Use it instead of print_inet_addr.
        * netlink_sock_diag.c (print_inet_diag_sockid): Likewise.
        * sockaddr.c (print_sockaddr_data_in6): Likewise.

        net: move print_ifindex to a separate file.
        * print_ifindex.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * net.c (print_ifindex): Move to print_ifindex.c.

        net: move parsers of bind, listen, and shutdown to separate files.
        * bind.c: New file.
        * listen.c: Likewise.
        * shutdown.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * net.c (SYS_FUNC(bind)): Move to bind.c.
        (SYS_FUNC(listen)): Move to listen.c.
        (SYS_FUNC(shutdown)): Move to shutdown.c.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of packet_diag_msg attributes.
        * tests/netlink_sock_diag-v.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/nlattr_packet_diag_msg.c: New file.
        * tests/gen_tests.in (nlattr_packet_diag_msg): New entry.
        * tests/pure_executables.list: Add nlattr_packet_diag_msg.
        * tests/.gitignore: Likewise.

        netlink: decode AF_PACKET packet_diag_msg attributes.
        * linux/packet_diag.h (packet_diag_info, packet_diag_mclist,
        packet_diag_ring): New structures.
        (PDI_*): New macros.
        * netlink_sock_diag.c: Include <linux/filter.h>
        and "xlat/packet_diag_info_flags.h".
        (decode_packet_diag_info, decode_packet_diag_mclist,
        decode_packet_diag_ring, decode_packet_diag_filter): New functions.
        (packet_diag_msg_nla_decoders): New array.
        (decode_packet_diag_msg): Use it.
        * print_fields.h (PRINT_FIELD_QUOTED_STRING): New macro.
        * xlat/packet_diag_info_flags.in: New file.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: fix TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects.
        commit v4.17-161-gdbd0605 that adjusted TEST_NLATTR_OBJECT and
        TEST_NLATTR_ARRAY for large objects, only changed the pattern
        print length, large length still can be specified as nla_data_len,
        resulting to output mismatch.

        * tests/test_nlattr.h (TEST_NLATTR_OBJECT): Pass "plen"
        both as nla_data_len and slen arguments of TEST_NLATTR_
        in len < sizeof(object) case.
        (TEST_NLATTR_ARRAY): Likewise, Pass "plen" both as nla_data_len
        and slen arguments of TEST_NLATTR_ in len < sizeof(object[0]) case.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: introduce TEST_NLATTR_nla macro in test_nlattr.h.
        Explicitly make struct nlattr * pointer which is internal
        to TEST_NLATTR_ macro available to its varadic arguments.

        * tests/test_nlattr.h (TEST_NLATTR_): Rename nla to TEST_NLATTR_nla.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of SO_PEERCRED socket option.
        * tests/so_peercred.c: New file.
        * tests/gen_tests.in (so_peercred): New entry.
        * tests/pure_executables.list: Add so_peercred.
        * tests/.gitignore: Likewise.

        net: accept arbitrary option length for getsockopt's SO_PEERCRED.
        * print_fields.h (PRINT_FIELD_UID): New macro.
        * net.c (print_ucred): Rewrite to match the kernel behaviour.
        * NEWS: Mention this.

        tests: check decoding of socket filters.
        * tests/sock_filter-v.c: New file.
        * tests/gen_tests.in (sock_filter-v): New entry.
        * tests/pure_executables.list: Add sock_filter-v.
        * tests/.gitignore: Likewise.

        Implement decoding of linux socket filter programs.
        * bpf_sock_filter.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/skf_ad.in: New file.
        * defs.h (decode_sock_fprog, print_sock_fprog): New prototypes.
        * fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer.
        * net.c (print_getsockopt): Use decode_sock_fprog to print
        socket filter programs for SO_GET_FILTER socket option.
        (print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size
        to print socket filter programs for SO_ATTACH_FILTER
        and SO_ATTACH_REUSEPORT_CBPF socket options.
        * NEWS: Mention this.

        tests: check decoding of SO_LINGER socket option.
        * tests/so_linger.c: New file.
        * tests/gen_tests.in (so_linger): New entry.
        * tests/pure_executables.list: Add so_linger.
        * tests/.gitignore: Likewise.

        tests: fix print_quoted_hex output of bytes with high bit set.
        * tests/tests.h (print_quoted_memory, print_quoted_hex): Change the type
        of first argument from "const char *" to "const void *".
        * tests/print_quoted_string.c: Likewise.
        (print_quoted_hex): Print bytes as unsigned char objects to avoid
        unwanted sign extension.
        * tests/netlink_protocol.c (send_query): Remove the cast of print_quoted_hex
        first argument which is now redundant.

        net: accept arbitrary option length for getsockopt's SO_LINGER.
        * net.c (print_linger): Rename to print_set_linger.
        (print_setsockopt): Replace print_linger with print_set_linger.
        (print_get_linger): New function that accepts arbitrary option length
        to match the kernel behaviour.
        (print_getsockopt): Replace print_linger with print_get_linger.
        * NEWS: Mention this.

        net: accept large option length for SO_LINGER.
        * net.c (print_linger): Allow len > sizeof(struct linger) to match
        the kernel behaviour.

        net: fix printing of struct linger's field names.
        * net.c: Include "print_fields.h".
        (print_linger): Print fields of struct linger using PRINT_FIELD_D.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        net: enhance decoding of getsockopt's optlen argument.
        As the last argument of getsockopt syscall has read-write semantics,
        print both user and kernel values when they differ.

        * net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save
        the length specified to the kernel.  On error, print the length saved
        on entering.  When the saved length and the length returned by the
        kernel differ, print both values.
        * NEWS: Mention this.
        * tests/net-icmp_filter.c (main): Update expected output.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        net: move printing of [gs]etsockopt's socklen argument to toplevel parsers
        * net.c (print_getsockopt, print_setsockopt): Remove "done" label,
        replace "goto done" statement with "return".
        Move printing of "len" argument ...
        (SYS_FUNC(getsockopt), SYS_FUNC(setsockopt)): ... here.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        Generalize seccomp filter parser.
        Linux socket filter uses almost the same classic BPF as seccomp filter,
        The only difference noticeable from strace PoV is the meaning of generic
        multiuse field.

        Transform the parser of seccomp filters to a more generic parser
        of classic BPF, parametrized with a method of parsing the generic
        multiuse field in BPF_STMT.

        * bpf_filter.c: New file.
        * bpf_filter.h: Likewise.
        * bpf_fprog.h: Likewise.
        * bpf_seccomp_filter.c: Likewise.
        * fetch_bpf_fprog.c: Likewise.
        * fetch_seccomp_fprog.c: Remove.
        * seccomp_fprog.h: Likewise.
        * Makefile.am (strace_SOURCES): Add bpf_filter.c, bpf_filter.h,
        bpf_fprog.h, bpf_seccomp_filter.c, and fetch_bpf_fprog.c.
        Remove fetch_seccomp_fprog.c and seccomp_fprog.h.
        * seccomp.c: Do not include linux/filter.h and xlat header files.
        Do not define SECCOMP_RET_ACTION.
        (bpf_filter, decode_bpf_code, decode_bpf_stmt, decode_bpf_jump,
        print_bpf_filter, print_seccomp_fprog, print_seccomp_filter): Remove.
        * defs.h (print_seccomp_filter): Rename to decode_seccomp_fprog.
        (SYS_FUNC(seccomp)): Replace print_seccomp_filter
        with decode_seccomp_fprog.
        * prctl.c (SYS_FUNC(prctl)): Likewise.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that <linux/filter.h> is always available.
        <linux/filter.h> was introduced in linux 2.1.75, way before
        the minimal kernel version supported by strace.

        * configure.ac (AC_CHECK_HEADERS): Remove linux/filter.h.
        * seccomp.c: Assume HAVE_LINUX_FILTER_H.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter.c: Likewise.

2017-07-07  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: add BPF_END to BPF_ALU opcode list.
        BPF_END is one of three eBPF-only opcodes for BPF_ALU class.
        Other two (BPF_MOV and BPF_ARSH) has been added earlier.

        * xlat/bpf_op_alu.in: Add BPF_END.

2017-07-07  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink_sock_diag: print unrecognized data in hex.
        * netlink_sock_diag.c (decode_family): Replace printstrn with
        printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/netlink_sock_diag.c (test_odd_family_req,
        test_odd_family_msg): Update expected output.

        netlink: print unrecognized nlattr in hex.
        * nlattr.c (fetch_nlattr): Replace printstrn
        with printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/nlattr.c (test_nlattr): Update expected output.

        netlink: print unrecognized netlink messages in hex.
        * netlink.c (fetch_nlmsghdr): Replace printstrn
        with printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/netlink_protocol.c (send_query): Update expected output.

        netlink: print unrecognized netlink payload in hex.
        * netlink.c (decode_payload): Replace printstrn
        with printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/netlink_protocol.c (send_query, test_nlmsgerr,
        test_nlmsg_done): Update expected output.
        * tests/netlink_generic.c (test_nlmsg_type): Likewise.

        netlink: print unrecognized nlmsgerr in hex.
        * netlink.c (decode_nlmsgerr): Replace printstrn
        with printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/netlink_protocol.c (test_nlmsgerr): Update expected output.

        netlink: print unrecognized attribute data in hex.
        * nlattr.c (decode_nlattr_with_data): Replace printstrn
        with printstr_ex and set QUOTE_FORCE_HEX flag.
        * tests/tests.h (print_quoted_hex): New prototype.
        * tests/print_quoted_string.c (print_quoted_hex): New function.
        * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Use it
        for updated expected output.  Change the type of "plen" variable
        to unsigned int.
        * tests/nlattr.c (test_nlattr): Update expected output.

        tests: print quotation marks in print_quoted_memory.
        * tests/print_quoted_string.c (print_quoted_memory): Print opening
        and closing quotation marks.
        * tests/getcwd.c (main): Do not print quotation marks around
        print_quoted_string.
        * tests/uname.c (main): Likewise.
        * tests/keyctl.c (print_quoted_string_limit): Do not print quotation
        marks around print_quoted_memory.
        * tests/netlink_protocol.c (send_query): Likewise.
        * tests/xattr.c (main): Likewise.

2017-07-06  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: remove misleading remark that -i option is weakly supported.
        Given that -i functionality is covered by pc.test, the remark that
        it is weakly supported is wrong.

        * strace.1 (BUGS): Remove the remark about weakly supported -i option.

2017-07-06  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.18-1.
        * strace.spec.in: Likewise.

2017-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.18 release.
        * NEWS: Update for 4.18 release.

2017-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify create_nl_socket based tests against the race condition
        There is a race condition between the moment a netlink socket is created
        and the moment it is reported via SOCK_DIAG_BY_FAMILY interface.
        Add one more operation on the socket created by create_nl_socket
        to increase chances of winning the race.

        * tests/create_nl_socket.c (create_nl_socket_ext): Add a getsockopt call
        with the created socket.

2017-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2017-07-04  Romain Naour  <romain.naour@smile.fr>

        nios2: fix wrong access to "SP" register in user_pt_regs.
        Starting with linux commit v4.0-rc4~21^2, "SP" register
        is available via regs[PTR_SP] member of struct user_pt_regs.

        * linux/nios2/arch_regs.h (nios2_sp_ptr): Change type
        to "unsigned int *".
        * linux/nios2/arch_regs.c (nios2_sp_ptr): Likewise.
        Replace .sp with .regs[PTR_SP].

        Fixes: http://autobuild.buildroot.net/results/b9f/b9fc25b82f3280872fe1593ac252a8529ba83576
        Fixes: v4.16-34-g6117728a ("nios2: export nios2_sp_ptr")

2017-07-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        tests: add multi-process check to qual_fault.test.
        Check that syscall counters used for tampering are per-tcb.

        * tests/qual_fault.c: Include <fcntl.h> for open(),
        <sys/param.h> for PATH_MAX, and <sys/wait.h> for wait().
        (expfd): Rename to exp_fd, remove const qualifier and initialization.
        (gotfd): Rename to got_fd, remove const qualifier and initialization.
        (out_fd): New variable, for the expected strace output.
        (open_file): New helper function.
        (main): Remove st, add num_procs, proc, exp_prefix, got_prefix,
        out_prefix, pid_prefix.  Remove stat asserts, update argc assert.
        Add num_procs, exp_prefix, got_prefix, out_prefix, pid_prefix
        initialization.  Add per-process loop, open expfd, gotfd, out_fd, pidfd
        in each one, print process's pid to pidfd, print exit message to out_fd.
        Add wait() call for each forked process.
        * tests/qual_fault.test (N): increase to 100 in order to check
        concurrent process execution.
        (check_fault_injection): Take additional argument for the process
        count, pass it to qual_fault, add filename variables for expected strace
        output and pid file, pass them to qual_fault.
        Specify -ff parameter to strace invocation.
        Compare write and strace output for the each process.
        Update all check_fault_injection invocation with process count argument,
        add an invocation with 4 concurrent processes.
        * tests/init.sh (TIMEOUT_DURATION): Raise from 120 to 300.

2017-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: adjust TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects
        * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Add
        support for objects larger than DEFAULT_STRLEN.
        * tests/nlattr_inet_diag_msg.c (main): Change pattern size
        from DEFAULT_STRLEN to 4096.
        * tests/nlattr_netlink_diag_msg.c: Likewise.
        * tests/nlattr_unix_diag_msg.c: Likewise.

        Reported-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move DEFAULT_STRLEN macro to tests.h.
        * tests/tests.h [!DEFAULT_STRLEN] (DEFAULT_STRLEN): New macro.
        * tests/mincore.c (DEFAULT_STRLEN): Remove.
        * tests/mmsg_name.c: Likewise.
        * tests/msg_control.c: Likewise.
        * tests/netlink_protocol.c: Likewise.
        * tests/nlattr.c: Likewise.
        * tests/nlattr_inet_diag_msg.c: Likewise.
        * tests/nlattr_netlink_diag_msg.c: Likewise.
        * tests/nlattr_unix_diag_msg.c: Likewise.
        * tests/printstr.c: Likewise.
        * tests/xattr.c: Likewise.
        * tests/execve.c: Likewise.
        (main): Initialize str_a and str_b arrays at run time.
        * tests/execveat.c: Likewise.

        Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-07-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use unified diff in order to improve test log readability.
        * tests/init.sh (match_diff): Add -u option to the diff invocation.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        Fix error diagnostics in case of zero argc.
        * strace.c (init): Adjust argc along with argv,
        check that adjusted argc is sane.
        * tests/zeroargc.c: New file.
        * tests/.gitignore: Add zeroargc.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/options-syntax.test: Check strace error diagnostics
        in case of zero argc.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        Use program_invocation_name instead of a local progname variable.
        Emulate program_invocation_name only if it is not provided by libc.

        * configure.ac: Check for program_invocation_name variable.
        * strace.c (progname): Remove.
        [!HAVE_PROGRAM_INVOCATION_NAME] (program_invocation_name): New variable.
        (verror_msg, error_msg_and_help): Use it instead of progname.
        (init): Initialize program_invocation_name instead of progname.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>
            Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Introduce generic STRINGIFY and STRINGIFY_VAL macros.
        * macros.h (STRINGIFY, STRINGIFY_VAL): New macros.
        * mpers_type.h: Include "macros.h".
        [IN_MPERS] (STRINGIFY): Remove.
        * tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove.
        (TEST_SYSCALL_STR): Use STRINGIFY_VAL.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce macros.h.
        Introduce a separate header file for generic macros shared between
        strace and its tests.  Start this unification with ARRAY_SIZE macro.

        * defs.h: Include "macros.h".
        (ARRAY_SIZE): Move ...
        * macros.h: ... to new file.
        * Makefile.am (strace_SOURCES): Add it.
        * tests/tests.h: Include "macros.h".
        (ARRAY_SIZE): Remove.  All callers updated.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        quota: use PRINT_FIELD_FLAGS.
        * quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t
        to uint8_t.
        (decode_cmd_data): Use PRINT_FIELD_FLAGS.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        Unify different generic PRINT_FIELD_* implementations.
        Create a new header print_fields.h and move generic PRINT_FIELD_*
        macros there.

        * print_fields.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_sock_diag.c: Include "print_fields.h".
        (PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS,
        PRINT_FIELD_XVAL): Move to print_fields.h file.
        * quota.c: Include "print_fields.h".
        (PRINT_FIELD_D): Move to print_fields.h file.
        (PRINT_FIELD_U, PRINT_FIELD_X): Remove.
        * statx.c: Include "print_fields.h".
        (PRINT_FIELD_U): Remove.
        (SYS_FUNC(statx)): Update PRINT_FIELD_U callers.
        * tests/quotactl.h: Include "print_fields.h".
        * tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros.
        * tests/quotactl.c: Likewise.
        (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove.
        * tests/test_nlattr.h: Include "print_fields.h".
        (PRINT_FIELD_U, PRINT_FIELD_X): Remove.
        * tests/xstatx.c: Include "print_fields.h".
        (PRINT_FIELD_U): Remove.
        (print_stat): Update PRINT_FIELD_U callers.
        * tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf.

2017-07-01  Eugeniy Paltsev  <Eugeniy.Paltsev@synopsys.com>

        arc: fix wrong access to "sp" member in user_regs_struct.
        "sp" register is a member of "scratch" structure (which is nested
        in user_regs_struct)

        * linux/arc/arch_regs.c: Replace .sp with .scratch.sp .

        Fixes: v4.16-31-g134042a5 ("arc: export arc_sp_ptr")

2017-07-01  Khem Raj  <raj.khem@gmail.com>

        aarch64, tile: replace struct ucontext with ucontext_t.
        glibc >= 2.26 has dropped the tag struct ucontext from ucontext_t type.

        * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Replace
        struct ucontext with ucontext_t.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance nlattr_unix_diag_msg test.
        * tests/nlattr_unix_diag_msg.c: Include "test_nlattr.h".
        (test_unix_diag_vfs, test_unix_diag_icons, test_unix_diag_rqlen):
        Remove.
        (init_unix_diag_msg): Add const qualifier to arguments and variables.
        (print_unix_diag_msg, print_uint): New functions.
        (main): Use them and macros from test_nlattr.h file.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of netlink unix_diag_msg attributes.
        * tests/nlattr_unix_diag_msg.c: New file.
        * tests/gen_tests.in (nlattr_unix_diag_msg): New entry.
        * tests/pure_executables.list: Add nlattr_unix_diag_msg.
        * tests/.gitignore: Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: ensure that structure field names are printed properly
        * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_rqlen):
        Use PRINT_FIELD_U to print structure fields.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: add const qualifiers.
        Add const qualifiers to auto variables and function arguments.
        This change does not affect the code generated by the compiler,
        the purpose of these "const" qualifiers is to highlight the intent.

        * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_inode,
        decode_unix_diag_rqlen): Add const qualifier to tcp, addr, and len
        arguments.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode AF_UNIX unix_diag_msg attributes.
        * netlink_sock_diag.c (unix_diag_msg_nla_decoders): New array.
        (decode_unix_diag_msg): Use it.
        * linux/unix_diag.h (unix_diag_vfs, unix_diag_rqlen): New structures.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance nlattr_netlink_diag_msg test.
        * tests/nlattr_netlink_diag_msg.c: Include "test_nlattr.h".
        (test_netlink_diag_groups, test_netlink_diag_rx_ring,
        test_netlink_diag_flags): Remove.
        (init_netlink_diag_msg): Add const qualifier to arguments and variables.
        (print_netlink_diag_msg, print_xlong): New functions.
        (main): Use them and macros from test_nlattr.h file.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of netlink_diag_msg attributes.
        * tests/nlattr_netlink_diag_msg.c: New file.
        * tests/gen_tests.in (nlattr_netlink_diag_msg): New entry.
        * tests/pure_executables.list: Add nlattr_netlink_diag_msg.
        * tests/.gitignore: Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: ensure that structure field names are printed properly
        * netlink_sock_diag.c (decode_netlink_diag_ring): Use PRINT_FIELD_U
        to print structure fields.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: add const qualifiers.
        Add const qualifiers to auto variables and function arguments.
        This change does not affect the code generated by the compiler,
        the purpose of these "const" qualifiers is to highlight the intent.

        * netlink_sock_diag.c (print_group, decode_netlink_diag_groups,
        decode_netlink_diag_ring, decode_netlink_diag_flags): Add const
        qualifier to tcp, addr, and len arguments.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode AF_NETLINK netlink_diag_msg attributes.
        * linux/netlink_diag.h (netlink_diag_ring): New structure.
        (NDIAG_FLAG_*): New macros.
        * netlink_sock_diag.c: Include "xlat/netlink_socket_flags.h".
        (print_group, decode_netlink_diag_groups, decode_netlink_diag_ring,
        decode_netlink_diag_flags): New functions.
        (netlink_diag_msg_nla_decoders): New array.
        (decode_netlink_diag_msg): Use it.
        * xlat/netlink_socket_flags.in: New file.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: print inet_diag_sockid.idiag_if as an interface index
        * netlink_sock_diag.c (print_inet_diag_sockid): Print idiag_if field
        using print_ifindex.
        * tests/nlattr_inet_diag_msg.c: Include <net/if.h>.
        (IFINDEX_LO): New macro.
        (init_inet_diag_msg): Set inet_diag_sockid.idiag_if field.
        (print_inet_diag_msg): Update expected output.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>
            JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of several standard netlink attributes.
        * tests/nlattr_inet_diag_msg.c (main): Check decoding of uint32_t,
        uint8_t, and zero-terminated string attributes.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance nlattr_inet_diag_msg test.
        * tests/test_nlattr.h: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/nlattr_inet_diag_msg.c: Include "test_nlattr.h".
        (test_inet_diag_meminfo, test_inet_diag_vegasinfo,
        test_inet_diag_dctcpinfo, test_inet_diag_bbrinfo): Remove.
        (address): New variable.
        (init_inet_diag_msg): Remove "address" argument, add const qualifier
        to all remaining arguments.
        (print_inet_diag_msg, print_uint): New functions.
        (main): Use macros from test_nlattr.h file.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of netlink inet_diag_msg attributes.
        * tests/nlattr_inet_diag_msg.c: New file.
        * tests/gen_tests.in (nlattr_inet_diag_msg): New entry.
        * tests/pure_executables.list: Add nlattr_inet_diag_msg.
        * tests/.gitignore: Likewise.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: ensure that structure field names are printed properly
        * netlink_sock_diag.c (PRINT_FIELD_X): New macro.
        (decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info,
        decode_tcp_bbr_info): Use it and PRINT_FIELD_U to print structure
        fields.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: add const qualifiers.
        Add const qualifiers to auto variables and function arguments.
        This change does not affect the code generated by the compiler,
        the purpose of these "const" qualifiers is to highlight the intent.

        * netlink_sock_diag.c (print_meminfo, decode_meminfo,
        decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info,
        decode_tcp_bbr_info): Add const qualifier to tcp, addr, and len
        arguments.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode AF_INET inet_diag_msg attributes.
        * linux/inet_diag.h (inet_diag_meminfo, tcpvegas_info,
        tcp_dctcp_info, tcp_bbr_info): New structures.
        * linux/sock_diag.h (SK_MEMINFO_VARS): New macro.
        * netlink_sock_diag.c: Include  <linux/sock_diag.h>.
        (print_meminfo, decode_meminfo, decode_inet_diag_meminfo,
        decode_tcpvegas_info, decode_tcp_dctcp_info, decode_tcp_bbr_info):
        New functions.
        (inet_diag_msg_nla_decoders): New array.
        (decode_inet_diag_msg): Use it.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        nlattr: add const qualifiers to auto variables and function arguments.
        This change does not affect the code generated by the compiler,
        the purpose of these "const" qualifiers is to highlight the intent.

        * nlattr.c (decode_nlattr_with_data, decode_nla_str, decode_nla_strn,
        decode_nla_##name): Add const qualifier to tcp, addr, and len arguments.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: introduce nla_decoder_t to parse netlink attributes data.
        * nlattr.h (nla_decoder_t): New typedef.
        (DECL_NLA): New macro.
        (decode_nlattr): Add decoders, size and opaque_data argument.
        * nlattr.c: (decode_nlattr_with_data): Likewise.
        (decode_nla_*): New functions.
        * netlink_sock_diag.c (decode_inet_diag_req_compat)
        (decode_inet_diag_req_v2, decode_inet_diag_msg)
        (decode_netlink_diag_msg, (decode_packet_diag_msg)
        (decode_smc_diag_msg, decode_unix_diag_msg): Add decoders,
        size and opaque_data arguments. All callers updated.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: add a basic netlink attribute parser of AF_SMC diag.
        * netlink_sock_diag.c: Include "xlat/smc_diag_attrs.h".
        (decode_smc_diag_msg): Use decode_nlattr.
        * xlat/smc_diag_attrs.in: New file.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add a basic netlink attribute parser of AF_INET diag.
        * linux/inet_diag.h (INET_DIAG_REQ_*): New enum.
        * netlink_sock_diag.c: Include "xlat/inet_diag_attrs.h"
        and "xlat/inet_diag_req_attrs.h".
        (decode_inet_diag_req_compat, decode_inet_diag_req_v2,
         decode_inet_diag_msg): Use decode_nlattr.
        * xlat/inet_diag_attrs.in: New file.
        * xlat/inet_diag_req_attrs.in: Likewise.

        netlink: add a basic netlink attribute parser of AF_PACKET diag.
        * linux/packet_diag.h (PACKET_DIAG_*): New enum.
        * netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h".
        (decode_packet_diag_msg): Use decode_nlattr.
        * xlat/packet_diag_attrs.in: New file.

        netlink: add a basic netlink attribute parser of AF_NETLINK diag.
        * linux/netlink_diag.h (NETLINK_DIAG_*): New enum.
        * netlink_sock_diag.c: Include "xlat/netlink_diag_attrs.h".
        (decode_netlink_diag_msg): Use decode_nlattr.
        * xlat/netlink_diag_attrs.in: New file.

2017-06-29  Dmitry V. Levin  <ldv@altlinux.org>

        netlink_sock_diag: ensure that structure field names are printed properly
        * netlink_sock_diag.c (PRINT_FIELD_U, PRINT_FIELD_COOKIE,
        PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): New macros.
        (decode_unix_diag_req, decode_unix_diag_msg, decode_netlink_diag_req,
        decode_netlink_diag_msg, decode_packet_diag_req, decode_packet_diag_msg,
        print_inet_diag_sockid, decode_inet_diag_req_compat,
        decode_inet_diag_req_v2, decode_inet_diag_msg, decode_smc_diag_req,
        decode_smc_diag_msg): Use them to print structure fields.

2017-06-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.12-rc7.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7
        (with f7a320ff commit applied on top) 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.
        * NEWS: Mention this.

2017-06-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        maint: fix ioctls_sym.sh premature termination.
        When the list of headers do not fit into the command line, xargs splits
        it into several lists and then passes them to grep.  If no headers from
        a list match the grep pattern, grep exits with a non-zero status that
        causes xargs to exit with a non-zero status, too.

        * maint/ioctls_sym.sh: Use "find -exec +" instead of xargs,
        ignore its exit status.

2017-06-27  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: introduce NLMSG_ATTR macro.
        * tests/tests.h (NLMSG_ATTR): New macro.
        * tests/nlattr.c (test_nlattr, test_nla_type): Use it.

2017-06-27  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: pass NLMSG_DONE messages to family specific payload decoders.
        While many NLMSG_DONE messages indeed have payload containing
        just one integer, there are exceptions. Handle this by passing
        payloads of NLMSG_DONE messages to family specific netlink
        payload decoders.

        * netlink.c (print_nlmsghdr): Do not skip family detection
        for nlmsg_type == NLMSG_DONE.
        (decode_nlmsg_type): Skip family specific type decoders
        for type == NLMSG_DONE.
        (decode_nlmsg_flags): Skip family specific decoding of flags
        for type == NLMSG_DONE.
        (decode_netlink_sock_diag): Skip for nlmsg_type == NLMSG_DONE.

2017-06-26  Dmitry V. Levin  <ldv@altlinux.org>

        Unexport die_out_of_memory.
        Print more specific error diagnostics than a generic "Out of memory"
        when an error happens outside xmalloc.c.

        * defs.h (die_out_of_memory): Remove prototype.
        * strace.c (strace_popen, init): Call perror_msg_and_die instead
        of die_out_of_memory.
        * unwind.c (unwind_tcb_init): Likewise.
        * xmalloc.c (die_out_of_memory): Add static qualifier.

2017-06-26  Dmitry V. Levin  <ldv@altlinux.org>

        Check -s argument early.
        * util.c (printstr_ex): Move the check that -s argument
        does not exceed -1U / 4 ...
        * strace.c (init): ... here.
        * tests/options-syntax.test: Check it.

2017-06-25  Dmitry V. Levin  <ldv@altlinux.org>

        Include "netlink.h" instead of <linux/netlink.h>
        * net.c: Include "netlink.h" instead of <linux/netlink.h>.
        * sockaddr.c: Likewise.
        * tests/create_nl_socket.c: Likewise.
        * tests/net-sockaddr.c: Likewise.
        * tests/netlink_audit.c: Likewise.
        * tests/netlink_generic.c: Likewise.
        * tests/netlink_inet_diag.c: Likewise.
        * tests/netlink_netfilter.c: Likewise.
        * tests/netlink_route.c: Likewise.
        * tests/netlink_selinux.c: Likewise.
        * tests/netlink_xfrm.c: Likewise.
        * tests/net-yy-netlink.c: Include "netlink.h" instead
        of <linux/netlink.h>, remove fallback definition of NETLINK_SOCK_DIAG.
        * tests/netlink_netlink_diag.c: Likewise.
        * tests/netlink_protocol.c: Likewise.
        * tests/netlink_sock_diag.c: Likewise.
        * tests/netlink_unix_diag.c: Likewise.
        * tests/nlattr.c: Likewise.

2017-06-24  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: provide a fallback definition of NETLINK_SOCK_DIAG.
        Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h
        instead of adding these fallback definitions to every file.

        * netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG.
        * socketutils.c: Include "netlink.h" instead of <linux/netlink.h>,
        remove fallback definition of NETLINK_SOCK_DIAG.

2017-06-23  Dmitry V. Levin  <ldv@altlinux.org>

        Update prctl ARCH_* constants.
        * xlat/archvals.in: Add ARCH_GET_CPUID and ARCH_SET_CPUID
        introduced by linux kernel commit v4.12-rc1~153^2~2.

2017-06-22  Dmitry V. Levin  <ldv@altlinux.org>

        Update V4L2_* constants.
        * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_META_CAPTURE introduced
        by linux kernel commit v4.12-rc1~85^2~71.
        * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_META_CAPTURE
        introduced by the same commit.
        * xlat/v4l2_control_flags.in: Add V4L2_CTRL_FLAG_HAS_PAYLOAD,
        V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and V4L2_CTRL_FLAG_MODIFY_LAYOUT
        introduced by linux kernel commits v3.17-rc1~112^2~363,
        v4.1-rc1~59^2~1^2~63, and v4.12-rc1~85^2~62, respectively.
        * xlat/v4l2_control_types.in: Add V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16,
        and V4L2_CTRL_TYPE_U32 introduced by linux kernel commits
        v3.17-rc1~112^2~343 and v3.17-rc1~112^2~112.

        Update SCTP_* constants.
        * xlat/socksctpoptions.in: Add SCTP_ENABLE_STREAM_RESET,
        SCTP_RESET_STREAMS, SCTP_RESET_ASSOC, SCTP_ADD_STREAMS,
        SCTP_RECONFIG_SUPPORTED, and SCTP_PR_STREAM_STATUS introduced
        by linux kernel commits v4.11-rc1~124^2~387^2~1, v4.11-rc1~124^2~387^2,
        v4.11-rc1~124^2~166^2~2, v4.11-rc1~124^2~166^2, v4.12-rc1~64^3~469^2,
        and v4.12-rc1~64^3~276, respectively.

        Update RTM_* constants.
        * xlat/nl_route_types.in: Add RTM_DELNETCONF introduced
        by linux kernel commit v4.12-rc1~64^3~312^2~6.

        Update NDIAG_SHOW_* constants.
        * linux/netlink_diag.h (NDIAG_SHOW_FLAGS): New constant introduced
        by linux kernel commit v4.12-rc1~64^3~260.
        * xlat/netlink_diag_show.in: Add it.

        Update KEYCTL_* constants.
        * xlat/keyctl_commands.in: Add KEYCTL_RESTRICT_KEYRING introduced
        by linux kernel commit v4.12-rc1~123^2~7^2~2^2~3.

        Update ARPHRD_* constants.
        * xlat/arp_hardware_types.in: Add ARPHRD_VSOCKMON introduced
        by linux kernel commit v4.12-rc1~129^2~118^2~2.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_MEMINFO, SO_INCOMING_NAPI_ID,
        and SO_COOKIE introduced by linux kernel commits v4.12-rc1~64^3~389,
        v4.12-rc1~64^3~341^2, and v4.12-rc1~64^3~221^2~1, respectively.

2017-06-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check more corner cases of nlattr decoding.
        * tests/nlattr.c (test_nlattr): Check decoding in case of invalid
        struct nlattr.nla_len.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of netlink attribute.
        * tests/nlattr.c: New file.
        * tests/gen_tests.in (nlattr): New entry.
        * tests/pure_executables.list: Add nlattr.
        * tests/.gitignore: Likewise.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: introduce a basic netlink attributes parser.
        * linux/unix_diag.h (UNIX_DIAG_*): New enum.
        * nlattr.c: New file.
        * nlattr.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * netlink_sock_diag.c: Include "nlattr.h" and "xlat/unix_diag_attrs.h".
        (decode_unix_diag_msg): Use decode_nlattr.
        * xlat/unix_diag_attrs.in: New file.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: introduce netlink.h.
        * netlink.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * netlink_sock_diag.c: Include "netlink.h",
        remove <sys/socket.h> and <linux/netlink.h>.
        * netlink.c: Likewise.
        (NLMSG_HDRLEN): Move to netlink.h.
        * tests/netlink_protocol.c: Replace <linux/netlink.h> with "netlink.h".
        * tests/netlink_sock_diag.c: Likewise.

2017-06-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add SET_STRUCT macro to tests.h.
        * tests/netlink_sock_diag.c (INIT_STRUCT): Rename to SET_STRUCT,
        all callers updated.  Move ...
        * tests/tests.h: ... here.

2017-06-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix potential unaligned access in netlink_sock_diag.test.
        Despite our efforts made to avoid unaligned access, gcc appears to be
        generating instructions that might cause unaligned access when copying
        structures to unaligned addresses.

        Fix this issue by replacing copying of structures to unaligned addresses
        with memcpy calls.

        * tests/netlink_sock_diag.c (INIT_STRUCT): New macro.
        (test_odd_family_req, test_odd_family_msg, test_unix_diag_req,
        test_unix_diag_msg, test_netlink_diag_req, test_netlink_diag_msg,
        test_packet_diag_req, test_packet_diag_msg, test_inet_diag_sockid,
        test_inet_diag_req, test_inet_diag_req_v2, test_inet_diag_msg,
        test_smc_diag_req, test_smc_diag_msg): Use it to initialize potentially
        unaligned struct nlmsghdr.  Do not access nlh->nlmsg_len.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

        tests: check decoding of NETLINK_GENERIC message types.
        * tests/netlink_generic.c: New file.
        * tests/gen_tests.in (netlink_generic): New entry.
        * tests/pure_executables.list: Add netlink_generic.
        * tests/.gitignore: Likewise.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

        netlink: add decoding of NETLINK_GENERIC protocol families.
        NETLINK_GENERIC is a protocol stacked on netlink protocol.

        When a NETLINK_GENERIC subsystem registers its "family" name in the
        kernel at run time, an integer value associated with this name is
        assigned by the kernel.  This integer value is specified in struct
        nlmsghdr.nlmsg_type of subsequent communications with the
        NETLINK_GENERIC subsystem.

        This change implements decoding of NETLINK_GENERIC message types in
        symbolic form, for example:

          $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null
          sendto(4<NETLINK:[GENERIC:12345]>, {{len=20, type=tcp_metrics, ...
          +++ exited with 0 +++

        Note that type= specifying the NETLINK_GENERIC protocol family
        is decoded properly.

        * netlink.c (decode_nlmsg_type_generic): New function.
        (nlmsg_types): Add NETLINK_GENERIC entry.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

        socketutils: build a dynamic xlat table for NETLINK_GENERIC decoding.
        * configure.ac (AC_CHECK_HEADERS): Add linux/genetlink.h.
        * defs.h (genl_families_xlat): New prototype.
        * socketutils.c [HAVE_LINUX_GENETLINK_H]: Include <linux/genetlink.h>.
        [HAVE_LINUX_GENETLINK_H] (genl_send_dump_families,
        genl_parse_families_response): New helper functions.
        (genl_families_xlat): New function for building the xlat table
        for NETLINK_GENERIC decoding.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

        dyxlat: new interface for building xlat tables dynamically.
        xlat tables are usually generated at build time.

        printxval is suitable for printing struct nlmsghdr.nlmsg_type for
        NETLINK_GENERIC protocol.  However, the corresponding xlat table
        cannot be defined at build time because the values are registered
        by the kernel at run time.

        This change introduces dyxlat functions for building xlat tables
        dynamically.  The primary use case is decoding nlmsg_type but this
        interface can be used for other purposes.

        * defs.h (struct dyxlat): New opaque data type.
        (dyxlat_alloc, dyxlat_free, dyxlat_add_pair): New function declarations.
        * dyxlat.c: New file.
        * Makefile.am (strace_SOURCES): Add it.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

        Introduce xstrndup function.
        * configure.ac (AC_CHECK_FUNCS): Add strndup.
        * defs.h (xstrndup): New prototype.
        * xmalloc.c (xstrndup): New function.

2017-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: do not print extra braces around payloadless nlmsghdr.
        * netlink.c (decode_nlmsghdr_with_payload): Print braces before
        print_nlmsghdr and after decode_payload iff decode_payload is invoked.
        * tests/netlink_audit.c (test_nlmsg_type): Update expected output.
        * tests/netlink_netfilter.c: Likewise.
        * tests/netlink_selinux.c: Likewise.
        * tests/netlink_protocol.c (send_query): Likewise.
        * tests/netlink_route.c (test_nlmsg_type, test_nlmsg_flags): Likewise.
        * tests/netlink_sock_diag.c: Likewise.
        * tests/netlink_xfrm.c: Likewise.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Strip argument name of type "struct tcb *" from function prototypes.
        "struct tcb *" was used in most prototypes along with "struct tcb *tcp",
        this change converts the latter form to the former for consistency.

        Fix a few spacing style issues.
        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Strip redundant trailing semicolons.
        Strip trailing semicolons from macro definitions.
        Strip extra semicolons from statements terminations.

        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix macros encosure in a do/while loop.
        Enclose macros with multiple statements and macros starting
        with "if" statement in a do/while loop.
        Do not enclose single statement macros in a do/while loop.

        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Use __func__ instead of gcc specific __FUNCTION__
        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix a few initialization style issues.
        Do not initialise statics and globals to 0, NULL, or false.

        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix function prototypes with unspecified arguments.
        Change functions declared as taking unspecified number of arguments
        of unspecified type to functions that take no arguments.

        Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix a few sizeof style issues.
        Reported by kernel's checkpatch.pl script.

        Fix a few misspellings in comments.
        Reported by kernel's checkpatch.pl script.

2017-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        print_mreq: remove superfluous print_quoted_string calls.
        The string returned by inet_ntoa(3) has IPv4 dotted-decimal notation,
        no need to quote it.

        * net.c (print_mreq): Remove print_quoted_string calls.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of incomplete SCM_TIMESTAMP* control messages.
        * tests/msg_control.c (test_scm_timestamp, test_scm_timestampns,
        test_scm_timestamping): Check decoding of incomplete control messages.

2017-06-15  Miroslav Lichvar  <mlichvar@redhat.com>

        msghdr: print SCM_TIMESTAMP* control messages.
        Add support for printing control messages containing software and/or
        hardware timestamps, which are typically enabled by NTP and PTP
        implementations.

        * print_timeval.c (print_struct_timeval_data_size): New mpers printer.
        * print_timespec.c (print_struct_timespec_data_size,
        print_struct_timespec_array_data_size): Likewise.
        * msghdr.c (print_scm_timestamp, print_scm_timestampns,
        print_scm_timestamping): New functions.
        (cmsg_socket_printers): Add them.
        * NEWS: Mention this change.
        * tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h".
        (test_scm_timestamp, test_scm_timestampns, test_scm_timestamping):
        New functions.
        (test_sol_socket): Use them.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages.
        * tests/netlink_sock_diag.c: Include <linux/smc_diag.h>.
        (SMC_ACTIVE): New macro.
        (test_smc_diag_req, test_smc_diag_msg): New functions.
        (main): Use them.

        netlink: add a basic socket diag parser of AF_SMC messages.
        * linux/smc_diag.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * netlink_sock_diag.c: Include <linux/smc_diag.h>,
        "xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h".
        (decode_smc_diag_req, decode_smc_diag_msg): New functions.
        (diag_decoders): Add AF_SMC.
        * xlat/smc_diag_extended_flags.in: New file.
        * xlat/smc_states.in: Likewise.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages.
        * tests/netlink_sock_diag.c: Include <arpa/inet.h>
        and <linux/inet_diag.h>.
        (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2,
        test_inet_diag_msg): New functions.
        (mian): Use them.

        netlink: add a basic socket diag parser of AF_INET and AF_INET6 messages
        * defs.h (inet_protocols): New xlat prototype.
        * linux/inet_diag.h (inet_diag_req): New structure.
        (INET_DIAG_*): New enum.
        * netlink_sock_diag.c: Include <arpa/inet.h>, <linux/inet_diag.h>
        and "xlat/inet_diag_extended_flags.h".
        (print_inet_diag_sockid, decode_inet_diag_req_compat)
        (decode_inet_diag_req_v2, decode_inet_diag_req)
        (decode_inet_diag_msg): New functions.
        (diag_decoders): Add AF_INET and AF_INET6;
        * xlat/inet_diag_extended_flags.in: New file.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce print_inet_addr.
        * defs.h (print_inet_addr): New prototype.
        * sockaddr.c (print_inet_addr): New function.
        (print_sockaddr_data_in6): Use it.
        * net.c (print_mreq6): Likewise.
        * tests/ip_mreq.c (main): Update expected output.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>

        tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages.
        * tests/netlink_sock_diag.c: Include <linux/if_ether.h>
        and <linux/packet_diag.h>.
        (test_packet_diag_req, test_packet_diag_msg): New functions.
        (main): Use them.

        netlink: add a basic socket diag parser of AF_PACKET messages.
        * linux/packet_diag.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * defs.h (ethernet_protocols): New xlat prototype.
        * netlink_sock_diag.c: Include <linux/packet_diag.h>
        and "xlat/packet_diag_show.h".
        (decode_packet_diag_req, decode_packet_diag_msg): New functions.
        (diag_decoders): Add AF_PACKET.
        * xlat/packet_diag_show.in: New file.

        tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages.
        * tests/netlink_sock_diag.c: Include <linux/netlink_diag.h>.
        (test_netlink_diag_req, test_netlink_diag_msg): New functions.
        (main): Use them.

        netlink: add a basic socket diag parser of AF_NETLINK messages.
        * linux/netlink_diag.h (NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG):
        New macros.
        * netlink_sock_diag.c: Include <linux/netlink_diag.h>,
        "xlat/netlink_diag_show.h" and "xlat/netlink_states.h".
        (decode_netlink_diag_req, decode_netlink_diag_msg): New functions.
        (diag_decoders): Add AF_NETLINK.
        * xlat/netlink_diag_show.in: New file.
        * xlat/netlink_states.in: Likewise.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>
            Fabien Siron  <fabien.siron@epita.fr>
            JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages.
        * tests/netlink_sock_diag.c: Include <netinet/tcp.h>
        and <linux/unix_diag.h>.
        (test_odd_family_req, test_odd_family_msg, test_unix_diag_req,
        test_unix_diag_msg): New functions.
        (main): Use them.

        netlink: add a basic socket diag parser of AF_UNIX messages.
        * defs.h (socktypes): New xlat prototype.
        * linux/unix_diag.h (UDIAG_SHOW_VFS, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN,
        UDIAG_SHOW_MEMINFO): New macros.
        * netlink_sock_diag.c: Include <sys/socket.h>, <linux/netlink.h>,
        <linux/unix_diag.h>, "xlat/tcp_states.h", "xlat/tcp_state_flags.h",
        and "xlat/unix_diag_show.h".
        (decode_unix_diag_req, decode_unix_diag_msg): New functions.
        (netlink_diag_decoder_t): New typedef.
        (diag_decoders): New array.
        (decode_netlink_sock_diag): Use it.
        * xlat/tcp_state_flags.in: New file.
        * xlat/tcp_states.in: Likewise.
        * xlat/unix_diag_show.in: Likewise.

        netlink: introduce family specific payload decoders.
        * defs.h (netlink_decoder_t): New typedef.
        (DECL_NETLINK): New macro.
        (decode_netlink_sock_diag): New prototype.
        * netlink.c (netlink_decoders): New array.
        (decode_payload): Use it to invoke netlink family specific decoders.
        * netlink_sock_diag.c: New file.
        * Makefile.am (strace_SOURCES): Add it.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

        Update SCM_* constants.
        * xlat/scmvals.in: Add SCM_TIMESTAMP, SCM_TIMESTAMPNS, SCM_TIMESTAMPING,
        SCM_WIFI_STATUS, and SCM_TIMESTAMPING_OPT_STATS.

2017-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: refactor decode_nlmsg_type.
        * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_netfilter):
        New functions.
        (nlmsg_types_decoder_t): New typedef.
        (nlmsg_types): Add decoder field.
        (decode_nlmsg_type): Use it.

2017-06-14  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: extend printstr test.
        * tests/printstr.c (main): Add a case for short read.

2017-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: fix preprocessor checks.
        Fix checks for struct v4l2_window.global_alpha and struct
        v4l2_sdr_format.buffersize.

        * v4l2.c (print_v4l2_format_fmt): Do not assume that
        HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA and
        HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE are defined.
        * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise.

2017-06-12  Dmitry V. Levin  <ldv@altlinux.org>

        Move xlat related functions to a separate file.
        * util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals,
        printxval_searchn, addflags, sprintflags, printflags_ex): Move ...
        * xlat.c: ... to this new file.
        * Makefile.am (strace_SOURCES): Add it.

2017-06-12  Masatake YAMATO  <yamato@redhat.com>

        socketeutils: extend receive_responses further.
        This is the second patch in series of implementing NETLINK_GENERIC
        protocol decoder.

        This change allows passing of opaque user data to the callback function.

        * socketutils.c (receive_responses): Change the type of proto_name
        argument from "const char *" to "void *" to allow passing
        of arbitrary data to the callback function.
        Rename proto_name to opaque_data, make it the last argument.
        Pass it to the callback function as the last argument.
        (inet_parse_response, unix_parse_response, netlink_parse_response):
        Change the type of proto_name argument from "const char *" to "void *",
        rename it to opaque_data, make it the last argument.
        Introduce a local variable proto_name to convert the type
        of opaque_data argument from "void *" to "const char *".
        (unix_get, inet_get, netlink_get): Cast the protocol name from
        "const char *" to "void *" for passing to the callback function.

2017-06-12  Masatake YAMATO  <yamato@redhat.com>

        socketeutils: extend receive_responses to handle other netlink types.
        This is the first patch in series of implementing NETLINK_GENERIC
        protocol decoder.

        receive_responses was written for decoding kernel responses of type
        SOCK_DIAG_BY_FAMILY, other types were ignored.

        This change makes the type of netlink response a parameter
        so the function can be used for other types of communication.

        * socketutils.c (receive_responses): add a new parameter
        expected_msg_type to handle types other than SOCK_DIAG_BY_FAMILY.

2017-06-12  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: fix typo.
        * tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&.

2017-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce printflags_ex function.
        Add printflags_ex extension over printflags64 that, similar
        to printxvals, takes a NULL-terminated sequence of xlat pointers.

        * defs.h (printflags_ex): New prototype.
        (printflags64): Turn into a thin wrapper around printflags_ex.
        * netlink.c (decode_nlmsg_flags): Use printflags_ex.
        * util.c (printflags_ex): New function.
        (printflags64): Remove.
        * xlat/netlink_get_flags.in: Remove entries listed
        in xlat/netlink_flags.in file.
        * xlat/netlink_new_flags.in: Likewise.

2017-06-08  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: add check for decoding netlink get and new flags.
        * tests/netlink_route.c (test_nlmsg_flags): New function, checks
        decoding of NETLINK_ROUTE get and new flags.
        (main): Use it.
        * tests/netlink_sock_diag.c (test_nlmsg_flags): New function, checks
        decoding of NETLINK_SOCK_DIAG get flags.
        (main): Use it.
        * tests/netlink_xfrm.c: (test_nlmsg_flags): New function, checks
        decoding of NETLINK_XFRM get and new flags.
        (main): Use it.

2017-06-08  JingPiao Chen  <chenjingpiao@gmail.com>
            Fabien Siron  <fabien.siron@epita.fr>
            Dmitry V. Levin  <ldv@altlinux.org>

        netlink: implement generic nlmsg_flags decoding.
        * netlink.c: Include "xlat/netlink_get_flags.h"
        and "xlat/netlink_new_flags.h".
        (decode_nlmsg_flags): New function.
        (print_nlmsghdr): Use it.
        * xlat/netlink_get_flags.in: New file.
        * xlat/netlink_new_flags.in: Likewise.

2017-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for XFRM_MSG_* constants.
        Some of XFRM_MSG_* constants were introduced later than the header file
        where they are defined.

        * xlat/nl_xfrm_types.in: Add default values for constants.

2017-06-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        syscall.c: split trace_syscall() into 6 functions.
        This change removes the trace_syscall function.  Now, the code that uses
        syscall.c trace functions is expected to check whether it is a syscall
        entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make
        an appropriate sequence of function calls.

        * defs.h: Update comment on TCB_INSYSCALL.
        (trace_syscall): Remove prototype.
        (syscall_entering_decode, syscall_entering_trace,
        syscall_entering_finish, syscall_exiting_decode, syscall_exiting_trace,
        syscall_exiting_finish): New prototypes.
        * strace.c (trace_syscall): New static replacement for old trace_syscall.
        * syscall.c (trace_syscall): Remove.
        (trace_syscall_entering): Split into ...
        (syscall_entering_decode, syscall_entering_trace,
        syscall_entering_finish): ... new functions.
        (trace_syscall_exiting): Split into ...
        (syscall_exiting_decode, syscall_exiting_trace,
        syscall_exiting_finish): ... new functions.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: guard against missing linux/netfilter/nfnetlink.h.
        nfnetlink was introduced in linux by commit v2.6.14-rc1~1035^2~217,
        add a guard for the case when system headers are not fresh enough.

        * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nfnetlink.h.
        * tests/netlink_netfilter.c: Check for HAVE_LINUX_NETFILTER_NFNETLINK_H.

2017-06-05  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: check decoding of NETLINK_XFRM message types.
        * tests/netlink_xfrm.c: New file.
        * tests/gen_tests.in (netlink_xfrm): New entry.
        * tests/pure_executables.list: Add netlink_xfrm.
        * tests/.gitignore: Likewise.

        tests: check decoding of NETLINK_SELINUX message types.
        * tests/netlink_selinux.c: New file.
        * tests/gen_tests.in (netlink_selinux): New entry.
        * tests/pure_executables.list: Add netlink_selinux.
        * tests/.gitignore: Likewise.

        tests: check decoding of NETLINK_NETFILTER message types.
        * tests/netlink_netfilter.c: New file.
        * tests/gen_tests.in (netlink_netfilter): New entry.
        * tests/pure_executables.list: Add netlink_netfilter.
        * tests/.gitignore: Likewise.

        tests: check decoding of NETLINK_AUDIT message types.
        * tests/netlink_audit.c: New file.
        * tests/gen_tests.in (netlink_audit): New entry.
        * tests/pure_executables.list: Add netlink_audit.
        * tests/.gitignore: Likewise.

        tests: check decoding of NETLINK_ROUTE message types.
        * tests/netlink_route.c: New file.
        * tests/gen_tests.in (netlink_route): New entry.
        * tests/pure_executables.list: Add netlink_route.
        * tests/.gitignore: Likewise.

        tests: check decoding of NETLINK_SOCK_DIAG message types.
        * tests/netlink_sock_diag.c: New file.
        * tests/netlink_sock_diag.test: New test.
        * tests/pure_executables.list: Add netlink_sock_diag.
        * tests/.gitignore: Likewise.
        * tests/Makefile.am (DECODER_TESTS): Add netlink_sock_diag.test.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use create_nl_socket in netlink_protocol.test.
        * tests/netlink_protocol.c (main): Use create_nl_socket.

        tests: change netlink_protocol.test to trace sendto syscalls only.
        * tests/gen_tests.in (netlink_protocol): Replace %network with sendto.
        * tests/netlink_protocol.c (main): Update expected output.

        tests: enhance create_nl_socket diagnostics messages.
        * tests/tests.h (create_nl_socket): Rename to create_nl_socket_ext,
        add a string argument.
        (create_nl_socket): New macro wrapper around create_nl_socket_ext.
        * tests/create_nl_socket.c (create_nl_socket): Rename
        to create_nl_socket_ext, add a string argument, include it
        in diagnostic messages.

        tests: use const and designated initializers in create_nl_socket.c.
        * tests/create_nl_socket.c: Stop including <string.h>.
        (create_nl_socket): Use const and designated initializers.

2017-06-05  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: add create_nl_socket function to libtests.
        * tests/create_nl_socket.c: New file.
        * tests/tests.h (create_nl_socket): New prototype.
        * tests/Makefile.am (libtests_a_SOURCES): Add create_nl_socket.c.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: add decoding of NETLINK_NETFILTER message types.
        * xlat/nl_netfilter_msg_types.in: New file.
        * xlat/nl_netfilter_subsys_ids.in: Likewise.
        * netlink.c: Include "xlat/nl_netfilter_msg_types.h"
        and "xlat/nl_netfilter_subsys_ids.h".
        (nlmsg_types): Add NETLINK_NETFILTER.
        (decode_nlmsg_type): Handle NETLINK_NETFILTER.

        netlink: add decoding of NETLINK_XFRM message types.
        * xlat/nl_xfrm_types.in: New file.
        * netlink.c: Include "xlat/nl_xfrm_types.h".
        (nlmsg_types): Add NETLINK_XFRM.

        netlink: add decoding of NETLINK_SELINUX message types.
        * xlat/nl_selinux_types.in: New file.
        * netlink.c: Include "xlat/nl_selinux_types.h".
        (nlmsg_types): Add NETLINK_SELINUX.

        netlink: add decoding of NETLINK_ROUTE message types.
        * xlat/nl_route_types.in: New file.
        * netlink.c: Include <linux/rtnetlink.h> and "xlat/nl_route_types.h".
        (nlmsg_types): Add NETLINK_ROUTE.

        netlink: add decoding of NETLINK_AUDIT message types.
        * xlat/nl_audit_types.in: New file.
        * netlink.c: Include <linux/audit.h> and "xlat/nl_audit_types.h".
        (nlmsg_types): Add NETLINK_AUDIT.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>
            Fabien Siron  <fabien.siron@epita.fr>

        netlink: implement generic nlmsg_type decoding.
        Implement a pluggable mechanism of nlmsg_type decoding.
        Add decoding of NETLINK_SOCK_DIAG types.

        * linux/sock_diag.h (SOCK_DESTROY): New macro.
        * xlat/nl_sock_diag_types.in: New file.
        * netlink.c: Include xlat/nl_sock_diag_types.h.
        (get_fd_nl_family, decode_nlmsg_type): New functions.
        (print_nlmsghdr): Use them for nlmsg_type decoding.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: add netlink family argument to printers and decoders.
        * netlink.c (NL_FAMILY_ERROR, NL_FAMILY_DEFAULT): New constants.
        (print_nlmsghdr): Add netlink family argument, change return type
        to int, return family.
        (decode_nlmsghdr_with_payload, decode_nlmsgerr, decode_payload): Add
        netlink family argument.  All callers updated.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
            Dmitry V. Levin  <ldv@altlinux.org>

        Add file descriptor argument to decode_netlink.
        * defs.h (decode_netlink): Add file descriptor argument.
        * io.c (print_iovec): Specify file descriptor to decode_netlink.
        * net.c (decode_sockbuf): Likewise.
        * netlink.c (print_nlmsghdr, decode_nlmsghdr_with_payload,
        decode_nlmsgerr, decode_payload, decode_nlmsghdr_with_payload,
        decode_netlink): Likewise.
        All callers updated.

        Introduce getfdinode to obtain inode from fd.
        * defs.h (getfdinode): New prototype.
        * utils.c (getfdinode): New function.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
            Dmitry V. Levin  <ldv@altlinux.org>

        Introduce get_sockaddr_by_inode.
        Add a way to get socket information without printing it.

        * defs.h (get_sockaddr_by_inode): New prototype.
        * socketutils.c (get_sockaddr_by_inode): New function.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        socketutils.c: introduce get_sockaddr_by_inode_uncached.
        * socketutils.c (get_sockaddr_by_inode_uncached): New function.
        (print_sockaddr_by_inode_uncached): Use it.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
            Dmitry V. Levin  <ldv@altlinux.org>

        socketutils.c: use get_sockaddr_by_inode_cached.
        * socketutils.c (unix_print, inet_print, tcp_v4_print, tcp_v6_print,
        udp_v4_print, udp_v6_print, netlink_print): Remove.
        (unix_get, inet_get, tcp_v4_get, tcp_v6_get, udp_v4_get,
        udp_v6_get, netlink_get): New functions.
        (protocols): Update.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        socketutils.c: move inet_print closer to its first use.
        * socketutils.c (inet_print): Move right before tcp_v4_print.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
            Dmitry V. Levin  <ldv@altlinux.org>

        socketutils.c: introduce cache_inode_details.
        cache_inode_details gives a way to obtain cache information without
        printing it.

        * socketutils.c (cache_and_print_inode_details): Rename
        to cache_inode_details.  Do not print cached information.
        (inet_parse_response, unix_parse_response, netlink_parse_response):
        Use cache_inode_details instead of cache_and_print_inode_details.
        (inet_print, unix_print, netlink_print): Call
        print_sockaddr_by_inode_cached.

2017-06-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        strace.c: move termination code to a separate function.
        This will be needed for the pull-style API.

        * strace.c (terminate): New function.
        (main): Use it.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: avoid hitting SO_SNDBUF limit in sendfile/sendfile64 tests.
        Do not assume that an executable is small enough and SO_SNDBUF is large
        enough so that the executable could be sendfile'ed into a socket pair.

        * tests/sendfile.c (main): Create a regular file of the right size
        to avoid hitting SO_SNDBUF limit.
        * tests/sendfile64.c: Likewise.

        Reported-by: Andreas Schwab <schwab@linux-m68k.org>

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        Move netlink_protocols definition from net.c to netlink.c.
        The side effect of #include "xlat/netlink_protocols.h" is
        NETLINK_* constants properly defined in that header file.
        While net.c does not use these constants itself, netlink.c
        is going to need them soon.

        * net.c: Move inclusion of "xlat/netlink_protocols.h" ...
        * netlink.c: ... here.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        travis: switch from gcc-6 to gcc-7.
        * .travis.yml (matrix): Change gcc-6 to gcc-7.

        tests: extend checking of NLMSG_DONE decoding.
        * tests/netlink_protocol.c (test_nlmsg_done):  Use designated
        initializers.  Check decoding of messages with non-integer payload.

2017-06-04  JingPiao Chen  <chenjingpiao@gmail.com>

        netlink: decode NLMSG_DONE messages.
        * netlink.c (decode_payload): Decode NLMSG_DONE messages.
        * tests/netlink_protocol.c (test_nlmsg_done): New function
        for checking decoding of NLMSG_DONE messages.
        (main): Use it.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        socketutils.c: introduce get_sockaddr_by_inode_cached.
        * socketutils.c (get_sockaddr_by_inode_cached): New function.
        (print_sockaddr_by_inode_cached): Use it.

2017-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        Unexport print_sockaddr_by_inode_cached.
        Change print_sockaddr_by_inode to be the only function exposed,
        hide print_sockaddr_by_inode_cached as a part of implementation.

        * defs.h (print_sockaddr_by_inode_cached): Remove prototype.
        (print_sockaddr_by_inode): Add struct tcb * and descriptor arguments.
        * socketutils.c (print_sockaddr_by_inode_cached): Make static.
        (print_sockaddr_by_inode): Rename to print_sockaddr_by_inode_uncached,
        make static.
        (print_sockaddr_by_inode): New function.
        * util.c (printfd): Update to use new print_sockaddr_by_inode.

2017-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce str_strip_prefix_len function and STR_STRIP_PREFIX macro.
        Address proliferation of string prefix check implementations.

        * defs.h (str_strip_prefix_len): New inline function.
        (STR_STRIP_PREFIX): New macro.
        * qualify.c (strip_prefix): Remove.
        (parse_inject_token): Use STR_STRIP_PREFIX instead of strip_prefix.
        (qualify): Use str_strip_prefix_len.
        * socketutils.c (netlink_parse_response): Likewise.
        * util.c (printfd): Likewise.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: move NLMSG_ERROR payload length check to nlmsgerr decoder.
        Move decoder specific check to the decoder.

        * netlink.c (decode_payload): Move NLMSG_ERROR payload length check ...
        (decode_nlmsgerr): ... here.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        strace.c: handle PTRACE_EVENT_EXEC like other events.
        There is nothing unusual about PTRACE_EVENT_EXEC that would require
        a special treatment.

        * strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main
        switch statement.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        strace.c: remove dead code.
        As strace does not use WCONTINUED flag, there is no need to handle
        WIFCONTINUED status.

        * strace.c (print_debug_info) [WIFCONTINUED]: Remove.
        (next_event): Remove redundant !WIFSTOPPED check.

2017-06-02  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        strace.c: refactor trace into two functions.
        This change decouples waiting for next event from reacting to it.  This
        makes the control flow easier to understand, and serves as a preparation
        for implementing a pull-style API for LuaJIT.

        * strace.c (enum trace_event): New enum.
        (trace): Split into ...
        (next_event, dispatch_event): ... new functions.
        (main): Use them.

2017-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        scno.am: include config.h before syscallent.h.
        This fixes generation of syscallent.i and subsequent scno.h files
        on mips where syscallent.h checks macros defined in config.h.

        * scno.am (syscallent.i): Add $(top_builddir)/config.h
        to prerequisites, include it.
        * NEWS: Mention this fix.

        Reported-by: David Robins <dbrobins@i4031.net>

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of sigaction syscall.
        * tests/sigaction.c: New file.
        * tests/gen_tests.in (sigaction): New entry.
        * tests/pure_executables.list: Add sigaction.
        * tests/.gitignore: Likewise.

        tests: rename sigaction.test to rt_sigaction.test.
        * tests/sigaction.awk: Rename to rt_sigaction.awk.
        * tests/sigaction.c: Rename to tests/rt_sigaction.c.
        * tests/sigaction.test: Rename to tests/rt_sigaction.test.
        * tests/.gitignore: Replace sigaction with rt_sigaction.
        * tests/pure_executables.list: Likewise.
        * tests/Makefile.am (DECODER_TESTS): Replace sigaction.test
        with rt_sigaction.test.
        (EXTRA_DIST): Replace sigaction.awk with rt_sigaction.awk.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: enhance decoding of signal number argument of sigaction syscall.
        On sparc, unlike all other architectures, old sigaction syscall takes
        a negated signal number.

        * signal.c (SYS_FUNC(sigaction)) [SPARC || SPARC64]: Enhance printing
        of negative signal number argument.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        signal: enhance printing of old_sigaction.mask.
        * signal.c (decode_old_sigaction): Print old_sigaction.mask
        using tprint_old_sigmask_val.

        signal: limit scope of struct old_sigaction32 definition.
        * signal.c (struct old_sigaction32): Define only if [!current_wordsize].

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        signal: fix decoding of struct old_sigaction on some architectures.
        On alpha, struct old_sigaction.sa_flags has a 32-bit type.

        On mips, only first word of old_sigaction.sa_mask is read.

        On all architectures except alpha and mips that have old sigaction
        syscall, struct old_sigaction has sa_restorer field that has to be
        decoded.

        * signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type
        to unsigned int, add ATTRIBUTE_PACKED.
        [MIPS]: Dhrink sa_mask array to 1 element.
        [!ALPHA && !MIPS]: Define sa_restorer field unconditionally.
        (struct old_sigaction32): Likewise.
        (decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field
        from old_sigaction32.sa_restorer unconditionally.
        [!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag
        is set.
        * NEWS: Mention this change.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: rename SA_STACK to SA_ONSTACK.
        SA_ONSTACK is the standard name while its alias SA_STACK is not even
        defined on many platforms.

        * xlat/sigact_flags.in (SA_STACK): Rename to SA_ONSTACK.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of sigpending syscall.
        * tests/sigpending.c: New file.
        * tests/gen_tests.in (sigpending): New entry.
        * tests/pure_executables.list: Add sigpending.
        * tests/.gitignore: Likewise.

        tests: check decoding of sigprocmask syscall.
        * tests/sigprocmask.c: New file.
        * tests/gen_tests.in (sigprocmask): New entry.
        * tests/pure_executables.list: Add sigprocmask.
        * tests/.gitignore: Likewise.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: rename sys_sigprocmask to sys_osf_sigprocmask.
        Parsers of sigprocmask and osf_sigprocmask syscalls are different
        anyway, so rename the function to match the syscall name.

        * signal.c [ALPHA] (SYS_FUNC(sigprocmask)): Rename
        to SYS_FUNC(osf_sigprocmask).
        * linux/alpha/syscallent.h: Update sys_func.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Enable coverage when strace is self terminated by signal.
        The data collected by -fprofile-arcs during program run is saved
        on program exit.  When program is terminated by signal, the data
        is not saved.  However, libgcov provides an interface to dump
        the data at runtime.

        * m4/ax_code_coverage.m4 (AX_CODE_COVERAGE): Add -DENABLE_COVERAGE_GCOV
        to CODE_COVERAGE_CPPFLAGS.
        * strace.c [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype.
        (main) [ENABLE_COVERAGE_GCOV]: Call __gcov_flush() before raise()
        and sigprocmask() calls that might cause program termination.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check termination signal forwarding.
        * tests/run_expect_termsig.c: New file.
        * tests/unblock_reset_raise.c: Likewise.
        * tests/termsig.test: New test.
        * tests/.gitignore: Add run_expect_termsig and unblock_reset_raise.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add termsig.test.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Fix termination signal forwarding.
        When traced command is terminated by a blocked signal, unblock
        that signal to ensure strace termination with the same signal.

        * strace.c (main): Unblock the signal raised for strace termination.
        * NEWS: Mention this change.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Do not reset SIGCHLD handler in tracees to SIG_DFL.
        While strace resets SIGCHLD handler to the default action so that
        waitpid definitely works without losing track of children, tracees
        should not inherit this change.

        * strace.c (struct exec_params): Add child_sa field.
        (init): When setting SIGCHLD handler to SIG_DFL, save the old handler.
        (exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL
        at startup.
        * NEWS: Mention this change.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor setting of signal handlers to reduce redundancy.
        * strace.c (set_sigaction): New function.
        (init): Use it instead of sigaction with sigaddset.

        tests: check how signals are unblocked in interactive mode.
        * tests/block_reset_raise_run.c: New file.
        * tests/interactive_block.test: New test.
        * tests/.gitignore: Add block_reset_raise_run.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add interactive_block.test.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        Fix unblocking of signals in interactive mode.
        In interactive mode (-I2), those signals that were blocked at startup
        will remain blocked for the whole period of strace execution.

        * strace.c (empty_set): Rename to start_set.  All users changed.
        (init): Initialize start_set and blocked_set to the set of currently
        blocked signals.
        (startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK.
        * NEWS: Mention this change.

2017-05-26  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup interactive check.
        * strace.c (init): Check for INTR_WHILE_WAIT mode the same way
        as in other places.

        tests: check decoding of signal syscall.
        * tests/signal.c: New file.
        * tests/gen_tests.in (signal): New entry.
        * tests/pure_executables.list: Add signal.
        * tests/.gitignore: Likewise.

2017-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Unify capitalisation of (c) in copyright notices.

2017-05-25  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.17-1.
        * strace.spec.in: Likewise.

2017-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.17 release.
        * NEWS: Update for 4.17 release.

        powerpc64, sparc, sparc64: wire up statx syscall.
        * linux/powerpc64/syscallent.h [383]: Add statx entry.
        * linux/sparc/syscallent.h [360]: Likewise.
        * linux/sparc64/syscallent.h [360]: Likewise.

2017-05-23  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compat personality support for sgetmask syscall.
        * signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val
        with sprint_old_sigmask_val.
        * tests/sxetmask.c (main): Check decoding of signal mask containing
        RT signals.

2017-05-22  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of sgetmask and ssetmask syscalls.
        Old ssetmask syscall takes an argument and returns a value of type int.
        Old sgetmask syscall may return an error.

        * signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument
        and return value to unsigned int, print it using sprint_old_sigmask_val.
        (SYS_FUNC(sgetmask)): Do not print the mask in case of syserror.
        * tests/sxetmask.c: New file.
        * tests/gen_tests.in (sxetmask): New entry.
        * tests/pure_executables.list: Add sxetmask.
        * tests/.gitignore: Likewise.
        * NEWS: Mention this fix.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add copyright headers.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Elvira Khabirova  <lineprinter0@gmail.com>

        Add scripts for automating copyright notices update.
        * maint/update_copyright_years.awk: New file.
        * maint/update_copyright_years.sh: Likewise.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Fix typos in copyright notices.

        unwind.c: remove non-ASCII character from comment.

2017-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        Rename sys_sig[gs]etmask to sys_s[gs]etmask to match syscall names.
        * signal.c (SYS_FUNC(sigsetmask)): Rename to SYS_FUNC(ssetmask).
        (SYS_FUNC(siggetmask)): Rename to SYS_FUNC(sgetmask).
        * linux/arm/syscallent.h (sgetmask, ssetmask): Update sys_func.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/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-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.

        tests: enhance sigsuspend.test.
        * tests/sigsuspend.c (sigtxt): New variable.
        (main): Change signal masks to contain all signals except USR1 and USR2.

2017-05-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compat personality support for old sigsuspend syscall.
        * signal.c (sprint_old_sigmask_val): New function.
        (tprint_old_sigmask_val): New macro.
        (SYS_FUNC(sigsuspend)): Use it.

2017-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Move errnoent.sh, signalent.sh, and syscallent.sh to maint subdirectory.
        Also do not include them into release tarballs.  These files are
        intended for developers who are expected to use a git repository.

        * errnoent.sh: Move to maint subdirectory.
        * signalent.sh: Likewise.
        * syscallent.sh: Likewise.
        * HACKING-scripts: Update.
        * Makefile.am (EXTRA_DIST): Remove errnoent.sh, signalent.sh,
        and syscallent.sh.

2017-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Do not include maint subdirectory into release tarballs.
        These files are intended for developers who are expected to use
        a git repository.

        * Makefile.am (EXTRA_DIST): Remove maint/ioctls_gen.sh,
        maint/ioctls_hex.sh, maint/ioctls_sym.sh, and maint/print_ioctlent.c.

2017-05-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/ia64/syscallent.h: remove tabulation, add spaces in file comment.

        linux/mtd-abi.h: remove non-ASCII character from file comment.

2017-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall.
        On some architectures old sigsuspend syscall takes the signal mask from
        the 3rd argument, on some from the 1st.  And, if it wasn't peculiar
        enough, the signal mask is passed by value on all architectures except
        mips where it's passed by reference.

        * signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last
        argument.
        * linux/alpha/syscallent.h (sigsuspend): Set nargs to 1.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * tests/sigsuspend.c: New file.
        * tests/gen_tests.in (sigsuspend): New entry.
        * tests/pure_executables.list: Add sigsuspend.
        * tests/.gitignore: Likewise.
        * NEWS: Mention this fix.

2017-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: raise default timeout for individual tests.
        Recently added tests based on pure_executables.list are quite slow
        by their nature, the one minute default timeout is no longer enough
        for some of not so fast architectures.

        * tests/init.sh (TIMEOUT_DURATION): Raise from 60 to 120.

2017-05-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2017-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Update TCP_* constants.
        * xlat/socktcpoptions.in: Add TCP_FASTOPEN_CONNECT introduced
        by linux kernel commit v4.11-rc1~124^2~321^2.

2017-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Update AF_* constants.
        * xlat/addrfams.in: Add AF_SMC introduced by linux kernel
        commit v4.11-rc1~94^2~43^2~13.

2017-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance madvise decoder check.
        * tests/mmap.c (main): Remove madvise check.
        * tests/madvise.c: New file.
        * tests/gen_tests.in (madvise): New entry.
        * tests/.gitignore: Add madvise.
        * tests/pure_executables.list: Likewise.

2017-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add -etrace=?... test.
        Check for some architecture-specific syscalls which are not present
        on most architectures.

        * gen_tests.in: Add trace_question test.
        * tests/trace_question.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.

2017-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more information to generated header comments.
        * tests/gen_tests.sh: Update header comment with the source string
        used for test generation.

        tests: move generated common header comment into a variable.
        * tests/gen_tests.sh: Move generated file header comment
        into a variable, use it in all cases.

2017-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use TAIL_ALLOC_OBJECT_CONST_PTR in v4l2 test.
        * tests/ioctl_v4l2.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR.

2017-04-25  Edgar Kaziahmedov  <edos@linux.com>

        tests: Check decoding of VIDIOC_G/S_TUNER's arg.
        * tests/ioctl_v4l2.c (main): Add checks for VIDIOC_G/S_TUNER's arg.

        v4l2: Add decoding for VIDIOC_G/S_TUNER's arg.
        * v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
        "xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
        (print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
        (v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
        * xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
        V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
        2.5.46~39^2~23^2~4.
        Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
        commit v2.6.11-rc4~55^2~20.
        Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
        v3.15-rc1~85^2~215.
        Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
        (as the replacement of V4L2_TUNER_ADC).
        * xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
        V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
        V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
        commit 2.5.46~39^2~23^2~4.
        Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
        introduced by linux kernel commit v3.6-rc1~28^2~306.
        Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
        Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
        introduced by linux kernel commit v2.6.37-rc1~64^2~110.
        Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
        v3.6-rc1~28^2~46.
        Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
        v3.6-rc1~28^2~40.
        Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
        v3.15-rc1~85^2~214.
        * xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
        V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
        V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
        2.5.46~39^2~23^2~4.
        Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
        v2.6.17-rc1~739^2~9.
        * xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
        V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
        V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
        2.5.46~39^2~23^2~4.
        Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
        v2.6.32-rc1~679^2~189.

2017-04-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of invalid tv_sec and tv_usec values.
        * tests/futimesat.c (main): Check decoding of invalid tv_sec and tv_usec
        values.
        * tests/xetitimer.c (main): Likewise.
        * tests/xettimeofday.c (main): Likewise.
        * tests/xselect.c (main): Likewise.
        * tests/xutimes.c (main): Likewise.

        tests: check decoding of invalid tv_sec and tv_nsec values.
        * tests/aio.c (main): Check decoding of invalid tv_sec and tv_nsec
        values.
        * tests/clock_nanosleep.c (main): Likewise.
        * tests/clock_xettime.c (main): Likewise.
        * tests/futex.c (main): Likewise.
        * tests/nanosleep.c (main): Likewise.
        * tests/ppoll.c (main): Likewise.
        * tests/pselect6.c (main): Likewise.
        * tests/recvmmsg-timeout.c (main): Likewise.
        * tests/rt_sigtimedwait.c (main): Likewise.
        * tests/semop.c (main): Likewise.
        * tests/timer_xettime.c (main): Likewise.
        * tests/timerfd_xettime.c (main): Likewise.
        * tests/utimensat.c (main): Likewise.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print time in ISO 8601 format in time syscall decoder.
        * print_time.c (SYS_FUNC(time)): Print timestamp stringification
        (via sprinttime) for the value stored in the argument and return value
        (return RVAL_STR in the latter case).
        * tests/time.c (main): Update expected output.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Print string representation of timestamps in parsers of *utime* syscalls
        * print_timespec.c (print_timespec_t_utime): Use sprinttime_nsec
        to format a string representation of time, use tprints_comment
        to print it as a comment.
        * print_timeval.c (print_timeval_t_utime): New function.
        (print_timeval_utimes): Use it instead of print_timeval_t.
        [ALPHA] (print_timeval32_t_utime): New function.
        [ALPHA] (print_timeval32_utimes): Use it instead of print_timeval32_t.
        * tests/futimesat.c (print_tv): Update expected output.
        * tests/utimensat.c (print_ts): Likewise.
        * tests/xutimes.c (print_tv): Likewise.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add support for printing timestamp with microsecond precision.
        It will be needed later.

        * tests/tests.h (print_time_t_usec): New prototype.
        * tests/print_time.c (print_time_t_usec): New function, a thin wrapper
        around print_time_t_ex.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Print microseconds/nanoseconds as non-negative.
        Negative micro/nanoseconds values are treated as invalid by kernel
        anyway, and in one case (timespec_valid in include/linux/time.h)
        it is even checked by conversion to unsigned long.

        * print_timespec.c (timespec_fmt): Change tv_sec format to %lld and
        tv_nsec format to %llu.
        (print_timespec_t): Cast tv_sec to long long and process tv_nsec with
        zero_extend_signed_to_ull.
        (sprint_timespec): Likewise.
        * print_timeval.c (timeval_fmt): Change tv_sec format to %lld and
        tv_usec format to %llu.
        (print_timeval_t): Cast tv_sec to long long and process tv_nsec with
        zero_extend_signed_to_ull.
        (sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise.
        * defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
        * tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast
        it to long long; change tv_usec printing format to %llu, process it with
        zero_extend_signed_to_ull.
        * tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld,
        cast it to long long; change tv_nsec printing format to %llu, process it
        with zero_extend_signed_to_ull.
        * tests/clock_xettime.c (main): Likewise.
        * tests/futex.c (main): Likewise.
        * tests/futimesat.c (print_tv): Likewise.
        * tests/getrusage.c (invoke_print): Likewise.
        * tests/mq_sendrecv.c (do_send, do_recv, main): Likewise.
        * tests/nanosleep.c (main): Likewise.
        * tests/pselect6.c (main): Likewise.
        * tests/restart_syscall.c (main): Likewise.
        * tests/rt_sigtimedwait.c (iterate, main): Likewise.
        * tests/sched_rr_get_interval.c (main): Likewise.
        * tests/semop.c (main): Likewise.
        * tests/timer_xettime.c (main): Likewise.
        * tests/timerfd_xettime.c (main): Likewise.
        * tests/waitid.c (main): Likewise.
        * tests/xetitimer.c (main): Likewise.
        * tests/xettimeofday.c (main): Likewise.
        * tests/xselect.c (main): Likewise.
        * tests/xutimes.c (print_tv): Likewise.
        * tests/wait4.c (sprint_rusage): Likewise.
        * tests/waitid.c (sprint_rusage): Likewise.
        * tests/utimensat.c (print_ts): Likewise.
        (main): Add check for higher bits of tv_sec/tv_nsec.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Always print raw values of time data fields.
        Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec
        that handle nanoseconds and microseconds, respectively.
        Always print raw values of time data fields, format string
        representations of time as comments.

        * defs.h (sprinttime): Change argument type from time_t to long long.
        (sprinttime_nsec, sprinttime_usec): New prototypes.
        * util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New
        functions.
        (sprinttime): Turn into a thin wrapper around sprinttime_ex.
        * stat.h (struct strace_stat): Add has_nsec field.
        * fetch_struct_stat.c (HAVE_NSEC): New macro.
        (fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC.
        * fetch_struct_stat64.c (HAVE_NSEC): New macro.
        (fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC.
        * print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>:
        Print raw values of time fields, use sprinttime_nsec to format a string
        representation of time, use tprints_comment to print it as a comment.
        * statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise.
        * utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime
        and struct utimbuf.modtime fields, use sprinttime to format a string
        representation of time, use tprints_comment to print it as a comment.
        * tests/tests.h (print_time_t_nsec): Add int argument.
        * tests/print_time.c (print_time_t_ex): New function.
        (print_time_t_nsec): Add int argument, turn into a thin wrapper around
        print_time_t_ex.
        * tests/utime.c (main): Update expected output.
        * tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro.
        [!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update
        expected output.
        * NEWS: Mention this timestamps representation improvement.

2017-04-24  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce tprintf_comment and tprints_comment functions.
        * defs.h (tprintf_comment, tprints_comment): New prototypes.
        * strace.c (tvprintf): New function.
        (tprintf): Use it.
        (tprintf_comment, tprints_comment): New functions.
        * aio.c (tprint_lio_opcode): Use tprints_comment.
        * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
        dm_decode_dm_name_list, dm_decode_dm_target_versions,
        dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise.
        * futex.c (SYS_FUNC(futex)): Likewise.
        * perf.c (print_perf_event_attr): Likewise.
        * seccomp.c (decode_bpf_code): Likewise.
        * util.c (printxvals, printxval_searchn, printflags64): Likewise.
        * btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid,
        print_key_value_internal): Likewise.
        (btrfs_ioctl): Use tprints_comment and tprintf_comment.
        * dirent.c (SYS_FUNC(getdents)): Likewise.
        * dirent64.c (SYS_FUNC(getdents64)): Likewise.
        * execve.c (printargc): Use tprintf_comment.
        * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl,
        btrfs_test_features_ioctls): Update expected output.

        Make output of execve/execveat syscall parsers more structured.
        * execve.c (printargc): Always print the address, format the number
        of variables as a comment.
        * tests/execve.c: Update expected output.
        * tests/execveat.c: Likewise.
        * tests/qual_syscall.test: Likewise.
        * tests/strace-r.expected: Likewise.
        * tests/strace-t.test: Likewise.
        * tests/strace-tt.test: Likewise.
        * tests/strace-ttt.test: Likewise.
        * tests/threads-execve.c: Likewise.
        * tests/threads-execve.test: Likewise.

        dm: fix diagnostics about misplaced parts of struct dm_ioctl.
        * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
        dm_decode_dm_name_list, dm_decode_dm_target_versions,
        dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Fix
        diagnostics about various misplaced parts of struct dm_ioctl.
        * tests/ioctl_dm.c: Update expected output.

        print_mq_attr: fix typo.
        * print_mq_attr.c (printmqattr): Fix the last argument of printflags64.

2017-04-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add faulty pointer check to time test.
        * tests/time.c (main): Add check for an inaccessible pointer.

2017-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix print_time_t_nsec usage in xstatx.c.
        * tests/xstatx.c (print_stat): Pass tv_nsec field through
        zero_extend_signed_to_ull before feeding it to print_time_t_nsec.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix netlink_protocol on sparc.
        * tests/netlink_protocol.c (test_nlmsgerr): Do not access fields of an
        unaligned structure, this makes architectures like sparc very unhappy.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: return pointer to string literal directly in sprinttime.
        There is no sense to copy it to static buffer first.

        * util.c (sprinttime): Just return "0", do not copy it to internal
        buffer first.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove stat.sample creation from gen_tests.in.
        stat.sample is created by appropriate executables and never removed.

        * tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat,
        trace_stat_like): Remove stat.sample creation.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate fstat.test.
        * tests/gen_tests.in (fstat): New entry.
        (fstat64, oldfstat): Update.
        * tests/fstat.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove fstat.test.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%stat option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h

        * sysent.h (TRACE_STAT): New macro.
        * syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion.
        * qualify.c (lookup_class): Add TRACE_STAT for "%stat".
        * strace.1 (.SS Filtering): Add information about %stat syscall class.
        * NEWS: Mention this change.
        * linux/aarch64/syscallent.h (stat): Add TST flag.
        * linux/ia64/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h (oldstat, stat, stat64): Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/avr32/syscallent.h (stat, stat64): Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/powerpc64/syscallent.h (oldstat, stat): Likewise.
        * linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise.
        * linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat,
        svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise.
        * tests/gen_tests.in (trace_stat): New entry.
        * tests/trace_stat.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TST): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%lstat option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i '/TSTA,.*lx\?stat/ s/TSTA,/TLST|&/' linux/*/syscallent*.h

        * sysent.h (TRACE_LSTAT): New macro.
        * syscall.c: Alias TLST to TRACE_LSTAT around syscallent.h inclusion.
        * qualify.c (lookup_class): Add TRACE_LSTAT for "%lstat".
        * strace.1 (.SS Filtering): Add information about %lstat syscall class.
        * NEWS: Mention this change.
        * linux/aarch64/syscallent.h (lstat): Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h (lstat, lstat64, oldlstat): Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/avr32/syscallent.h (lstat, lstat64): Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h (lstat, lstat64, osf_lstat, osf_old_lstat): Likewise.
        * linux/mips/syscallent-compat.h (bsd43_lstat, posix_lstat, svr4_lstat,
        sysv_lstat): Likewise.
        * tests/gen_tests.in (trace_lstat): New entry.
        * tests/trace_lstat.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TLST): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%fstat option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i -e '/TSTA.*fx\?stat/ s/TSTA,/TFST|&/' \
                   -e 's/\(TD|TF|TFST|TSTA,\)[[:space:]]/\1/' linux/*/syscallent*.h

        * sysent.h (TRACE_FSTAT): New macro.
        * syscall.c: Alias TFST to TRACE_FSTAT around syscallent.h inclusion.
        * qualify.c (lookup_class): Add TRACE_FSTAT for "%fstat".
        * strace.1 (.SS Filtering): Add information about %fstat syscall class.
        * NEWS: Mention this change.
        * linux/32/syscallent.h (fstat64, fstatat64): Add TFST flag.
        * linux/64/syscallent.h (fstat, newfstatat): Likewise.
        * linux/aarch64/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h (fstat, fstat64, fstatat64, oldfstat): Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/avr32/syscallent.h (fstat, fstat64, fstatat64): Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, osf_fstat,
        osf_old_fstat): Likewise.
        * linux/powerpc64/syscallent.h (fstat, newfstatat, oldfstat): Likewise.
        * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_oldfstat, posix_fstat,
        svr4_fstat, sysv_fstat): Likewise.
        * tests/gen_tests.in (trace_fstat): New entry.
        * tests/trace_fstat.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TFST): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%%stat option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i '/TSFA\|stat[iu]s/! s/,[[:space:]]\?\([[:space:]]*SEN(.*stat\)/|TSTA,\1/' \
                linux/*/syscallent*.h

        * sysent.h (TRACE_STAT_LIKE): New macro.
        * syscall.c: Alias TSTA to TRACE_STAT_LIKE around syscallent.h inclusion.
        * qualify.c (lookup_class): Add TRACE_STAT_LIKE for "%%stat".
        * strace.1 (.SS Filtering): Add information about %%stat syscall class.
        * NEWS: Mention this change.
        * linux/32/syscallent.h (fstat64, fstatat64, statx): Add TSTA flag.
        * linux/64/syscallent.h (fstat, newfstatat, statx): Likewise.
        * linux/aarch64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise.
        * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        osf_fstat, osf_lstat, osf_old_fstat, osf_old_lstat, osf_old_stat, osf_stat,
        stat, stat64): Likewise.
        * linux/arm/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
        oldlstat, oldstat, stat, stat64, statx): Likewise.
        * linux/avr32/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
        stat64): Likewise.
        * linux/bfin/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
        * linux/crisv10/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
        * linux/hppa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
        stat64): Likewise.
        * linux/i386/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
        oldlstat, oldstat, stat, stat64, statx): Likewise.
        * linux/ia64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise.
        * linux/m68k/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
        oldlstat, oldstat, stat, stat64, statx): Likewise.
        * linux/microblaze/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
        * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_lstat, bsd43_oldfstat,
        bsd43_oldstat, bsd43_stat, posix_fstat, posix_lstat, posix_stat, svr4_fstat,
        svr4_fxstat, svr4_lstat, svr4_lxstat, svr4_stat, svr4_xstat, sysv_fstat,
        sysv_fxstat, sysv_lstat, sysv_lxstat, sysv_stat, sysv_xstat): Likewise.
        * linux/mips/syscallent-n32.h (fstat, lstat, newfstatat, stat, statx): Likewise.
        * linux/mips/syscallent-n64.h (fstat, lstat, newfstatat, stat, statx): Likewise.
        * linux/mips/syscallent-o32.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise.
        * linux/powerpc64/syscallent.h (fstat, lstat, newfstatat, oldfstat, oldlstat,
        oldstat, stat): Likewise.
        * linux/powerpc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise.
        * linux/s390/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
        stat64, statx): Likewise.
        * linux/s390x/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
        * linux/sh64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
        oldlstat, oldstat, stat, stat64): Likewise.
        * linux/sh/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
        oldlstat, oldstat, stat, stat64): Likewise.
        * linux/sparc64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldlstat, stat, stat64): Likewise.
        * linux/sparc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
        oldlstat, stat, stat64): Likewise.
        * linux/x32/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
        * linux/x86_64/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
        * linux/xtensa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
        stat64, statx): Likewise.
        * tests/gen_tests.in (trace_stat_like): New entry.
        * tests/trace_stat_like.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TSTA): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        qualify: add syntax for optional non-matching syscall qualification.
        It may be useful in case syscall is not present on the target
        architecture.

        * qualify.c (qualify_syscall): Add ignore_fail flag, set it to true
        in case syscall qualification is led by a question mark(s).
        * strace.1 (.SS Filtering): Document ability to use question marks
        in syscall qualification.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/alpha/syscallent.h: add TSFA flag to osf_getfsstat.
        In accordance with [1].

        [1] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2

        * linux/alpha/syscallent.h (osf_getfsstat): Add TSFA flag.
        * strace.1 (.SS Filtering) <%%statfs>: Update equivalent regexp.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/mips/syscallent-compat.h: add some TD/TF flags for *stat* variants
        *xstat syscalls are, according to [1], like their *stat counterparts,
        but with additional argument with fixed value.

        [1] http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf

        * linux/mips/syscallent-compat.h (*_xstat, *_lxstat, bsd43_oldstat):
        Add TF flag.
        (*_fxstat, bsd43_oldfstat): Add TD flag.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%%statfs option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i 's/\(TSF\),[[:space:]]\?/\1|TSFA,/' linux/*/syscallent*.h
            sed -i 's/\(TFSF\),/\1|TSFA,/' linux/*/syscallent*.h
            sed -i 's/0\(,.*ustat\)/TSFA\1/' linux/*/syscallent*.h

        * sysent.h (TRACE_STATFS_LIKE): New macro.
        * syscall.c: Alias TSFA to TRACE_STATFS_LIKE around syscallent.h inclusion.
        * qualify.c (lookup_class): Add SCHED_STATFS_LIKE for "%%statfs".
        * strace.1 (.SS Filtering): Add information about %%statfs syscall class.
        * NEWS: Mention this change.
        * linux/32/syscallent.h (statfs64, fstatfs64): Add TSFA flag.
        * linux/64/syscallent.h (statfs, fstatfs): Likewise.
        * linux/aarch64/syscallent.h (statfs, fstatfs, ustat): Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h (statfs, statfs64, fstatfs, fstatfs64, ustat):
        Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/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/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/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs,
        ofs_fstatfs, osf_fstatfs64, ustat): Likewise.
        * linux/mips/syscallent-compat.h (*_statfs, *_statvfs, *_fstatfs): Likewise.
        * tests/gen_tests.in (trace_statfs_like): New entry.
        * tests/trace_statfs_like.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TSFA): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement -e trace=%fstatfs option.
        linux/*/syscallent*.h part is updated automatically by:

            sed -i 's/TD,[[:space:]]\([[:space:]]*SEN.*[_"]fstatv\?fs\)/TD|TFSF,\1/' \
                   linux/*/syscallent*.h

        * sysent.h (TRACE_FSTATFS): New macro.
        * syscall.c: Alias TFSF to TRACE_FSTATFS around syscallent.h inclusion.
        * qualify.c (lookup_class): Add SCHED_FSTATFS for "%fstatfs".
        * strace.1 (.SS Filtering): Add information about %fstatfs syscall class.
        * NEWS: Mention this change.
        * linux/32/syscallent.h (fstatfs64): Add TFSF flag.
        * linux/64/syscallent.h (fstatfs): Likewise.
        * linux/aarch64/syscallent.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h (fstatfs, fstatfs64):
        Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/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/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/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h (ofs_fstatfs, osf_fstatfs64): Likewise.
        * linux/mips/syscallent-compat.h (*_fstatfs, *_fstatvfs): Likewise.
        * tests/gen_tests.in (trace_fstatfs): New entry.
        * tests/trace_fstatfs.in: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/ksysent.c (TFSF): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        sysent.h: format syscall flag macros.
        Add some tabulation and leading zeroes to the values.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate sched.test.
        Rewrite sched.test using test_trace_expr().

        * tests/gen_tests.in (sched): New entry.
        * tests/sched.in: New file, derived from a set of tests in sched.test.
        * tests/sched.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove sched.test.
        (EXTRA_DIST): Add sched.in.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate regex.test.
        Rewrite regex.test using test_trace_expr().

        * tests/gen_tests.in (regex): New entry.
        * tests/regex.in: New file, derived from a set of tests in regex.test.
        * tests/regex.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove regex.test.
        (EXTRA_DIST): Add regex.in.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate clock.test.
        Rewrite clock.test using test_trace_expr().

        * tests/gen_tests.in (clock): New entry.
        * tests/clock.in: New file, derived from a set of tests in clock.test.
        * tests/clock.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove clock.test.
        (EXTRA_DIST): Add clock.in.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: tabulate trace_statfs.test.
        Rewrite trace_statfs.test using test_trace_expr().

        * tests/gen_tests.in (trace_statfs): New entry.
        * tests/trace_statfs.in: New file, derived from a set of tests
        in trace_statfs.test.
        * tests/trace_statfs.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test.
        (EXTRA_DIST): Add trace_statfs.in.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/init.sh: add helpers for running set of programs.
        This introduces three new helpers:
        prog_set_subtract subtracts one program set from another,
        test_pure_prog_set runs strace check on a set of programs,
        test_trace_expr tests trace expressions.

        * tests/init.sh (prog_set_subtract, test_pure_prog_set,
        test_trace_expr): New functions.

2017-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend gen_tests.sh further.
        * tests/gen_tests.sh: Extend support of arbitrary rules.

2017-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/xstat.c: do not remove sample file after test.
        As tests are executed in separate directories now, there is no need to
        remove sample file.

        * tests/xstat.c (main): Remove unlink calls.

2017-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use fixed name for stat tests sample file.
        As tests are now run in separate directories.

        * tests/xstatx.c: Use fixed "stat.sample" name for sample file.
        * tests/fstat.test: Use it as an argument for -P option.
        * tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat,
        oldstat, stat, stat64, statx): Likewise.

2017-04-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Derive copyright year from the git commit date.
        This solves problems like the need to update test suite on every
        New Year's Eve.

        * Makefile.am (dist-hook): Generate .year.
        * copyright-year-gen: New file.
        * configure.ac (copyright_year): New m4 variable, defined as the output
        of copyright-year-gen script.
        (AC_COPYRIGHT): Use it.
        (COPYRIGHT_YEAR): New output variable and preprocessor macro.
        * strace.c (print_version): Use COPYRIGHT_YEAR.
        * strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf
        variable to .year file.
        * tests/strace-V.test (config_year): New variable, derived from config.h.
        Add sanity checks for $config_year and use it in expected output.

        Reported-by: Andreas Schwab <schwab@suse.de>

2017-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move /proc/ checks from scripts to executables.
        Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts
        to xecutables.

        * tests/attach-f-p.test: Move /proc/self/task/ check ...
        * tests/attach-f-p-cmd.c (main): ... here.
        * tests/fstat.test: Move /proc/self/fd/ check ...
        * tests/xstatx.c (main): ... here.
        * tests/net-y-unix.test: Move /proc/self/fd/ check ...
        * tests/net-y-unix.c (main): ... here.
        * tests/net-yy-inet.test: Move /proc/self/fd/ check ...
        * tests/net-yy-inet.c (main): ... here.
        * tests/net-yy-netlink.test: Move /proc/self/fd/ check ...
        * tests/net-yy-netlink.c (main): ... here.
        * tests/net-yy-unix.test: Move /proc/self/fd/ check ...
        * tests/net-yy-unix.c (main): ... here.

2017-04-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate pread64-pwrite64.test.
        * tests/gen_tests.in (pread64-pwrite64): New entry.
        * tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/
        is not available.
        * tests/pread64-pwrite64.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test.

        tests: tabulate read-write.test.
        * tests/gen_tests.in (read-write): New entry.
        * tests/read-write.c: (main): Skip the test if /proc/self/fd/
        is not available.
        * tests/read-write.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove read-write.test.

        tests: add skip_if_unavailable function to libtests.
        * tests/skip_unavailable.c: New file.
        * tests/tests.h (skip_if_unavailable): New prototype.
        * tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c.

        tests: tabulate netlink_protocol.test.
        * tests/gen_tests.in (netlink_protocol): New entry.
        * tests/netlink_protocol.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove netlink_protocol.test.

        tests: tabulate statfs.test.
        * tests/gen_tests.in (statfs): New entry.
        (fstatfs, fstatfs64, statfs64): Update.
        * tests/statfs.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove statfs.test.

2017-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip statfs related tests if their sample files are not available
        * tests/xstatfsx.c (print_statfs): Skip the test if open failed.

        tests: extend gen_tests.sh to support arbitrary test_* rules.
        * tests/gen_tests.sh: Add support of arbitrary test_* rules.

        tests: change gen_tests.sh to read its input as raw input.
        * tests/gen_tests.sh: Specify -r option to read.
        * tests/gen_tests.in (shmxt): Update.

2017-04-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        strace.1: s/regex expression/regular expression/

2017-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: enhance %statfs description.
        * strace.1 (.SS Filtering) <%statfs>: Fix the list of syscalls,
        add an equivalent regex expression.

        netlink: decode NLMSG_ERROR messages.
        * netlink.c (decode_nlmsgerr, decode_payload): New functions.
        (decode_nlmsghdr_with_payload): Use decode_payload.
        * tests/netlink_protocol.c (send_query): Check decoding
        of NLMSG_ERROR messages.
        * NEWS: Mention this change.

        netlink: avoid using unaligned sizeof(struct nlmsghdr) unnecessarily.
        * netlink.c (NLMSG_HDRLEN): Redefine.
        (decode_nlmsghdr_with_payload, decode_netlink): Use it instead
        of sizeof(struct nlmsghdr).

        Fix the length argument passed from print_iovec to decode_netlink.
        * io.c (print_iovec): Pass the actual length to decode_netlink
        instead of the original length.
        * NEWS: Mention this fix.

        numa: fix printing of error values in move_pages status array.
        * numa.c (print_status): Do not lose a minus sign when printing
        a symbolic error code.
        * tests/move_pages.c (print_status_array): Update expected output.

        tests: generate pure_executables part of check_PROGRAMS automatically.
        * tests/gen_pure_executables.sh: New file.
        * bootstrap: Invoke it.
        * tests/Makefile.am: Include pure_executables.am.
        (check_PROGRAMS): Add $(PURE_EXECUTABLES).  Remove everything listed
        in pure_executables.list.
        (EXTRA_DIST): Add gen_pure_executables.sh.
        * tests/.gitignore: Add pure_executables.am.

        tests: make EXTRA_DIST sorted.
        * tests/Makefile.am (EXTRA_DIST): Sort.

        tests: check decoding of alpha specific osf_utimes syscall.
        * tests/osf_utimes.c: New file.
        * tests/gen_tests.in (osf_utimes): New entry.
        * tests/Makefile.am (check_PROGRAMS): Add osf_utimes.
        * tests/pure_executables.list: Likewise.
        * tests/.gitignore: Likewise.

        tests: parametrize utimes.c.
        * tests/xutimes.c: New file, based on utimes.c.
        * tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR,
        TEST_STRUCT): New macros.
        [__NR_utimes]: Replace all the rest with include "xutimes.c".
        * tests/Makefile.am (EXTRA_DIST): Add xutimes.c.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix tracing flags of osf_select and osf_utimes syscalls.
        * linux/alpha/syscallent.h (osf_select): Add TD flag.
        (osf_utimes): Add TF flag.
        * NEWS: Mention alpha specific fixes.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: rename print_timeval32_pair to print_timeval32_utimes.
        This follows the rename of print_timeval_item to print_timeval_utimes.

        * defs.h [ALPHA] (print_timeval32_pair): Rename
        to print_timeval32_utimes.
        * print_timeval.c [ALPHA] (print_timeval32_pair): Likewise.
        * utimes.c [ALPHA] (SYS_FUNC(osf_utimes)): Replace print_timeval32_pair
        with print_timeval32_utimes.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do more rigorous testing of utimes syscall parser.
        * tests/utimes.c (errstr): New variable.
        (print_ts, k_utimes): New functions.
        (main): Use them to do more rigorous testing of utimes syscall parser.
        * tests/gen_tests.in (utimes): Update -a option.

        tests: do more rigorous testing of futimesat syscall parser.
        * tests/futimesat.c (errstr): New variable.
        (print_ts, k_futimesat): New functions.
        (main): Use them to do more rigorous testing of futimesat syscall parser.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of inaccessible times argument of utimes and futimesat syscalls
        When the whole pair of struct timeval structures cannot be fetched from
        tracee's memory, print the address.  This behavior follows the kernel's
        that uses copy_from_user for the whole pair, too.

        * print_timeval.c (print_timeval_item): Remove.
        (print_timeval_pair): Rename to print_timeval_utimes, all callers
        updated.  Fetch the whole timeval_t array with a single
        umove_or_printaddr call.
        * tests/futimesat.c (main): Update expected output.
        * tests/utimes.c (main): Likewise.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite utimensat.test without relying on libc utimensat wrapper.
        The new test also does more rigorous testing.

        * tests/utimensat.c: Stop including <assert.h> and <errno.h>, include
        <unistd.h> and <asm/unistd.h>, check __NR_utimensat instead
        of HAVE_UTIMENSAT.
        (errstr): New variable.
        (k_utimensat): New function, a thin wrapper around
        syscall(__NR_utimensat).
        (main): Use them instead of utimensat.
        * tests/gen_tests.in (utimensat): New entry.
        * tests/utimensat.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove it.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use fixed timestamps in utime related tests.
        * tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests
        from the list of exceptions.
        * tests/utime.c (main): Do not use time(), use fixed timestamp instead.
        * tests/futimesat.c (main): Do not use gettimeofday(), use fixed
        timestamps instead.
        * tests/utimensat.c (main): Likewise.
        * tests/utimes.c (main): Likewise.

2017-04-15  Dmitry V. Levin  <ldv@altlinux.org>

        xtensa: wire up new syscalls.
        * linux/xtensa/syscallent.h [348..350]: New pkey_* entries.

        Reported-by: Victor Krapivensky <krapivenskiy.va@phystech.edu>

2017-04-15  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Update statx parser and syscall entries lists to the upstream.
        * linux/32/syscallent.h [291]: Add statx entry.
        * linux/64/syscallent.h [291]: Likewise.
        * linux/arm/syscallent.h [397]: Likewise.
        * linux/m68k/syscallent.h [379]: Likewise.
        * linux/mips/syscallent-n32.h [6330]: Likewise.
        * linux/mips/syscallent-n64.h [5326]: Likewise.
        * linux/mips/syscallent-o32.h [4366]: Likewise.
        * linux/powerpc/syscallent.h [383]: Likewise.
        * linux/s390/syscallent.h [379]: Likewise.
        * linux/s390x/syscallent.h [379]: Likewise.
        * linux/xtensa/syscallent.h [351]: Likewise.
        * statx.h (struct_statx): Update.
        * statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask.
        * tests/xstatx.c (print_stat, main): Update to test decoding
        of struct_statx.stx_attributes_mask.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add more regex match checks.
        * tests/qual_syscall.test: Add regex match checks.

        tests: make mq_sendrecv* test executables reenterable.
        * tests/mq_sendrecv.c (MQ_NAME): Remove.
        (mq_name): New static variable.
        (cleanup): Use it instead of MQ_NAME.
        (main): Initialize it dynamically using the pid of process.  Use it
        instead of MQ_NAME.

        tests: make mq test executable reenterable.
        * tests/mq.c (NAME): Remove.
        (main): Replace the fixed message queue name with a dynamically
        made name containing the pid of process.
        * tests/gen_tests.in (mq): Update -a option.

        tests: make net-yy-netlink test executable reenterable.
        * tests/net-yy-netlink.c (main): Use getpid() instead of a fixed
        magic number.

        tests: tabulate shmxt.test.
        * tests/gen_tests.in (shmxt): New entry.
        * tests/shmxt.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove shmxt.test.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        Revert "Implement -e trace=%sched option"
        -e trace=%sched became redundant as -e trace=/sched does the same.

        This reverts commit 811638e9c1805438a63c14f9704b8b00ac922623.

        * syscall.c (TSC): Remove.
        * sysent.h (TRACE_SCHED): Remove.
        * qualify.c (lookup_class): Remove %sched.
        * strace.1 (.SS Filtering): Likewise.
        * NEWS: Likewise.
        * linux/32/syscallent.h: Remove TSC flag from sched* syscalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * tests/sched.test: Replace trace=%sched with trace=/sched.
        * tests/ksysent.c (TSC): Remove.
        * tests/nsyscalls.c: Likewise.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        Revert "Implement -e trace=%clock option"
        -e trace=%clock became redundant as -e trace=/clock does the same.

        This reverts commit 0a13d2391c413e3847b71ec0c1d38f56e353b1b5.

        * syscall.c (TCL): Remove.
        * sysent.h (TRACE_CLOCK): Remove.
        * qualify.c (lookup_class): Remove %clock.
        * strace.1 (.SS Filtering): Likewise.
        * NEWS: Likewise.
        * linux/32/syscallent.h: Remove TCL flag from clock_* syscalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * tests/clock.test: Replace trace=%clock with trace=/clock.
        * tests/ksysent.c (TCL): Remove.
        * tests/nsyscalls.c: Likewise.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify regex.test.
        * tests/regex.test: Use trace_statfs.test as a template instead
        of clock.test and sched.test, not because of more interesting
        regular expressions but to fix build on platforms where
        clock.test and sched.test are not reenterable.

2017-04-14  JingPiao Chen  <chenjingpiao@gmail.com>

        Implement -e trace=/regex option.
        * qualify.c: Include <regex.h>.
        (qualify_syscall_regex): New function.
        (qualify_syscall): Use it.
        * strace.1: Document -e trace=/regex option.
        * NEWS: Mention -e trace=/regex option.
        * tests/regex.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add it.
        * tests/options-syntax.test: Add checks for invaild regexp
        and for regexp that doesn't match a syscall.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix ioctl_nsfs.test on hppa.
        * tests/ioctl_nsfs.c (test_user_namespace): Specify an address
        in the middle of a mapped page as child_stack address argument
        of the clone call.
        [IA64] (clone): Update.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix ioctl_nsfs.test on ia64.
        glibc on ia64 provides no clone() function, but there is a __clone2
        function instead.  It is documented but no prototype is provided by
        glibc.

        * tests/ioctl_nsfs.c [IA64] (__clone2): New prototype.
        [IA64] (clone): New macro wrapper around __clone2.

2017-04-13  Edgar Kaziahmedov  <edos@linux.com>

        tests: check decoding of the remaining V4L2_BUF_TYPE_* types.
        * tests/ioctl_v4l2.c (init_v4l2_format, print_ioctl_v4l2): New functions
        to avoid code duplication in VIDIOC_S_FMT and VIDIOC_TRY_FMT tests.
        (main) <VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT>: Use them.  Add
        checks for remaining V4L2_BUF_TYPE_* types.

        v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types.
        * v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h".
        (struct_v4l2_clip): New typedef.  Mpersify it.
        (print_v4l2_clip): New function.
        (print_v4l2_format_fmt): Use it.  Add struct tcb argument.  Implement
        decoding of the remaining V4L2_BUF_TYPE_* types.
        * xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED
        introduced by linux kernel commit v2.5.46~39^2~23^2~4.
        Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
        V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by
        linux kernel commit v3.17-rc1~112^2~217.
        * xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
        V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and
        V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64.
        * configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and
        V4L2_BUF_TYPE_SDR_OUTPUT.
        (AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and
        struct v4l2_sdr_format.buffersize.
        * NEWS: Mention this change.

2017-04-13  Dmitry V. Levin  <ldv@altlinux.org>

        travis: use mainline kernel uapi headers for coverage.
        * .travis.yml (matrix) <CHECK=coverage>: Add KHEADERS=torvalds/linux.
        * travis-build.sh: Handle $KHEADERS.
        * travis-install.sh: Likewise.

        travis: switch from clang-3.6 to clang-3.8.
        * .travis.yml (matrix): Change clang-3.6 to clang-3.8.

2017-04-13  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

        Implement decoding of NS_* ioctl commands.
        * configure.ac (AC_CHECK_HEADERS): Add linux/nsfs.h.
        * defs.h (DECL_IOCTL(nsfs)): New prototype.
        (setns_types): Make global.
        * ioctl.c (ioctl_decode): Call nsfs_ioctl for 0xb7 code.
        * nsfs.c: New file.
        * nsfs.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * tests/ioctl_nsfs.c: New file.
        * tests/ioctl_nsfs.test: Likewise.
        * tests/.gitignore: Add ioctl_nsfs.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_nsfs.test.
        * NEWS: Mention this change.

2017-04-13  Dmitry V. Levin  <ldv@altlinux.org>

        travis: copy coverage test suite log to the travis log.
        * travis-build.sh (coverage): Print tests*/test-suite.log
        and tests*/ksysent.log.

2017-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        travis: add gcc-6.
        * .travis.yml (matrix): Add gcc-6 entries.
        * travis-build.sh: Handle gcc*.
        * travis-install.sh: Handle gcc-*.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify gen_tests.sh against in-tree builds.
        * tests/gen_tests.sh: Use abs_srcdir instead of srcdir to construct
        a path to gen_tests.sh in implicit make rules.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        trace_syscall_exiting: do not call get_regs for filtered syscalls.
        This saves up to 25% of ptrace syscalls in case of trace filtering.

        * syscall.c (trace_syscall_exiting): Do not call gettimeofday
        and get_regs for filtered syscalls.
        * NEWS: Mention this change.
        * tests/get_regs.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Delay get_regs invocation.
        strace used to call get_regs on every stop of a tracee, including cases
        when the result is going to be discarded.  Prepare to change this lavish
        practice by delaying get_regs invocation until its result is actually
        needed.

        * defs.h (get_regs): Remove.
        * strace.c (trace): Do not call get_regs.
        * syscall.c (get_regs): Add static qualifier.
        (trace_syscall_exiting, print_pc, get_scno): Call get_regs.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        startup_tcb: move get_scno invocation to a more convenient place.
        * strace.c (trace): Move get_scno invocation ...
        (startup_tcb): ... here.  This is a no-op change that slightly improves
        readability.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        get_regs: guard against subsequent invocations.
        At this moment there is only one call to get_regs,
        but there is going to be more of them, so a guard is needed.

        This change also adds a clear_regs call before get_regs,
        which essentially reverts commit v4.9-288-ge9bfff6.

        * strace.c (trace): Call clear_regs before get_regs.
        * syscall.c (get_regs): Skip if get_regs_error != -1.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: move definitions of automatic variables closer to their use.
        * syscall.c (trace_syscall_entering, trace_syscall_exiting): Move
        definitions of automatic variables closer to their first use.  This
        change slightly improves readability.

        tests: check decoding of gettid syscall.
        * tests/gettid.c: New file.
        * tests/.gitignore: Add gettid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (gettid): New entry.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build on alpha.
        * tests/getpid.c: Skip if __NR_getpid is not defined.
        * tests/getppid.c: Skip if __NR_getppid is not defined.

        Fixes: fd1041f6 ("tests: add tests for getpid and getppid syscalls")

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with old linux/netlink.h.
        * socketutils.c: Provide a fallback definition of NETLINK_SOCK_DIAG.

        Fixes: 5c256356 ("Do not include xlat/netlink_protocols.h twice")

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

        Do not include xlat/netlink_protocols.h twice.
        Make netlink_protocols a global xlat array defined in net.c file.

        * defs.h (netlink_protocols): New prototype.
        * socketutils.c: Stop including "xlat/netlink_protocols.h".

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

        Do not include xlat/clocknames.h twice.
        Make clocknames a global xlat array defined in time.c file.

        * defs.h (clocknames): New prototype.
        * perf.c: Stop including "xlat/clocknames.h".

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused xlat/openmodessol.in.
        * xlat/openmodessol.in: Remove file unused since commit
        v4.10-45-gdf4dd8b.

        Remove unused xlat/aclipc.in.
        * xlat/aclipc.in: Remove file unused since commit v4.9-46-g681452b.

2017-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove statfs.expected.
        statfs.expected is unused since commit v4.11-515-g67c2f67.

        * tests/statfs.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

2017-04-07  Sandhya Bankar  <bankarsandhya512@gmail.com>

        tests: add tests for getpid and getppid syscalls.

        [ldv: rewritten everything]

        * tests/getpid.c: New file.
        * tests/getppid.c: Likewise.
        * tests/.gitignore: Add getpid and getppid.
        * tests/pure_executables.list: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/gen_tests.in (getpid, getppid): New entries.

2017-04-07  Edgar Kaziahmedov  <edos@linux.com>

        Update V4L2_* constants.
        * xlat/v4l2_buf_flags.in: Add V4L2_BUF_FLAG_PREPARED,
        V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, and V4L2_BUF_FLAG_NO_CACHE_CLEAN
        introduced by linux kernel commit v3.2-rc1~63^2~55.
        Add V4L2_BUF_FLAG_TIMESTAMP_MASK, V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN,
        and V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC introduced by linux kernel commit
        v3.9-rc1~93^2~536.
        Add V4L2_BUF_FLAG_TIMESTAMP_COPY introduced by linux kernel commit
        v3.10-rc1~136^2~560.
        Add V4L2_BUF_FLAG_TSTAMP_SRC_MASK, V4L2_BUF_FLAG_TSTAMP_SRC_EOF,
        and V4L2_BUF_FLAG_TSTAMP_SRC_SOE introduced by linux kernel commit
        v3.15-rc1~85^2~186.
        Add V4L2_BUF_FLAG_LAST introduced by linux kernel commit
        v4.2-rc1~107^2~389.
        * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_SDR_CAPTURE
        and V4L2_BUF_TYPE_SDR_OUTPUT introduced by linux kernel commits
        v3.15-rc1~85^2~213 and v4.4-rc1~118^2~14, respectively.
        * xlat/xlat/v4l2_colorspaces.in: Add V4L2_COLORSPACE_ADOBERGB
        and V4L2_COLORSPACE_BT2020 introduced by linux kernel commit
        v3.19-rc1~29^2~72.
        Add V4L2_COLORSPACE_RAW and V4L2_COLORSPACE_DCI_P3 introduced by linux
        kernel commits v4.2-rc1~107^2~182 and v4.4-rc1~118^2~120, respectively.
        * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_SDR_CAPTURE,
        V4L2_CAP_EXT_PIX_FORMAT, and V4L2_CAP_SDR_OUTPUT introduced by linux
        kernel commits v3.15-rc1~85^2~210, v3.17-rc1~112^2~327,
        and v4.4-rc1~118^2~14, respectively.
        * xlat/v4l2_memories.in: Add V4L2_MEMORY_OVERLAY introduced
        in linux 2.5.46.  Add V4L2_MEMORY_DMABUF introduced by linux kernel
        commit v3.8-rc1~115^2^2~52.

2017-04-07  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

        Implement -e trace=%statfs option.
        linux/*/syscallent*.h part is modified automatically by:

                sed -i 's/TF\(,[[:space:]]*SEN.*[_"]statv\?fs\)/TF|TSF\1/' \
                        linux/*/syscallent*.h

        [ldv: rewritten trace_statfs.test using sched.test as a template]

        * sysent.h (TRACE_STATFS): New macro.
        * syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion.
        * qualify.c (lookup_class): Add SCHED_STATFS for "%statfs".
        * strace.1 (.SS Filtering): Add information about %statfs syscall class.
        * NEWS: Mention this change.
        * linux/64/syscallent.h (statfs): Add TSF flag.
        * linux/aarch64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/32/syscallent.h (statfs64): Likewise.
        * linux/arm/syscallent.h (statfs, statfs64): Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/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/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/xtensa/syscallent.h: Likewise.
        * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs): Likewise.
        * linux/mips/syscallent-compat.h (*_statfs, *_statvfs): Likewise.
        * tests/trace_statfs.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add it.
        * tests/ksysent.c (TSF): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-06  Rishi Bhatt  <bhatt.rishi062@gmail.com>

        Implement -e trace=%clock option.
        linux/*/syscallent.h part is modified automatically by
        sed -i 's/0\(,[[:space:]]*SEN(clock_\)/TCL\1/' linux/*/syscallent*.h

        [ldv: rewritten clock.test using sched.test as a template]

        * sysent.h (TRACE_CLOCK): New macro.
        * syscall.c: Alias TCL to TRACE_CLOCK around syscallent.h inclusion.
        * qualify.c (lookup_class): Add TRACE_CLOCK for "%clock".
        * strace.1 (.SS Filtering): Add information about %clock syscall class.
        * NEWS: Mention this change.
        * linux/32/syscallent.h: Add TCL flag for clock_* syscalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * tests/clock.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add it.
        * tests/ksysent.c (TCL): New macro, defined to 0.
        * tests/nsyscalls.c: Likewise.

2017-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate xattr.test.
        * tests/gen_tests.in (xattr): New entry.
        * tests/xattr.test: Remove.
        * tests/Makefile.am (DECODER_TESTS): Remove xattr.test.

2017-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: generalize scripts that check non-abbreviated decoding of ioctls.
        * tests/ioctl-v.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        (DECODER_TESTS): Remove ioctl_evdev-v.test, ioctl_loop-v.test,
        and ioctl_rtc-v.test.
        * tests/gen_tests.in (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v):
        New entries.
        * tests/ioctl_evdev-v.test: Remove.
        * tests/ioctl_loop-v.test: Ditto.
        * tests/ioctl_rtc-v.test: Ditto.

2017-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tabulate stereotypical test scripts.
        Convert test scripts that follow simple testing patterns to a table.
        Generate all these scripts from gen_tests.in file using gen_tests.sh
        script at bootstrap time.

        The largest set of test scripts has been converted using
        the following command:

        grep -l ^run_strace_match_diff *.test |while read f; do
                n="${f%.test}"
                grep '^[^#]' "$f" |
                grep -Evq '^(\. "\${srcdir=\.}/init\.sh"|run_strace_match_diff)' ||
                sed -n 's/^run_strace_match_diff\(.*\)/'$n'\1/p' "$f"
        done

        The second largest set of test scripts has been converted using
        the following command:

        grep -l srcdir= *.test |while read f; do
                n="${f%.test}"
                grep '^[^#]' "$f" |
                grep -Fvq srcdir= ||
                sed -n 's/^. "\${srcdir=.}\/\([^"]\+\)".*/'$n'\t+\1/p' "$f"
        done

        * tests/gen_tests.in: New file.
        * tests/gen_tests.sh: New file.
        * bootstrap: Invoke it.
        * tests/.gitignore: Add *.gen.test and gen_tests.am.
        * tests/_newselect.test: Remove.
        * tests/accept.test: Ditto.
        * tests/accept4.test: Ditto.
        * tests/access.test: Ditto.
        * tests/acct.test: Ditto.
        * tests/add_key.test: Ditto.
        * tests/adjtimex.test: Ditto.
        * tests/aio.test: Ditto.
        * tests/alarm.test: Ditto.
        * tests/bpf.test: Ditto.
        * tests/btrfs.test: Ditto.
        * tests/chmod.test: Ditto.
        * tests/chown.test: Ditto.
        * tests/chown32.test: Ditto.
        * tests/chroot.test: Ditto.
        * tests/clock_adjtime.test: Ditto.
        * tests/clock_nanosleep.test: Ditto.
        * tests/clock_xettime.test: Ditto.
        * tests/copy_file_range.test: Ditto.
        * tests/creat.test: Ditto.
        * tests/delete_module.test: Ditto.
        * tests/dup.test: Ditto.
        * tests/dup2.test: Ditto.
        * tests/dup3.test: Ditto.
        * tests/epoll_create.test: Ditto.
        * tests/epoll_create1.test: Ditto.
        * tests/epoll_ctl.test: Ditto.
        * tests/epoll_pwait.test: Ditto.
        * tests/epoll_wait.test: Ditto.
        * tests/erestartsys.test: Ditto.
        * tests/execveat-v.test: Ditto.
        * tests/execveat.test: Ditto.
        * tests/faccessat.test: Ditto.
        * tests/fadvise64_64.test: Ditto.
        * tests/fallocate.test: Ditto.
        * tests/fanotify_init.test: Ditto.
        * tests/fanotify_mark.test: Ditto.
        * tests/fchdir.test: Ditto.
        * tests/fchmod.test: Ditto.
        * tests/fchmodat.test: Ditto.
        * tests/fchown.test: Ditto.
        * tests/fchown32.test: Ditto.
        * tests/fchownat.test: Ditto.
        * tests/fcntl.test: Ditto.
        * tests/fcntl64.test: Ditto.
        * tests/fdatasync.test: Ditto.
        * tests/file_handle.test: Ditto.
        * tests/file_ioctl.test: Ditto.
        * tests/finit_module.test: Ditto.
        * tests/flock.test: Ditto.
        * tests/fork-f.test: Ditto.
        * tests/fstat64.test: Ditto.
        * tests/fstatat64.test: Ditto.
        * tests/fstatfs.test: Ditto.
        * tests/fstatfs64.test: Ditto.
        * tests/fsync.test: Ditto.
        * tests/ftruncate.test: Ditto.
        * tests/ftruncate64.test: Ditto.
        * tests/futimesat.test: Ditto.
        * tests/get_mempolicy.test: Ditto.
        * tests/getcpu.test: Ditto.
        * tests/getcwd.test: Ditto.
        * tests/getdents.test: Ditto.
        * tests/getdents64.test: Ditto.
        * tests/getegid.test: Ditto.
        * tests/getegid32.test: Ditto.
        * tests/geteuid.test: Ditto.
        * tests/geteuid32.test: Ditto.
        * tests/getgid.test: Ditto.
        * tests/getgid32.test: Ditto.
        * tests/getgroups.test: Ditto.
        * tests/getgroups32.test: Ditto.
        * tests/getpeername.test: Ditto.
        * tests/getpgrp.test: Ditto.
        * tests/getrandom.test: Ditto.
        * tests/getresgid.test: Ditto.
        * tests/getresgid32.test: Ditto.
        * tests/getresuid.test: Ditto.
        * tests/getresuid32.test: Ditto.
        * tests/getrlimit.test: Ditto.
        * tests/getrusage.test: Ditto.
        * tests/getsid.test: Ditto.
        * tests/getsockname.test: Ditto.
        * tests/getuid32.test: Ditto.
        * tests/getxxid.test: Ditto.
        * tests/inet-cmsg.test: Ditto.
        * tests/init_module.test: Ditto.
        * tests/inotify.test: Ditto.
        * tests/inotify_init1.test: Ditto.
        * tests/int_0x80.test: Ditto.
        * tests/ioctl_block.test: Ditto.
        * tests/ioctl_evdev.test: Ditto.
        * tests/ioctl_loop.test: Ditto.
        * tests/ioctl_mtd.test: Ditto.
        * tests/ioctl_rtc.test: Ditto.
        * tests/ioctl_scsi.test: Ditto.
        * tests/ioctl_sg_io_v3.test: Ditto.
        * tests/ioctl_sg_io_v4.test: Ditto.
        * tests/ioctl_uffdio.test: Ditto.
        * tests/ioctl_v4l2.test: Ditto.
        * tests/ioperm.test: Ditto.
        * tests/iopl.test: Ditto.
        * tests/ioprio.test: Ditto.
        * tests/ip_mreq.test: Ditto.
        * tests/ipc.test: Ditto.
        * tests/ipc_msg.test: Ditto.
        * tests/ipc_sem.test: Ditto.
        * tests/ipc_shm.test: Ditto.
        * tests/kcmp.test: Ditto.
        * tests/kexec_file_load.test: Ditto.
        * tests/kexec_load.test: Ditto.
        * tests/keyctl.test: Ditto.
        * tests/kill.test: Ditto.
        * tests/lchown.test: Ditto.
        * tests/lchown32.test: Ditto.
        * tests/link.test: Ditto.
        * tests/linkat.test: Ditto.
        * tests/lookup_dcookie.test: Ditto.
        * tests/lstat.test: Ditto.
        * tests/lstat64.test: Ditto.
        * tests/mbind.test: Ditto.
        * tests/membarrier.test: Ditto.
        * tests/memfd_create.test: Ditto.
        * tests/migrate_pages.test: Ditto.
        * tests/mincore.test: Ditto.
        * tests/mkdir.test: Ditto.
        * tests/mkdirat.test: Ditto.
        * tests/mknod.test: Ditto.
        * tests/mknodat.test: Ditto.
        * tests/mlock.test: Ditto.
        * tests/mlock2.test: Ditto.
        * tests/mlockall.test: Ditto.
        * tests/mmap64.test: Ditto.
        * tests/mmsg-silent.test: Ditto.
        * tests/mmsg.test: Ditto.
        * tests/mmsg_name-v.test: Ditto.
        * tests/mmsg_name.test: Ditto.
        * tests/mount.test: Ditto.
        * tests/move_pages.test: Ditto.
        * tests/mq.test: Ditto.
        * tests/mq_sendrecv-read.test: Ditto.
        * tests/mq_sendrecv-write.test: Ditto.
        * tests/mq_sendrecv.test: Ditto.
        * tests/msg_control-v.test: Ditto.
        * tests/msg_control.test: Ditto.
        * tests/msg_name.test: Ditto.
        * tests/munlockall.test: Ditto.
        * tests/nanosleep.test: Ditto.
        * tests/net-icmp_filter.test: Ditto.
        * tests/net-sockaddr.test: Ditto.
        * tests/newfstatat.test: Ditto.
        * tests/old_mmap.test: Ditto.
        * tests/oldfstat.test: Ditto.
        * tests/oldlstat.test: Ditto.
        * tests/oldstat.test: Ditto.
        * tests/open.test: Ditto.
        * tests/openat.test: Ditto.
        * tests/pause.test: Ditto.
        * tests/perf_event_open.test: Ditto.
        * tests/perf_event_open_nonverbose.test: Ditto.
        * tests/perf_event_open_unabbrev.test: Ditto.
        * tests/pipe2.test: Ditto.
        * tests/pkey_alloc.test: Ditto.
        * tests/pkey_free.test: Ditto.
        * tests/pkey_mprotect.test: Ditto.
        * tests/ppoll-v.test: Ditto.
        * tests/ppoll.test: Ditto.
        * tests/preadv-pwritev.test: Ditto.
        * tests/preadv.test: Ditto.
        * tests/preadv2-pwritev2.test: Ditto.
        * tests/printstr.test: Ditto.
        * tests/prlimit64.test: Ditto.
        * tests/process_vm_readv.test: Ditto.
        * tests/process_vm_writev.test: Ditto.
        * tests/pselect6.test: Ditto.
        * tests/ptrace.test: Ditto.
        * tests/pwritev.test: Ditto.
        * tests/quotactl-v.test: Ditto.
        * tests/quotactl-xfs-v.test: Ditto.
        * tests/quotactl-xfs.test: Ditto.
        * tests/quotactl.test: Ditto.
        * tests/readahead.test: Ditto.
        * tests/readdir.test: Ditto.
        * tests/readlink.test: Ditto.
        * tests/readlinkat.test: Ditto.
        * tests/reboot.test: Ditto.
        * tests/recvfrom.test: Ditto.
        * tests/recvmmsg-timeout.test: Ditto.
        * tests/recvmsg.test: Ditto.
        * tests/remap_file_pages.test: Ditto.
        * tests/rename.test: Ditto.
        * tests/renameat.test: Ditto.
        * tests/renameat2.test: Ditto.
        * tests/request_key.test: Ditto.
        * tests/rmdir.test: Ditto.
        * tests/rt_sigpending.test: Ditto.
        * tests/rt_sigprocmask.test: Ditto.
        * tests/rt_sigqueueinfo.test: Ditto.
        * tests/rt_sigreturn.test: Ditto.
        * tests/rt_sigsuspend.test: Ditto.
        * tests/rt_sigtimedwait.test: Ditto.
        * tests/rt_tgsigqueueinfo.test: Ditto.
        * tests/sched_get_priority_mxx.test: Ditto.
        * tests/sched_rr_get_interval.test: Ditto.
        * tests/sched_xetaffinity.test: Ditto.
        * tests/sched_xetattr.test: Ditto.
        * tests/sched_xetparam.test: Ditto.
        * tests/sched_xetscheduler.test: Ditto.
        * tests/sched_yield.test: Ditto.
        * tests/seccomp-filter-v.test: Ditto.
        * tests/seccomp-filter.test: Ditto.
        * tests/select.test: Ditto.
        * tests/semop.test: Ditto.
        * tests/sendfile.test: Ditto.
        * tests/sendfile64.test: Ditto.
        * tests/set_mempolicy.test: Ditto.
        * tests/setdomainname.test: Ditto.
        * tests/setfsgid.test: Ditto.
        * tests/setfsgid32.test: Ditto.
        * tests/setfsuid.test: Ditto.
        * tests/setfsuid32.test: Ditto.
        * tests/setgid.test: Ditto.
        * tests/setgid32.test: Ditto.
        * tests/setgroups.test: Ditto.
        * tests/setgroups32.test: Ditto.
        * tests/sethostname.test: Ditto.
        * tests/setns.test: Ditto.
        * tests/setregid.test: Ditto.
        * tests/setregid32.test: Ditto.
        * tests/setresgid.test: Ditto.
        * tests/setresgid32.test: Ditto.
        * tests/setresuid.test: Ditto.
        * tests/setresuid32.test: Ditto.
        * tests/setreuid.test: Ditto.
        * tests/setreuid32.test: Ditto.
        * tests/setrlimit.test: Ditto.
        * tests/setuid.test: Ditto.
        * tests/setuid32.test: Ditto.
        * tests/shutdown.test: Ditto.
        * tests/siginfo.test: Ditto.
        * tests/signal_receive.test: Ditto.
        * tests/signalfd4.test: Ditto.
        * tests/sigreturn.test: Ditto.
        * tests/socketcall.test: Ditto.
        * tests/splice.test: Ditto.
        * tests/stat.test: Ditto.
        * tests/stat64.test: Ditto.
        * tests/statfs64.test: Ditto.
        * tests/statx.sh: Ditto.
        * tests/statx.test: Ditto.
        * tests/swap.test: Ditto.
        * tests/symlink.test: Ditto.
        * tests/symlinkat.test: Ditto.
        * tests/sync.test: Ditto.
        * tests/sync_file_range.test: Ditto.
        * tests/sync_file_range2.test: Ditto.
        * tests/sysinfo.test: Ditto.
        * tests/syslog.test: Ditto.
        * tests/tee.test: Ditto.
        * tests/time.test: Ditto.
        * tests/timer_create.test: Ditto.
        * tests/timer_xettime.test: Ditto.
        * tests/timerfd_xettime.test: Ditto.
        * tests/times-fail.test: Ditto.
        * tests/times.test: Ditto.
        * tests/truncate.test: Ditto.
        * tests/truncate64.test: Ditto.
        * tests/ugetrlimit.test: Ditto.
        * tests/umask.test: Ditto.
        * tests/umoven-illptr.test: Ditto.
        * tests/umovestr-illptr.test: Ditto.
        * tests/umovestr3.test: Ditto.
        * tests/unlink.test: Ditto.
        * tests/unlinkat.test: Ditto.
        * tests/unshare.test: Ditto.
        * tests/userfaultfd.test: Ditto.
        * tests/ustat.test: Ditto.
        * tests/utime.test: Ditto.
        * tests/utimes.test: Ditto.
        * tests/vfork-f.test: Ditto.
        * tests/vhangup.test: Ditto.
        * tests/vmsplice.test: Ditto.
        * tests/wait4-v.test: Ditto.
        * tests/wait4.test: Ditto.
        * tests/waitid-v.test: Ditto.
        * tests/waitid.test: Ditto.
        * tests/waitpid.test: Ditto.
        * tests/xattr-strings.test: Ditto.
        * tests/xet_robust_list.test: Ditto.
        * tests/xetitimer.test: Ditto.
        * tests/xetpgid.test: Ditto.
        * tests/xetpriority.test: Ditto.
        * tests/xettimeofday.test: Ditto.
        * tests/Makefile.am (DECODER_TESTS, MISC_TESTS): Remove them.
        Include gen_tests.am.
        (TESTS): Add $(GEN_TESTS).
        (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Rename int_0x80.test
        to int_0x80.gen.test.
        (EXTRA_DIST): Add gen_tests.in and gen_tests.sh, remove statx.sh.
        (clean-local-check): Remove $(GEN_TESTS:.gen.test=.dir).

2017-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: handle test scripts with .gen.test suffix.
        * tests/init.sh: If script name ends with .gen.test,
        set NAME variable with .gen.test suffix stripped.

2017-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mpers.awk: add support for multidimensional arrays.
        * mpers.awk (update_upper_bound): New function, which maintains new "count"
        property for storing total element count and updates "upper_bound"
        property which now contains string with array dimensions.
        (/^DW_AT_upper_bound/, /^DW_AT_count/): Use it.
        (what_is) <case "array_type">: Use "count" property in order to calculate
        returned_size, do not embody returned string in square brackets.
        * mpers_test.sh: Add checks for multidimensional arrays.

2017-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: prepare for adding support of multidimensional arrays.
        * mpers.awk (what_is) <case "structure_type", case "union_type">:
        Move formatting of array upper_bound ...
        <case "array_type">: ... here.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup temporary files removals.
        As every test now runs in its own subdirectory, there is no need
        to remove leftover files manually by each test.

        * tests/init.sh (run_strace_match_diff): Do not remove $EXP.
        * tests/brk.test: Likewise.
        * tests/options-syntax.test: Likewise.
        * tests/qual_inject-retval.test (check_injection): Likewise.
        * tests/qual_signal.test (test_one_sig): Likewise.
        * tests/sched.test: Likewise.
        * tests/seccomp-strict.test: Likewise.
        * tests/strace-V.test: Likewise.
        * tests/strace-tt.test: Likewise.
        * tests/strace-ttt.test: Likewise.
        * tests/threads-execve.test: Likewise.
        * tests/attach-f-p.test: Use $EXP instead of $OUT, do not remove it.
        * tests/personality.test: Likewise.
        * tests/poll.test: Likewise.
        * tests/fstat.test: Likewise.
        * tests/ipc.sh: Likewise.
        * tests/restart_syscall.test: Likewise.
        * tests/utimensat.test: Likewise.
        * tests/attach-p-cmd.test: Likewise.  Do not remove
        attach-p-cmd.test-lock.
        * tests/detach-running.test: Do not remove $LOG.
        * tests/detach-sleeping.test: Likewise.
        * tests/detach-stopped.test: Likewise.
        * tests/redirect.test: Do not remove $OUT.
        * tests/strace-S.test: Likewise.
        * tests/getdents.test: Do not remove $LOG.dir.
        * tests/getdents64.test: Likewise.
        * tests/readdir.test: Likewise.
        * tests/btrfs-v.test: Do not remove $EXP and $OUT.
        * tests/btrfs-vw.test: Likewise.
        * tests/btrfs-w.test: Likewise.
        * tests/execve-v.test: Likewise.
        * tests/execve.test: Likewise.
        * tests/fadvise64.test: Likewise.
        * tests/getuid.test: Likewise.
        * tests/ioctl.test: Likewise.
        * tests/ioctl_dm-v.test: Likewise.
        * tests/ioctl_dm.test: Likewise.
        * tests/ioctl_evdev-v.test: Likewise.
        * tests/ioctl_loop-nv.test: Likewise.
        * tests/ioctl_loop-v.test: Likewise.
        * tests/ioctl_loop.test: Likewise.
        * tests/ioctl_rtc-v.test: Likewise.
        * tests/ioctl_sock_gifconf.test: Likewise.
        * tests/llseek.test: Likewise.
        * tests/lseek.test: Likewise.
        * tests/mmap.test: Likewise.
        * tests/net-y-unix.test: Likewise.
        * tests/net-yy-inet.test: Likewise.
        * tests/net-yy-netlink.test: Likewise.
        * tests/net-yy-unix.test: Likewise.
        * tests/opipe.test: Likewise.
        * tests/prctl-arg2-intptr.test: Likewise.
        * tests/prctl-dumpable.test: Likewise.
        * tests/prctl-name.test: Likewise.
        * tests/prctl-no-args.test: Likewise.
        * tests/prctl-pdeathsig.test: Likewise.
        * tests/prctl-seccomp-filter-v.test: Likewise.
        * tests/prctl-seccomp-strict.test: Likewise.
        * tests/prctl-securebits.test: Likewise.
        * tests/prctl-tid_address.test: Likewise.
        * tests/prctl-tsc.test: Likewise.
        * tests/umovestr2.test: Likewise.
        * tests/uname.test: Likewise.
        * tests/pread64-pwrite64.test: Do nore remove pread64-pwrite64-tmpfile.
        * tests/read-write.test: Do nore remove read-write-tmpfile.
        * tests/qual_fault.test (check_fault_injection): Do not remove $EXP,
        $outexp, and $outgot.
        * tests/redirect-fds.test (check_fd): Reorder removal of work files.
        * tests/pc.test: Use $EXP instead of $EXPECTED, do not remove it.
        * tests/strace-t.test: Likewise.
        * tests/scm_rights-fd.test: Likewise.  Use dir instead of $LOG.dir,
        do not remove it.
        * tests/strace-ff.test: Do not remove $OUT and $LOG.* files.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance sched.test negative check.
        * tests/sched.test: Test that trace=%sched doesn't match
        anything besides sched_* syscalls by checking it against all test
        executables without side effects listed in pure_executables.list
        except sched_* and times.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a list of executables without side effects.
        These are executables that could be used by several different tests
        simultaneously.

        * tests/pure_executables.list: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use fixed socket address in net-yy-unix.test.
        This allows net-yy-unix invocation without arguments.

        * tests/net-yy-unix.c (TEST_SOCKET): New macro.
        (void): Use it instead of av[1].
        * tests/net-yy-unix.test: Do not specify arguments for the test
        executable.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use fixed socket address in net-y-unix.test.
        This allows net-y-unix invocation without arguments.

        * tests/net-y-unix.c (TEST_SOCKET): New macro.
        (void): Use it instead of av[1].
        * tests/net-y-unix.test: Do not specify arguments for the test
        executable.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: run every test except ksysent.test in its own subdirectory.
        Many test executables create temporary files in the current work
        directory for the duration of their execution.
        This level of test isolation allows more test executables to be invoked
        several times simultaneously.

        * tests/.gitignore: Add *.dir, remove *.log.*, *.tmp, *.tmp-*,
        and *.tmp.* patterns.
        * tests/Makefile.am (clean-local, clean-local-check): New rules.
        (.PHONY): Add clean-local-check.
        (CLEANFILES): Remove all but ksysent.h.
        * tests/init.sh: Strip test-specific prefix from LOG, OUT, and EXP
        variables.  When invoked from a test, create a new test-specific
        directory, chdir into it, and add more ../ prefix to STRACE variable.
        (run_prog): Replace "./" with "../".
        * tests/attach-f-p.test: Replace "./" with "../".
        * tests/attach-p-cmd.test: Likewise.
        * tests/bexecve.test: Likewise.
        * tests/btrfs-v.test: Likewise.
        * tests/btrfs-vw.test: Likewise.
        * tests/btrfs-w.test: Likewise.
        * tests/count.test: Likewise.
        * tests/detach-running.test: Likewise.
        * tests/detach-sleeping.test: Likewise.
        * tests/detach-stopped.test: Likewise.
        * tests/mmap.test: Likewise.
        * tests/net-y-unix.test: Likewise.
        * tests/net-yy-inet.test: Likewise.
        * tests/net-yy-netlink.test: Likewise.
        * tests/net-yy-unix.test: Likewise.
        * tests/net.test: Likewise.
        * tests/opipe.test: Likewise.
        * tests/poll.test: Likewise.
        * tests/prctl-seccomp-strict.test: Likewise.
        * tests/qual_fault-exit_group.test: Likewise.
        * tests/qual_fault.test: Likewise.
        * tests/qual_inject-error-signal.test: Likewise.
        * tests/qual_inject-retval.test: Likewise.
        * tests/qual_inject-signal.test: Likewise.
        * tests/qual_signal.test: Likewise.
        * tests/qual_syscall.test: Likewise.
        * tests/readv.test: Likewise.
        * tests/redirect-fds.test: Likewise.
        * tests/sched.test: Likewise.
        * tests/scm_rights-fd.test: Likewise.
        * tests/seccomp-strict.test: Likewise.
        * tests/strace-C.test: Likewise.
        * tests/strace-E.expected: Likewise.
        * tests/strace-E.test: Likewise.
        * tests/strace-S.test: Likewise.
        * tests/strace-T.test: Likewise.
        * tests/strace-V.test: Likewise.
        * tests/strace-ff.test: Likewise.
        * tests/strace-k.test: Likewise.
        * tests/strace-r.expected: Likewise.
        * tests/strace-r.test: Likewise.
        * tests/strace-t.test: Likewise.
        * tests/strace-tt.test: Likewise.
        * tests/strace-ttt.test: Likewise.
        * tests/sun_path.test: Likewise.
        * tests/uname.test: Likewise.
        * tests/unix-pair-send-recv.test: Likewise.
        * tests/unix-pair-sendto-recvfrom.test: Likewise.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: make test executables invocable outside current work directory.
        Most of test executables were ready for the upcoming change,
        this change prepares all the rest.

        * tests/getdents.c (main): Use fixed name for the sample directory.
        * tests/getdents64.c (main): Likewise.
        * tests/readdir.c (main): Likewise.
        * tests/mknod.c (sample): Change to a pointer.
        (main): Use av[0] as a sample.
        * tests/symlink.c (main): Use av[0] as a linkpath.
        * tests/umode_t.c (sample): Change to a pointer.
        (test_syscall): Fix expected output.
        (main): Use av[0] as a sample.

2017-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup access.test.
        * tests/access.test: Use run_strace_match_diff.
        * tests/access.c (main): Update expected output.

2017-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup oldfstat.test.
        * tests/oldfstat.test: Use fstat.test.

2017-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: workaround gcc+kernel bug.
        Due to a subtle gcc bug that leads to miscompiled aarch64 kernels,
        the 3rd argument of sched_getattr syscall is not quite 32-bit
        on aarch64 as on other architectures.  For more details see
        https://sourceforge.net/p/strace/mailman/message/35721703/

        * defs.h (print_abnormal_hi): New prototype.
        * util.c (print_abnormal_hi): New function.
        * sched.c (SYS_FUNC(sched_getattr)) [AARCH64]: Use it.
        * tests/sched_xetattr.c (main) [__arm64__ || __aarch64__]: Test it.

2017-03-29  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

        alpha, mips: fix missing flags in stat related compatibility syscalls.
        Following commands do the fix:

        Add TF flag, fixed by:
                git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \
                        's/0\(,[[:space:]]*SEN(.*_l\?stat[^i]\)/TF\1/'

        Add TD flag, fixed by:
                git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \
                  's/0\(,[[:space:]]*SEN(.*_fstat\)/TD\1/'

        * linux/alpha/syscallent.h: Add TF and TD flags to stat related
        compat syscall entries.
        * linux/mips/syscallent-compat.h: Likewise.

2017-03-24  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix the number of arguments in alpha specific syscalls.
        * linux/alpha/syscallent.h (getxgid, osf_stat, osf_lstat, osf_fstat,
        osf_sysinfo, sethae): Set nargs according to arch/alpha/kernel/osf_sys.c
        from linux v4.10.

        alpha: update comments about not implemented syscalls.
        * linux/alpha/syscallent.h: Sync "not implemented" comments
        with arch/alpha/kernel/systbls.S from linux v4.10.

2017-03-23  Quentin Monnet  <quentin.monnet@6wind.com>

        Update BPF_MAP_TYPE_* constants.
        * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_ARRAY_OF_MAPS
        and BPF_MAP_TYPE_HASH_OF_MAPS constants.

2017-03-23  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux v4.11-rc3.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.11-rc3 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/arm/ioctls_arch0.h: Likewise.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux 4.11.
        * maint/ioctls_sym.sh (ppc_list): Add KVM_PPC_GET_RMMU_INFO
        and KVM_PPC_CONFIGURE_V3_MMU.

2017-03-19  Dmitry V. Levin  <ldv@altlinux.org>

        test: rename README to README.md.
        * test/README: Rename to README.md, turn ../tests reference into an URL.

        test: update README.
        * test/README: Tell the reader what this directory is actually for.

        test: rewrite skodic.c demo.
        * test/skodic.c: Rewrite this demo to simplify its use.

2017-03-18  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Implement decoding of statx syscall.
        * linux/i386/syscallent.h [383]: Add statx entry.
        * linux/x32/syscallent.h [332]: Likewise.
        * linux/x86_64/syscallent.h [332]: Likewise.
        * pathtrace.c (pathtrace_match): Handle SEN_statx.
        * statx.c: New file.
        * statx.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * tests/.gitignore: Add statx.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add statx.test.
        * tests/statx.c: New file.
        * tests/statx.test: Likewise.
        * tests/xstatx.c: Modify to support statx.
        * xlat/at_statx_sync_types.in: New file.
        * xlat/statx_attrs.in: Likewise.
        * xlat/statx_masks.in: Likewise.
        * NEWS: Mention this change.

2017-03-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check for out of bounds fetch in parsers of stat family syscalls.
        * tests/xstatx.c (main): Create STRUCT_STAT object using
        TAIL_ALLOC_OBJECT_CONST_PTR.

        tests: check unexpected syscall errors returned by stat family syscalls.
        * tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test
        in case of EOVERFLOW.
        Treat errors other than ENOSYS and EOVERFLOW as fatal.

2017-03-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move try_run_prog to init.sh.
        Looks like try_run_prog may be of general use by other syscall class
        tests.

        * tests/sched.test (try_run_prog): Move it...
        * tests/init: ... here.

2017-03-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/sched.test: rc should be a local variable in try_run_prog.
        * tests/sched.test (try_run_prog): Add local rc.

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of int 0x80 on x86_64, x32, and x86.
        * tests/int_0x80.c: New file.
        * tests/int_0x80.test: New test.
        * tests/.gitignore: Add int_0x80.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS, XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Add int_0x80.test.
        (XFAIL_TESTS): Add $(XFAIL_TESTS_$(ARCH)).
        (CLEANFILES): Add $(TESTS:=.tmp.out) and $(TESTS:=.tmp.exp).

2017-03-16  Damien Profeta  <damien.profeta@amadeus.com>

        strace-graph: handle pid looping.
        * strace-graph: On long running process or heavily forking one (like
        compilation), it can happen that a parent get 2 different children with
        the same pid.  By tracking the currently runnig pid and adding the start
        timestamp to the pid, the graph can now handle that case.

        Closes: https://github.com/strace/strace/pull/7

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use TAIL_ALLOC_OBJECT_CONST_PTR.
        Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro
        with the following sed expression:

        sed -ri \
        's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \
        tests/*.c

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use TAIL_ALLOC_OBJECT_VAR_PTR.
        Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro
        with the following sed expression:

        sed -ri \
        's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \
        tests/{move_pages,net-sockaddr,sendfile}.c

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h.
        Introduce a new macros for the most widespread use of tail_alloc.

        * tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR,
        TAIL_ALLOC_OBJECT_VAR_PTR): New macros.

2017-03-16  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        Decode RUSAGE_THREAD.
        * xlat/usagewho.in: Add values for existing entities, add
        RUSAGE_THREAD.
        * tests/getrusage.c: Test decoding of RUSAGE_THREAD.

2017-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/sched.test: use heredoc in order to avoid spawning of subprocess.
        Pipelined commands executed in subprocesses (some shells have special
        provision for last command in the pipeline, but it is not guaranteed
        and not POSIX), so exit codes of these subprocesses can be lost.
        In order to avoid creating subprocesses, input for read commands
        is better to supply via heredoc and not pipe.

        * tests/sched.test: Move test cases to heredoc.

2017-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not skip sched.test if one of its subtests skips.
        * tests/sched.test (try_run_prog): New function.
        Use it instead of run_prog.

2017-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not check decoding of setitimer syscall outside xetitimer.test
        xetitimer.test already implements a comprehensive test of setitimer
        syscall parser, no need to duplicate its parts in other tests.

        * tests/clock_nanosleep.c (main): Remove setitimer expected output.
        * tests/nanosleep.c (main): Likewise.
        * tests/clock_nanosleep.test: Remove setitimer from the trace set.
        * tests/nanosleep.test: Likewise.

2017-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of getitimer and setitimer corner cases.
        * tests/sched_xetattr.c: Include <unistd.h> and <asm/unistd.h>.
        (main): Check that pointer and integer arguments of getitimer
        and setitimer syscalls are decoded properly.
        * tests/xetitimer.test: Add -a option.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite sigreturn syscall decoding check from match_grep to match_diff
        Unlike the former test that was based on match_grep,
        the new one uses match_diff and does more rigorous testing.

        * tests/sigreturn.c: Rewrite.
        * tests/sigreturn.test: Likewise.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls.
        As there is no sigreturn syscall on ia64, mips n32, mips n64, x32,
        and x86_64, no longer used parsers could be safely removed.

        * linux/ia64/arch_sigreturn.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32].
        * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Move sigreturn parser to libstrace.
        All architectures have rt_sigreturn, but only old ones also have
        sigreturn.  Since not all architectures need a parser of sigreturn
        syscall, remove the warning and move the parser to libstrace.

        * Makefile.am (strace_SOURCES): Move sigreturn.c ...
        (libstrace_a_SOURCES): ... here.
        * linux/arch_sigreturn.c: Remove warning.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of rt_sigreturn syscall.
        * tests/rt_sigreturn.c: New file.
        * tests/rt_sigreturn.test: New test.
        * tests/.gitignore: Add rt_sigreturn.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add rt_sigreturn.test.

        Implement proper decoding of rt_sigreturn syscall.
        * rt_sigreturn.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_rt_sigreturn): Remove.
        * linux/64/syscallent.h (rt_sigreturn): Change sys_func to rt_sigreturn.
        * linux/hppa/syscallent.h (rt_sigreturn): Likewise.
        * linux/ia64/syscallent.h (rt_sigreturn): Likewise.
        * linux/s390/syscallent.h (rt_sigreturn): Likewise.
        * linux/s390x/syscallent.h (rt_sigreturn): Likewise.
        * linux/x86_64/syscallent.h (rt_sigreturn): Likewise.
        * linux/x32/syscallent.h (rt_sigreturn, 64:rt_sigreturn): Likewise.
        * NEWS: Mention this change.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce get_rt_sigframe_addr function.
        Add get_rt_sigframe_addr function for all supported architectures.
        It is going to be used in a parser of rt_sigreturn syscall.

        * defs.h (get_rt_sigframe_addr): New function prototype.
        * rt_sigframe.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/aarch64/arch_rt_sigframe.c: New file.
        * linux/alpha/arch_rt_sigframe.c: Likewise.
        * linux/arc/arch_rt_sigframe.c: Likewise.
        * linux/arm/arch_rt_sigframe.c: Likewise.
        * linux/avr32/arch_rt_sigframe.c: Likewise.
        * linux/bfin/arch_rt_sigframe.c: Likewise.
        * linux/crisv10/arch_rt_sigframe.c: Likewise.
        * linux/crisv32/arch_rt_sigframe.c: Likewise.
        * linux/hppa/arch_rt_sigframe.c: Likewise.
        * linux/i386/arch_rt_sigframe.c: Likewise.
        * linux/ia64/arch_rt_sigframe.c: Likewise.
        * linux/m68k/arch_rt_sigframe.c: Likewise.
        * linux/metag/arch_rt_sigframe.c: Likewise.
        * linux/microblaze/arch_rt_sigframe.c: Likewise.
        * linux/mips/arch_rt_sigframe.c: Likewise.
        * linux/nios2/arch_rt_sigframe.c: Likewise.
        * linux/or1k/arch_rt_sigframe.c: Likewise.
        * linux/powerpc/arch_rt_sigframe.c: Likewise.
        * linux/powerpc64/arch_rt_sigframe.c: Likewise.
        * linux/riscv/arch_rt_sigframe.c: Likewise.
        * linux/s390/arch_rt_sigframe.c: Likewise.
        * linux/s390x/arch_rt_sigframe.c: Likewise.
        * linux/sh/arch_rt_sigframe.c: Likewise.
        * linux/sh64/arch_rt_sigframe.c: Likewise.
        * linux/sparc/arch_rt_sigframe.c: Likewise.
        * linux/sparc64/arch_rt_sigframe.c: Likewise.
        * linux/tile/arch_rt_sigframe.c: Likewise.
        * linux/x32/arch_rt_sigframe.c: Likewise.
        * linux/x86_64/arch_rt_sigframe.c: Likewise.
        * linux/xtensa/arch_rt_sigframe.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce struct_rt_sigframe type.
        Add rt_sigframe.h files with definitions of struct_rt_sigframe type
        for all supported architectures.
        These definitions are going to be used in a parser of rt_sigreturn
        syscall.

        * linux/rt_sigframe.h: New file.
        * linux/bfin/rt_sigframe.h: Likewise.
        * linux/crisv10/rt_sigframe.h: Likewise.
        * linux/crisv32/rt_sigframe.h: Likewise.
        * linux/hppa/rt_sigframe.h: Likewise.
        * linux/i386/rt_sigframe.h: Likewise.
        * linux/ia64/rt_sigframe.h: Likewise.
        * linux/m68k/rt_sigframe.h: Likewise.
        * linux/mips/rt_sigframe.h: Likewise.
        * linux/powerpc64/rt_sigframe.h: Likewise.
        * linux/s390/rt_sigframe.h: Likewise.
        * linux/s390x/rt_sigframe.h: Likewise.
        * linux/sh64/rt_sigframe.h: Likewise.
        * linux/sparc/rt_sigframe.h: Likewise.
        * linux/sparc64/rt_sigframe.h: Likewise.
        * linux/tile/rt_sigframe.h: Likewise.
        * linux/x32/rt_sigframe.h: Likewise.
        * linux/x86_64/rt_sigframe.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2017-03-13  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        unwind.c: fix a possible buffer overflow.
        Linux does not prevent a user from creating a lot of nested directories
        with length of the absolute path of the deepest one exceeding PATH_MAX,
        then chdir'ing into it, creating a file there and mmap'ing it. Since the
        length of the prefix preceding the pathname in /proc/[pid]/maps is not
        necessary 80 (it's 73 on my machine), an overflow is possible.

        * unwind.c (build_mmap_cache): Fix a possible buffer overflow.

2017-03-13  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

        util.c: remove a wrong comment.
        4924dbd6d750665cf383b20ab4fd67e48219ab91 modified the return type, but
        not the comment.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        riscv: export riscv_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/riscv/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/riscv/arch_regs.c (riscv_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        or1k: export or1k_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/or1k/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/or1k/arch_regs.c (or1k_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        nios2: export nios2_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/nios2/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/nios2/arch_regs.c (nios2_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        metag: export metag_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/metag/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/metag/arch_regs.c (metag_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        avr32: export avr32_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/avr32/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/avr32/arch_regs.c (avr32_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        arc: export arc_sp_ptr.
        Export SP register for later use by get_rt_sigframe_addr.

        * linux/arc/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/arc/arch_regs.c (arc_sp_ptr): New variable.

2017-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce print_sigset_addr function.
        As the definition of NSIG_BYTES is based on NSIG defined in <signal.h>,
        NSIG_BYTES cannot be used in files that use kernel sigset_t.

        Add another wrapper around print_sigset_addr_len_limit function that
        takes one argument less than print_sigset_addr_len wrapper.  This new
        wrapper is going to be used in cases when the length argument is equal
        to NSIG_BYTES.

        * defs.h (print_sigset_addr): New function prototype.
        * signal.c (print_sigset_addr): New function.
        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Replace
        print_sigset_addr_len with print_sigset_addr.
        * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise.

2017-03-08  Dmitry V. Levin  <ldv@altlinux.org>

        README.md: rework guidelines about sending bug reports.

2017-03-08  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

        Update information on how to build strace from git repository.
        * INSTALL-git.md: Describe how to build strace from git repository.
        * README.md: Add reference to INSTALL-git.md.
        * README-hacking: Likewise.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        README.md: fix references to in-tree files.
        * README.md: Change references to COPYING and NEWS files from absolute
        to relative.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        INSTALL: regenerate from install.texi.
        Regenerate INSTALL from install.texi using the following command:
        makeinfo --plaintext install.texi > INSTALL

        * INSTALL: Regenerate from install.texi.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        install.texi: remove irrelevant sections.
        Remove "Multiple Architectures" and "Particular Systems" sections using
        the following filter script:

        awk '/^@node (Multiple Architectures|Particular Systems)/{skip=1;next}
        /^@node/{skip=0} {if(!skip)print}'

        * install.texi (Multiple Architectures, Particular Systems): Remove.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        install.texi: import from GNU Autoconf.
        install.texi from GNU Autoconf is the ultimate source of INSTALL file.
        This edition of install.texi has been downloaded from
        https://git.savannah.gnu.org/cgit/autoconf.git/plain/doc/install.texi?id=63f3c78cdb0ccc85751543e387ef2a7252d5f0a2

        * install.texi: Import from GNU Autoconf.

2017-03-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Md Haris Iqbal  <haris.phnx@gmail.com>

        Implement -e trace=%sched option for tracing sched_* syscalls.
        Based on the patch by Md Haris Iqbal
        (https://sourceforge.net/p/strace/mailman/message/35111320/)

        linux/*/syscallent.h part is modified automatically by:

            git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \
                's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/'

        * sysent.h (TRACE_SCHED): New definition.
        * syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion.
        * linux/32/syscallent.h: Add TSC flag for sched_* sycalls.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * qualify.c (lookup_class): Add TRACE_SCHED for "%sched".
        * tests/ksysent.c: Define TSC to 0.
        * tests/nsyscalls.c: Likewise.
        * tests/sched.test: New test.
        * tests/Makefile.am (DECODER_TESTS): Add sched.test.
        * strace.1 (.SS Filtering): Add information about %sched syscall class.
        * NEWS: Mention this change.

2017-03-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add "%" prefix for syscall classes in qualify.
        (as suggested in
        https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html )

        In order to move them to a different namespace than syscall names. This is
        already a problem in case of ipc class which shadows ipc syscall.

        Old behaviour is retained in order to preserve backwards compatibility.

        * qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions.
        * strace.1 (.SS Filtering): Add information regarding %-prefixed class
        syntax, declare legacy class syntax deprecated.
        * tests/net.test: Update to use %-prefixed syscall class name.
        * tests/netlink_protocol.test: Likewise.
        * tests/qual_fault-exit_group.test: Likewise.
        * tests/qual_syscall.test: Likewise.
        * tests/scm_rights-fd.test: Likewise.
        * tests/sigreturn.test: Likewise.
        * tests/uio.test: Likewise.
        * NEWS: Mention this change.

2017-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: simplify print_time_t.
        * tests/print_time.c (print_time_t): Treat localtime errors as fatal.

2017-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Update homepage URL.
        * README: Change homepage URL to https://strace.io
        * debian/control: Likewise.
        * strace.spec.in: Likewise.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: transform print_time_t into print_time_t_nsec.
        * tests/print_time.c (print_time_t): Rename to print_time_t_nsec,
        take second argument and print it.
        * tests/tests.h (print_time_t): Rename to print_time_t_nsec,
        add second argument.
        * tests/utime.c (main): Use print_time_t_nsec instead of print_time_t.
        * tests/xstatx.c (print_stat): Likewise.  Pass nanoseconds
        to print_time_t_nsec instead of printing them.

        tests: use print_time_t in utime.test.
        * tests/utime.c (print_tm): Remove.
        (main): Use print_time_t instead of print_tm.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move print_time function to libtests.
        Rename print_time function to print_time_t and move it to libtests.

        * tests/print_time.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/tests.h (print_time_t): New prototype.
        * tests/print_time.c (print_time): Remove.
        (print_stat): Replace print_time with print_time_t.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: macroize printing of atime, mtime, and ctime fields in xstatx.c.
        Introduce a macro for printing similar time related fields.

        * print_struct_stat.c (PRINT_ST_TIME): New macro.
        (print_stat): Use it.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        print_struct_stat.c: macroize printing of atime, mtime, and ctime fields
        Introduce a macro for printing similar time related fields.

        * print_struct_stat.c (PRINT_ST_TIME): New macro.
        (print_struct_stat): Use it.

2017-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls.
        x32 is the only linux architecture where preadv2 and pwritev2 syscalls
        take 5 arguments instead of 6.

        * io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro.
        (SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it.
        * linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5.
        * NEWS: Mention this fix.
        * tests/preadv2-pwritev2.c (main): Fix invocation of preadv2
        and pwritev2 syscalls on x32.

2017-02-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite ppoll syscall decoding check from match_grep to match_diff
        Unlike the former test that was based on match_grep,
        the new one uses match_diff and does more rigorous testing.

        * tests/ppoll-v.c: New file.
        * tests/ppoll-v.test: New test.
        * tests/ppoll.c: Rewrite.
        * tests/ppoll.test: Likewise.
        * tests/ppoll.expected: Remove.
        * tests/ppoll-v.expected: Remove.
        * tests/.gitignore: Add ppoll-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ppoll-v.test.
        (EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected.

2017-02-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move get_sigset_size function to libtests.
        * tests/get_sigset_size.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/tests.h (get_sigset_size): New prototype.
        * tests/ptrace.c: Do not check for __NR_rt_sigprocmask.
        (main): Use get_sigset_size.
        * tests/signalfd4.c: Do not check for __NR_rt_sigprocmask.
        (get_sigset_size): Remove.

2017-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        sched: enhance decoding of sched_setattr syscall.
        Implement read/write semantics of struct sched_attr.size argument
        of sched_setattr syscall.  Do not print members of struct sched_attr
        besides sched_attr.size when the specified structure size is less than
        the minimal size allowed by the kernel.

        * sched.c (print_sched_attr): Fetch struct sched_attr.size and use it
        as the structure size.  Print struct sched_attr.size only when the
        structure size is less than SCHED_ATTR_MIN_SIZE.
        (SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size
        argument.  Print struct sched_attr.size returned by the kernel
        on exiting syscall in case of E2BIG. Print the last syscall argument
        on exiting syscall.
        (SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size
        argument.
        * NEWS: Mention it.
        * tests/sched_xetattr.c (main): Check it.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of sched_[gs]etattr corner cases.
        * tests/sched_xetattr.c (main): Check that integer arguments
        of sched_getattr and sched_setattr syscalls are decoded properly
        by adding a few cases with filled higher 32 bits.
        Check that pointer argument is decoded properly
        on F8ILL_KULONG_SUPPORTED architectures.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        Move definition of struct sched_attr to a separate header file.
        Avoid multiple defintions of struct sched_attr by creating a separate
        header file with its definition and using it in other places.

        * sched_attr.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * sched.c: Include it.
        (print_sched_attr): Use it.
        * tests/sched_xetattr.c: Include it.
        (main): Use it.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite sched_xetattr.test from match_grep to match_diff.
        Unlike the previous edition of the test that was based on match_grep,
        the new one is match_diff based and does more rigorous testing.

        * tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h",
        (sys_sched_getattr, sys_sched_setattr): New functions.
        (main): Use them.  Update expected output.
        * tests/adjtimex.test: Use run_strace_match_diff.

2017-02-17  Dmitry V. Levin  <ldv@altlinux.org>

        Use tprints instead of tprintf in a few more places.
        * bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf
        with tprints for printing strings without format specifiers.
        * dm.c (dm_decode_dm_target_spec): Likewise.
        * mq.c (SYS_FUNC(mq_timedreceive)): Likewise.
        * perf.c (print_perf_event_attr): Likewise.
        * syscall.c (trace_syscall_exiting): Likewise.

2017-02-17  Dmitry V. Levin  <ldv@altlinux.org>

        bpf: update BPF_PROG_ATTACH decoding.
        Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH
        command introduced by linux kernel commit v4.10-rc7-174-g7f67763.

        * configure.ac: Check for union bpf_attr.attach_flags
        instead of union bpf_attr.attach_type.
        * xlat/bpf_attach_flags.in: New file.
        * bpf.c: Include "xlat/bpf_attach_flags.h".
        (bpf_prog_attach_detach): Rename print_attach_bpf_fd argument
        to print_attach.  Add attach_flags field to the structure,
        print it in case of BPF_PROG_ATTACH.
        * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
        instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE.
        (prog_cgroup): Initialize attach_flags field.
        (main): Update expected output.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite adjtimex.test from match_grep to match_diff.
        Unlike the previous edition of the test that was based on match_grep,
        the new one is match_diff based and does more rigorous testing.

        * tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h",
        and "xlat/adjtimex_status.h".
        (main): Update expected output.
        * tests/adjtimex.test: Use run_strace_match_diff.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
        * tests/init_delete_module.h (bogus_zero): Remove.
        * tests/delete_module.c (main): Replace bogus_zero and
        (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
        * tests/finit_module.c (main): Replace bogus_zero
        with F8ILL_KULONG_MASK.
        * tests/init_module.c (main): Likewise.
        * tests/pipe2.c (main): Likewise.
        * tests/epoll_ctl.c (invoke_syscall): Replace
        (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
        * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise.
        * tests/fanotify_init.c (main): Likewise.
        * tests/xetpgid.c (main): Likewise.
        * tests/xetpriority.c (main): Likewise.
        (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
        * tests/fanotify_mark.c (main): Likewise.
        * tests/file_handle.c (main): Likewise.
        * tests/kexec_load.c (main): Likewise.
        * tests/setfsugid.c (main): Likewise.
        * tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL
        with F8ILL_KULONG_MASK.
        * tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL
        and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fill higher bits of integer arguments of fcntl* syscalls.
        Check that integer arguments of fcntl and fcntl64 syscalls are decoded
        properly by casting them to kernel_ulong_t and filling higher bits.

        * tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd"
        syscall arguments to kernel_ulong_t, fill their higher 32 bits.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc in tests of fcntl and fcntl64 syscalls.
        * tests/struct_flock.c (EINVAL_STR): Remove.
        (test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR.
        * tests/fcntl.c (test_flock64_einval): Likewise.
        * tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise.

2017-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.16-1.
        * strace.spec.in: Likewise.

2017-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.16 release.
        * NEWS: Update for 4.16 release.

2017-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        .mailmap: add addresses of JingPiao Chen.
        * .mailmap: Add both addresses of JingPiao Chen here to avoid
        duplications in CREDITS file.

        tests: skip scno tampering tests on compat mips abi.
        * tests/scno_tampering.sh: In case of mips abi, skip the test
        unless it is the native abi.

2017-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix -Werror=duplicate-decl-specifier compilation issues.
        capability.c:82:28: error: duplicate "const" declaration specifier
        capability.c:110:33: error: duplicate "const" declaration specifier
        rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier
        utime.c:66:23: error: duplicate "const" declaration specifier
        waitid.c:147:20: error: duplicate "const" declaration specifier

        * capability.c (cap_user_header_t, cap_user_data_t): Remove.
        (get_cap_header): Change return type
        to "const struct user_cap_header_struct *".
        (print_cap_header, print_cap_data): Change the type of last argument
        to "const struct user_cap_header_struct * const".
        (SYS_FUNC(capget)): Change type of "h" variable
        to "const struct user_cap_header_struct *".
        (SYS_FUNC(capset)): Change type of "h" variable
        to "const struct user_cap_header_struct * const".
        * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last
        argument to "const void *const".
        * tests/utime.c (main): Change the type of "tail_u" variable
        to "const struct utimbuf *const".
        * tests/waitid.c (do_waitid): Change the type of 3rd argument
        to "const siginfo_t *const".

2017-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite pipe syscall decoding check from match_grep to match_diff
        * configure.ac (AC_CHECK_FUNCS): Remove pipe2.
        * tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe]
        instead of [!HAVE_PIPE2].
        (main): Do not call pipe2.
        * tests/pipe.test: Skip the test if libc pipe wrapper does not use
        pipe syscall, rewrite from match_grep to match_diff.
        * tests/pipe.expected: Update expected output.

2017-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite pipe2 syscall decoding check from match_grep to match_diff
        Unlike pipe.test that is based on match_grep, the new test
        is based on match_diff and does more rigorous testing.

        * tests/pipe2.c: New file.
        * tests/pipe2.test: New test.
        * tests/.gitignore: Add pipe2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add pipe2.test.

2017-02-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite mq.test from match_grep to match_diff.
        Unlike the previous edition of the test that was based on match_grep,
        the new one is match_diff based and does more rigorous testing.

        * tests/mq.c: Include <stdio.h>.
        (NAME): New macro.
        (main): Use it.  Print expected output.
        * tests/mq.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove mq.expected.
        * tests/mq.test: Use run_strace_match_diff.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify struct inject_opts.rval semantics.
        Drop use of INJECT_OPTS_RVAL_DISABLE special inject_opts.rval value,
        INJECT_OPTS_RVAL_DEFAULT is enough.

        * defs.h (INJECT_OPTS_RVAL_DISABLE): Remove.
        * qualify.c (qualify_inject_common): Do not replace
        INJECT_OPTS_RVAL_DEFAULT with INJECT_OPTS_RVAL_DISABLE
        in inject_opts.rval.
        * syscall.c (tamper_with_syscall_entering): Check
        for INJECT_OPTS_RVAL_DEFAULT instead of INJECT_OPTS_RVAL_DISABLE.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check signal injection along with fault injection.
        * tests/qual_inject-error-signal.c: New file.
        * tests/qual_inject-error-signal.expected: Likewise.
        * tests/qual_inject-error-signal.test: New test.
        * tests/.gitignore: Add qual_inject-error-signal.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add qual_inject-error-signal.test.
        (EXTRA_DIST): Add qual_inject-error-signal.expected.

        tests: simplify qual_inject-signal.test.
        * tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        Make symbolic errno values match case-insensitive.
        Follow the example of case-insensitive symbolic signal values in signal
        and inject expressions and make symbolic errno values in inject
        expressions case-insensitive.

        * qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp
        to match symbolic errno values.
        * tests/qual_fault.c (main): Likewise.
        * tests/qual_fault.test: Test case-insensitive symbolic errno match.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check case-insensitive symbolic signal match.
        * tests/qual_signal.test: Test case-insensitive symbolic signal match.

2017-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: fix dist version checks.
        * strace.spec.in: Fix libunwind availability check.

        Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: update ipc_sem.test for new glibc.
        Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL
        address to semctl like other libcs.

        * tests/ipc_sem.c (main) [__GLIBC__]: Remove.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix typo in bpf.test.
        * tests/bpf.c (main): Add missing semicolon.

        Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff")

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check signal injection.
        * tests/qual_inject-signal.c: New file.
        * tests/qual_inject-signal.expected: Likewise.
        * tests/qual_inject-signal.test: New test.
        * tests/.gitignore: Add qual_inject-signal.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add qual_inject-signal.test.
        (EXTRA_DIST): Add qual_inject-signal.expected.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Implement -e inject= option.
        Introduce -e inject= as a general injection option,
        limit -e fault= option to syscall fault injection.

        Change default return code of syscall fault injection to ENOSYS.

        * qualify.c (parse_inject_token): Add fault_tokens_only argument,
        do not accept retval= and signal= tokens when fault_tokens_only
        is set to true.
        (parse_inject_expression): Add fault_tokens_only argument,
        forward it to parse_inject_token.
        (qualify_inject_common): New function.
        (qualify_fault): Use it.
        (qualify_inject): New function.
        (qual_options): New entry.
        * strace.1: Describe -e inject= option.
        * NEWS: Mention -e inject= option.
        * tests/qual_fault-syntax.test: Test that -e fault= option does not
        support retval=, signal=, and multiple error= tokens.
        * tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally.
        * tests/qual_inject-retval.test: Replace -e fault= option
        with -e inject= option.
        * tests/qual_inject-syntax.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: prepare for introduction of -e inject= option.
        Rename files related to fault injection to avoid further confusion.

        * tests/fault_injection-exit_group.expected: Rename
        to tests/qual_fault-exit_group.expected.
        * tests/fault_injection-exit_group.test: Rename
        to tests/qual_fault-exit_group.test.
        * tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test.
        * tests/fault_injection.c: Rename to tests/qual_fault.c.
        * tests/fault_injection.test: Rename to tests/qual_fault.test.
        * tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c.
        * tests/fault_injection-retval.test: Rename
        to tests/qual_inject-retval.test.
        * tests/fault_injection.sh: Rename to tests/scno_tampering.sh.
        * tests/.gitignore: Update.
        * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
        EXTRA_DIST): Update.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for introduction of -e inject= option.
        As -e fault= injection syntax has been extended to configure various
        kinds of injections besides fault injection, the original option name
        bacame too narrow.

        This change renames internal constants, types, and functions from
        "fault" to more generic inject/tamper ones.

        * defs.h (fault_opts): Rename to inject_opts.
        (FAULT_OPTS_RVAL_DEFAULT): Rename to INJECT_OPTS_RVAL_DEFAULT.
        (FAULT_OPTS_RVAL_DISABLE): Rename to INJECT_OPTS_RVAL_DISABLE.
        (struct tcb): Rename fault_vec field to inject_vec.
        (TCB_FAULT_INJ): Rename to TCB_TAMPERED.
        (QUAL_FAULT): Rename to QUAL_INJECT.
        (fault_vec): Rename to inject_vec.
        All users changed.
        * qualify.c (fault_set): Rename to inject_set.
        (parse_fault_token): Rename to parse_inject_token.
        (parse_fault_expression): Rename to parse_inject_expression.
        All callers changed.
        * syscall.c (fault_vec): Rename to inject_vec.
        (tcb_fault_opts): Rename to tcb_inject_opts.
        (inject_syscall_fault_entering): Rename to tamper_with_syscall_entering.
        (update_syscall_fault_exiting): Rename to tamper_with_syscall_exiting.
        (syscall_fault_injected): Rename to syscall_tampered.
        All callers changed.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: make Makefile.am lists sorted in C locale.
        * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
        EXTRA_DIST): Make sorted in C locale.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use ARG_STR in msg_control.test.
        Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h.

        * tests/msg_control.c (VAL_STR): Remove.
        (test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc, powerpc64: wire up new syscalls.
        * linux/powerpc/syscallent.h [382]: Add kexec_file_load entry.
        * linux/powerpc64/syscallent.h [382]: Likewise.

        microblaze: wire up new syscalls.
        * linux/microblaze/syscallent.h [392..397]: New entries.

        avr32: wire up new syscalls.
        * linux/avr32/syscallent.h [328..330]: New entries.

2017-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        Update IPV6_* constants.
        * xlat/sockipv6options.in: Add IPV6_RECVFRAGSIZE introduced
        by linux kernel commit v4.10-rc1~202^2~340^2~1.

        Update IP_* constants.
        * xlat/sockipoptions.in: Add IP_RECVFRAGSIZE introduced
        by linux kernel commit v4.10-rc1~202^2~340^2~2.

2017-02-06  Jacob Goense  <dugo@xs4all.nl>

        or1k: fix build.
        This fixes a typo in the arch_set_success for the or1k architecture.

        * linux/or1k/set_error.c (arch_setsuccess): Rename to arch_set_success.

        Fixes: 41d647c ("Implement success injection")
        Closes: https://github.com/strace/strace/pull/6

2017-02-04  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux 4.10.
        * linux/32/ioctls_inc_align16.h: Update from linux v4.10 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.
        * NEWS: Mention this.

        maint: update for linux 4.10.
        * maint/ioctls_sym.sh: Update workaround for linux/if_pppox.h file.

        maint: add workaround for m68k.
        * maint/ioctls_sym.sh: Skip asm/amigayle.h.

2017-01-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of bpf corner cases.
        * tests/bpf.c (bogus_bpf): New function.
        (BOGUS_BPF): New macro.
        (main): Use them.
        * tests/bpf.test: Add -a option.

2017-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite bpf.test from match_grep to match_diff.
        * tests/bpf.c (errstr): New variable.
        (sys_bpf): New function.
        (map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it.
        (main): Update expected output.
        * tests/bpf.test: Use run_strace_match_diff.

        bpf: move common code to a separate function.
        * bpf.c (bpf_prog_attach_detach): New function.
        (bpf_prog_attach, bpf_prog_detach): Use it.

2017-01-29  Quentin Monnet  <quentin.monnet@6wind.com>

        Update bpf syscall decoding.
        Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH,
        and BPF_PROG_DETACH commands.

        * bpf.c: Include "xlat/bpf_attach_type.h".
        (bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions.
        (SYS_FUNC(bpf)): Use them.
        * configure.ac: Check for union bpf_attr.bpf_fd and union
        bpf_attr.attach_type.
        * xlat/bpf_attach_type.in: New file.
        * xlat/bpf_commands.in: Update list of BPF_* command constants.
        * xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants.
        * xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants.
        * tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function.
        [HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise.
        (main): Use them.

2017-01-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: check success injection.
        * tests/fault_injection-retval.c: New file.
        * tests/fault_injection-retval.test: New test.
        * tests/.gitignore: Add fault_injection-retval.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add fault_injection-retval.test.

2017-01-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Implement success injection.
        This extends fault injection syntax with :retval= option.
        When :retval=VALUE is specified, the syscall number is replaced by -1
        and a bogus success VALUE is returned to the callee.

        * defs.h (fault_opts): Remove err field, add rval field.
        (MAX_ERRNO_VALUE, FAULT_OPTS_RVAL_DEFAULT, FAULT_OPTS_RVAL_DISABLE):
        New macros.
        * qualify.c (parse_fault_token): Handle retval= token.
        (qualify_fault): Update fault_opts initialization after the move
        from struct fault_opts.err to struct fault_opts.rval.
        * syscall.c (arch_set_success): New prototype.
        (inject_syscall_fault_entering): Check opts->rval instead of opts->err.
        (update_syscall_fault_exiting): Implement retval injection.
        * strace.1: Update the section on fault injection.
        * NEWS: Mention retval= option.
        * linux/aarch64/set_error.c (arch_set_success): New function.
        * linux/alpha/set_error.c: Likewise.
        * linux/arc/set_error.c: Likewise.
        * linux/arm/set_error.c: Likewise.
        * linux/avr32/set_error.c: Likewise.
        * linux/bfin/set_error.c: Likewise.
        * linux/crisv10/set_error.c: Likewise.
        * linux/hppa/set_error.c: Likewise.
        * linux/i386/set_error.c: Likewise.
        * linux/ia64/set_error.c: Likewise.
        * linux/m68k/set_error.c: Likewise.
        * linux/metag/set_error.c: Likewise.
        * linux/microblaze/set_error.c: Likewise.
        * linux/mips/set_error.c: Likewise.
        * linux/nios2/set_error.c: Likewise.
        * linux/or1k/set_error.c: Likewise.
        * linux/powerpc/set_error.c: Likewise.
        * linux/riscv/set_error.c: Likewise.
        * linux/s390/set_error.c: Likewise.
        * linux/sh/set_error.c: Likewise.
        * linux/sh64/set_error.c: Likewise.
        * linux/sparc/set_error.c: Likewise.
        * linux/sparc64/set_error.c: Likewise.
        * linux/tile/set_error.c: Likewise.
        * linux/x86_64/set_error.c: Likewise.
        * linux/xtensa/set_error.c: Likewise.

        Closes: https://github.com/strace/strace/issues/3

2017-01-26  Dmitry V. Levin  <ldv@altlinux.org>

        mips: rewrite configure check without sgidefs.h.
        Use builtin macros provided by gcc >= 3.4 instead of sgidefs.h macros.

        * configure.ac <mips>: Do not include <asm/sgidefs.h>, use _ABIO32
        instead of _MIPS_SIM_ABI32, _ABIN32 instead of _MIPS_SIM_NABI32,
        and _ABI64 instead of _MIPS_SIM_ABI64.

2017-01-20  Elvira Khabirova  <lineprinter0@gmail.com>

        .gitignore: add missing files that should be ignored.
        * .gitignore: Add /ioctl_iocdef.[ih].

        Fixes: 5679fad ("ioctlsort: get ioctl definitions from host, not build")

2017-01-20  Andre McCurdy  <armccurdy@gmail.com>

        mips: use <asm/sgidefs.h>
        Build fix for MIPS with musl libc.

        The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
        but not by musl. Regardless of the libc, the kernel headers provide
        <asm/sgidefs.h> which provides the same definitions, so use that
        instead.

        * configure.ac: Replace <sgidefs.h> with <asm/sgidefs.h>.

2017-01-20  JingPiao Chen  <chenjingpiao@gmail.com>

        Implement decoding of ustat syscall.
        * configure.ac (AC_CHECK_HEADERS): Add ustat.h.
        * ustat.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h: Remove sys_ustat.
        * tests/ustat.c: New file.
        * tests/ustat.test: New test.
        * tests/.gitignore: Add ustat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ustat.test.

        Makefile.am: allow indented DEF_MPERS_TYPE includes.
        * Makefile.am (m%_type_defs.h): Change sed regular expression to allow
        arbitrary number of whitespace characters between "#" symbol
        and "include" directive.

        strace.1: fix formatting.
        * strace.1: Remove misplaced .TP macros.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: drop non-USE_ASM_STAT case support.
        With the switch of fstatat family tests to USE_ASM_STAT variant,
        there are no non-USE_ASM_STAT users left.  Remove support of unused
        non-USE_ASM_STAT case.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec.
        * tests/fstatat.c (USE_ASM_STAT): Remove.
        * tests/fstatx.c: Likewise.
        * tests/lstatx.c: Likewise.
        * tests/xstatx.c: Assume USE_ASM_STAT.
        [!USE_ASM_STAT]: Remove.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: call newfstatat and fstatat64 syscalls directly.
        Do not use glibc wrappers to call newfstatat and fstatat64.
        These wrappers have various problems, e.g. they segfault on sparc64
        and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong
        conversion of timestamps on mips64.

        * tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall
        directly.
        (USE_ASM_STAT): Define.
        * tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove.
        (STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define.

        Based on patch by James Cowgill <james410@cowgill.org.uk>.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove redundant SAMPLE_SIZE definitions.
        Remove all definitions of SAMPLE_SIZE that are identical to the fallback
        definition in tests/xstatx.c.

        * tests/fstat64.c (SAMPLE_SIZE): Remove.
        * tests/lstat64.c (SAMPLE_SIZE): Remove.
        * tests/stat64.c (SAMPLE_SIZE): Remove.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change SAMPLE_SIZE type to libc_off_t.
        As ftruncate libc function and our create_sample function that calls
        ftruncate both take size argument of type libc_off_t, change the type
        of SAMPLE_SIZE constant to libc_off_t.

        * tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t.
        * tests/lstat.c (SAMPLE_SIZE): Likewise.
        * tests/oldfstat.c (SAMPLE_SIZE): Likewise.
        * tests/oldlstat.c (SAMPLE_SIZE): Likewise.
        * tests/oldstat.c (SAMPLE_SIZE): Likewise.
        * tests/stat.c (SAMPLE_SIZE): Likewise.
        * tests/xstatx.c (SAMPLE_SIZE): Likewise.

2017-01-13  Alexey Neyman  <stilor@att.net>

        ioctlsort: get ioctl definitions from host, not build.
        When cross-compiling, ioctlsort must obtain _IOC_* values from the
        host, build's values may be incompatible.

        * ioctl_iocdef.c: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        (ioctl_iocdef.i, ioctl_iocdef.h): New rules.
        (ioctlsort%.o): Depend on ioctl_iocdef.h.
        (CLEANFILES): Add ioctl_iocdef.h and ioctl_iocdef.i.
        * ioctlsort.c: Include "ioctl_iocdef.h" instead of <linux/ioctl.h>.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: treat struct stat mismatch as an error.
        If the test detects struct stat mismatch, this is likely an error
        in definitions of a stat structure that might affect strace as well.
        Fail the test instead of skipping it to attract more attention.

        * tests/xstatx.c (main): Return 1 instead of 77
        in case of struct stat mismatch.

2017-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite diagnostics about struct stat mismatch.
        * tests/xstatx.c (LOG_STAT_OFFSETOF_SIZEOF): New macro.
        (main): Use it to print struct stat mismatch details.

        tests: fix typo in tests/xstatx.c.
        * tests/xstatx.c [!IS_FSTAT]: Define IS_FSTAT instead of IS_STAT.

2017-01-12  JingPiao Chen  <chenjingpiao@gmail.com>

        tests: fix typo in mlock.c.
        * tests/mlock.c [!(__NR_mlock && __NR_munlock)]: Fix spelling
        of SKIP_MAIN_UNDEFINED.

2017-01-12  JingPiao Chen  <chenjingpiao@gmail.com>

        strace: move description of -k option to the appropriate place.
        Follow the example of strace.1 and put the description of -k option
        into the  output format group.

        * strace.c (usage): Move description of -k option to the output
        format group.

2017-01-11  Dmitry V. Levin  <ldv@altlinux.org>

        Remove redundant commas at the end of structure initializers.
        Automatically remove redundant commas using the following
        sed expression:

        git grep -El ',[[:space:]]+}' |xargs sed -ri 's/,([[:space:]]+\})/\1/'

        * linux/32/syscallent.h: Remove redundant commas at the end of structure
        initializers.
        * linux/64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/crisv10/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/microblaze/userent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * tests/kexec_file_load.c: Likewise.

        Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of scsi ioctl commands.
        * tests/ioctl_scsi.c: New file.
        * tests/ioctl_scsi.test: New test.
        * tests/.gitignore: Add ioctl_scsi.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_scsi.test.

        scsi: implement decoding of all SG_* ioctl commands.
        * print_sg_req_info.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/sg_scsi_reset.in: New file.
        * scsi.c: Include "xlat/sg_scsi_reset.h".
        (scsi_ioctl): Implement decoding of all SG_* ioctl commands.

        scsi: prepare for decoding of other SG_* ioctl commands.
        * scsi.c (scsi_ioctl): Introduce a switch statement.

        tests: check decoding of ioctl SG_IO v3 commands.
        * tests/ioctl_sg_io_v3.c: New file.
        * tests/ioctl_sg_io_v3.test: New test.
        * tests/.gitignore: Add ioctl_sg_io_v3.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_sg_io_v3.test.

        tests: check decoding of ioctl SG_IO v4 commands.
        * tests/ioctl_sg_io_v4.c: New file.
        * tests/ioctl_sg_io_v4.test: New test.
        * tests/.gitignore: Add ioctl_sg_io_v4.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_sg_io_v4.test.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        scsi: add fallback definitions for SG_* ioctl command constants.
        Unfortunately, <scsi/sg.h> from libc does not provide all constants
        recognized by the kernel.

        * xlat/scsi_sg_commands.in: New file.
        * scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing
        a fallback definition of SG_IO.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for BSG_FLAG_* constants.
        BSG_FLAG_* constants were introduced later than the header file where
        they are defined.

        * xlat/bsg_flags.in: Add default values for constants.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for SG_FLAG_* constants.
        Unfortunately, <scsi/sg.h> from libc does not provide all constants
        recognized by the kernel.

        * xlat/sg_io_flags.in: Add default values for constants.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: print din_resid and dout_resid fields as signed integers.
        * sg_io_v4.c (decode_response): Print din_resid and dout_resid fields
        using %d format.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io: cleanup printing of sg_io buffers.
        Turn print_sg_io_buffer into a universal sg_io buffer printer.

        * sg_io_v3.c (print_sg_io_buffer): Add iovec_count argument.
        Call tprint_iov_upto when iovec_count is non-zero.
        (decode_request, decode_response): Do not call tprint_iov_upto directly,
        use print_sg_io_buffer instead.
        * sg_io_v4.c: Likewise.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io: decode structures on exiting syscall in case of syserror.
        The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78,
        translates its "struct request.errors" to ioctl errors after
        filling in all the output members of the SG_IO header structure.

        As there is no easy way to tell SCSI layer errors from other syscall
        errors, decode the structure on exiting syscall in case of syserror,
        too.

        * scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use
        get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io
        unconditionally.
        * sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using
        set_tcb_priv_data.
        (decode_response): Restore it using get_tcb_priv_data.  Print its i/o
        fields when umove call fails.  Pass IOV_DECODE_STR to tprint_iov_upto
        unconditionally.
        * sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using
        set_tcb_priv_data.
        (decode_response): Restore it using get_tcb_priv_data.  Print its i/o
        fields when umove call fails.  Pass IOV_DECODE_STR to tprint_iov_upto
        unconditionally.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io: reorder printing of fields to follow structure order.
        * sg_io_v4.c (decode_request): Print timeout, flags, and usr_ptr fields
        after dout_xferp field.

        sg_io_v3: print sg_io_hdr.duration field as unsigned integer.
        * sg_io_v3.c (decode_response): Print duration field using %u format.

        sg_io_v3: print msg_status field.
        * sg_io_v3.c (decode_response): Print msg_status field.

        sg_io: print names of array fields and corresponding length fields.
        * sg_io_v3.c (decode_request): Print names of cmd_len, cmdp,
        and dxferp fields.
        (decode_response): Print names of dxferp, sb_len_wr, and sbp fields.
        * sg_io_v4.c (decode_request): Print names of request_len, request,
        dout_xfer_len, and dout_xferp fields.
        (decode_response): Print names of response_len, response,
        and din_xferp fields.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v3: print status fields using %#x format specifier.
        The formerly used format string %02x led to misleading output as there
        was no clear indication sometimes whether the printed integer was
        decimal or hexadecimal.

        * sg_io_v3.c (decode_response): Print status and masked_status fields
        using %#x format specifier instead of %02x.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: print status fields in a hexadecimal form.
        The tradition is to print scsi status codes in a hexadecimal form.

        * sg_io_v4.c (decode_response): Print driver_status, transport_status,
        and device_status fields using %#x format specifier instead of %u.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: print request_tag and generated_tag fields in hex.
        The tradition is to print scsi tags in a hexadecimal form.

        * sg_io_v4.c (decode_request): Print request_tag field
        using ("%#" PRI__x64) format string.
        (decode_response): Print generated_tag field using ("%#" PRI__x64)
        format string.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: print usr_ptr field in a hexadecimal form.
        As the nature of this field is pointer-like, print it
        in a hexadecimal form.

        * sg_io_v4.c (decode_request): Print usr_ptr field
        using ("%#" PRI__x64) format string.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io_v4: do not print spare_in and spare_out fields.
        As the kernel does not touch these fields, there is no use
        to print them.

        * sg_io_v4.c (decode_request): Do not print spare_in field.
        (decode_response): Do not print spare_out field.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info.
        Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags.

        * xlat/sg_io_info.in: New file.
        * defs.h (sg_io_info): New xlat prototype.
        * sg_io_v3.c: Include "xlat/sg_io_info.h".
        (decode_response): Print struct_sg_io_hdr.info using printflags.
        * sg_io_v4.c: (decode_response): Print struct sg_io_v4.info
        using printflags.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags.
        Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags.

        * xlat/sg_io_flags.in: New file.
        * sg_io_v3.c: Include "xlat/sg_io_flags.h".
        (decode_request): Print struct_sg_io_hdr.flags using printflags.
        * xlat/bsg_flags.in: New file.
        * sg_io_v4.c: Include "xlat/bsg_flags.h".
        (decode_request): Print struct sg_io_v4.flags using printflags.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify struct sg_io_hdr.
        struct sg_io_hdr contains pointers and therefore has to be mpersified.

        * defs.h (decode_sg_io_v3): Remove prototype.
        * sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr.
        Mpersify it.
        (decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        Split scsi.c.
        Move decoders of SG_IO v3 and v4 APIs into separate files,
        compile generic SG_IO decoder unconditionally.

        * sg_io_v3.c: New file.
        * sg_io_v4.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * defs.h (decode_sg_io_v3, decode_sg_io_v4): New prototypes.
        * ioctl.c (ioctl_decode): Remove [HAVE_SCSI_SG_H] condition.
        * scsi.c: (print_sg_io_res): Remove.
        (print_sg_io_req): Rename to decode_sg_io, replace print_sg_io_v3_req
        with decode_sg_io_v3, replace print_sg_io_v4_req with decode_sg_io_v4,
        compile uncoditionally.
        (scsi_ioctl): Replace print_sg_io_req and print_sg_io_res
        with decode_sg_io, compile uncoditionally.
        Move [HAVE_SCSI_SG_H] code to sg_io_v3.c.
        Move [HAVE_LINUX_BSG_H] code to sg_io_v4.c.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        scsi: detect and print changes of interface id.
        * scsi.c (print_sg_io_v3_res): Detect and print changes
        of struct sg_io_hdr.interface_id field between entering and exiting
        syscall.
        (print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard
        field between entering and exiting syscall.

        scsi: print field names of all fields being printed.
        * scsi.c (print_sg_io_v3_req): Always print the name
        of struct sg_io_hdr.interface_id field.
        (print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard
        field.
        (print_sg_io_req): Print unknown interface id as an integer.
        (scsi_ioctl): Save interface id on entering syscall and use it
        on exiting syscall.

        scsi: print struct sg_io_hdr.dxfer_direction field name.
        * scsi.c (print_sg_io_v3_req): Print struct sg_io_hdr.dxfer_direction
        field name.

        scsi: print "protocol" and "subprotocol" field names of struct sg_io_v4.
        * scsi.c (print_sg_io_v4_req): Print field names
        of struct sg_io_v4.protocol and struct sg_io_v4.subprotocol.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Print hexadecimal integer in error diagnostics using %#x.
        The formerly used format string %x led to misleading output as there was
        no clear indication sometimes whether the printed integer was decimal or
        hexadecimal.

        * aio.c (startup_child, test_ptrace_seize): Print status
        using %#x format specifier instead of %x.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        aio: print hexadecimal integer using %#x.
        The formerly used format string %x led to misleading output as there was
        no clear indication sometimes whether the printed integer was decimal or
        hexadecimal.

        * aio.c (print_common_flags): Print struct iocb.aio_flags using %#x
        format specifier instead of %x.
        * tests/aio.c (main): Likewise.

2017-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        scsi: rewrite print_sg_io_buffer using printstr_ex(QUOTE_FORCE_HEX)
        As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need
        to implement it manually any longer.

        * scsi.c (print_uchar): Remove.
        (print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX).

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        getrandom: print string as hex-escaped.
        Since there is no reason to interpret the value returned by getrandom as
        ASCII string, it makes sense to always print it as a hex-escaped string.

        * getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead
        of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order
        to force hex-escaped string formatting.
        * tests/getrandom.test: Remove no longer needed -xx flag as the string
        is always printed in hexadecimal format now.

        Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add support for forcing printing string as hex-escaped.
        This could be useful in cases when some binary data should not be
        interpreted as an ASCII string, but rather as an array of byte values.

        * defs.h (QUOTE_FORCE_HEX): New macro constant.
        * util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set
        in user_style parameter.

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        term: do not abort decoding in case of non-verbose output.
        The case of unset verbose is handled by umoven_or_printaddr, moreover,
        exiting at this point is plain wrong and leads to last argument not
        being printed while it should be.

        * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
        decode_modem_flags): Do not check verbose flags explicitly and do not
        exit early if it is not set.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip fault injection tests on hppa if the kernel is too old.
        * tests/fault_injection.sh: Add the minimal kernel version for hppa.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip readahead.test on MIPS n64 when built with glibc < 2.25.
        Due to a bug in glibc readahead syscall wrapper on MIPS n64,
        this wrapper cannot be used in readahead.test.

        * tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]:
        Undefine HAVE_READAHEAD.

        Reported-by: James Cowgill <james410@cowgill.org.uk>

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace init_magic with fill_memory.
        Use the same fill_memory/fill_memory_ex interface in all affected tests.

        * tests/ioctl_block.c (init_magic): Remove.
        (main): Replace init_magic with fill_memory.
        * tests/ioctl_evdev.c: Likewise.
        * tests/ioctl_v4l2.c: Likewise.
        * tests/ioctl_mtd.c (magic, init_magic): Remove.
        (main): Replace init_magic with fill_memory.
        * tests/ioctl_rtc.c: Likewise.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite ioctl_v4l2 test without reliance on init_magic.
        * tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros.
        (main): Use them.  Rewrite expected output without assumptions
        on any particular magic data.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove redundant casts in fill_memory{,_ex} invocations.
        * tests/ioctl_loop.c (main): Remove redundant casts of fill_memory
        first argument.
        * tests/kexec_load.c (main): Likewise.
        * tests/perf_event_open.c (main): Likewise.
        * tests/quotactl.c (main): Likewise.
        * tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex
        first argument.
        * tests/quotactl-xfs.c (main): Likewise.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change the type of fill_memory{,_ex} first argument to void *
        As these functions behave like memset, it's more convenient to have
        the first argument of type void * like memset.

        * tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type
        of first argument from "char *" to "void *".
        * tests/tests.h (fill_memory, fill_memory_ex): Likewise.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check non-verbose decoding of LOOP_* ioctls.
        * tests/ioctl_loop-nv.c: New file.
        * tests/ioctl_loop-nv.test: New test.
        * tests/ioctl_loop.c [!ABBREV] (ABBREV): Define to 0.
        (print_loop_info, print_loop_info64): Handle [ABBREV != 0] case.
        * tests/.gitignore: Add ioctl_loop-nv.
        * tests/Makefile.am (check_PROGRAMS): Likewise.

        tests: add more checks of LOOP_* ioctls decoding.
        * tests/ioctl_loop.c: Include <linux/ioctl.h>.
        (magic, lmagic): Move static constants ...
        (main): ... here.  Change types of magic constants to kernel_ulong_t.
        Add more checks.

2017-01-04  JingPiao Chen  <chenjingpiao@gmail.com>
            Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of LOOP_* ioctls.
        * tests/ioctl_loop.c: New file.
        * tests/ioctl_loop-v.c: Likewise.
        * tests/ioctl_loop.test: New test.
        * tests/ioctl_loop-v.test: Likewise.
        * tests/.gitignore: Add ioctl_loop and ioctl_loop-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        Drop vsprintf.c.
        Drop custom vfprintf implementation that was disabled by default.
        Apparently nobody tests strace with this vfprintf enabled, otherwise
        multiple uses of format specifiers not supported by this custom vfprintf
        would not left unnoticed.

        The GNU C library is not the only libc available, so those who want
        faster implementations of libc functions are encouraged to try building
        strace with other libc implementations.

        * vsprintf.c: Remove.
        * Makefile.am (strace_SOURCES): Remove vsprintf.c.
        * defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove.
        * strace.c (tprintf): Replace strace_vfprintf with vfprintf.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: remove unnecessary verbose check.
        The verbose flag is responsible for dereferencing of addresses, and it
        is perfectly handled by umove_or_printaddr; moreover, this early exit
        leads to incorrect formatting of last argument.

        * loop.c (loop_ioctl): Do not check verbose flag explicitly and do not
        exit early if it is not set.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: fix lo_encrypt_key field output.
        lo_encrypt_key is a sized string with its size specified by
        lo_encrypt_key_size field, so take lo_encrypt_key_size into account.

        * loop.c (decode_loop_info, decode_loop_info64): Use minimum of
        LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: print lo_encrypt_key_size field of struct loop_info as unsigned.
        It is converted to an unsigned value in kernel (see loop_info64_from_old
        in drivers/block/loop.c), so let's print it that way despite its type.

        * loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t
        value.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more checks of unknown ioctl command formatting.
        * tests/ioctl.c (main): Additional check for unknown ioctl command
        decoding.
        * tests/ioctl_evdev.c (main): Likewise.
        * tests/ioctl_dm.c: Include <linux/ioctl.h> for _IOC_SIZE and _IOC_NR.
        (main) <dummy_dm_ioctl1, dummy_dm_ioctl2, dummy_dm_arg>: New constants.
        Add more checks for unknown command formatting.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ioctl: do not print explicit 0x prefix and do not specify minimum width.
        Specifying output width for size argument is rather misleading - it can
        be up to 14 bits in size.  The use of explicit "0x" prefix is
        discouraged because 0x0 looks ugly.  Usage of width specification along
        with alternate form flag leads to inconsistent output for 0.
        Let's use just plain %#x qualifiers instead.

        * ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command
        type, number and size to "%#x".
        * tests/ioctl.c (main): Update expected test output.
        * tests/ioctl_dm.c (main): Likewise.
        * tests/ioctl_evdev.c (main): Likewise.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: fix printing of the reserved field array items.
        They are of char type, so "hh" length modifier should be used (otherwise
        they are printed incorrectly as they are sign extended implicitly when
        passed as printf arguments in case char is a signed type which is true
        for most compilers).

        * loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx"
        in printing routine for array elements of the "reserved" field of
        loop_info structure.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check ioctl(SIOCGIFCONF) decoding.
        * tests/ioctl_sock_gifconf.c: New file.
        * tests/ioctl_sock_gifconf.test: New test.
        * tests/.gitignore: Add ioctl_sock_gifconf.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_sock_gifconf.test.

        dm.c: add copyright notice.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        Add scno.h and syscallent.i to .gitignore files.
        * .gitignore: Add /scno.h and /syscallent.i.
        * tests/.gitignore: Add scno.h and syscallent.i.

2017-01-04  JingPiao Chen  <chenjingpiao@gmail.com>

        tests/.gitignore: add generated files that should be ignored.
        * tests/.gitignore: Replace addkey with add_key, add attach-f-p-cmd.

2017-01-03  Dmitry V. Levin  <ldv@altlinux.org>

        Remove checks of __NR_* availability from strace source code.
        * strace.c: Remove __NR_tkill checks, assume it is always defined.
        * util.c: Remove __NR_process_vm_readv checks and fallback definitions,
        assume it is always defined.

        Include "scno.h" in files that check __NR_* constants.
        * strace.c: Include "scno.h".
        * util.c: Likewise.

        Generate scno.h for use during the build of strace itself.
        * Makefile.am: Include scno.am.
        ($(strace_OBJECTS)): New rule.

2017-01-01  Dmitry V. Levin  <ldv@altlinux.org>

        Generate scno.h without invoking a generated executable helper.
        Generate scno.h using only those tools that are available for cross
        build.  This allows to use scno.h during the build of strace itself.

        * scno.am: New file.
        * scno.head: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * tests/generate_scno.c: Remove.
        * tests/.gitignore: Remove generate_scno.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (CLEANFILES): Remove scno.h.
        (scno.h, $(scno_dependants)): Remove rules.
        (scno_dependants): Remove.
        ($(objects)): New rule.
        Include ../scno.am.

2017-01-01  Dmitry V. Levin  <ldv@altlinux.org>

        Update all publicly shown copyright year number ranges.
        * COPYING: Update copyright year number range.
        * configure.ac: Likewise.
        * strace.c: Likewise.
        * tests/strace-V.test: Use the current year for the check.

2016-12-31  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: stop including <asm/unistd.h>
        Limit the number of files where <asm/unistd.h> is included
        to only those few that need it.

        * defs.h: Do not include <asm/unistd.h>.
        * clone.c: Include <asm/unistd.h>.
        * strace.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not use BUILT_SOURCES.
        * tests/Makefile.am (ksysent.$(OBJEXT)): New rule.
        (BUILT_SOURCES): Remove.

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        Fix cross build.
        This fixes cross build regression introduced by commit
        v4.15-39-g605a705a63d533dceb3c2d489468fcd3aed3963c.

        * tests/Makefile.am (BUILT_SOURCES): Remove scno.h
        (objects, scno_dependants): New variables.
        ($(scno_dependants)): New rule.

        Reported-by: Joakim Bech <joakim.bech@linaro.org>

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not use defs.h and syscall.h.
        * tests/generate_scno.c: Include "tests.h", "sysent.h", <stdio.h>,
        <string.h>, and <asm/unistd.h> instead of "defs.h" and "syscall.h".
        * tests/ksysent.c: Likewise.
        * tests/nsyscalls.c: Include "tests.h", "sysent.h", <errno.h>,
        <stdio.h>, and <unistd.h> instead of "defs.h" and "syscall.h".

        Move definition of struct sysent and trace flags to a separate file.
        * sysent.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h: Include it.
        (struct sysent, TRACE_FILE, TRACE_IPC, TRACE_NETWORK, TRACE_PROCESS,
        TRACE_SIGNAL, TRACE_DESC, TRACE_MEMORY, SYSCALL_NEVER_FAILS,
        STACKTRACE_INVALIDATE_CACHE, STACKTRACE_CAPTURE_ON_ENTER,
        TRACE_INDIRECT_SUBCALL, COMPAT_SYSCALL_TYPES): Remove.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Mpersify SIOC* ioctls.
        struct ifreq and struct ifconf are ABI-dependent and should have been
        mpersified.

        * defs.h (sock_ioctl): Remove prototype.
        * sock.c (struct_ifconf, struct_ifreq): New typedefs.
        (DEF_MPERS_TYPE(struct_ifconf), DEF_MPERS_TYPE(struct_ifreq),
        MPERS_DEFS): New includes.
        (print_ifreq, print_ifc_len, print_ifconf_ifreq): Replace struct ifreq
        with struct_ifreq.
        (decode_ifconf): Replace struct ifconf with struct_ifconf, struct ifreq
        with struct_fireq.
        (sock_ioctl): Wrap into MPERS_PRINTER_DECL.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        sock: rewrite decode_ifconf.
        * sock.c (decode_ifconf): Rewrite.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: update LOOP_* ioctl flags constants.
        * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_USE_AOPS
        and LO_FLAGS_DIRECT_IO.
        * xlat/loop_flags_options.in: Likewise.  Add default values
        for constants.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: add fallback definitions for LOOP_* ioctl command constants.
        Since these are architecture-independent and have been added over the
        kernel's lifetime, it makes sense to have these definitions in strace
        itself.

        * xlat/loop_cmds.in: New file.
        * loop.c: Include "xlat/loop_cmds.h".
        (loop_ioctl): Eliminate conditional compilation based on availability
        of LOOP_* constant definitions.

2016-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: extend syntax.
        * xlat/gen.sh: Implement #stop directive that stops preprocessor
        at the line it has been encountered during the first pass.  This could
        be used, for example, to provide fallback definitions for constants
        without defining xlat tables.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        loop: mpersify struct loop_info and loop_ioctl function.
        struct loop_info contains fields of type long, so it definitely should
        have been mpersified.

        * defs.h (loop_ioctl): Remove prototype.
        * loop.c (struct_loop_info): New typedef.
        Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS.
        (decode_loop_info): Replace struct loop_info with struct_loop_info.
        Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print
        them using appropriate format specifiers.
        (loop_ioctl): Wrap into MPERS_PRINTER_DECL.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        loop: print lo_device and lo_rdevice fields using print_dev_t.
        * loop.c (decode_loop_info, decode_loop_info64): Use print_dev_t
        for printing lo_device and lo_rdevice fields.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Move device number printing code into a separate routine.
        * print_dev_t.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (print_dev_t): New prototype.
        * dm.c: Do not include <sys/sysmacros.h>.
        (dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use
        print_dev_t function for printing device numbers.
        * mknod.c: Do not include <sys/sysmacros.h>.
        (decode_mknod): Use print_dev_t function for printing device number.
        * print_struct_stat.c: Do not include <sys/sysmacros.h>.
        (print_struct_stat): Use print_dev_t function for printing device
        numbers.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance invalid address decoding check in seccomp-strict.test.
        * tests/seccomp-strict.c (main): Change the type of addr variable
        containg the invalid address from unsigned long to kernel_ulong_t,
        print it using %#llx format.

2016-12-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of prctl PR_GET_TID_ADDRESS operation.
        * tests/prctl-tid_address.c: New file.
        * tests/prctl-tid_address.test: New test.
        * tests/.gitignore: Add prctl-tid_address.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-tid_address.test.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        Update the publicly shown copyright information.
        Set the publicly shown copyright holder to "The strace developers.".

        * COPYING: Update copyright information.
        * configure.ac: Add AC_COPYRIGHT.
        * strace.c (print_version): New function.
        (init): Use it.
        * tests/strace-V.test: Update expected output.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        configure: specify project URL.
        * configure.ac (AC_INIT): Add URL.

2016-12-28  Seraphime Kirkovski  <kirkseraph@gmail.com>

        Document signal injection.
        * strace.1: Describe :signal=SIG option of the fault injection syntax.
        * NEWS: Mention signal injection.

2016-12-28  Seraphime Kirkovski  <kirkseraph@gmail.com>

        Implement signal injection.
        This extends the fault injection capability with :signal=SIG option
        which injects a signal on entering each syscall from the specified set.

        :signal and :error options are complementary, if they are both specified
        the syscall will be fault injected as usual and the specified signal
        will be delivered to the tracee.

        * defs.h (struct fault_opts): Change the type of err field to int16_t,
        add signo field.
        (trace_syscall): Add a pointer argument.
        * qualify.c: Include "nsig.h".
        (parse_fault_token): Handle signal= option.
        (qualify_fault): Update default fault_opts.
        * strace.c (trace): Forward signal number from trace_syscall
        to ptrace_restart(PTRACE_SYSCALL).
        * syscall.c (inject_syscall_fault_entering): Add pointer argument,
        save there the signal number specified by fault options.  Do not inject
        a syscall fault unless instructed by fault options.
        (update_syscall_fault_exiting): Update the error code injection check.
        (trace_syscall_entering): Add pointer argument, forward it to
        inject_syscall_fault_entering.
        (trace_syscall): Add pointer argument, forward it to
        trace_syscall_entering.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        Update README.md.
        * README.md: Update homepage URL, mention command-line interface
        and tampering capabilities in the description.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify prctl-arg2-intptr.test.
        Robustify prctl-arg2-intptr.test against unrelated prctl invocations.

        * tests/prctl-arg2-intptr.test: Filter out unrelated PR_GET_*
        and PR_SET_* prctl calls.

2016-12-27  Dmitry V. Levin  <ldv@altlinux.org>

        signal: remove redundant checks around NSIG.
        * signal.c (struct old_sigaction, struct new_sigaction,
        struct new_sigaction32): Remove safety checks for NSIG >= sizeof(long).

        Introduce NSIG_BYTES.
        * nsig.h (NSIG_BYTES): New macro.
        * desc.c: Use it in comments instead of NSIG.
        * epoll.c: Likewise.
        * poll.c: Likewise.
        * signalfd.c: Likewise.
        * signal.c: Likewise.
        (sprintsigmask_n, print_sigset_addr_len_limit): Use it instead of NSIG.
        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise.
        * tests/pselect6.c (main): Likewise.

        Move NSIG ifdefery to a separate header file.
        * nsig.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * signal.c: Include "nsig.h" instead of <signal.h>, remove
        NSIG workarounds.
        * sigreturn.c: Likewise.
        * syscall.c: Likewise.
        * tests/pselect6.c: Likewise.

        Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro.
        * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): New macro.
        (truncate_klong_to_current_wordsize,
        truncate_kulong_to_current_wordsize): Use it.
        * mem.c (SYS_FUNC(old_mmap)): Likewise.
        * util.c (umoven, umovestr, dumpiov_upto): Likewise.
        * syscall.c (trace_syscall_exiting): Likewise.

        Simplify personality checks in msghdr.c and signal.c.
        * msghdr.c: Check for [!current_wordsize] instead
        of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4].
        * signal.c: Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Replace widen_to_long with truncate_klong_to_current_wordsize.
        * defs.h (widen_to_long): Remove.
        (truncate_klong_to_current_wordsize): New static inline function.
        * aio.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents): Use it
        instead of widen_to_long.
        * linux/sparc64/get_syscall_args.c (get_syscall_args): Update comment.
        * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise.

        Replace widen_to_ulong with truncate_kulong_to_current_wordsize.
        * defs.h (widen_to_ulong): Remove.
        (truncate_kulong_to_current_wordsize): New static inline function.
        * io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify print_lld_from_low_high_val ifdefery.
        The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler
        implementation.

        * io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4
        && SIZEOF_LONG == SIZEOF_LONG_LONG]
        and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases
        into a single [SIZEOF_KERNEL_LONG_T > 4] case.
        [SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long
        instead of zero_extend_signed_to_ull.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify getllval ifdefery.
        The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler
        implementation.

        * util.c (getllval): Merge [SIZEOF_LONG > 4
        && SIZEOF_LONG == SIZEOF_LONG_LONG]
        and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases
        into a single [SIZEOF_KERNEL_LONG_T > 4] case.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long.
        Since there is no compat handler for x32/n32, kernel returns kernel's
        long as a result of the call.

        Interesting, does any callee out there actually care to have enough room
        allocated for kernel long?

        * prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr
        to print the value stored at address pointed by addr2 argument
        of PR_GET_TID_ADDRESS operation.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add functions for printing pointers of kernel_ulong_t size.
        In cases where no compat for x32/n32 is implemented, pointer is of
        kernel's long size, so it should be printed appropriately.

        * defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype.
        (printnum_kptr): New macro.
        * util.c [!current_klongsize] (printnum_addr_klong_int): New function.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Print indirect pointers as pointers.
        Originally, printnum_long_int was used, but it prints NULL incorrectly.

        * defs.h (DECL_PRINTNUM_ADDR): New macro.
        (DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes.
        [!current_wordsize] (printnum_addr_long_int): New prototype.
        [!current_wordsize] (printnum_ptr): Use it.
        [current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64.
        [current_wordsize == 4] (printnum_ptr) Use printnum_addr_int.
        * util.c (DEF_PRINTNUM_ADDR): New macro.
        (DEF_PRINTNUM_ADDR(int, unsigned int),
        DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that
        provide printnum_addr_int and printnum_addr_int64, accordingly.
        [!current_wordsize] (printnum_addr_long_int): New function.
        * xet_robust_list.c (sprintaddr): New function.
        (main): Use it, update expected output.
        * tests/ipc_sem.c (main): Update expected output.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ipc_sem: print 4th argument of semctl syscall as an address.
        * ipc_sem.c (SYS_FUNC(semctl)): Print 4th argument using printaddr.
        * tests/ipc_sem.c (cleanup): Update expected output.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Do not define printnum_long_int on systems with constant current_wordsize
        * defs.h: Check [!current_wordsize] instead
        of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to select
        definitions of printnum_slong, printnum_ulong, and printnum_ptr.
        * util.c: Check [!current_wordsize] instead
        of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to decide
        whether to compile printnum_long_int.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        umoven: detect invalid addresses.
        Do not silently truncate tracee addresses to current_wordsize.
        After transition from long to kernel_ulong_t there should be no sign
        extension issues with tracee addresses, and invalid addresses should
        be printed properly.

        * util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead
        of [SIZEOF_LONG > 4], reject addresses that do not fit into
        current_wordsize.
        * tests/umoven-illptr.c: New file.
        * tests/umoven-illptr.test: New test.
        * tests/.gitignore: Add umoven-illptr.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add umoven-illptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        umovestr: detect invalid addresses.
        Do not silently truncate tracee addresses to current_wordsize.
        After transition from long to kernel_ulong_t there should be no sign
        extension issues with tracee addresses, and invalid addresses should
        be printed properly.

        * util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead
        of [SIZEOF_LONG > 4], reject addresses that do not fit into
        current_wordsize.
        * tests/umovestr-illptr.c: New file.
        * tests/umovestr-illptr.test: New test.
        * tests/.gitignore: Add umovestr-illptr.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add umovestr-illptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        lseek: simplify _llseek syscall decoder.
        After transition from long to kernel_ulong_t the implementation
        could be made a bit simpler.

        * lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead
        of zero_extend_signed_to_ull.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        lseek: merge two different implementations of lseek syscall decoder.
        After transition from long to kernel_ulong_t there are no mo
        complications that required to keep a separate implementation
        for x32 and mips n32.

        * lseek.c (SYS_FUNC(lseek)): Merge two different implementations
        into a single one.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval.
        After transition from long to kernel_ulong_t these fields
        are no longer needed.

        * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove.
        (struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
        [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
        (RVAL_MASK): Update.
        * io.c (print_lld_from_low_high_val): Check
        [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
        instead of [HAVE_STRUCT_TCB_EXT_ARG].
        Use u_arg instead of ext_arg.
        * linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove.
        * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]:
        Remove.
        [LINUX_MIPSN64]: Extend to [LINUX_MIPSN32].
        * linux/x86_64/get_error.c (get_error) [X32]: Remove.
        * linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove.
        * lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
        instead of [HAVE_STRUCT_TCB_EXT_ARG].
        [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg
        instead of ext_arg.  Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL.
        * mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly
        to print_mmap.
        * syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
        * times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead
        of RVAL_LUDECIMAL.
        * util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
        instead of [HAVE_STRUCT_TCB_EXT_ARG].  Use u_arg instead of ext_arg.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Remove getarg_klu.
        After transition from long to kernel_ulong_t we no longer need
        tcp->ext_arg, and therefore a function to access it is also no longer
        needed.

        * defs.h (getarg_klu): Remove prototype.
        * util.c (getarg_klu): Remove.
        (printargs): Access tcp->u_arg directly
        * bjm.c (SYS_FUNC(init_module)): Likewise.
        * clone.c (SYS_FUNC(unshare)): Likewise.
        * fadvise.c (SYS_FUNC(fadvise64)): Likewise.
        * kcmp.c (SYS_FUNC(kcmp)): Likewise.
        * kexec.c (SYS_FUNC(kexec_file_load)): Likewise.
        * keyctl.c (SYS_FUNC(keyctl)): Likewise.
        * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
        * mem.c (do_mprotect): Likewise.
        * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
        * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
        * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
        Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Remove printaddr_klu.
        After transition from long to kernel_ulong_t we no longer need
        two versions of printaddr function.

        * defs.h (printaddr): Remove.
        (printaddr_klu): Rename to printaddr.
        * util.c (printaddr_klu): Likewise.
        * bjm.c (SYS_FUNC(init_module)): Replace printaddr_klu with printaddr.
        * mem.c (do_mprotect): Likewise.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of a subset of prctl operations.
        Check decoding of prctl operations that take the second syscall argument
        as a pointer to an integer.

        * tests/prctl-arg2-intptr.c: New file.
        * tests/prctl-arg2-intptr.test: New test.
        * tests/.gitignore: Add prctl-arg2-intptr.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-arg2-intptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Automatically replace PRI_kr[dux] with PRI_kl[dux]
        Remove temporary macros created for transition from long
        to kernel_ulong_t.

        Automatically replace PRI_kr[dux] with PRI_kl[dux] using
        $ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g'

        * defs.h (PRI_krd, PRI_kru, PRI_krx): Remove.  All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t.
        Remove temporary types created for transition from long
        to kernel_ulong_t.

        Automatically replace kernel_scno_t and kernel_ureg_t with
        kernel_ulong_t using
        $ git grep -El 'kernel_(scno|ureg)_t' |
          xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g'

        * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove.
        All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t
        * defs.h (struct tcb): Change u_rval type from long to kernel_long_t.
        (PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx.
        * kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect
        to kernel_ulong_t.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Print kernel_ureg_t and kernel_scno_t using dedicated format strings.
        Prepare for the change of kernel_ureg_t and kernel_scno_t from
        unsigned long to kernel_ulong_t.

        * defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros.
        All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        vm_read_mem: detect address truncation.
        When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed
        to vm_read_mem could be silently truncated.  Detect this situation
        and return EIO when the tracee address does not fit into unsigned long.

        * util.c (vm_read_mem): Save raddr argument into a temporary variable
        truncated_raddr of type unsigned long.  Set errno to EIO and return -1
        when truncated_raddr does not equal to raddr.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        trace_syscall_exiting: prepare personality check for u_rval type change.
        * syscall.c (trace_syscall_exiting): Check for sizeof(tcp->u_rval)
        instead of sizeof(long) when deciding how to print tcp->u_rval.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Use ptr_to_kulong instead of explicit casts of pointers to kernel_ureg_t
        Direct casts to kernel_ureg_t will not work after the change
        of kernel_ureg_t from unsigned long to kernel_ulong_t.

        * defs.h (ptr_to_kulong): New macro.
        * block.c (print_blkpg_req): Use it instead of explicit casts
        to kernel_ureg_t.
        * btrfs.c (btrfs_ioctl): Likewise.
        * evdev.c (ff_effect_ioctl): Likewise.
        * mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
        * msghdr.c (print_struct_msghdr, dumpiov_in_msghdr): Likewise.
        * mtd.c (decode_mtd_oob_buf): Likewise.
        * printsiginfo.c (printsigval, print_si_info): Likewise.
        * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Likewise.
        * sigaltstack.c (print_stack_t): Likewise.
        * sock.c (decode_ifconf): Likewise.
        * sysctl.c (SYS_FUNC(sysctl)): Likewise.
        * util.c (dumpiov_upto): Likewise.
        * v4l2.c (print_v4l2_framebuffer, print_v4l2_ext_control,
        print_v4l2_ext_controls): Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        umove*: remove redundant casts.
        * util.c (umoven, umovestr): Remove casts from unsigned long to pointer.

        upoke: remove redundant casts.
        * upoke.c (upoke): Remove casts from unsigned long to pointer.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        signal: cleanup decoding of sa_handler and sa_restorer.
        Change type of sa_handler and sa_restorer fields from function pointers
        to unsigned long.  This saves the code from a lot of casts between
        pointers and integers.

        Rename __sa_handler to sa_handler__ as names starting with underscore
        symbol are reserved and should not be used.

        * signal.c (old_sigaction): Rename __sa_handler to sa_handler__,
        all users updated.  Change the type of sa_handler__ and sa_restorer
        from pointer to unsigned long.
        (old_sigaction32): Rename __sa_handler to sa_handler__, all users
        updated.
        (decode_old_sigaction): Remove now redundant casts from
        old_sigaction32.sa_handler__ to old_sigaction.sa_handler__,
        from old_sigaction32.sa_restorer to old_sigaction.sa_restorer,
        and from old_sigaction.sa_handler__ to unsigned long.  Print
        old_sigaction.sa_restorer using printaddr.
        * signal.c (new_sigaction): Rename __sa_handler to sa_handler__,
        all users updated.  Change the type of sa_handler__ and sa_restorer
        from pointer to unsigned long.
        (new_sigaction32): Rename __sa_handler to sa_handler__, all users
        updated.
        (decode_new_sigaction): Remove now redundant casts from
        new_sigaction32.sa_handler__ to new_sigaction.sa_handler__,
        from new_sigaction32.sa_restorer to new_sigaction.sa_restorer,
        and from new_sigaction.sa_handler__ to unsigned long.  Print
        new_sigaction.sa_restorer using printaddr.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        signal: change signal handler address type from unsigned long to kernel_ureg_t
        * signal.c (get_sa_handler_str, print_sa_handler): Change handler type
        from unsigned long to kernel_ureg_t.

        quota: change address argument type from unsigned long to kernel_ureg_t.
        * quota.c (decode_cmd_data): Change the type of data argument
        from unsigned long to kernel_ureg_t.

        execve: prepare for handling big pointers.
        * execve.c (printargv): Change cp.p64 type from unsigned long
        to kernel_ulong_t so it could handle wordsize > sizeof(long) properly.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        clone: print clone flags without truncation.
        The flags argument is defined in kernel as unsigned long,
        so change its decoding to avoid truncation.

        * clone.c (SYS_FUNC(clone)): Change flags type from unsigned long
        to kernel_ureg_t, print it using printflags64 instead of printflags.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Use printxval64 instead of printxval_long.
        After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
        to stop using printxval_long proxy and pass syscall arguments directly
        to printxval64.

        * defs.h (printxval_long): Remove.
        * fcntl.c (print_fcntl): Replace printxval_long with printxval64.
        * mtd.c (mtd_ioctl): Likewise.
        * numa.c (SYS_FUNC(mbind)): Likewise.
        * or1k_atomic.c [OR1K] (SYS_FUNC(or1k_atomic)): Likewise.
        * sysmips.c [MIPS] (SYS_FUNC(sysmips)): Likewise.
        * term.c (term_ioctl): Likewise.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Use printflags64 instead of printflags_long.
        After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
        to stop using printflags_long proxy and pass syscall arguments directly
        to printflags64.

        * defs.h (printflags_long): Remove.
        * fcntl.c (print_fcntl): Replace printflags_long with printflags64.
        * numa.c (SYS_FUNC(get_mempolicy)): Likewise.
        * perf.c (SYS_FUNC(perf_event_open)): Likewise.
        * sram_alloc.c [BFIN] (SYS_FUNC(sram_alloc)): Likewise.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        upeek, upoke: change argument types from long to unsigned long.
        * defs.h (upeek, upoke): Change offset argument type from long
        to unsigned long.  Change res argument type from long to kernel_ureg_t.
        * upeek.c (upeek): Likewise.
        * upoke.c (upoke.c): Likewise.
        * syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long
        to kernel_ureg_t.
        * linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast.
        * linux/metag/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise.
        * linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise.
        * linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts.
        * linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long
        to unsigned long.
        * linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long
        to unsigned long.
        * linux/bfin/arch_regs.c (bfin_r0): Likewise.
        * linux/crisv10/arch_regs.c (cris_r10): Likewise.
        * linux/hppa/arch_regs.c (hppa_r28): Likewise.
        * linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise.
        * linux/microblaze/arch_regs.c (microblaze_r3): Likewise.
        * linux/sh/arch_regs.c (sh_r0): Likewise.
        * linux/sh64/arch_regs.c (sh64_r9): Likewise.
        * linux/xtensa/arch_regs.c (xtensa_a2): Likewise.
        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type
        from long to unsigned long.
        * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/alpha/get_scno.c (arch_get_scno): Update for the change
        of signedness.
        * linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type
        from pointer to long to pointer to unsigned long.
        * linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long
        to pointer to unsigned long.
        * linux/arm/arch_regs.h (arm_sp_ptr): Likewise.
        * linux/i386/arch_regs.c (i386_esp_ptr): Likewise.
        * linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
        * linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise.
        * linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise.
        * linux/ia64/get_syscall_args.c (get_syscall_args): Use umove
        instead of umoven.
        * linux/sh/arch_getrval2.c (getrval2): Change val type from long
        to unsigned long.

        arch_sigreturn: change tracee address type from long to unsigned long.
        * linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable
        type from long to unsigned long.
        * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
        * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type
        of addr and regs variables from long to unsigned long.
        * linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable
        type from long to kernel_ureg_t.
        * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type
        of offset and addr variables from long to kernel_ureg_t.

        kexec: change flags type from unsigned long to kernel_ureg_t.
        * kexec.c (SYS_FUNC(kexec_load)): Change n variable type
        from unsigned long to kernel_ureg_t.  Use printxval64 instead
        of printxval_long.  Use printflags64 instead of printflags_long.

        kexec: change types of pointers and sizes to kernel_ureg_t.
        * kexec.c (print_seg): Change the type of *seg and seg_buf variables
        from unsigned long to kernel_ureg_t.
        (print_kexec_segments): Change len argument type from unsigned long
        to kernel_ureg_t.  Change seg variable type from unsigned long
        to kernel_ureg_t.

        printsiginfo: change len argument type from unsigned long to kernel_ureg_t
        * printsiginfo.c (print_siginfo_array): Change len argument type
        from unsigned long to kernel_ureg_t.

        signal: change address argument type from unsigned long to kernel_ureg_t
        * signal.c (print_sigqueueinfo): Change address argument type
        from unsigned long to kernel_ureg_t.

        statfs64: change size argument type from unsigned long to kernel_ureg_t.
        * defs.h (print_struct_statfs64): Change size argument type
        from unsigned long to kernel_ureg_t.
        * print_statfs.c (print_struct_statfs64): Likewise.
        * fetch_struct_statfs.c (fetch_struct_statfs64): Likewise.
        * fstatfs64.c (SYS_FUNC(fstatfs64)): Pass size argument directly
        to print_struct_statfs64.
        * statfs64.c (SYS_FUNC(statfs64)): Likewise.

        Cast tcp->u_rval to kernel_ureg_t instead of unsigned long.
        * fcntl.c (print_fcntl): Cast tcp->u_rval to kernel_ureg_t instead
        of unsigned long.
        * membarrier.c (SYS_FUNC(membarrier)): Likewise.
        * prctl.c (SYS_FUNC(prctl)): Likewise.
        * sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
        * time.c (do_adjtimex): Likewise.

        decode_sockbuf: change addrlen argument type from long to kernel_ureg_t.
        * net.c (decode_sockbuf): Change addrlen argument type from long
        to kernel_ureg_t.

        netlink: change size types from unsigned long to kernel_ureg_t.
        * defs.h (decode_netlink): Change len argument type from unsigned long
        to kernel_ureg_t.
        * netlink.c (fetch_nlmsghdr): Likewise.
        (decode_nlmsghdr_with_payload): Likewise.  Change nlmsg_len variable
        type from unsigned long to unsigned int.
        (decode_netlink): Change the type of len argument and next_len variable
        from unsigned long to kernel_ureg_t.  Change nlmsg_len variable type
        from unsigned long to unsigned int.

        ipc_msg: change size types from unsigned long to kernel_ureg_t.
        * ipc_msg.c (tprint_msgsnd): Change count argument type
        from unsigned long to kernel_ureg_t.  Change flags argument type
        from unsigned long to unsigned int.
        (tprint_msgrcv): Change the type of count and msgtyp arguments
        from unsigned long to kernel_ureg_t.
        (fetch_msgrcv_args): Change *pair type from unsigned long
        to kernel_ureg_t.
        (SYS_FUNC(msgrcv)): Change pair type from unsigned long
        to kernel_ureg_t.
        * print_msgbuf.c (tprint_msgbuf): Change count argument type
        from unsigned long to kernel_ureg_t.

        dumpiov_upto: change size types from unsigned long to kernel_ureg_t.
        * defs.h (dumpiov_upto): Change data_size argument type
        from unsigned long to kernel_ureg_t.
        * util.c (dumpiov_upto): Change the type of data_size argument
        and iov_len variable from unsigned long to kernel_ureg_t.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr: change cmsghdr size types from size_t to unsigned int.
        As the kernel does not accept control messages longer than the value
        of int sysctl_optmem_max kernel variable exported as
        /proc/sys/net/core/optmem_max, we do not print them either.

        Since unsigned int has enough room to contain any valid control message
        size, change all internal cmsghdr size types from size_t
        to unsigned int.

        * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
        print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t,
        print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr,
        cmsg_printer, print_cmsg_type_data): Change data_len argument type
        from size_t to unsigned int.
        (cmsg_socket_printers): Change min_len type from size_t to unsigned int.
        (decode_msg_control): Change the type of in_control_len argument,
        cmsg_len, and len variables from size_t to kernel_ureg_t.
        Change the type of cmsg_size, control_len, and buf_len variables
        from size_t to unsigned int.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr: change register based size types from unsigned long to kernel_ureg_t
        * defs.h (dumpiov_in_msghdr): Change data_size argument type
        from unsigned long to kernel_ureg_t.
        * msghdr.h (print_struct_msghdr): Likewise.
        * msghdr.c (print_struct_msghdr): Likewise.  Cast msghdr.msg_iovlen
        and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long.
        (decode_msghdr, dumpiov_in_msghdr): Change data_size argument type
        from unsigned long to kernel_ureg_t.
        (SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument
        to decode_msghdr.
        * mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead
        of -1UL as data_size argument to print_struct_msghdr.
        (dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead
        of unsigned long.
        * syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument
        to dumpiov_in_msghdr

        mq: remove redundant u_rval check.
        * mq.c (SYS_FUNC(mq_timedreceive)): Do not check for tcp->u_rval < 0,
        syserror(tcp) is enough, and printstrn can handle len < 0 anyway.

        io: change size types from unsigned long to kernel_ureg_t.
        * defs.h (tprint_iov_upto): Change the type of len and data_size
        arguments from unsigned long to kernel_ureg_t.
        (tprint_iov): Change the type of len argument from unsigned long
        to kernel_ureg_t.
        * io.c (print_iovec_config): Change data_size type from unsigned long
        to kernel_ureg_t.
        (print_iovec): Change the type of *iov, iov_buf, and len variables
        from unsigned long to kernel_ureg_t.
        (tprint_iov_upto): Change the type of len and data_size arguments, and
        the type of iov variable from unsigned long to kernel_ureg_t.

        mount: change flags type from unsigned long to kernel_ureg_t.
        * mount.c (SYS_FUNC(mount)): Change the type of flags from unsigned long
        to kernel_ureg_t, use printflags64 instead of printflags_long
        to print it.

        mem: change mmap arguments type from unsigned long to kernel_ureg_t.
        * mem.c (print_mmap): Change the type of len, prot, and flags
        from unsigned long to kernel_ureg_t.  Use printflags64 instead
        of printflags_long.  Use printxval64 instead of printxval_long.
        (SYS_FUNC(old_mmap)): Check for current_klongsize instead
        of [AARCH64 || X86_64] to take X32 into account.
        (SYS_FUNC(mremap)): Use printflags64 instead of printflags_long.
        (SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and
        flags from unsigned long to kernel_ureg_t.  Use printflags64 instead
        of printflags_long.  Use printxval64 instead of printxval_long.
        [POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb
        from unsigned long to kernel_ureg_t.

        numa: change size arguments type from unsigned long to kernel_ureg_t.
        * numa.c (print_node, print_addr): Add kernel_ureg_t support.
        (print_nodemask): Change type of maxnodes argument from unsigned long
        to kernel_ureg_t.
        (SYS_FUNC(move_pages)): Change npages type from unsigned long
        to kernel_ureg_t.  Change buf type from long to kernel_ureg_t.

        print_sigset_addr_len: change len argument type from long to kernel_ureg_t
        * defs.h (print_sigset_addr_len): Change len argument type from long
        to kernel_ureg_t.
        * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise.

        process_vm: change size arguments type from unsigned long to kernel_ureg_t
        * process_vm.c (SYS_FUNC(process_vm_readv),
        SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt,
        remote_iovcnt, and flags from unsigned long to kernel_ureg_t.

        printstr*: change len argument type from long to kernel_ureg_t.
        * defs.h (printstr_ex, printstrn): Change len argument type from long
        to kernel_ureg_t.
        * util.c (printstr_ex): Likewise.

        xattr: change size arguments type from unsigned long to kernel_ureg_t.
        * xattr.c (print_xattr_val): Change type of insize and size arguments
        from unsigned long to kernel_ureg_t.
        (print_xattr_list): Change type of size argument from unsigned long
        to kernel_ureg_t.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        printstr_ex: fix decoding of non-NUL-terminated strings when len == -1.
        Do not treat len == -1 in any special way.  All users who need the
        string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED
        bit in user_style flags already.

        * util.c (printstr_ex): Remove (len == -1) check.
        * tests/printstr.c: New file.
        * tests/printstr.test: New test.
        * tests/.gitignore: Add printstr.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add printstr.test.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of sethostname syscall.
        The second argument of sethostname syscall is not an unsigned long but
        unsigned int.  The kernel does not look at the string argument when
        the length argument is too long.

        * hostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
        [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
        (SYS_FUNC(sethostname)): Treat the second argument as unsigned int.
        Print the first argument as a pointer when the second argument exceeds
        __NEW_UTS_LEN.
        * tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
        [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
        (main): Use it.  Check that the second argument of sethostname
        is handled as unsigned int.  Check that the first argument is printed
        as a pointer when the second argument exceeds __NEW_UTS_LEN.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h.
        * tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros.
        (f8ill_ptr_to_kulong): New static inline function.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        printstr: rename to printstrn, add printstr as a thin wrapper.
        As about half of all printstr uses cases are invocations with the last
        argument set to -1, create a dedicated function for this use case.

        * defs.h (printstr): Rename to printstrn.  All callers updated.
        (printstr): New static inline function.  All callers updated.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        process: change ptrace arguments type from unsigned long to kernel_ureg_t
        (SYS_FUNC(ptrace)): Change type of request and data arguments
        from unsigned long to kernel_ureg_t.

        process: change tracee address type from unsigned long to kernel_ureg_t.
        * process.c (print_user_offset_addr): Change address argument type
        from unsigned long to kernel_ureg_t.
        (SYS_FUNC(ptrace)): Change addr variable type from unsigned long
        to kernel_ureg_t.

        net: change address argument type from long to kernel_ureg_t.
        * net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred,
        print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq,
        print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq,
        print_setsockopt): Change address argument type from long
        to kernel_ureg_t.

        print_mq_attr: change address argument type from long to kernel_ureg_t.
        * print_mq_attr.c (printmqattr): Change address argument type from long
        to kernel_ureg_t.

        ipc_*: change address argument type from long to kernel_ureg_t.
        * ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change
        address argument type from long to kernel_ureg_t.
        * ipc_msgctl.c (print_msqid_ds): Likewise.
        * ipc_sem.c (tprint_sembuf_array): Likewise.
        * ipc_shmctl.c (print_shmid_ds): Likewise.

        print_msgbuf: change address argument type from long to kernel_ureg_t.
        * print_msgbuf.c (tprint_msgbuf): Change address argument type
        from long to kernel_ureg_t.

        desc: change tracee address type from long to kernel_ureg_t.
        * desc.c (decode_select): Rename arg to addr, change its type
        from long to kernel_ureg_t.

        uid: change address argument type from long to kernel_ureg_t.
        * uid.c (get_print_uid): Change address argument type
        from long to kernel_ureg_t.

        time: change address argument type from long to kernel_ureg_t.
        * time.c (print_timezone, do_adjtimex): Change address argument type
        from long to kernel_ureg_t.

        sched: change address argument type from long to kernel_ureg_t.
        * sched.c (print_sched_attr): Change address argument type
        from long to kernel_ureg_t.

        printsiginfo: change address argument type from long to kernel_ureg_t.
        * printsiginfo.c (printsiginfo_at): Change address argument type
        from long to kernel_ureg_t.

        print_timex: change address argument type from long to kernel_ureg_t.
        * print_timex.c (print_timex): Change address argument type
        from long to kernel_ureg_t.

        print_sigevent: change address argument type from long to kernel_ureg_t.
        * print_sigevent.c (print_sigevent): Change address argument type
        from long to kernel_ureg_t.

        poll: change address argument type from long to kernel_ureg_t.
        * poll.c (decode_poll_exiting): Change tracee address argument type
        from long to kernel_ureg_t.

        printrusage*: change tracee address argument type from long to kernel_ureg_t
        * defs.h [ALPHA] (printrusage32): Change address argument type
        from long to kernel_ureg_t.
        * printrusage.c (printrusage): Likewise.
        [ALPHA] (printrusage32): Likewise.
        * wait.c (printwaitn): Change the type of tracee address argument
        of print_rusage from long to kernel_ureg_t.

        print_time*: change tracee address argument type from long to kernel_ureg_t
        * defs.h [ALPHA] (sprint_timeval32, print_timeval32,
        print_timeval32_pair, print_itimerval32): Change address argument type
        from long to kernel_ureg_t.
        * desc.c (decode_select): Change the type of tracee address argument
        of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t.
        * print_timespec.c (print_timespec, sprint_timespec,
        print_timespec_utime_pair, print_itimerspec): Change address argument
        type from long to kernel_ureg_t.
        * print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval,
        print_itimerval, print_timeval32, print_timeval32_pair,
        print_itimerval32, sprint_timeval32): Likewise.

        rtc: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info):
        Change addr type from long to kernel_ureg_t.
        (rtc_ioctl): Change arg type from long to kernel_ureg_t.

        mtd: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * mtd.c (decode_erase_info_user, decode_erase_info_user64,
        decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info,
        decode_otp_select, decode_mtd_write_req, decode_mtd_info_user,
        decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats):
        Change addr type from long to kernel_ureg_t.
        (mtd_ioctl): Change arg type from long to kernel_ureg_t.

        hdio: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t.

        v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
        print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
        print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
        print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
        print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
        print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
        print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
        to kernel_ureg_t.

        evdev: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl,
        getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl,
        evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type
        from long to kernel_ureg_t.

        btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long
        to kernel_ureg_t.

        block: change type of ioctl 3rd argument from long to kernel_ureg_t.
        * block.c (block_ioctl): Change arg type from long to kernel_ureg_t.

        Change type of ioctl 3rd argument from long to kernel_ureg_t.
        * defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t.
        * dm.c (dm_known_ioctl, dm_ioctl): Likewise.
        * file_ioctl.c (file_ioctl): Likewise.
        * fs_x_ioctl.c (fs_x_ioctl): Likewise.
        * ioctl.c (ioctl_decode): Likewise.
        * loop.c (decode_loop_info, decode_loop_info64): Change addr type
        from long to kernel_ureg_t.
        (loop_ioctl): Change arg type from long to kernel_ureg_t.
        * ptp.c (ptp_ioctl): Likewise.
        * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
        print_sg_io_v4_res, scsi_ioctl): Likewise.
        * sock.c (print_ifreq, sock_ioctl): Likewise.
        (decode_ifconf): Change addr type from long to kernel_ureg_t.
        * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
        decode_modem_flags): Likewise.
        (term_ioctl): Change arg type from long to kernel_ureg_t.
        * ubi.c (ubi_ioctl): Likewise.
        * userfaultfd.c (uffdio_ioctl): Likewise.

        ldt: change address argument type from long to kernel_ureg_t.
        * defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address
        argument type from long to kernel_ureg_t.
        * ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise.

        fcntl: change address argument type from long to kernel_ureg_t.
        * fcntl.c (printflock64, printflock, print_f_owner_ex): Change
        address argument type from long to kernel_ureg_t.

        execve: change address argument type from long to kernel_ureg_t.
        * execve.c (printargv, printargc): Change address argument type
        from long to kernel_ureg_t.

        dirent: change address argument type from long to kernel_ureg_t.
        * dirent.c (print_old_dirent): Change address argument type from long
        to kernel_ureg_t.

        bpf: change address argument type from long to kernel_ureg_t.
        * bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem,
        bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument
        type from long to kernel_ureg_t.

        dump*: change address argument type from long to kernel_ureg_t.
        * defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr):
        Change address argument type from long to kernel_ureg_t.
        * mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
        * msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr):
        Likewise.
        * util.c (dumpiov_upto, dumpstr): Likewise.

        print_sigset_addr_len: change address argument type from long to kernel_ureg_t
        * defs.h (print_sigset_addr_len) Change address argument type from long
        to kernel_ureg_t.
        * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len,
        decode_old_sigaction, decode_new_sigaction): Likewise.

        decode_sockaddr: change address argument type from long to kernel_ureg_t
        * defs.h (decode_sockaddr) Change tracee address argument type from long
        to kernel_ureg_t.
        * sockaddr.c (decode_sockaddr): Likewise.

        print_struct_statfs*: change address argument type from long to kernel_ureg_t
        * defs.h (print_struct_statfs, print_struct_statfs64): Change address
        argument type from long to kernel_ureg_t.
        * print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise.
        * fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64):
        Likewise.

        fetch_struct_flock: change address argument type from long to kernel_ureg_t
        * fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64):
        Change address argument type from long to kernel_ureg_t.

        fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t
        * fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument
        type from long to kernel_ureg_t.

        printnum_*, printpair_*: change address argument type from long to kernel_ureg_t
        * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change
        address argument type from long to kernel_ureg_t.
        * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise.

        printpath*: change address argument type from long to kernel_ureg_t.
        * defs.h (printpath, printpathn): Change address argument type
        from long to kernel_ureg_t.
        * util.c (printpath, printpathn): Likewise.

        printstr*: change address argument type from long to kernel_ureg_t.
        * defs.h (printstr_ex, printstr_ex): Change address argument type
        from long to kernel_ureg_t.
        * util.c (printstr_ex): Likewise.

        umove*: change tracee address argument type from long to kernel_ureg_t.
        * defs.h (umovestr, umoven, umoven_or_printaddr,
        umoven_or_printaddr_ignore_syserror): Change tracee address argument
        type from long to kernel_ureg_t.
        (print_array): Change the type of tracee address argument of umoven_func
        from long to kernel_ureg_t.
        * util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr,
        umoven_or_printaddr_ignore_syserror): Change tracee address argument
        type from long to kernel_ureg_t.
        (print_array): Change the type of tracee address argument of umoven_func
        from long to kernel_ureg_t.
        * desc.c (umove_kulong_array_or_printaddr): Change tracee address
        argument type from long to kernel_ureg_t.
        * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise.

        futex: change address type from long to kernel_ureg_t.
        * futex.c (SYS_FUNC(futex)): Change address type from long
        to kernel_ureg_t.

        file_handle: change address type from long to kernel_ureg_t.
        * file_handle.c (SYS_FUNC(name_to_handle_at),
        SYS_FUNC(open_by_handle_at)): Change address type from long
        to kernel_ureg_t.

        printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long.
        * printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer
        to kernel_ureg_t instead of unsigned long.
        (print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers
        to kernel_ureg_t instead of unsigned long.

        sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long
        * sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer
        and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long.

        v4l2: cast pointers to kernel_ureg_t instead of long.
        * v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer
        to kernel_ureg_t instead of long.

        v4l2: cast pointers to kernel_ureg_t instead of unsigned long.
        * v4l2.c (print_v4l2_buffer): Remove redundant cast.
        (print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer
        to kernel_ureg_t instead of unsigned long.
        (print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer
        to kernel_ureg_t instead of unsigned long.

2016-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        sysctl: cast pointers to kernel_ureg_t instead of size_t.
        * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and
        __sysctl_args.newval pointers to kernel_ureg_t instead of size_t.

        sysctl: cast pointers to kernel_ureg_t instead of long.
        * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer
        to kernel_ureg_t instead of long.

        block: cast pointers to kernel_ureg_t instead of long.
        * block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer
        to kernel_ureg_t instead of long.

        dumpiov_upto: cast pointers to kernel_ureg_t instead of long.
        * util.c  (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t
        instead of long.

        msghdr: cast pointers to kernel_ureg_t instead of long.
        * msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer
        to kernel_ureg_t instead of long.
        (dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t
        instead of long.

        mmsghdr: cast pointers to kernel_ureg_t instead of long.
        * mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer
        to kernel_ureg_t instead of long.

        Remove redundant casts of ptrace arguments.
        * strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument
        from pointer to long type.

        ptrace_restart: cleanup.
        * strace.c (ptrace_restart): Replace the sequence of "if" statements
        with a "switch" statement.

        ptrace_restart: change types of integer arguments to unsigned.
        * strace.c (ptrace_restart): Change types of "op" and "sig"
        from int to unsigned int.

        process: remove redundant syserror checks.
        * process.c (SYS_FUNC(ptrace)): Remove syserror checks as both
        print_siginfo_array and print_seccomp_fprog do the right thing
        by using umoven_or_printaddr.

        sparc64: remove redundant casts.
        * linux/sparc64/get_syscall_args.c (get_syscall_args): Remove
        redundant casts from uint32_t to long.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        numa: change address argument type from unsigned long to kernel_ureg_t.
        * numa.c (print_nodemask): Change address argument type from
        unsigned long to kernel_ureg_t.

        net: change address argument type from unsigned long to kernel_ureg_t.
        * net.c (fetch_socklen): Change address argument type from
        unsigned long to kernel_ureg_t.

        mem: change tracee address type from unsigned long to kernel_ureg_t.
        * mem.c (print_mmap, SYS_FUNC(remap_file_pages),
        SYS_FUNC(subpage_prot)): Change the type of variables containing tracee
        addresses from unsigned long to kernel_ureg_t.

        kexec: change address argument type from unsigned long to kernel_ureg_t.
        * kexec.c (print_kexec_segments): Change address argument type
        from unsigned long to kernel_ureg_t.

        poll: change counter type from unsigned long to unsigned int.
        * poll.c (decode_poll_exiting): Change the type of printed and
        max_printed counters from unsigned long to unsigned int.

        xattr: change address argument type from unsigned long to kernel_ureg_t.
        * xattr.c (print_xattr_val, print_xattr_list): Change address
        argument type from unsigned long to kernel_ureg_t.

        uid: change address argument type from unsigned long to kernel_ureg_t.
        * uid.c (print_groups): Change address argument type
        from unsigned long to kernel_ureg_t.

        stat64: change address argument type from unsigned long to kernel_ureg_t
        * stat64.c (decode_struct_stat64): Change address argument type
        from unsigned long to kernel_ureg_t.

        stat: change address argument type from unsigned long to kernel_ureg_t.
        * stat.c (decode_struct_stat): Change address argument type
        from unsigned long to kernel_ureg_t.

        sigaltstack: change address argument type from unsigned long to kernel_ureg_t
        * sigaltstack.c (print_stack_t): Change address argument type
        from unsigned long to kernel_ureg_t.

        resource: change address argument type from unsigned long to kernel_ureg_t
        * resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change
        address argument type from unsigned long to kernel_ureg_t.

        printsiginfo: change address argument type from unsigned long to kernel_ureg_t
        * printsiginfo.c (print_siginfo_array): Change address argument type
        from unsigned long to kernel_ureg_t.

        poll: change tracee address type from unsigned long to kernel_ureg_t.
        * poll.c (decode_poll_entering, decode_poll_exiting): Change the type
        all tracee address variables from unsigned long to kernel_ureg_t.

        perf: change address argument type from unsigned long to kernel_ureg_t.
        * perf.c (fetch_perf_event_attr, print_perf_event_attr): Change
        address argument type from unsigned long to kernel_ureg_t.

        pathtrace: change tracee address type from unsigned long to kernel_ureg_t
        * pathtrace.c (upathmatch): Change address argument type
        from unsigned long to kernel_ureg_t.
        (pathtrace_match): Change the type of all tracee address variables
        from unsigned long to kernel_ureg_t.

        scsi: change address argument type from unsigned long to kernel_ureg_t.
        * scsi.c (print_sg_io_buffer): Change address argument type
        from unsigned long to kernel_ureg_t.

        dm: change address argument type from unsigned long to kernel_ureg_t.
        * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
        dm_decode_dm_name_list, dm_decode_dm_target_versions,
        dm_decode_dm_target_msg, dm_decode_string): Change address argument type
        from unsigned long to kernel_ureg_t.

        oldstat: change address argument type from unsigned long to kernel_ureg_t
        * oldstat.c (print_old_kernel_stat): Change address argument type
        from unsigned long to kernel_ureg_t.

        capability: change address argument type from unsigned long to kernel_ureg_t
        * capability.c (get_cap_header, print_cap_header, print_cap_data):
        Change address argument type from unsigned long to kernel_ureg_t.

        btrfs: change address argument type from unsigned long to kernel_ureg_t.
        * btrfs.c (btrfs_print_qgroup_inherit): Change address argument type
        from unsigned long to kernel_ureg_t.

        affinity: change address argument type from unsigned long to kernel_ureg_t
        * affinity.c (print_affinitylist): Change address argument type from
        unsigned long to kernel_ureg_t.

        aio: change address type from unsigned long to kernel_ureg_t.
        * aio.c (print_iocb): Remove casts to unsigned long.
        (print_iocbp,  SYS_FUNC(io_submit)): Change address type
        from unsigned long to kernel_ureg_t.

        mmsghdr: change address argument type from unsigned long to kernel_ureg_t
        * mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change
        address argument type from unsigned long to kernel_ureg_t.

        msghdr: change address argument type from unsigned long to kernel_ureg_t
        * msghdr.c (decode_msg_control): Change address argument type
        from unsigned long to kernel_ureg_t.

        fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t
        * fetch_struct_stat64.c (fetch_struct_stat64): Change address argument
        type from unsigned long to kernel_ureg_t.

        fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t
        * fetch_struct_stat.c (fetch_struct_stat): Change address argument
        type from unsigned long to kernel_ureg_t.

        fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t
        * fetch_struct_msghdr.c (fetch_struct_msghdr): Change
        address argument type from unsigned long to kernel_ureg_t.

        fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t
        * fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change
        address argument type from unsigned long to kernel_ureg_t.

        decode_netlink: change address argument type from unsigned long to kernel_ureg_t
        * defs.h (decode_netlink) Change address argument type
        from unsigned long to kernel_ureg_t.
        * netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload,
        decode_netlink): Likewise.

        print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t
        * defs.h (print_seccomp_filter, print_seccomp_fprog): Change
        address argument type from unsigned long to kernel_ureg_t.
        * seccomp.c (print_seccomp_filter, print_seccomp_fprog,
        decode_seccomp_set_mode_strict): Likewise.

        tprint_iov*: change address argument type from unsigned long to kernel_ureg_t
        * defs.h (tprint_iov, tprint_iov_upto): Change address argument type
        from unsigned long to kernel_ureg_t.
        * io.c (tprint_iov, tprint_iov_upto): Likewise.

        print_array: change tracee address type from unsigned long to kernel_ureg_t
        * defs.h (print_array): Change start_addr type from unsigned long
        to kernel_ureg_t.
        * util.c (print_array): Likewise.  Change the type of all tracee
        address variables from unsigned long to kernel_ureg_t.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long
        In all places where LONG_LONG is used the destination already has type
        unsigned long long, so it is quite natural to change LONG_LONG as well.

        * defs.h (LONG_LONG): Rename to ULONG_LONG, change return type
        from long long to unsigned long long.  All callers updated.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        mem: remove redundant casts.
        * mem.c (SYS_FUNC(old_mmap)): Remove redundant cast
        from kernel_ureg_t to unsigned long.
        [S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast
        from unsigned int to unsigned long.

        desc: remove redundant casts.
        * desc.c (umove_kulong_array_or_printaddr): Remove redundant cast
        from uint32_t to kernel_ulong_t.
        (SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t
        to unsigned long.

2016-12-22  Dmitry V. Levin  <ldv@altlinux.org>

        print_sigevent: remove redundant cast.
        * print_sigevent.c (print_sigevent): Remove redundant cast from
        struct_sigevent.sigev_value.sival_ptr to unsigned long as the former
        is not a pointer but an unsigned integer.

        tests: fix xattr.test for the case when listxattr returns a long list.
        * tests/xattr.c (DEFAULT_STRLEN): New macro.
        (main): Use it to limit the length passed to print_quoted_memory.
        Print ellipsis when the list returned by listxattr is too long.

2016-12-22  Gabriel Laskar  <gabriel@lse.epita.fr>

        tests: test for correct ellipsis with -s in xattr.
        * tests/xattr-strings.c: New file.
        * tests/xattr-strings.test: New test.
        * tests/.gitignore: Add xattr-string.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add xattr-string.test.

2016-12-22  Gabriel Laskar  <gabriel@lse.epita.fr>

        xattr: use printstr_ex instead of print_quoted_string.
        This fixes the display when using `-s` to limit the string size
        of the values displayed by {get,set}xattr.

        * xattr.c (print_xattr_val): Remove static buffer.  Use printstr_ex
        instead of print_quoted_string.

        Reported-by: Марк Коренберг <socketpair@gmail.com>

2016-12-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use scno.h in finit_module, kcmp, renameat2 tests.
        * tests/finit_module.c: Include "scno.h".
        * tests/kcmp.c: Likewise.
        * tests/renameat2.c: Likewise.

2016-12-21  Dmitry V. Levin  <ldv@altlinux.org>

        sock: cast pointers to kernel_ureg_t instead of unsigned long.
        * sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t
        instead of unsigned long.

        scsi: cast pointers to kernel_ureg_t instead of unsigned long.
        * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Cast sg_io_hdr.cmdp,
        sg_io_hdr.dxferp, and sg_io_hdr.sbp pointers to kernel_ureg_t instead
        of unsigned long.

        mtd: cast pointers to kernel_ureg_t instead of unsigned long.
        * mtd.c (decode_mtd_oob_buf): Cast mtd_oob_buf.ptr pointer
        to kernel_ureg_t instead of unsigned long.

        msghdr: cast pointers to kernel_ureg_t instead of unsigned long.
        * msghdr.c (print_struct_msghdr): Cast msghdr.msg_iov and
        msghdr.msg_control pointers to kernel_ureg_t instead of unsigned long.

        evdev: cast tcp->u_rval to kernel_ureg_t instead of unsigned long.
        * evdev.c (decode_bitset): Cast tcp->u_rval to kernel_ureg_t
        instead of unsigned long.

        evdev: cast pointers to kernel_ureg_t instead of unsigned long.
        * evdev.c (ff_effect_ioctl): Cast ff_periodic_effect.custom_data
        pointer to kernel_ureg_t instead of unsigned long.

        btrfs: cast pointers to kernel_ureg_t instead of unsigned long.
        * btrfs.c (btrfs_ioctl): Cast btrfs_ioctl_send_args.clone_sources
        and btrfs_ioctl_vol_args_v2.qgroup_inherit pointers to kernel_ureg_t
        instead of unsigned long.

        Rework ifdefery around print_user_desc.
        * configure.ac (AC_CHECK_TYPES): Check for struct user_desc
        in <asm/ldt.h>.
        * clone.c (print_tls_arg): New function.
        (SYS_FUNC(clone)): Use it.
        (print_user_desc): Move prototype ...
        * defs.h [HAVE_STRUCT_USER_DESC]: ... here.
        * ldt.c: Check for HAVE_STRUCT_USER_DESC instead of architectures.
        * linux/dummy.h: Likewise.

        Introduce DECL_IOCTL macro to declare *_ioctl functions.
        * defs.h (DECL_IOCTL): New macro.
        (dm_ioctl, file_ioctl, fs_x_ioctl, loop_ioctl, ptp_ioctl, scsi_ioctl,
        sock_ioctl, term_ioctl, ubi_ioctl, uffdio_ioctl): Rewrite prototypes
        using DECL_IOCTL.

        Introduce DECL_PRINT* macros to declare printnum_* and printpair_*
        * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR): New macros.
        (printnum_short, printnum_int, printnum_int64): Rewrite prototypes
        using DECL_PRINTNUM.
        (printpair_int, printpair_int64): Rewrite prototypes
        using DECL_PRINTPAIR.

        ioctl: use uintptr_t for casts between 32-bit integers and pointers.
        * ioctl.c (compare): Cast pointer to uintptr_t before assigning
        it to an integer.
        (ioctl_lookup): Cast integer to uintptr_t before passing it
        as a pointer.

        scsi: use umove_or_printaddr.
        * scsi.c (scsi_ioctl): Use umove_or_printaddr.

        Remove dumpiov wrapper.
        * defs.h (dumpiov): Remove.
        * syscall.c (dumpio): Use dumpiov_upto instead of dumpiov.

        travis: fix enabling of gcc -Werror builds.
        * travis-build.sh: Use DISTCHECK_CONFIGURE_FLAGS instead
        of CHECK_CONFIGURE_FLAGS and ENABLE_GCC_WERROR.
        [$CC == gcc]: Add --enable-gcc-Werror to DISTCHECK_CONFIGURE_FLAGS
        instead of ENABLE_GCC_WERROR.
        [$CHECK == coverage]: Add --enable-code-coverage
        to DISTCHECK_CONFIGURE_FLAGS instead of CHECK_CONFIGURE_FLAGS.

        printaddr: change argument type to kernel_ureg_t.
        * defs.h (printaddr): Change argument type from unsigned long
        to kernel_ureg_t.

        tests: check decoding of unreadable ip_mreq and ipv6_mreq structures.
        * tests/ip_mreq.c (main): Check short read.

        tests: rewrite ip_mreq.c using arrays and iterators.
        * tests/ip_mreq.c (main): Create arrays of setsockopt arguments to test.
        Iterate over these arrays invoking setsockopt and printing expected
        output.

        tests: rewrite ip_mreq.c using tail_alloc.
        * tests/ip_mreq.c (main): Allocate objects of struct ip_mreq
        and struct ipv6_mreq using tail_alloc instead of using stack.

        tests: rewrite ip_mreq.c without asserts.
        * tests/ip_mreq.c: Do not include <assert.h>.
        (main): Do not use assert.  Use sprintrc instead of errno2name.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        Remove NEED_PTRACE_PROTOTYPE_WORKAROUND.
        Remove the workaround for broken ptrace prototypes
        that seems to be unneeded for quite a long time.

        * defs.h [NEED_PTRACE_PROTOTYPE_WORKAROUND]: Remove.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use scno.h in tests of relatively new syscalls.
        * tests/add_key.c: Include "scno.h" after <asm/unistd.h>.
        * tests/copy_file_range.c: Likewise.
        * tests/execveat.c: Likewise.
        * tests/kexec_file_load.c: Likewise.
        * tests/membarrier.c: Likewise.
        * tests/memfd_create.c: Likewise.
        * tests/mlock2.c: Likewise.
        * tests/pkey_alloc.c: Likewise.
        * tests/pkey_free.c: Likewise.
        * tests/pkey_mprotect.c: Likewise.
        * tests/preadv2-pwritev2.c: Likewise.
        * tests/userfaultfd.c: Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: generate scno.h from syscallent.h for use by other tests.
        Provide scno.h with fallback definitions of all __NR_* constants known
        to strace for the personbality being tested.

        Some tests need just __NR_* constants without any kernel support.
        Such tests can include "scno.h" after <asm/unistd.h> to get definitions
        of these constants when system headers are too old.

        * tests/generate_scno.c: New file.
        * tests/.gitignore: Add generate_scno.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (scno.h): New rule.
        (BUILT_SOURCES, CLEANFILES): Add scno.h.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix potential errno clobbering in membarrier test.
        * tests/membarrier.c (main): Save errno.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        Do not use widen_to_ulong in kexec.c and process_vm.c.
        Automatic argument truncation makes use of this function redundant.

        * kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong.
        * process_vm.c (SYS_FUNC(process_vm_readv),
        SYS_FUNC(process_vm_writev)): Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        x32: implement automatic argument truncation for compat syscalls.
        x32 syscalls starting with number 512 are compat syscalls that operate
        on compat types.  Set COMPAT_SYSCALL_TYPES flag to these syscall entries
        and make get_syscall_args truncate arguments of syscalls that have this
        flag set, to avoid unpleasant alternative of adding multiple
        widen_to_ulong invocations to individual syscall parsers.

        preadv, pwritev, preadv2, and pwritev2 are exceptions: while these
        syscalls operate on compat types, the offset argument has a regular
        64-bit type, so the automatic argument truncation cannot be applied.

        * defs.h (COMPAT_SYSCALL_TYPES): New macro.
        * syscall.c (CST): New macro, defined to COMPAT_SYSCALL_TYPES.
        * linux/ia64/syscallent.h: Do not include "../i386/syscallent.h"
        unless [CST > 0].
        * linux/x32/syscallent.h [512..533, 536..545]: Add CST flag.
        * linux/x86_64/get_syscall_args.c (get_syscall_args): Truncate arguments
        of compat syscalls to 32-bit values.
        * tests/ksysent.c (CST): New macro, defined to 0.
        * tests/nsyscalls.c (CST): Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix decoding of mprotect and pkey_mprotect syscall arguments.
        As there are no compat versions of mprotect or pkey_mprotect syscalls
        in x32 personality, "addr", "len", and "prot" syscall arguments have
        kernel_ulong_t type and should be printed accordingly.

        * mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using
        getarg_klu, print them using printaddr_klu, PRI_klu format,
        and printflags64, correspondingly.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        Make tprint_iov function a static inline wrapper.
        * io.c (tprint_iov): Move ...
        * defs.h: ... here, add static inline keywords.

2016-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls.
        In x32 personality these syscalls use compat type for the 3rd argument,
        therefore it has to be truncated there.

        * io.c (do_preadv, do_pwritev): Truncate tcp->u_arg[2] using
        widen_to_ulong.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix preadv2-pwritev2 test on x32.
        On x32 p(read|write)v(|2) syscalls are implemented via compat, which
        truncates len argument to unsigned int.

        * tests/preadv2-pwritev2.c (main): Print vlen argument as unsigned long.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kexec: fix for the x32 ABI.
        There is no compat (and no 32-bit version, ever) for x32 ABI, so
        kernel's long type should be used for arguments' values.

        The only remaining thing is a pointer to cmdline string, but it is
        currently broken on x32 anyway.

        * kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument
        as kernel long, retrieve it via getarg_klu; use printflags64 for
        printing the flags argument, retrieve it via getarg_klu.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        Check for current_klongsize instead of current_personality where appropriate
        current_klongsize checks are more universal, therefore they are usually
        shorter and easier to comprehend.

        * desc.c (umove_kulong_array_or_printaddr): Check for current_klongsize
        instead of current_personality and current_wordsize.
        * io.c (print_lld_from_low_high_val): Likewise.
        * lseek.c (SYS_FUNC(lseek)): Likewise.
        * resource.c (decode_rlimit): Likewise.
        * syscall.c (is_negated_errno): Likewise.
        * util.c (getllval, getarg_klu): Likewise.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        Use kernel_ulong_t instead of unsigned long long where appropriate.
        * defs.h (printaddr_ull): Rename to printaddr_klu, change argument
        type from unsigned long long to kernel_ulong_t.  All callers updated.
        (getarg_ull): Rename to getarg_klu, change return value type
        from unsigned long long to kernel_ulong_t.  All callers updated.
        (PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
        * bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
        PRI_klu format.
        * desc.c (SYS_FUNC(pselect6)): Likewise.
        * fadvise.c (SYS_FUNC(fadvise64)): Likewise.
        * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
        * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
        * kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
        PRI_klx format.
        * keyctl.c (SYS_FUNC(keyctl)): Likewise.
        * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
        * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
        Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
        * util.c (printaddr_ull): Rename to printaddr_klu, change argument
        type from unsigned long long to kernel_ulong_t, print it using
        PRI_klx format.
        (getarg_ull): Rename to getarg_klu, change return value type
        from unsigned long long to kernel_ulong_t, print it using
        PRI_klx format.

        fcntl.c: print 64-bit fields of struct_kernel_flock64 using PRId64 format
        * fcntl.c (print_struct_flock64): Print l_start and l_len fields
        of struct_kernel_flock64 using PRId64 format.

        v4l2.c: print v4l2_ext_control.value64 using PRId64 format.
        * v4l2.c (print_v4l2_ext_control): Print value64 field
        of struct_v4l2_ext_control using PRId64 format.

        perf.c: print perf_event_attr.__reserved_1 using PRIx64 format.
        * perf.c (print_perf_event_attr): Print __reserved_1 field
        of perf_event_attr using PRIx64 format.

        btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format
        * block.c (btrfs_ioctl): Print size and transid fields
        of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format.

        block.c: change type of long long fileds to int64_t.
        * block.c (struct_blkpg_partition): Change type of start and length
        fields from long long to int64_t.
        (print_blkpg_req): Print them using PRId64 format.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Introduce current_klongsize in addition to current_wordsize.
        Subsequent commits are going to use current_klongsize
        as the tracee's size of kernel_ulong_t type.

        * defs.h (PERSONALITY0_KLONGSIZE): New macro.
        [X86_64] (PERSONALITY2_KLONGSIZE): Likewise.
        [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise.
        [SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise.
        [SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE ==
        PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise.
        [SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 ||
        PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize):
        New variable prototype.
        * syscall.c [!current_klongsize] (current_klongsize): New variable.
        [!current_klongsize] (personality_klongsize): New array.
        (set_personality) [!current_klongsize]: Update current_klongsize
        with the appropriate value from personality_klongsize.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        configure: define SIZEOF_KERNEL_LONG_T macro.
        Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and
        SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t
        types at the time of preprocessing.

        * configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        Remove getarg_ll.
        This function has never been used in the code, and in perspective
        the whole ext_arg thing will go away.

        * defs.h (getarg_ll): Remove prototype.
        * util.c (getarg_ll): Remove.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        struct tcb: make types of syscall arguments unsigned.
        This is the first step in the direction of revisiting current practice
        of indiscriminate use of signed types for syscall arguments and memory
        addresses.

        * kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long.
        * defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t.
        [HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long
        to unsigned long long.
        * desc.c (decode_select): Change type of syscall arguments from long
        to kernel_ureg_t.
        (SYS_FUNC(oldselect)): Change type of select_args from long
        to kernel_ureg_t.
        * io.c (print_lld_from_low_high_val): Remove no longer needed cast
        of syscall arguments to unsigned long.
        * lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long
        to long.
        * mem.c (print_mmap): Change type of syscall arguments from long
        to kernel_ureg_t.
        (SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg
        from long to kernel_ureg_t.
        (SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove
        no longer needed cast of syscall arguments to unsigned long.
        * pathtrace.c (pathtrace_match): Change type of args and select_args
        from long to kernel_ureg_t.
        * util.c (getarg_ull): Remove no longer needed casts of syscall
        arguments to unsigned types.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        s390: fix decoding of mmap2 syscall when arguments are not available.
        * mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr
        instead of umoven to fetch mmap arguments, fix return value when this
        fetch fails.

        Fix pathmatch of oldselect syscall on 64-bit architectures.
        * pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect
        arguments on 64-bit architectures.

        Cleanup oldselect.
        * desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros.

2016-12-18  Dmitry V. Levin  <ldv@altlinux.org>

        Change scno type from long to unsigned long.
        Use an unsigned type for syscall numbers as they are not intended
        for signed arithmetics.  Introduce kernel_scno_t as a typedef
        to unsigned long, that could be changed later to kernel_ulong_t.

        * kernel_types.h (kernel_scno_t): New type, typedef to unsigned long.
        * defs.h (struct tcb): Change type of scno field from long
        to kernel_scno_t.
        (syscall_name): Change argument type from long to kernel_scno_t.
        (scno_in_range, scno_is_valid): Change argument type from unsigned long
        to kernel_scno_t.
        * linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type
        from long to kernel_scno_t.
        * linux/alpha/set_scno.c (arch_set_scno): Likewise.
        * linux/arc/set_scno.c (arch_set_scno): Likewise.
        * linux/arm/set_scno.c (arch_set_scno): Likewise.
        * linux/avr32/set_scno.c (arch_set_scno): Likewise.
        * linux/bfin/set_scno.c (arch_set_scno): Likewise.
        * linux/crisv10/set_scno.c (arch_set_scno): Likewise.
        * linux/hppa/set_scno.c (arch_set_scno): Likewise.
        * linux/i386/set_scno.c (arch_set_scno): Likewise.
        * linux/ia64/set_scno.c (arch_set_scno): Likewise.
        * linux/m68k/set_scno.c (arch_set_scno): Likewise.
        * linux/metag/set_scno.c (arch_set_scno): Likewise.
        * linux/microblaze/set_scno.c (arch_set_scno): Likewise.
        * linux/mips/set_scno.c (arch_set_scno): Likewise.
        * linux/nios2/set_scno.c (arch_set_scno): Likewise.
        * linux/or1k/set_scno.c (arch_set_scno): Likewise.
        * linux/powerpc/set_scno.c (arch_set_scno): Likewise.
        * linux/riscv/set_scno.c (arch_set_scno): Likewise.
        * linux/s390/set_scno.c (arch_set_scno): Likewise.
        * linux/sh/set_scno.c (arch_set_scno): Likewise.
        * linux/sh64/set_scno.c (arch_set_scno): Likewise.
        * linux/sparc/set_scno.c (arch_set_scno): Likewise.
        * linux/tile/set_scno.c (arch_set_scno): Likewise.
        * linux/x86_64/set_scno.c (arch_set_scno): Likewise.
        * linux/xtensa/set_scno.c (arch_set_scno): Likewise.
        * linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type
        from long to kernel_scno_t.
        * linux/alpha/get_scno.c (arch_get_scno): Likewise.
        * linux/arm/get_scno.c (arch_get_scno): Likewise.
        * linux/sh/get_scno.c (arch_get_scno): Likewise.
        * linux/x86_64/get_scno.c (arch_get_scno): Likewise.
        * syscall.c (arch_set_scno): Likewise.
        (shuffle_scno): Change return type from long to kernel_scno_t.
        (syscall_name): Change argument type from long to kernel_scno_t.

2016-12-18  Dmitry V. Levin  <ldv@altlinux.org>

        Lowercase SCNO_IN_RANGE and SCNO_IS_VALID.
        * defs.h (SCNO_IN_RANGE): Rename to scno_in_range.  All callers updated.
        (SCNO_IS_VALID): Rename to scno_is_valid.  All callers updated.

        Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions.
        * defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline
        functions.

        count.c: use syserror instead of direct u_error access.
        * count.c (count_syscall): Use syserror instead of u_error.

        Replace "(unsigned long) -1L" with -1UL.
        * defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL.
        * io.c (print_iovec, tprint_iov): Likewise.
        * msghdr.c (SYS_FUNC(sendmsg)): Likewise.
        * syscall.c (dumpio): Likewise.
        * poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U.

        Add toplevel recursive check-valgrind rule.
        * Makefile.am (.PHONY): Add check-valgrind-local.
        (check-valgrind): New rule.
        * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it.

        m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK.
        * m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend
        on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am
        instead of check-TESTS.

        travis: do coverage using a dedicated build.
        * .travis.yml (after_success): Remove.
        (matrix): Create an entry for the regular x86_64 target.
        * travis-success.sh: Merge into ...
        * travis-build.sh: ... this file.  Disable optimization
        for coverage builds.
        * travis-install.sh: Rename COVERAGE=true to CHECK=coverage.

2016-12-17  Dmitry V. Levin  <ldv@altlinux.org>

        mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t.
        * kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) &&
        LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types.

2016-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: simplify definitions of bit mask constants in umovestr.
        * util.c (umovestr): Do not check for SIZEOF_LONG in definitions
        of bit mask constants.

        tests: check decoding of prctl operations without arguments.
        * tests/prctl-no-args.c: New file.
        * tests/prctl-no-args.test: New test.
        * tests/.gitignore: Add prctl-no-args.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-no-args.test.

        tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations.
        * tests/prctl-securebits.c: New file.
        * tests/prctl-securebits.test: New test.
        * tests/.gitignore: Add prctl-securebits.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-securebits.test.

        tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations.
        * tests/prctl-dumpable.c: New file.
        * tests/prctl-dumpable.test: New test.
        * tests/.gitignore: Add prctl-dumpable.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-dumpable.test.

        prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE
        * xlat/pr_dumpable.in: New file.
        * prctl.c: Include "xlat/pr_dumpable.h".
        (SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation
        and the second syscall argument of PR_SET_DUMPABLE operation
        as SUID_DUMP_* constants.

2016-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        Include "kernel_types.h" in defs.h and tests/tests.h.
        As kernel_ulong_t type is going to be used in the definition
        of struct tcb and in many function prototypes, make it readily
        available for every source file by including "kernel_types.h"
        in defs.h and tests/tests.h files.

        * defs.h: Include "kernel_types.h".
        * tests/tests.h: Likewise.
        * desc.c: Do not include "kernel_types.h".
        * dirent.c: Likewise.
        * keyctl.c: Likewise.
        * syscall.c: Likewise.
        * linux/asm_stat.h: Likewise.
        * tests/answer.c: Likewise.
        * tests/epoll_pwait.c: Likewise.
        * tests/fanotify_init.c: Likewise.
        * tests/fanotify_mark.c: Likewise.
        * tests/file_handle.c: Likewise.
        * tests/ftruncate.c: Likewise.
        * tests/getdents.c: Likewise.
        * tests/init_delete_module.h: Likewise.
        * tests/inotify.c: Likewise.
        * tests/inotify_init1.c: Likewise.
        * tests/ioprio.c: Likewise.
        * tests/ipc_msgbuf.c: Likewise.
        * tests/kcmp.c: Likewise.
        * tests/kexec_file_load.c: Likewise.
        * tests/kexec_load.c: Likewise.
        * tests/keyctl.c: Likewise.
        * tests/lookup_dcookie.c: Likewise.
        * tests/lseek.c: Likewise.
        * tests/mq_sendrecv.c: Likewise.
        * tests/nsyscalls.c: Likewise.
        * tests/pkey_alloc.c: Likewise.
        * tests/pkey_free.c: Likewise.
        * tests/pkey_mprotect.c: Likewise.
        * tests/prctl-pdeathsig.c: Likewise.
        * tests/prctl-tsc.c: Likewise.
        * tests/preadv2-pwritev2.c: Likewise.
        * tests/process_vm_readv_writev.c: Likewise.
        * tests/read-write.c: Likewise.
        * tests/setfsugid.c: Likewise.
        * tests/setns.c: Likewise.
        * tests/truncate.c: Likewise.
        * tests/unshare.c: Likewise.
        * tests/xgetrlimit.c: Likewise.

2016-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.15-1.
        * strace.spec.in: Likewise.

2016-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: provide fallback definitions for NETLINK_* constants.
        As new constants have been added gradually over kernel releases, define
        all constant values to make newer constants decoded properly when strace
        is built with older kernel headers.

        * xlat/netlink_protocols.in: Add default values for constants.
        * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove.
        * socketutils.c: Likewise.

2016-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: relax getaffinity return value check in tests/sched_xetaffinity.c
        * tests/sched_xetaffinity.c (errstr): New variable.
        (getaffinity, setaffinity): Initialize it.
        (main): Use it.  Allow getaffinity return value to be less than
        its cpusetsize argument.

        tests: fix threads-execve.test for large pids.
        * tests/threads-execve.c (main): Fix expected output for large pids.

2016-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.15 release.
        * NEWS: Update for 4.15 release.

        .mailmap: add addresses of Thomas De Schampheleire.
        * .mailmap: Add both addresses of Thomas De Schampheleire here to avoid
        duplications in CREDITS file.

        Sync strace.spec and debian/ with packages.
        * debian/control: Add Vcs-* metadata from 4.13-0.1.
        * debian/watch: Sync with 4.13-0.1.
        * strace.spec.in: Sync with 4.14.0.100.622a-1.

2016-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround a bug in GNU grep.
        Workaround a bug introduced in GNU grep 2.27, for details see
        https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html

        * tests/init.sh (grep_pid_status): New function.
        * tests/detach-running.test: Use it instead of grep to search
        in /proc/$pid/status.
        * tests/detach-sleeping.test: Likewise.
        * tests/detach-stopped.test: Likewise.

2016-12-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix typo in comment inside prctl-tsc.c.

2016-12-13  Sean Stangl  <sstangl@mozilla.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Fix libunwind segfault when -p is passed before -k.
        * strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after
        unwind_init for all allocated tcb structures if stack trace is enabled.
        * unwind.c (unwind_tcb_init): Skip if tcb is already initialized.

2016-12-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip fault injection tests on unsupported platforms.
        * tests/fault_injection.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/fault_injection-exit_group.test: Use it.
        * tests/fault_injection.test: Likewise.

        tests: introduce require_min_kernel_version_or_skip function.
        * tests/init.sh (kernel_version_code,
        require_min_kernel_version_or_skip): New functions.
        * tests/threads-execve.test: Use require_min_kernel_version_or_skip.

2016-12-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add descriptions to prctl-pdeathsig and prctl-tsc tests.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify prctl-pdeathsig.test and prctl-tsc.test.
        Rrobustify remaining prctl tests against unrelated prctl invocations

        * tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_*
        prctl calls.
        * tests/prctl-tsc.test: Likewise.

2016-12-07  Thomas De Schampheleire  <thomas.de_schampheleire@nokia.com>

        Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD.
        Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra
        warning flags through configure.ac.  The configure script will determine
        dynamically if CC supports these flags before adding them to WARN_CFLAGS.

        ioctlsort is compiled with CC_FOR_BUILD, rather than CC.  Nevertheless,
        the flags passed to this compilation also include WARN_CFLAGS (through
        AM_CFLAGS).  This is incorrect: in a cross-compilation use case, CC
        and CC_FOR_BUILD are not the same.  The former is the cross-compiler,
        the latter is the host compiler.  Both may be of different versions
        and support different warning flags.

        In particular, this posed a problem when cross-compiling with a host
        compiler gcc 4.1, which does not support all the new flags:

            /usr/bin/gcc -DHAVE_CONFIG_H   -I./linux/arm -I./linux/arm -I./linux
            -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body
            -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op
            -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration
            -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2
            -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o
            ioctlsort0.o ./ioctlsort.c
            cc1: error: unrecognized command line option "-Wempty-body"
            cc1: error: unrecognized command line option "-Wignored-qualifiers"
            cc1: error: unrecognized command line option "-Wlogical-op"
            cc1: error: unrecognized command line option "-Wmissing-parameter-type"
            cc1: error: unrecognized command line option "-Wold-style-declaration"
            cc1: error: unrecognized command line option "-Wtype-limits"
            make[2]: *** [ioctlsort0.o] Error 1

        * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New
        variables.
        (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS.
        (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS.
        (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS.
        * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect
        WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS,
        substitute WARN_CFLAGS_FOR_BUILD.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers.
        * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use
        _AC_LANG_PREFIX[]FLAGS in unquoted form.  Change gl_Warn to use gl_Flags
        instead of _AC_LANG_ABBREV.  Change notification message to mention
        the variable name of the compiler.
        (gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if
        gl_unknown_warnings_are_errors is set.
        (gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from
        AC_REQUIRE to a regular call.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler.
        Some of these variables cannot be redirected using traditional
        pushdef/popdef mechanism because of complex constructions like
        [ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros.
        Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue.

        * m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc,
        ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89,
        am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using
        pushdef/popdef.
        Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag,
        ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu,
        ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        Move all gl_WARN_ADD calls to a separate m4 macro.
        This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD
        change.

        * configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD.
        Move all gl_WARN_ADD calls ...
        * m4/st_warn_cflags.m4: ... here.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros.
        These new macros are going to be needed for the upcoming
        AX_PROG_CC_FOR_BUILD change.

        * m4/st_save_restore_var.m4: New file.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add valgrind support to "make check"
        * m4/ax_valgrind_check.m4: Import from the autoconf-archive package.
        * configure.ac: Invoke AX_VALGRIND_CHECK.
        * valgrind.supp: Move to tests/strace.supp.
        * Makefile.am (EXTRA_DIST): Remove valgrind.supp.
        * tests/Makefile.am: Add @VALGRIND_CHECK_RULES@.
        (VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables.
        (EXTRA_DIST): Add strace.supp.
        * tests/init.sh: Add valgrind command prefix to $STRACE when appropriate.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify threads-execve.test against race conditions.
        Due to probabilistic nature of the test, try it several times.

        * tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1.
        * tests/threads-execve.test: Iterate up to 10 times.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix expected output in strace-ttt.test.
        If strace -ttt is running too long, it might happen that time stamps
        before and after its invocation differ for more than a second.
        Adjust expected output to handle this rare but possible case.

        * tests/strace-ttt.test: Allow any time stamp between start and finish
        of strace invocation.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix expected output in strace-tt.test.
        If strace -tt is running too long, it might happen that time stamps
        before and after its invocation differ for more than a second.
        Adjust expected output to handle this rare but possible case.

        * tests/strace-tt.test: Allow any time stamp between start and finish
        of strace invocation.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify redirect.test against race conditions.
        Introduce a synchronization mechanism between the tracee and its peer.

        * tests/redirect.test: Change timeout file to $OUT.  Let the tracee
        remove $LOG, wait for $LOG removal in its peer.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify attach-f-p.test against race conditions.
        Introduce a synchronization mechanism between attach-f-p and strace.

        * tests/attach-f-p-cmd.c: New file.
        * tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd.
        * tests/attach-f-p.c: Include <sys/stat.h>.
        (main): Write to stdout instead of descriptor 3.  Wait for the peer
        writing to stdout.
        * tests/attach-f-p.test: Assume that ./attach-f-p-cmd works.
        Use $OUT for expected output.  Use attach-f-p-cmd for unlocking $OUT.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify attach-p-cmd.test against race conditions.
        Introduce a synchronization mechanism between attach-p-cmd-p
        and attach-p-cmd-cmd processes.

        * tests/attach-p-cmd-cmd.c: Include <errno.h> and <sys/stat.h>.
        (main): Wait for the lock directory creation by attach-p-cmd-p.
        * tests/attach-p-cmd-p.c: Include <errno.h> and <sys/stat.h>.
        (main): Create a lock directory and wait for its removal
        by attach-p-cmd-cmd.
        * tests/attach-p-cmd.test: Assume that test programs work.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Rewrite remaining qual_* parsers using bit sets.
        * defs.h (struct fault_opts): Replace forward declaration
        with a definition.
        (qualbits_t, qualify_read, qualify_write, qualify_signals): Remove.
        (qual_flags): New function prototype.
        (nsyscall_vec, sysent_vec, fault_vec): New variable prototypes.
        * qualify.c (abbrev_set, fault_set, raw_set, trace_set, verbose_set):
        New variables.
        (qualify_read, qualify_write, qualify_signals): Add static qualifier.
        (find_errno_by_name, lookup_class, parse_fault_expression,
        parse_fault_token, qual_flags, qualify, qualify_abbrev, qualify_fault,
        qualify_raw, qualify_syscall, qualify_syscall_class,
        qualify_syscall_name, qualify_syscall_number, qualify_syscall_tokens,
        qualify_trace, qualify_verbose, strip_prefix): New functions.
        * syscall.c (nsyscall_vec, nsysent_vec): Remove static qualifier.
        (MAX_NSYSCALLS1, MAX_NSYSCALLS2, MAX_NSYSCALLS, qual_vec, qual_flags,
        qual_fault, qual_syscall, qual_options, fault_opts, qualify_one,
        qualify_scno, lookup_class, qualify_syscall_class, qualify_syscall_name,
        qual_syscall_ex, qual_syscall, strip_prefix, find_errno_by_name,
        parse_fault_token, parse_fault_expression, qual_fault, qualify): Remove.
        (decode_socket_subcall, decode_ipc_subcall, decode_mips_subcall,
        get_scno): Update use of qual_flags.
        (inject_syscall_fault_entering): Update per-personality allocation
        of tcp->fault_vec.
        * tests/fault_injection-exit_group.test: Check parsing of inversed
        fault sets.
        * tests/fault_injection.test: Check parsing of -efault=none.
        * tests/options-syntax.test: Check parsing of invalid syscall numbers.

        Change qual_vec/qual_fault into static fixed size arrays.
        * defs.h (qual_vec, num_quals): Remove.
        (qual_flags): Move ...
        * syscall.c: ... here.
        (num_quals, num_faults, MIN_QUALS, reallocate_vec, reallocate_qual,
        reallocate_fault): Remove.
        (qual_vec, qual_fault): Change into static fixed size arrays.
        (qualify_one): Remove reallocate_qual and reallocate_fault calls.
        (qualify): Likewise.  Replace num_quals and num_faults with
        MAX_NSYSCALLS.

        Rewrite qual_signal using bit sets.
        * defs.h (signal_set): New variable prototypes.
        (qualify_signals): New function prototypes.
        (QUAL_SIGNAL): Change to a value greater than 0xff.
        (QUAL_FAULT): Change to a lower value.
        * qualify.c (signal_set): New variable.
        (sigstr_to_uint, qualify_signals): New functions.
        * syscall.c (qual_signal): Remove.
        (qual_options): Replace qual_signal with NULL.
        (qualify): Use qualify_signals.
        * strace.c (print_signalled, print_stopped): Use is_number_in_set
        with signal_set argument.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Rewrite qual_desc using bit sets.
        As a side effect, this also fixes support of negated sets
        of descriptors.

        * defs.h (struct number_set): New forward declaration.
        (read_set, write_set): New variable prototypes.
        (is_number_in_set, qualify_read, qualify_write): New function
        prototypes.
        (QUAL_READ, QUAL_WRITE): Change to values greater than 0xff.
        * qualify.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * syscall.c (qual_desc): Remove.
        (qual_options): Replace qual_desc with NULL.
        (qualify): Use qualify_read and qualify_write.
        (dumpio): Use is_number_in_set.
        * tests/options-syntax.test: Check invalid sets of descriptors.
        * tests/readv.test: Check dumping of negated sets of descriptors.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip redirect-fds.test when strace is wrapped with valgrind.
        valgrind is not as transparent as strace wrt standard descriptors,
        so if strace is wrapped with valgrind, the test would check valgrind
        transparency properties and fail imminently.

        * tests/redirect-fds.test: Skip the test when $STRACE shows a presence
        of valgrind.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        Add valgrind.supp.
        As valgrind is not quite happy about the way how get_cpuset_size uses
        sched_getaffinity, add a suppression file for this case.

        * valgrind.supp: New file.
        * Makefile.am (EXTRA_DIST): Add it.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        affinity: pass 0 as a pid to sched_getaffinity.
        * affinity.c (get_cpuset_size): Pass 0 instead of getpid()
        to sched_getaffinity.

        affinity: document the method of finding out the cpuset size.
        * affinity.c (get_cpuset_size): Add a comment about sched_getaffinity.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: make options-syntax.test tolerant of strace wrappers.
        Change the test to allow wrappers like STRACE="valgrind ./strace".

        * tests/options-syntax.test: Strip all words but last from $STRACE
        variable in all contexts where the name of strace executable is expected
        in its output.

2016-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        Do not allocate memory for line buffered output.
        libc is perfectly capable of allocating memory for its buffers,
        so let it do its job.

        * strace.c (init): Do not allocate memory for setvbuf invocation.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

        tests: use kernel_ulong_t as argument type in setfsuid/setfsgid tests.
        * setfsugid.c: Include "kernel_types.h".
        (main): Change type of entries of the "tests" array from long to
        kernel_ulong_t.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Elvira Khabirova  <lineprinter0@gmail.com>

        uid: print size as signed in setgroups/getgroups.
        As this is the type used in kernel.

        * uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter
        as "%d".
        * tests/getgroups.c: Update expected output.
        * tests/setgroups.c: Likewise.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Elvira Khabirova  <lineprinter0@gmail.com>

        uid: use printuid for printing UID/GID value.
        * uid.c (setfsuid, get_print_uid, print_gid): Use printuid.
        * tests/setfsugid.c (printuid): New function.
        (main): Use it to print UID/GID values.
        * tests/setgroups.c: Likewise.
        * tests/setugid.c (ugid2int): Remove.
        (printuid): New function.
        (main): Use it to print UID/GID values.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: additional check for PTRACE_SETSIGINFO ptrace command.
        * tests/ptrace.c (main): Add an additional PTRACE_SETSIGINFO check.

2016-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        syscall_name: clear __X32_SYSCALL_BIT from syscall number on x32.
        * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro.
        * syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]:
        Clear __X32_SYSCALL_BIT from scno on x32 personality.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print syscall names only for defined syscalls.
        The string literal "__NR_syscall_4294967295" is semantically incorrect
        as there is no such constant defined.

        * syscall.c (syscall_name): Return NULL if there is no syscall
        corresponding to the given number.
        * defs.h (syscall_name): Document this behaviour.
        * printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix
        only if there is a syscall corresponding to si_syscall number; print
        a plain syscall number otherwise.
        * tests/ptrace.c (main): Update expected output.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        affinity: print cpu set as an array.
        * affinity.c: Add comma between elements of cpu set.
        * tests/sched_xetaffinity.c (main): Update expected output.

        statfs: fix printing format of f_fsid field.
        * print_statfs.c: Print f_fsid as a structure containing field "val"
        which, in turn, is an array of two elements that used to be printed
        as members of f_fsid structure.
        * tests/statfs.expected: Update expected output.
        * tests/xstatfsx.c (print_statfs): Likewise.

        swap: always print priority value.
        * swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value
        of the prio variable in order to print it.
        * tests/swap.c (main): Update expected output.

2016-12-01  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: show pattern line number in match_grep.
        This makes debugging of failing test  a bit easier.

        * tests/init.sh (match_grep): Add the cnt variable, increment it on every
        pattern line read, print it as a prefix for non-matched pattern.

2016-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Elvira Khabirova  <lineprinter0@gmail.com>

        futex: make output of the val3 argument of the FUTEX_WAKE_OP command more structured
        It is a number which consists of several xlat values, not a structure.

        * futex.c (SYS_FUNC(futex)): Modify output of the val3 argument
        of the FUTEX_WAKE_OP futex syscall command.
        * tests/futex.c (main): Update expected output.

2016-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: additional checks for prctl-* tests.
        * tests/prctl-pdeathsig.c (main): Additional checks.
        * tests/prctl-tsc.c (main): Likewise.
        * tests/prctl-pdeathsig.test: Update value of -a argument.
        * tests/prctl-tsc.test: Likewise.

2016-11-30  JingPiao Chen  <chenjingpiao@foxmail.com>

        tests: add prctl-pdeathsig.test and prctl-tsc.test.
        * tests/prctl-pdeathsig.c: New file.
        * tests/prctl-tsc.c: Likewise.
        * tests/prctl-pdeathsig.test: New test.
        * tests/prctl-tsc.test: Likewise.
        * tests/.gitignore: Add prctl-pdeathsig and prctl-tsc.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-pdeathsig.test and prctl-tsc.test.

2016-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        syscall: Simplify strip_prefix.
        * syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp.

        util: fix integer overflow check in string_to_uint_ex.
        * util.c (string_to_uint_ex): Fix the check for integer overflow
        on systems where LONG_MAX == INT_MAX.

        Check dumping of io syscalls when descriptor arguments are sensibly large
        * tests/tests.h (pipe_maxfd): New prototype.
        * tests/pipe_maxfd.c: New file.
        * tests/print_maxfd.c: Likewise.
        * tests/.gitignore: Add print_maxfd.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (libtests_a_SOURCES): Add pipe_maxfd.c.
        * tests/readv.c (main): Use pipe_maxfd() instead of pipe(),
        fds[0] instead of 0, fds[1] instead of 1.
        * tests/readv.test: Use print_maxfd to specify dump descriptor numbers.

        dumpio: remove useless check.
        * syscall.c (dumpio): Remove SEN_printargs check.  Use tcp->s_ent->sen
        directly.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fix dumping of io syscalls when descriptor argument has unused bits set.
        * syscall.c (dumpio): Explicitly cast the first argument of syscall
        to "int", the same way as the kernel does.
        * tests/read-write.c: Include <asm/unistd.h> and "kernel_types.h".
        (k_read, k_write): New functions.
        (test_dump, main): Use them.

        x32: fix preadv2-pwritev2.test.
        * tests/preadv2-pwritev2.c: Include "kernel_types.h".
        (main): Use kernel_ulong_t instead of unsigned long as types
        of arguments of preadv2 and pwritev2 syscalls.

        x32: wire up preadv2 and pwritev2 syscalls.
        * linux/x32/syscallent.h [546]: Add preadv2 entry.
        [547]: Add pwritev2 entry.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
            Elvira Khabirova  <lineprinter0@gmail.com>

        signal: fix omission of field names in sigaction printers.
        * signal.c (decode_old_sigaction, decode_new_sigaction): Add printing
        of the field names.
        * tests/sigaction.awk: Update expected output.

2016-11-29  Elvira Khabirova  <lineprinter0@gmail.com>

        Make date output format conform to ISO 8601.
        * util.c (sprinttime): Make date output conform to ISO 8601.
        * tests/utime.c (print_tm): Update expected output.
        * tests/xstatx.c (print_time): Likewise.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite utime.test without relying on libc utime wrapper.
        * tests/utime.c (k_utime): New function, a thin wrapper around
        syscall(__NR_utime).
        (main): Use it instead of utime.
        * tests/utime.test: Update.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fix meaning of negated sets in fault expressions.
        Change the parser of fault expression to follow the POLA:
        -e fault=!SET
        means that all syscalls except those from SET are subject to fault
        injection;
        -e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2
        means that all syscalls except those from SET2 are subject to fault
        injection with error code ERRNO2, and all syscalls from SET2 that are
        not in SET1 are subject to fault injection with error code ERRNO1.

        * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name):
        Handle negated QUAL_FAULT case differently.
        * tests/fault_syntax.test: Add checks of negated sets.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        print_sigevent: fix field names of sigev_value structure.
        * print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr"
        to "sival_ptr".
        * tests/mq_sendrecv.c (main): Update expected output in accordance with
        fixed field names.
        * tests/timer_create.c (main): Likewise.

        tests: add more utime checks.
        * tests/utime.c: Include <unistd.h> and <asm/unistd.h>.
        (main): Add checks for invalid pointers.

        utime: fix omission of field names in utimbuf structure printing.
        * utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure,
        not as an array (use curly brackets instead of square ones).
        Add field names to the output.
        * tests/utime.c (main): Update expected output.

        mem: print mincore output as an array.
        * mem.c (SYS_FUNC(minore)): Print commas between elements.
        * tests/mincore.c (print_mincore): Update expected output in accordance
        with syscall decoder formatting change.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: provide information whether xlat value has been found.
        This is necessary for the upcoming change in the output format
        of the val3 argument of the FUTEX_WAKE_OP futex command.

        * defs.h (printxvals, printxval_searchn): Change return type to int.
        (printxval64, printxval, printxval_long): Likewise.  Forward the value
        returned by printxvals call.
        * util.c (printxvals, printxval_searchn): Change return type to int,
        return 1 if xlat value has been found, 0 otherwise.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: check dflt argument for NULL in printxvals.
        This is necessary for the upcoming change in the output format
        of the val3 argument of the FUTEX_WAKE_OP futex command.

        * util.c (printxvals): Do not print dflt if it is NULL.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

        capability: fix omission of capability structure field names.
        * capability.c (print_cap_header, print_cap_data): Add field names
        to the output.
        * tests/caps.awk: Update test output.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix "comparison between signed and unsigned" compilation warnings
        * tests/readv.c (main): Cast r_len to int.
        * tests/preadv2-pwritev2.c (dumpio): Likewise.

        aarch64, arm, sparc: add comments on fault injection support in kernel.
        * linux/aarch64/set_scno.c: Note the kernel commit that introduced
        NT_ARM_SYSTEM_CALL support.
        * linux/arm/set_scno.c: Note the kernel commit that introduced
        PTRACE_SET_SYSCALL support.
        * linux/sparc/set_scno.c: Note the kernel commit that introduced
        reloading from the syscall number register.

        tests: check -C option.
        * tests/strace-C.expected: New file.
        * tests/strace-C.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add strace-C.test.
        (EXTRA_DIST): Add strace-C.expected.

        tests: check basic options syntax.
        * tests/options-syntax.test: New file.
        * tests/Makefile.am (MISC_TESTS): Add it.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        Fix -r option syntax.
        While -r option implies -t, it should not literally have the effect
        of -t option, e.g. -rr should not increment tflag twice.

        * strace.c (init): In the getopt loop, do not increment tflag for each
        occurrence of -r option.  After the getopt loop, if rflag is set, set
        tflag to 1.  Issue a warning that -tt has no effect with -r.

2016-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Print timeval pair as an array of timeval entries.
        * print_timeval.c (print_timeval_item): New function.
        (print_timeval_pair): Use it as a print_function in print_array call.
        * tests/futimesat.c (main): Update to test new behaviour.
        * tests/utimes.c (main): Likewise.

        tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests
        * tests/futimesat.c: Print tv_sec and tv_usec fields as signed types.
        * tests/utimes.c: Likewise.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: print struct timeval32 consistently.
        * defs.h [ALPHA] (timeval32_t): New type.
        [ALPHA] (print_timeval32_t): New prototype.
        * print_timeval.c [ALPHA] (timeval32_t): Remove.
        [ALPHA] (print_timeval32_t): Remove static keyword.
        * printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead
        of local definition of struct timeval32.  Use print_timeval32_t.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        Print struct timeval consistently.
        Use print_struct_timeval interface to print struct timeval.

        * print_timeval.c (print_struct_timeval): New mpers printer.
        * print_timex.c (print_timex): Use it.
        * printrusage.c (printrusage): Likewise.
        * v4l2.c (print_v4l2_buffer): Likewise.
        * tests/getrusage.c (main): Print tv_sec and tv_usec fields as signed.
        * tests/waitid.c (sprint_rusage): Likewise.

        Suggested-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        Split print_time.c.
        After commit v4.14-136-g151d1d1 that removed the last object common
        for timespec and timeval parsers there is no need to keep them all
        in a single file.

        * print_timespec.c: New file.
        * print_timeval.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * print_time.c: Move all timespec related code to print_timespec.c.
        Move all timeval related code to print_timeval.c.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of threads when a non-leader thread invokes execve
        * tests/threads-execve.c: New file.
        * tests/threads-execve.test: New test.
        * tests/.gitignore: Add threads-execve.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (threads_execve_LDADD): New variable.
        (MISC_TESTS): Add threads-execve.test.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of fault injected exit_group syscall.
        * tests/answer.c: New file.
        * tests/fault_injection-exit_group.expected: Likewise.
        * tests/fault_injection-exit_group.test: New test.
        * tests/.gitignore: Add answer.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fault_injection-exit_group.test.
        (EXTRA_DIST): Add fault_injection-exit_group.expected.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        Set PTRACE_O_TRACEEXIT option and handle PTRACE_EVENT_EXIT events.
        Do not assume that some syscalls do not generate syscall-exit-stops.
        When syscalls fail for any reason they may generate syscall-exit-stops.

        The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT
        and print the end of unfinished exiting syscall properly.

        * exit.c: Remove.
        * Makefile.am (strace_SOURCES): Remove exit.c.
        * linux/dummy.h (sys_exit): Alias to printargs_d.
        * strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit.
        (print_event_exit): New function.
        (trace): Use it in case of PTRACE_EVENT_EXIT.
        * syscall.c (trace_syscall_entering): Remove special handling
        of SEN_exit.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        Change printargs to return RVAL_DECODED.
        As printargs is invoked as a generic syscall decoder only and
        it is not supposed to print anything on exiting, change printargs
        to return RVAL_DECODED so it would not be called on exiting at all.

        * util.c (printargs): Print args unconditionally, return RVAL_DECODED.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance error diagnostics of exit/exit_group decoder.
        * exit.c (SYS_FUNC(exit)): Print the name of syscall that has returned.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Restrain from fault injection while the trace executes strace code.
        There is little use in injections of faults into syscalls made by strace.

        * syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from
        tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Move two global flags to tracee scope.
        A simultaneous use of -p option and tracing of a command available
        since commit v4.11-183-gfa8c286 introduces a race condition because
        the flags whether the first exec has happened are global.

        Fix the race by moving hide_log_until_execve and hide_log_until_execve
        global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
        in struct tcb.flags, correspondingly.

        * defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log):
        New macros.
        (hide_log_until_execve): Remove prototype.
        * strace.c (skip_one_b_execve, hide_log_until_execve): Remove.
        (startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
        in the allocated tcb structure.
        (init): Remove initialization of hide_log_until_execve and
        skip_one_b_execve.
        (print_stopped): Use hide_log() instead of hide_log_until_execve.
        (trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead
        of skip_one_b_execve.
        * syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of
        hide_log_until_execve.
        (trace_syscall_entering, trace_syscall_exiting): Check hide_log()
        instead of hide_log_until_execve.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Treat execveat as an execve family syscall.
        * syscall.c (trace_syscall_entering): Clear hide_log_until_execve flag
        also when SEN_execveat is encountered.

2016-11-25  Dmitry V. Levin  <ldv@altlinux.org>

        Change parser of fault expressions to conform the documentation.
        Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work
        as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM.

        * syscall.c (parse_fault_expression): Remove const qualifier from
        "name" and "token: variables, as well as from the return value.
        (qual_fault): Remove const qualifier from "name" variables.
        Split "name" into comma delimited tokens and pass each token
        to individual qual_syscall_ex call.
        (qualify): For QUAL_FAULT options, pass the whole option value
        to their qualify methods without prior splitting into comma
        delimited tokens.
        * tests/fault_injection.test: Check it.
        * tests/fault_syntax.test: Check empty syscall sets.

2016-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify parse_fault_expression.
        * syscall.c (parse_fault_expression): Rewrite iterator over strtok_r
        in a more concise way.

2016-11-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Fix omission of field names in printers of timeval structure.
        * print_time.c (time_fmt): Remove.
        (timeval_fmt): New constant.
        (print_timeval_t, sprint_timeval, print_timeval32_t, sprint_timeval32):
        Use it instead of time_fmt.
        * print_timex.c (print_timex): Print field names of the time field.
        * printrusage.c (printrusage, printrusage32): Print field names
        of ru_utime and ru_stime fields.
        * tests/adjtimex.c (main): Add field names to expected output.
        * tests/clock_nanosleep.c (main): Likewise.
        * tests/futimesat.c (main): Likewise.
        * tests/getrusage.c (main): Likewise.
        * tests/nanosleep.c (main): Likewise.
        * tests/oldselect.expected: Likewise.
        * tests/utimes.c (main): Likewise.
        * tests/wait4.c (sprint_rusage): Likewise.
        * tests/waitid.c (sprint_rusage): Likewise.
        * tests/xetitimer.c (main): Likewise.
        * tests/xettimeofday.c (main): Likewise.
        * tests/xselect.c (main): Likewise.

        Fix omission of field names in printers of timespec structure.
        * print_time.c (timespec_fmt): New constant.
        (print_timespec_t, sprint_timespec): Use it instead of time_fmt.
        * tests/aio.c: Add field names to expected output.
        * tests/clock_nanosleep.c (main): Likewise.
        * tests/clock_xettime.c (main): Likewise.
        * tests/futex.c (main): Likewise.
        * tests/mq_sendrecv.c (do_send, do_recv): Likewise.
        * tests/nanosleep.c (main): Likewise.
        * tests/ppoll-v.expected: Likewise.
        * tests/ppoll.expected: Likewise.
        * tests/pselect6.c (main): Likewise.
        * tests/recvmmsg-timeout.c (main): Likewise.
        * tests/restart_syscall.c (main): Likewise.
        * tests/rt_sigtimedwait.c (iterate, main): Likewise.
        * tests/sched_rr_get_interval.c (main): Likewise.
        * tests/semop.c (main): Likewise.
        * tests/strace-T.expected: Likewise.
        * tests/timer_xettime.c (main): Likewise.
        * tests/timerfd_xettime.c (main): Likewise.
        * tests/utimensat.c (print_ts): Likewise.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify prctl-name.test against unrelated prctl invocations.
        * tests/prctl-name.test: Filter out unrelated PR_GET_* prctl calls.

2016-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup prctl-name.c.
        * tests/prctl-name.c (main): Remove "len" variable, rename "len1"
        to "len".  Remove "name1" variable, use "name" instead.

        Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h.
        * linux/32/ioctls_inc_align32.h: Regenerate.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * linux/64/ioctls_inc.h: Likewise.
        * linux/arm/ioctls_arch0.h: Likewise.
        * linux/i386/ioctls_arch0.h: Likewise.
        * linux/powerpc/ioctls_arch0.h: Likewise.
        * linux/s390/ioctls_arch0.h: Likewise.
        * linux/s390x/ioctls_arch0.h: Likewise.
        * linux/x32/ioctls_inc0.h: Likewise.
        * linux/x86_64/ioctls_arch0.h: Likewise.

        maint: add more workarounds for alpha and powerpc.
        * maint/ioctls_sym.sh: Skip asm/core_*.h.  Filter out from
        asm-generic/ioctls.h those macros that are defined using unavailable
        struct termios2 on alpha and powerpc.

2016-11-22  Andreas Schwab  <schwab@linux-m68k.org>

        Add ioctl definitions for 16-bit alignment.
        * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align16.h.
        * linux/32/ioctls_inc_align16.h: New file.
        * linux/32/ioctls_inc.h [M68K]: Include it.

2016-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        maint: move KVM_* constants from ioctls_inc.h to ioctls_arch.h.
        * maint/ioctls_gen.sh: Place constants defined in linux/kvm.h
        into ioctls_arch.h instead of ioctls_inc.h.

2016-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        maint: harmonize use of ioctls_sym.sh.
        * maint/ioctls_gen.sh: Consistently specify INCLUDES for all
        ioctls_sym.sh invocations.  Use $mydir to specify ioctls_sym.sh
        location.

        maint: rework workarounds for linux/kvm.h.
        * maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds.
        Skip linux/kvm.h on those architectures that have no asm/kvm.h file.
        Introduce post-process workarounds, add post-process workarounds
        for linux/kvm.h.

2016-11-20  Elvira Khabirova  <lineprinter0@gmail.com>

        Restructure strace.1.
        * strace.1 (OPTIONS): Add subsections.
        (PROBLEMS): Rename to REPORTING BUGS.
        (SEE ALSO): Move to the bottom.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options.
        * xlat/pr_fp_mode.in: New file.
        * prctl.c: Include "xlat/pr_fp_mode.h".
        (SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE
        options.

        prctl: add braces for conditional blocks with else/else-if blocks having braces

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: cast arg2 to int in PR_SET_PTRACER handler.
        Kernel code does this when compares it with -1 (apart from comparing it with
        PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c.

        * prctl.c (SYS_FUNC(prctl)) <PR_SET_PTRACER>: Cast arg2 to int before
        comparing it with -1.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        prctl: use getarg_ull for option value retrieval.
        The prctl syscall does not use compat on x32/n32, so argument types
        are in fact kernel_ulong_t.

        * prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead
        of "%#lx".
        (SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3,
        arg4, arg5 variables of type unsigned long long.  Use them in printing
        routines.
        (SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr
        variable of type unsigned long long.  Print it as "%#llx" instead of
        "%#lx".

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        block: add some definitions from <linux/blkpg.h>
        This is done in order to fix build error on old distributions where
        struct blkpg_ioctl_arg declaration is broken:

        In file included from block.c:35:
        /usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token
        block.c: In function 'print_blkpg_req':
        block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data'

        (from SLE10)

        * block.c: Include <linux/ioctl.h> instead of <linux/blkpg.h>.
        (BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros.
        (struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions,
        copied from blkpg_ioctl_arg and blkpg_partition structures defined
        in <linux/blkpg.h>.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add values to new ARCH_* constants.
        Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE
        and they would never be defined in user space.

        * xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants.

2016-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        prctl: include <linux/prctl.h> instead of <sys/prctl.h>
        There are no users of prctl function in prctl.c, and all the rest
        is provided by <linux/prctl.h> anyway.

        * prctl.c: Include <linux/prctl.h> instead of <sys/prctl.h>.

2016-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of prctl PR_GET_NAME/PR_SET_NAME operations.
        * tests/prctl-name.c: New file.
        * tests/prctl-name.test: New test.
        * tests/.gitignore: Add prctl-name.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-name.test.

        prctl: fix printing of PR_SET_NAME's argument.
        * prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED
        instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME
        operations.

        printstr_ex: fix handling of last byte when QUOTE_0_TERMINATED bit set.
        * util.c (printstr_ex): Simplify handling of size == 0 case.
        Do not artificially decrement size when QUOTE_0_TERMINATED bit is set.
        Ensure that str[size] byte is non-zero if it hasn't been fetched.

2016-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        printstr_ex: handle QUOTE_0_TERMINATED bit consistently.
        When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints
        the fetched string as a NUL-terminated.
        After this change, the string is being fetched as a NUL-terminated, too.

        * util.c (printstr_ex): Use umovestr instead of umoven
        if QUOTE_0_TERMINATED bit is set.

2016-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup fetch part of printstr_ex.
        * util.c (printstr_ex): Initialize "style" early, unify error handling.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        Update prctl ARCH_* constants.
        * xlat/archvals.in: Add ARCH_MAP_VDSO_X32, ARCH_MAP_VDSO_32, and
        ARCH_MAP_VDSO_64 introduced by linux kernel commit v4.9-rc1~155^2~6.

        Update V4L2_* constants.
        * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced
        by linux kernel commit v4.9-rc4~7^2~422.
        * xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced
        by linux kernel commit v4.9-rc4~7^2~422.

        Update fs *_MAGIC constants.
        * xlat/fsmagic.in: Add DAXFS_MAGIC introduced by linux kernel commit
        v4.9-rc1~45^2^2~5.

        Update MS_* constants.
        * xlat/mount_flags.in: Add MS_NOREMOTELOCK introduced
        by linux kernel commit v4.9-rc1~57^2~1^2~7.

        Update FALLOC_* constants.
        * xlat/falloc_flags.in: Add FALLOC_FL_UNSHARE_RANGE introduced
        by linux kernel commit v4.9-rc1~31^2~69.

        Update BTRFS_* constants.
        * xlat/btrfs_features_compat_ro.in: Add
        BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID introduced
        by linux kernel commit v4.9-rc1~7^2^2~4.

        Update BPF_* constants.
        * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_PERF_EVENT introduced
        by linux kernel commit v4.9-rc1~127^2~302^2~4.

2016-11-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

        make-dist: use HEAD for making distribution package.
        * make-dist: Use HEAD commit instead of master branch by default.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix btrfs build error on some old systems.
        Fix the following build error on SLE 11 SP4:

        btrfs.c: In function 'btrfs_test_dev_replace_ioctl':
        btrfs.c:1570: error: unknown field 'start' specified in initializer

        * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization
        of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the
        designated initializer.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of ERESTARTSYS error code.
        * tests/erestartsys.c: New file.
        * tests/erestartsys.test: New test.
        * tests/.gitignore: Add erestartsys.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add erestartsys.test.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix signame usage in qual_signal.
        Do not assume that the string returned by signame starts with "SIG"
        prefix, this is not always the case.

        * syscall.c (qual_signal): Skip signame return value
        when it does not have "SIG" prefix.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check -e signal=set syntax.
        * tests/qual_signal.c: New file.
        * tests/qual_signal.test: New test.
        * tests/.gitignore: Add qual_signal.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add qual_signal.test.

2016-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Make -e fault= expressions cumulative.
        Change the way how subsequent -e fault= expressions are interpreted
        to implement a cumulative behavior.  For example,
        -e fault=file:when=3+ -e fault=chdir
        now specifies that all chdir syscalls and 3+ file related syscalls
        except chdir are subject for fault injection.

        * syscall.c (qualify): Do not reset qual_vec for QUAL_FAULT.
        * tests/fault_injection.test: Check it.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check syscall fault injection.
        * tests/fault_injection.c: New file.
        * tests/fault_injection.test: New test.
        * tests/fault_syntax.test: Likewise.
        * tests/.gitignore: Add fault_injection.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add fault_injection.test and fault_syntax.test.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        Implement syscall fault injection.
        Introduce new -e fault=EXPR syntax that can be used to specify a subset
        of syscalls that are subject of syscall fault injection, an error code
        that has to be injected, and a frequency of injection.

        The expression specifying syscall fault injection has the following
        format: SET[:error=ERRNO][:when=FIRST[+[STEP]]]
        where only SET is a required part and all the rest is optional.

        The method used to implement syscall fault injection is the following:
        on entering syscall the syscall number is substituted by an invalid
        syscall number -1, and on exiting syscall the error code returned by
        the kernel is substituted with the error code specified in the fault
        expression.

        This implementaion is based on the prototype developed
        by Nahim El Atmani as a part of his GSoC 2016 strace project.

        * defs.h (struct fault_opts): New forward declaration.
        (struct tcb): Add fault_vec field.
        (TCB_FAULT_INJ, QUAL_FAULT): New macros.
        * strace.1: Document -e fault expression syntax.
        * strace.c (usage): Mention -e fault expression.
        (droptcb): Deallocate fault_vec member.
        * syscall.c (qual_fault, arch_set_scno, arch_set_error): New prototypes.
        (qual_options): Add "fault" option.
        (struct fault_opts): New structure.
        (num_faults): New variable.
        (fault_vec): New array.
        (syscall_fault_injected, tcb_fault_opts, reallocate_fault,
        find_errno_by_name, qual_syscall_ex, strip_prefix, parse_fault_token,
        parse_fault_expression, qual_fault, inject_syscall_fault_entering,
        update_syscall_fault_exiting): New functions.
        (qual_syscall): Use qual_syscall_ex.
        (qualify_one): Add argument: a pointer to struct fault_opts, all callers
        changed.  Copy struct fault_opts from the pointer to fault_vec.
        Use reallocate_fault.
        (qualify_scno, qualify_syscall_class, qualify_syscall_name): Add
        argument: a pointer to struct fault_opts.
        (qualify): Use reallocate_fault.  Do not check "all" class for
        QUAL_FAULT qualifier.
        (lookup_class): Check for "all" class.
        (trace_syscall_entering): Use inject_syscall_fault_entering.
        (trace_syscall_exiting): Use update_syscall_fault_exiting.  Clear
        TCB_FAULT_INJ flag along with TCB_INSYSCALL.  Print " (INJECTED)" suffix
        when the syscall has been injected successfully.
        [ARCH_REGS_FOR_GETREGSET && !HAVE_GETREGS_OLD]
        (ptrace_setregset): New function.
        (ptrace_setregset_or_setregs): Define to ptrace_setregset.
        [ARCH_REGS_FOR_GETREGS && !HAVE_GETREGS_OLD]
        (ptrace_setregs): New function.
        (ptrace_setregset_or_setregs): Define to ptrace_setregs.
        [ptrace_setregset_or_setregs] (set_regs): New function.
        Include "set_scno.c" and "set_error.c"
        * NEWS: Mention this enhancement.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        Implement arch specific methods of changing syscall number and error code
        This introduces arch_set_error and arch_set_scno functions for each
        supported architecture, needed to implement syscall fault injection.

        * linux/aarch64/set_error.c: New file.
        * linux/aarch64/set_scno.c: Likewise.
        * linux/alpha/set_error.c: Likewise.
        * linux/alpha/set_scno.c: Likewise.
        * linux/arc/set_error.c: Likewise.
        * linux/arc/set_scno.c: Likewise.
        * linux/arm/set_error.c: Likewise.
        * linux/arm/set_scno.c: Likewise.
        * linux/avr32/set_error.c: Likewise.
        * linux/avr32/set_scno.c: Likewise.
        * linux/bfin/set_error.c: Likewise.
        * linux/bfin/set_scno.c: Likewise.
        * linux/crisv10/set_error.c: Likewise.
        * linux/crisv10/set_scno.c: Likewise.
        * linux/crisv32/set_error.c: Likewise.
        * linux/crisv32/set_scno.c: Likewise.
        * linux/hppa/set_error.c: Likewise.
        * linux/hppa/set_scno.c: Likewise.
        * linux/i386/set_error.c: Likewise.
        * linux/i386/set_scno.c: Likewise.
        * linux/ia64/set_error.c: Likewise.
        * linux/ia64/set_scno.c: Likewise.
        * linux/m68k/set_error.c: Likewise.
        * linux/m68k/set_scno.c: Likewise.
        * linux/metag/set_error.c: Likewise.
        * linux/metag/set_scno.c: Likewise.
        * linux/microblaze/set_error.c: Likewise.
        * linux/microblaze/set_scno.c: Likewise.
        * linux/mips/set_error.c: Likewise.
        * linux/mips/set_scno.c: Likewise.
        * linux/nios2/set_error.c: Likewise.
        * linux/nios2/set_scno.c: Likewise.
        * linux/or1k/set_error.c: Likewise.
        * linux/or1k/set_scno.c: Likewise.
        * linux/powerpc/set_error.c: Likewise.
        * linux/powerpc/set_scno.c: Likewise.
        * linux/powerpc64/set_error.c: Likewise.
        * linux/powerpc64/set_scno.c: Likewise.
        * linux/riscv/set_error.c: Likewise.
        * linux/riscv/set_scno.c: Likewise.
        * linux/s390/set_error.c: Likewise.
        * linux/s390/set_scno.c: Likewise.
        * linux/s390x/set_error.c: Likewise.
        * linux/s390x/set_scno.c: Likewise.
        * linux/sh/set_error.c: Likewise.
        * linux/sh/set_scno.c: Likewise.
        * linux/sh64/set_error.c: Likewise.
        * linux/sh64/set_scno.c: Likewise.
        * linux/sparc/set_error.c: Likewise.
        * linux/sparc/set_scno.c: Likewise.
        * linux/sparc64/set_error.c: Likewise.
        * linux/sparc64/set_scno.c: Likewise.
        * linux/tile/set_error.c: Likewise.
        * linux/tile/set_scno.c: Likewise.
        * linux/x32/set_error.c: Likewise.
        * linux/x32/set_scno.c: Likewise.
        * linux/x86_64/set_error.c: Likewise.
        * linux/x86_64/set_scno.c: Likewise.
        * linux/xtensa/set_error.c: Likewise.
        * linux/xtensa/set_scno.c: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        cris: add syscall tables.
        The incomplete CRIS support introduced by commit v4.5.18-77-gea0e6e8
        should not have been merged because it lacks essential parts, e.g.
        syscall tables.

        This change adds missing syscall tables for crisv10 and crisv32.

        * linux/crisv10/syscallent.h: New file.
        * linux/crisv32/syscallent.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce string_to_uint_ex and string_to_uint_upto functions.
        * defs.h (string_to_uint_ex): New prototype.
        (string_to_uint_upto): New function, a thin wrapper around
        string_to_uint_ex.
        * util.c (string_to_uint_ex): New function.
        (string_to_uint): Change into a thin wrapper around string_to_uint_upto.
        * strace.c (init): Use string_to_uint_upto.
        * syscall.c (qualify_scno, qual_signal, qual_desc): Use
        string_to_uint_upto instead of string_to_uint.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        Split qual_syscall into separate functions.
        Split qual_syscall into qualify_scno, qualify_syscall_class,
        and qualify_syscall_name.
        This might be needed later to implement syscall fault injection.

        * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name):
        New functions.
        (qual_syscall): Use them.

2016-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        xtensa: wire up new syscalls.
        * linux/xtensa/syscallent.h [342..347]: New entries.

2016-11-14  Dmitry V. Levin  <ldv@altlinux.org>

        arc: wire up new syscalls.
        * linux/arc/syscallent.h [247, 248]: New entries.

2016-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix potential compilation warning in ioctl_block.c.
        ioctl_block.c:48: warning: 'init_magic' defined but not used

        * tests/ioctl_block.c (init_magic): Define only for
        [BLKTRACESETUP && HAVE_STRUCT_BLK_USER_TRACE_SETUP].

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for pkey_mprotect, pkey_alloc, pkey_free syscalls.
        * linux/32/syscallent.h: Add syscall entries for pkey_* calls.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * mem.c (do_mprotect): New function, common handler for mprotect and
        pkey_mprotect.
        (SYS_FUNC(mprotect)): Convert to wrapper around do_mprotect.
        (SYS_FUNC(pkey_mprotect)): New function.
        * xlat/pkey_access.in: New file.
        * pkeys.c: New file containing implementation of pkey_alloc and
        pkey_free.
        * Makefile.am: Add it.
        * NEWS: Mention this enhancement.
        * tests/.gitignore: Add pkey_alloc, pkey_free, and pkey_mprotect.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add pkey_alloc.test, pkey_free.test, and
        pkey_mprotect.test.
        * tests/pkey_alloc.c: New file.
        * tests/pkey_free.c: Likewise.
        * tests/pkey_mprotect.c: Likewise.
        * tests/pkey_alloc.test: New test.
        * tests/pkey_free.test: Likewise.
        * tests/pkey_mprotect.test: Likewise.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix "constant is too large" compilation warnings.
        alarm.c: In function 'main':
        alarm.c:41: warning: integer constant is too large for 'long' type
        aio.c: In function 'main':
        aio.c:162: warning: integer constant is too large for 'long' type
        btrfs.c: In function 'btrfs_test_sync_ioctls':
        btrfs.c:202: warning: integer constant is too large for 'long' type
        btrfs.c: In function 'btrfs_test_subvol_ioctls':
        btrfs.c:289: warning: integer constant is too large for 'long' type
        btrfs.c:290: warning: integer constant is too large for 'long' type
        dup2.c: In function 'main':
        dup2.c:12: warning: integer constant is too large for 'long' type
        dup2.c:13: warning: integer constant is too large for 'long' type
        dup3.c: In function 'main':
        dup3.c:13: warning: integer constant is too large for 'long' type
        dup3.c:14: warning: integer constant is too large for 'long' type
        epoll_create.c: In function 'main':
        epoll_create.c:12: warning: integer constant is too large for 'long' type
        epoll_ctl.c: In function 'invoke_syscall':
        epoll_ctl.c:14: warning: integer constant is too large for 'long' type
        faccessat.c: In function 'main':
        faccessat.c:13: warning: integer constant is too large for 'long' type
        fchdir.c: In function 'main':
        fchdir.c:12: warning: integer constant is too large for 'long' type
        struct_flock.c: In function 'invoke_test_syscall':
        struct_flock.c:48: warning: integer constant is too large for 'long' type
        struct_flock.c: In function 'test_flock_einval':
        struct_flock.c:58: warning: integer constant is too large for 'long' type
        struct_flock.c:59: warning: integer constant is too large for 'long' type
        fcntl64.c: In function 'test_flock64_einval':
        fcntl64.c:44: warning: integer constant is too large for 'long' type
        fcntl64.c:45: warning: integer constant is too large for 'long' type
        fcntl.c: In function 'test_flock64_einval':
        fcntl.c:44: warning: integer constant is too large for 'long' type
        fcntl.c:45: warning: integer constant is too large for 'long' type
        fdatasync.c: In function 'main':
        fdatasync.c:12: warning: integer constant is too large for 'long' type
        flock.c: In function 'main':
        flock.c:13: warning: integer constant is too large for 'long' type
        xstatx.c: In function 'main':
        xstatx.c:255: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:290: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatx.c:294: warning: integer constant is too large for 'long' type
        xstatfsx.c: In function 'main':
        xstatfsx.c:113: warning: integer constant is too large for 'long' type
        fsync.c: In function 'main':
        fsync.c:12: warning: integer constant is too large for 'long' type
        ftruncate64.c: In function 'main':
        ftruncate64.c:39: warning: integer constant is too large for 'long' type
        futimesat.c: In function 'main':
        futimesat.c:52: warning: integer constant is too large for 'long' type
        futimesat.c:59: warning: integer constant is too large for 'long' type
        get_mempolicy.c: In function 'main':
        get_mempolicy.c:83: warning: integer constant is too large for 'long' type
        get_mempolicy.c:84: warning: integer constant is too large for 'long' type
        get_mempolicy.c:85: warning: integer constant is too large for 'long' type
        get_mempolicy.c:86: warning: integer constant is too large for 'long' type
        getdents.c: In function 'main':
        getdents.c:109: warning: integer constant is too large for 'long' type
        getdents.c:110: warning: integer constant is too large for 'long' type
        getdents.c:114: warning: integer constant is too large for 'long' type
        getdents64.c: In function 'main':
        getdents64.c:114: warning: integer constant is too large for 'long' type
        getdents64.c:115: warning: integer constant is too large for 'long' type
        getdents64.c:119: warning: integer constant is too large for 'long' type
        xgetrlimit.c: In function 'main':
        xgetrlimit.c:71: warning: integer constant is too large for 'long' type
        ioctl_block.c:44: warning: integer constant is too large for 'long' type
        ioctl_block.c: In function 'main':
        ioctl_block.c:136: warning: integer constant is too large for 'long' type
        ioctl_block.c:137: warning: integer constant is too large for 'long' type
        ioctl_block.c:161: warning: integer constant is too large for 'long' type
        ioctl_block.c:170: warning: integer constant is too large for 'long' type
        ioctl_block.c:171: warning: integer constant is too large for 'long' type
        ioctl_evdev.c:42: warning: integer constant is too large for 'long' type
        ioctl_mtd.c:46: warning: integer constant is too large for 'long' type
        ioctl_rtc.c:40: warning: integer constant is too large for 'long' type
        ioperm.c: In function 'main':
        ioperm.c:12: warning: integer constant is too large for 'long' type
        ioctl_v4l2.c: In function 'main':
        ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type
        ipc.c: In function 'ipc_call':
        ipc.c:52: warning: integer constant is too large for 'long' type
        kill.c: In function 'main':
        kill.c:59: warning: integer constant is too large for 'long' type
        kill.c:62: warning: integer constant is too large for 'long' type
        kill.c:63: warning: integer constant is too large for 'long' type
        kill.c:68: warning: integer constant is too large for 'long' type
        linkat.c: In function 'main':
        linkat.c:14: warning: integer constant is too large for 'long' type
        linkat.c:15: warning: integer constant is too large for 'long' type
        mbind.c: In function 'main':
        mbind.c:41: warning: integer constant is too large for 'long' type
        mbind.c:43: warning: integer constant is too large for 'long' type
        mbind.c:44: warning: integer constant is too large for 'long' type
        migrate_pages.c: In function 'main':
        migrate_pages.c:41: warning: integer constant is too large for 'long' type
        In file included from mkdirat.c:10:
        umode_t.c: In function 'test_syscall':
        umode_t.c:47: warning: integer constant is too large for 'long' type
        mknod.c: In function 'call_mknod':
        mknod.c:16: warning: integer constant is too large for 'long' type
        mknod.c: In function 'main':
        mknod.c:23: warning: integer constant is too large for 'long' type
        mknod.c:49: warning: integer constant is too large for 'long' type
        mknod.c:56: warning: integer constant is too large for 'long' type
        mknodat.c:12: warning: integer constant is too large for 'long' type
        mknodat.c: In function 'call_mknodat':
        mknodat.c:17: warning: integer constant is too large for 'long' type
        mknodat.c: In function 'main':
        mknodat.c:24: warning: integer constant is too large for 'long' type
        mknodat.c:50: warning: integer constant is too large for 'long' type
        mknodat.c:57: warning: integer constant is too large for 'long' type
        mmap.c: In function 'main':
        mmap.c:51: warning: integer constant is too large for 'long' type
        move_pages.c: In function 'print_stat_pages':
        move_pages.c:139: warning: integer constant is too large for 'long' type
        move_pages.c: In function 'print_move_pages':
        move_pages.c:166: warning: integer constant is too large for 'long' type
        move_pages.c: In function 'main':
        move_pages.c:188: warning: integer constant is too large for 'long' type
        mq_sendrecv.c: In function 'main':
        mq_sendrecv.c:238: warning: integer constant is too large for 'long' type
        mq_sendrecv.c:401: warning: integer constant is too large for 'long' type
        mq_sendrecv.c:403: warning: integer constant is too large for 'long' type
        nsyscalls.c: In function 'test_syscall':
        nsyscalls.c:64: warning: integer constant is too large for 'long' type
        nsyscalls.c:65: warning: integer constant is too large for 'long' type
        nsyscalls.c:66: warning: integer constant is too large for 'long' type
        nsyscalls.c:67: warning: integer constant is too large for 'long' type
        nsyscalls.c:68: warning: integer constant is too large for 'long' type
        nsyscalls.c:69: warning: integer constant is too large for 'long' type
        preadv-pwritev.c: In function 'main':
        preadv-pwritev.c:162: warning: comparison between signed and unsigned
        prlimit64.c: In function 'main':
        prlimit64.c:65: warning: integer constant is too large for 'long' type
        prlimit64.c:70: warning: integer constant is too large for 'long' type
        remap_file_pages.c: In function 'main':
        remap_file_pages.c:42: warning: integer constant is too large for 'long' type
        remap_file_pages.c:43: warning: integer constant is too large for 'long' type
        remap_file_pages.c:45: warning: integer constant is too large for 'long' type
        renameat.c: In function 'main':
        renameat.c:15: warning: integer constant is too large for 'long' type
        renameat.c:16: warning: integer constant is too large for 'long' type
        rt_sigqueueinfo.c: In function 'main':
        rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type
        rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo':
        rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type
        rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type
        rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type
        rt_tgsigqueueinfo.c: In function 'main':
        rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type
        sendfile.c: In function 'main':
        sendfile.c:110: warning: integer constant is too large for 'long' type
        sendfile64.c: In function 'main':
        sendfile64.c:100: warning: integer constant is too large for 'long' type
        set_mempolicy.c: In function 'main':
        set_mempolicy.c:129: warning: integer constant is too large for 'long' type
        set_mempolicy.c:130: warning: integer constant is too large for 'long' type
        setrlimit.c: In function 'main':
        setrlimit.c:44: warning: integer constant is too large for 'long' type
        socketcall.c: In function 'test_socketcall':
        socketcall.c:58: warning: integer constant is too large for 'long' type
        splice.c: In function 'main':
        splice.c:41: warning: integer constant is too large for 'long' type
        splice.c:42: warning: integer constant is too large for 'long' type
        splice.c:45: warning: integer constant is too large for 'long' type
        splice.c:46: warning: integer constant is too large for 'long' type
        symlinkat.c: In function 'main':
        symlinkat.c:12: warning: integer constant is too large for 'long' type
        sync_file_range.c: In function 'main':
        sync_file_range.c:42: warning: integer constant is too large for 'long' type
        sync_file_range.c:43: warning: integer constant is too large for 'long' type
        syslog.c: In function 'main':
        syslog.c:14: warning: integer constant is too large for 'long' type
        tee.c: In function 'main':
        tee.c:41: warning: integer constant is too large for 'long' type
        tee.c:42: warning: integer constant is too large for 'long' type
        timer_create.c: In function 'main':
        timer_create.c:52: warning: integer constant is too large for 'long' type
        timer_create.c:84: warning: integer constant is too large for 'long' type
        timer_create.c:85: warning: integer constant is too large for 'long' type
        truncate64.c: In function 'main':
        truncate64.c:41: warning: integer constant is too large for 'long' type
        xgetrlimit.c: In function 'main':
        xgetrlimit.c:71: warning: integer constant is too large for 'long' type
        umode_t.c: In function 'test_syscall':
        umode_t.c:46: warning: integer constant is too large for 'long' type
        unlinkat.c: In function 'main':
        unlinkat.c:13: warning: integer constant is too large for 'long' type
        waitpid.c: In function 'main':
        waitpid.c:43: warning: integer constant is too large for 'long' type
        waitid.c: In function 'poison':
        waitid.c:141: warning: integer constant is too large for 'long' type
        xetpriority.c: In function 'main':
        xetpriority.c:15: warning: integer constant is too large for 'long' type
        xetpriority.c:19: warning: integer constant is too large for 'long' type
        xetpriority.c:20: warning: integer constant is too large for 'long' type
        xetpgid.c: In function 'main':
        xetpgid.c:43: warning: integer constant is too large for 'long' type
        xetpgid.c:47: warning: integer constant is too large for 'long' type
        xetpgid.c:48: warning: integer constant is too large for 'long' type

        (SLES 11SP4, i386)

        * tests/alarm.c (main): Add proper suffix to integer constant.
        * tests/aio.c (main): Likewise.
        * tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise.
        * tests/dup2.c (main): Likewise.
        * tests/dup3.c (main): Likewise.
        * tests/epoll_create.c (main): Likewise.
        * tests/epoll_ctl.c (invoke_syscall): Likewise.
        * tests/faccessat.c (main): Likewise.
        * tests/fchdir.c (main): Likewise.
        * tests/fcntl.c (test_flock64_einval): Likewise.
        * tests/fcntl64.c (test_flock64_einval): Likewise.
        * tests/fdatasync.c (main): Likewise.
        * tests/flock.c (main): Likewise.
        * tests/fstat64.c (SAMPLE_SIZE): Likewise.
        * tests/fstat.c (SAMPLE_SIZE): Likewise.
        * tests/fsync.c (main): Likewise.
        * tests/ftruncate64.c (main): Likewise.
        * tests/futimesat.c (main): Likewise.
        * tests/get_mempolicy.c (main): Likewise.
        * tests/getdents.c (main): Likewise.
        * tests/getdents64.c (main): Likewise.
        * tests/ioctl_block.c (lmagic, main): Likewise.
        * tests/ioctl_evdev.c (lmagic): Likewise.
        * tests/ioctl_mtd.c (lmagic): Likewise.
        * tests/ioctl_rtc.c (lmagic): Likewise.
        * tests/ioctl_v4l2.c (main): Likewise.
        * tests/ioperm.c (main): Likewise.
        * tests/ipc.c (ipc_call): Likewise.
        * tests/kill.c (main): Likewise.
        * tests/linkat.c (main): Likewise.
        * tests/lstat64.c (SAMPLE_SIZE): Likewise.
        * tests/lstat.c (SAMPLE_SIZE): Likewise.
        * tests/mbind.c (main): Likewise.
        * tests/migrate_pages.c (main): Likewise.
        * tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise.
        * tests/mknod.c (call_mknod, main): Likewise.
        * tests/mknodat.c (fd, call_mknodat, main): Likewise.
        * tests/mmap.c (main): Likewise.
        * tests/move_pages.c (print_stat_pages, print_move_pages): Likewise.
        * tests/mq_sendrecv.c (main): Likewise.
        * tests/nsyscalls.c (test_syscall): Likewise.
        * tests/prlimit64.c (main): Likewise.
        * tests/remap_file_pages.c (main): Likewise.
        * tests/renameat.c (main): Likewise.
        * tests/rt_sigqueueinfo.c (main): Likewise.
        * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise.
        * tests/sendfile.c (main): Likewise.
        * tests/sendfile64.c (main): Likewise.
        * tests/set_mempolicy.c (main): Likewise.
        * tests/setrlimit.c (main): Likewise.
        * tests/socketcall.c (test_socketcall): Likewise.
        * tests/splice.c (main): Likewise.
        * tests/stat64.c (SAMPLE_SIZE): Likewise.
        * tests/stat.c (SAMPLE_SIZE): Likewise.
        * tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise.
        * tests/symlinkat.c (main): Likewise.
        * tests/sync_file_range.c (main): Likewise.
        * tests/syslog.c (main): Likewise.
        * tests/tee.c (main): Likewise.
        * tests/timer_create.c (main): Likewise.
        * tests/truncate64.c (main): Likewise.
        * tests/umode_t.c (test_syscall): Likewise.
        * tests/unlinkat.c (main): Likewise.
        * tests/waitid.c (main): Likewise.
        * tests/waitpid.c (main): Likewise.
        * tests/xetpgid.c (main): Likewise.
        * tests/xetpriority.c (main): Likewise.
        * tests/xgetrlimit.c (main): Likewise.
        * tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise.
        * tests/xstatx.c (main): Likewise.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix "comparison between signed and unsigned" compilation warnings
        preadv-pwritev.c: In function 'main':
        preadv-pwritev.c:162: warning: comparison between signed and unsigned
        readv.c: In function 'main':
        readv.c:148: warning: comparison between signed and unsigned
        recvmsg.c: In function 'main':
        recvmsg.c:148: warning: comparison between signed and unsigned

        * tests/preadv-pwritev.c (main): Cast r_len to int.
        * tests/readv.c (main): Likewise.
        * tests/recvmsg.c (main): Likewise.

2016-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: refactor getregs_old fallback in get_regs.
        This change moves remaining arch specific getregs_old code into
        appropriate arch subdirectories and removes unnecessary code
        duplication.

        * linux/getregs_old.h: New file.
        * linux/powerpc/getregs_old.h: Likewise.
        * linux/powerpc64/getregs_old.h: Likewise.
        * linux/x86_64/getregs_old.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * syscall.c: Include "getregs_old.h".
        [X86_64 || POWERPC]: Remove.
        [ARCH_REGS_FOR_GETREGSET] (ptrace_getregset_or_getregs): Define
        to ptrace_getregset.
        [ARCH_REGS_FOR_GETREGS] (ptrace_getregset_or_getregs): Define
        to ptrace_getregs.
        (get_regs): Check for ptrace_getregset_or_getregs instead
        of ARCH_REGS_FOR_GETREGSET and ARCH_REGS_FOR_GETREGS.  Use
        ptrace_getregset_or_getregs instead of ptrace_getregset and
        ptrace_getregs.  Check for HAVE_GETREGS_OLD instead of X86_64
        and POWERPC.  Use use_getregs_old instead of getregset_support
        and old_kernel.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Rename BUILD_BUG_ON_ZERO macro.
        In order to avoid name clash on distributions which decide to include
        kernel headers instead of UAPI ones.  For example, on SLES 11SP4:

        gcc -DHAVE_CONFIG_H -I./linux/x86_64 -I./linux -I. -Wall -O2 -c net.c
        In file included from /usr/include/linux/sysctl.h:25:0,
                         from /usr/include/linux/netfilter.h:6,
                         from /usr/include/linux/netfilter_arp.h:8,
                         from /usr/include/linux/netfilter_arp/arp_tables.h:14,
                         from net.c:60:
        net.c: In function 'print_packet_mreq':
        gcc_compat.h:59:27: error: negative width in bit-field '<anonymous>'
         # define MUST_BE_ARRAY(a) BUILD_BUG_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
                                   ^
        defs.h:76:53: note: in expansion of macro 'MUST_BE_ARRAY'
         #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a))
                                                             ^
        net.c:747:22: note: in expansion of macro 'ARRAY_SIZE'
           if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address))
                              ^
        due to the fact BUILD_BUG_ON_ZERO is already defined in <linux/kernel.h>.

        * gcc_compat.h (BUILD_BUG_ON_ZERO): Rename to FAIL_BUILD_ON_ZERO.
        (MUST_BE_ARRAY): Update usage.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: factor out ptrace_getregs from get_regs.
        Move the code that calls ptrace(PTRACE_GETREGS) to a separate function.

        * syscall.c (ptrace_getregs): New function.
        (get_regs): Use it.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: rename get_regset to ptrace_getregset.
        * syscall.c (get_regset): Rename to ptrace_getregset.
        (get_regs): Rename get_regset to ptrace_getregset.

2016-11-12  Andreas Schwab  <schwab@linux-m68k.org>

        m68k: switch to PTRACE_GETREGS.
        * Makefile.am (EXTRA_DIST): Add linux/m68k/arch_regs.h, remove
        linux/m68k/get_syscall_result.c.
        * linux/m68k/arch_regs.c (m68k_d0, ARCH_PC_PEEK_ADDR): Don't
        define.
        (m68k_regs, m68k_usp_ptr, ARCH_PC_REG, ARCH_REGS_FOR_GETREGS):
        Define.
        * linux/m68k/arch_regs.h: New file.
        * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use m68k_usp_ptr.
        * linux/m68k/get_error.c (get_error): Use m68k_regs.d0.
        * linux/m68k/get_scno.c (arch_get_scno): Use m68k_regs.orig_d0.
        * linux/m68k/get_syscall_args.c (get_syscall_args): Use m68k_regs.
        * linux/m68k/get_syscall_result.c: Remove.

        tests: do not run old_mmap test on m68k.
        * tests/old_mmap.c: Skip test on m68k.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: introduce reallocate_vec function.
        This might be needed later to implement syscall fault injection.

        * syscall.c (reallocate_vec): New function.
        (reallocate_qual): Use it.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix prototypes of qual_desc, qual_signal, and qual_syscall functions.
        * syscall.c (qual_desc, qual_signal, qual_syscall): Fix prototypes.
        (struct qual_options): Fix type of "qualify" member.

2016-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        linux/x32/syscallent.h: fix syscallent array initialisation on x32.
        Why gcc didn't complain about it? It is definitely an index clash.

        * linux/x32/syscallent.h: Change initializer indices for empty records from
        [327 ... 511] to [329 ... 511].

2016-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce upoke function.
        This will be needed to implement fault injection on those architectures
        that lack PTRACE_SETREGSET/PTRACE_SETREGS support.

        * defs.h (upoke): New prototype.
        * upoke.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.

2016-11-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        Update ioctl entries from linux 4.9.
        * linux/32/ioctls_inc_align32.h: Update from linux v4.9 using ioctls_gen.sh.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * linux/64/ioctls_inc.h: Likewise.
        * linux/x32/ioctls_inc0.h: Likewise.
        * NEWS: Mention this.

2016-11-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Update NEWS.

2016-11-10  Mikulas Patocka  <mpatocka@redhat.com>
            Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add support for decoding of DM_* ioctl commands.
        * dm.c: New file.
        * xlat/dm_flags.in: Likewise.
        * Makefile.am (strace_SOURCES): Add dm.c.
        * configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h.
        * defs.h (dm_ioctl): New prototype.
        * ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl
        for 0xfd ioctl type.
        * tests/ioctl_dm.c: New file.
        * tests/ioctl_dm-v.c: Likewise.
        * tests/ioctl_dm.test: New test.
        * tests/ioctl_dm-v.test: Likewise.
        * tests/.gitignore: Add ioctl_dm and ioctl_dm-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test.

2016-11-10  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce ALIGNOF macro.
        * gcc_compat.h (ALIGNOF): New macro.

2016-11-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add support for QUOTE_0_TERMINATED in user_style to ptrintstr_ex.
        This enables printing size-limited (expectedly) ASCIZ strings.

        This is done by increasing umoven size limit for sized strings by one
        byte above max_strlen (enabling copying possible NUL byte in case len is
        greater than max_strlen) and decreasing size after copying by one byte
        in case QUOTE_0_TERMINATED is set (due to user_style or usage of len of
        -1).  As a result, there is one excess byte for string_quote in case
        QUOTE_0_TERMINATED is set so string_quote can check for NUL termination
        of strings up to size bytes in size (which is len or max_strlen, whatever
        is greater).

        The catch here is that when string is not properly NUL-terminated and
        QUOTE_0_TERMINATED is provided in user_style and len is less than
        max_strlen then last non-NUL byte is not printed.  But ellipsis is
        printed instead, being indication that string is not terminated
        properly.  QUOTE_OMIT_TRAILING_0 should be used instead in case this
        behaviour is not intended.

        * util.c (printstr_ex): Copy one excess byte in case of non-negative len
        provided and it is more than max_strlen; handle case of max_strlen of 0
        in case QUOTE_0_TERMINATED is set separately; check for need of printing
        ellipsis by checking resulting style against QUOTE_0_TERMINATED.

2016-11-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of mq_{notify,open,timedreceive,timedsend,unlink}
        * tests/mq_sendrecv.c: New file.
        * tests/mq_sendrecv-read.c: Likewise.
        * tests/mq_sendrecv-write.c: Likewise.
        * tests/mq_sendrecv.test: New test.
        * tests/mq_sendrecv-read.test: Likewise.
        * tests/mq_sendrecv-write.test: Likewise.
        * tests/.gitignore: Add mq_sendrecv, mq_sendrecv-read,
        and mq_sendrecv-write.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, mq_sendrecv_write_LDADD):
        New variables.
        (DECODER_TESTS): Add mq_sendrecv.test, mq_sendrecv-read.test,
        and mq_sendrecv-write.test.

2016-11-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip times.test if CLOCK_PROCESS_CPUTIME_ID does not work.
        * tests/times.c (main): Skip if clock_gettime consistenly returns zero
        for CLOCK_PROCESS_CPUTIME_ID timer.

2016-10-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add tests for perf_event_attr structure decoding in perf_event_open
        * configure.ac: Add checks for presence of various fields of struct
        perf_event_attr defined in kernel headers.
        * tests/perf_event_open.c: New file.
        * tests/perf_event_open_unabbrev.c: Likewise.
        * tests/perf_event_open.test: New test.
        * tests/perf_event_open_unabbrev.test: Likewise.
        * tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test.

        Implement decoding of perf_event_attr structure in perf_event_open syscall
        * linux/perf_event_struct.h: New file, definition of struct perf_event_attr
        from Linux 4.8
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/hw_breakpoint_len.in: New file.
        * xlat/hw_breakpoint_type.in: Likewise.
        * xlat/perf_attr_size.in: Likewise.
        * xlat/perf_branch_sample_type.in: Likewise.
        * xlat/perf_event_read_format.in: Likewise.
        * xlat/perf_event_sample_format.in: Likewise.
        * xlat/perf_hw_cache_id.in: Likewise.
        * xlat/perf_hw_cache_op_id.in: Likewise.
        * xlat/perf_hw_cache_op_result_id.in: Likewise.
        * xlat/perf_hw_id.in: Likewise.
        * xlat/perf_sw_ids.in: Likewise.
        * xlat/perf_type_id.in: Likewise.
        * perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of
        <linux/perf_event.h>.
        (PRINT_XLAT): New macro for simplifying printing values from
        sorted xlat.
        (printxlat_search): New function, wrapper for xlat_search with behaviour
        similar to printval.
        (print_perf_event_attr): New print_event_attr structure fetching and
        printing function.
        (SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying
        attr argument contents.
        * tests/perf_event_open.c: Renamed to
        tests/perf_event_open_nonverbose.c.
        * tests/perf_event_open.test: add -e verbose=none in order to preserve
        output format being checked (in case verbose output is enabled,
        contents of attr arguments are shown now); rename to
        tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open.

        tests: fix name spelling.

2016-10-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix name spelling.

        Update NEWS.

        Fix typo in comment in tests/quotactl.h.

        tests: fix invalid pointer checks in quotactl test.
        * tests/quotactl.h (bogus_special, bogus_addr): Move it...
        * tests/quotactl.c (main): ... here; remove static and const qualifiers,
        use memory after tail_alloc instead of magic numbers.
        * tests/quotactl-xfs.c (main): Likewise.

        tests: fix invalid pointer checks in getcpu test.
        * test/getcpu.c (main): Replace magic numbers deemed invalid pointers
        with addresses after memory returned by tail_alloc.

        tests: fix invalid pointer checks in request_key test.
        * test/request_key.c (main): Replace magic numbers deemed invalid pointers
        with addresses after memory returned by tail_alloc.

        tests: fix invalid pointer checks in add_key test.
        * test/add_key.c (main): Replace magic numbers deemed invalid pointers
        with addresses after memory returned by tail_alloc.

        statfs: use printxval_search.
        * print_statfs.c (print_statfs_type): Use printxval_search for printing
        FS magic xlat value.

        util: add printing helper for sorted xlat arrays.
        * util.c (printxval_searchn): New function.
        * defs.h (printxval_searchn): New prototype.
        (printxval_search): New helper macro useful in conjunction with static
        xlat arrays.

        defs: add check for argument being array to ARRAY_SIZE macro.
        * gcc_compat.h [GNUC_PREREQ(3, 0)] (BUILD_BUG_ON_ZERO): New macro.
        (SAME_TYPE, MUST_BE_ARRAY): Likewise.
        * defs.h (ARRAY_SIZE): Add MUST_BE_ARRAY for build-time type check.

        tests: check decoding of oldfstat, oldlstat, and oldstat syscalls.
        * tests/oldfstat.c: New file.
        * tests/oldlstat.c: Likewise.
        * tests/oldstat.c: Likewise.
        * tests/oldfstat.test: New test.
        * tests/oldlstat.test: Likewise.
        * tests/oldstat.test: Likewise.
        * tests/xstatx.c [!OLD_STAT]: define OLD_STAT to 0.
        (print_stat) [OLD_STAT]: Print predefined values for
        st_blksize/st_blocks.
        (print_stat): Check for !OLD_STAT in nanosecond precision checks.
        (main) [OLD_STAT]: Ignore EOVERFLOW.
        (main): Test for successful rc in returned size value check;
        print address only on non-successful rc.
        * tests/.gitignore: Add oldfstat, oldlstat, and oldstat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add oldfstat.test, oldlstat.test, and oldstat.test.

        tests: additional tests of stat decoders.
        * tests/fstatx.c (IS_FSTAT): Define to 1.
        * tests/fstatat64.c [__GLIBC__ && __sparc64__] (TEST_BOGUS_STRUCT_STAT):
        Define to 0.
        * tests/xstatx.c [!IS_STAT] (IS_STAT): Define to 0.
        [!TEST_BOGUS_STRUCT_STAT] (TEST_BOGUS_STRUCT_STAT): Define to 1.
        (main): Add a check for non-available pointer and a check
        for block device file.
        * tests/statx.sh: Add tracing of /dev/full file, specify alignment.
        * tests/fstat.test: Specify alignment.

2016-10-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: prepare for additional tests of stat decoders.
        PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace
        pair in order to save errno.  PRINT_SYSCALL_FOOTER now uses sprintrc for
        printing rc/errno.

        * tests/xstatx.c: Include <errno.h>.
        (main): Update PRINT_SYSCALL_FOOTER call convention.
        * tests/fstatat.c (PRINT_SYSCALL_HEADER): Add errno saving.
        (PRINT_SYSCALL_FOOTER): Restore errno.
        * tests/fstatx.c: Likewise.
        * tests/lstatx.c: Likewise.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

        Provide a safe definition of O_ACCMODE.
        Some libcs e.g. musl are guilty of messing up with O_ACCMODE.

        * open.c (O_ACCMODE): Redefine to 03.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Implement dumping of mq_timedsend and mq_timedreceive syscalls.
        * syscall.c (dumpio): Add SEN_mq_timedreceive and SEN_mq_timedsend.

        mq: print msg_prio as a pointer, not as an immediate value.
        * mq.c (SYS_FUNC(mq_timedreceive)): Use printnum_int for printing
        msg_prio argument.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: print msg payload only in case of successful mq_timedreceive call.
        Also, use u_rval for determining message size.

        * mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative
        u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise;
        provide u_rval as string size.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: Print msg_prio parameter as unsigned int in mq_timedsend.
        * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%ld"
        to "%u", cast argument value to unsigned int.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: Properly print mq_flags field.
        mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other
        flags are treated as invalid by mq_getsetattr). Moreover, this field is
        ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr
        attribute).

        * xlat/mq_attr_flags.in: New file.
        * print_mq_attr.c: Include xlat/mq_attr_flags.h.
        (printmqattr): New parameter, bool decode_flags; cast members of struct
        mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags;
        print mq_flags as flags only in case decode_flags parameter is set
        to true.
        * mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags
        parameter of printmqattr call.
        (SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags
        parameter of printmqattr call.
        * tests/mq.expected: Update expected output.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: Print msg_len parameter as kernel_ulong_t.
        * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%lu"
        to "%llu", use getarg_ull for obtaining msg_len parameter.
        (SYS_FUNC(mq_timedreceive)): Likewise.

        print_mq_attr: fix typo.
        * print_mq_attr.c (printmqattr): Print field name "mq_curmsgs"
        instead of "mq_curmsg".
        * tests/mq.expected: Update expected output.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: print mqdes parameter as int.
        It is defined as int in <linux/posix_types.h>.

        * mq.c (SYS_FUNC(mq_timedsend)): Use "%d" conversion specifier instead
        of "%ld" for printing mqdes (0th parameter), cast parameter value to
        int.
        (SYS_FUNC(mq_timedreceive)): Likewise.
        (SYS_FUNC(mq_notify)): Likewise.
        (SYS_FUNC(mq_getsetattr)): Likewise.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        mq: curly brackets usage fix.
        Use curly brackets for denoting blocks in both of if branches if they
        are already used in at least one branch.

        tests: additional name_to_handle_at/open_by_handle_at checks.
        * tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at
        checks.

        tests: require only presence of __NR_* macros for file_handle test.
        * tests/file_handle.c: replace fcntl.h include with asm/unistd.h.
        [MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at
        && defined __NR_open_by_handle_at, add fcntl.h include
        [!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct
        file_handle.
        (main): Change name_to_handle_at and open_by_handle_at calls to syscall.

        tests: proper type conversion in keyctl test.
        * tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t
        since kernel_ulong_t may be of different size.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        file_handle: use separate xlat for name_ta_handle_at flags.
        Since the only two flags supported are AT_SYMLINK_FOLLOW and
        AT_EMPTY_PATH.

        * xlat/name_to_handle_at_flags.in: New file.
        * file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags
        for printing flags parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of kexec_file_load and kexec_load syscalls.
        * tests/kexec_file_load.c: New file.
        * tests/kexec_load.c: Likewise.
        * tests/kexec_file_load.test: New test.
        * tests/kexec_load.test: Likewise.
        * tests/.gitignore: Add kexec_file_load and kexec_load.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add kexec_file_load.test and kexec_load.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kexec: use widen_to_ulong since kexec_load has compat on x32/n32.
        Curiously, kexec_load uses compat on x32/n32, so its parameters should
        be 4 bytes in size on these ABIs.

        * kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting
        parameters to proper size on x32/n32.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        kexec: fix zeroing of higher bits of flags parameter in kexec_load.
        * kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before
        negation in order to properly negate higher bits of KEXEC_ARCH_MASK.

        kexec: add printing of struct kexec_segment field names.
        * kexec.c (print_seg): Print field names of the kexec_segment structure.

        tests: check decoding of unshare syscall.
        * tests/unshare.c: New file.
        * tests/unshare.test: New test.
        * tests/.gitignore: Add unshare.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add unshare.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: use kernel_ulong_t as type of flags parameter of unshare call.
        Kernel declares flags parameter as long and looks like x32 and n32
        implement no compat for this call.

        * clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for
        obtaining and parsing flags parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: use separate flag list for unshare.
        Not all clone flags could be passed to unshare (see check_unshare_flags
        function in kernel/fork.c).

        * xlat/unshare_flags.in: New file.
        * clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags
        parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of setns syscall.
        * tests/setns.c: New file.
        * tests/setns.test: New test.
        * tests/.gitignore: Add setns.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setns.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        clone: use separate xlat for nstype parameter of setns syscall.
        nstype is not flag set but specific type value against which it is
        compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)).

        * xlat/setns_types.in: New file.
        * clone.c: Use printxval and setns_types for nstype parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check non-verbose capget/capset output.
        * tests/caps-abbrev.awk: New file.
        * tests/caps-abbrev.c: Likewise.
        * tests/caps-abbrev.test: New test.
        * tests/.gitignore: Add caps-abbrev.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add caps-abbrev.test.
        (EXTRA_DIST): Add caps-abbrev.awk.

        tests: additional capset decoder checks.
        * tests/caps.awk: Add patterns for additional checks.
        * tests/caps.c: Implement additional checks.

        tests: check decoding of fanotify_init syscall.
        * tests/fanotify_init.c: New file.
        * tests/fanotify_init.test: New test.
        * tests/.gitignore: Add fanotify_init.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fanotify_init.test.

        tests: some additional checks for fanotify_mark.
        * tests/fanotify_mark.c (do_call): New function.
        (main): Use it.

        tests: use sprintrc in tests/fanotify_mark.c.
        * tests/fanotify.c (main): Use sprintrc.

        tests: check decoding of {init,finit,delete}_module syscalls.
        * tests/delete_module.c: New file.
        * tests/finit_module.c: Likewise.
        * tests/init_delete_module.h: Likewise.
        * tests/init_module.c: Likewise.
        * tests/delete_module.test: New test.
        * tests/finit_module.test: Likewise.
        * tests/init_module.test: Likewise.
        * tests/.gitignore: Add delete_nodule, finit_module, and init_module.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add delete_module.test, finit_module.test,
        and init_module.test.
        (EXTRA_DIST): Add init_delete_module.h.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        bjm: use getarg_ull for retrieving first two parameters of init_module syscall
        As init_module has no compat wrapper, its first parameter is a pointer
        and the second is length, they both have the same size as kernel_ulong_t
        type.

        * bjm.c (SYS_FUNC(init_module)): Obtain first two parameters using
        getarg_ull, print address argument using printaddr_ull, print length
        argument using "%llu" conversion specifier.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

        Add printaddr_ull, change printaddr into a thin wrapper around it.
        * defs.h (printaddr_ull): New prototype.
        (printaddr): Change to a static inline wrapper around printaddr_ull.
        * util.c (printaddr): Rename to printaddr_ull, change argument type
        to unsigned long long, change print format to %#llx.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add values for MODULE_INIT_* constants.
        * bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC):
        Remove.
        * xlat/module_init_flags.in: Add values for
        MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Remove parser of create_module syscall.
        Since create_module syscall is present only in kernels before Linux 2.6
        and strace does not support those kernels, there is no use to keep this
        parser any longer.

        * bjm.c (SYS_FUNC(create_module)): Remove.
        * linux/dummy.h (sys_create_module): Add stub alias.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of process_vm_readv and process_vm_writev syscalls
        * tests/process_vm_readv.c: New file.
        * tests/process_vm_readv_writev.c: Likewise.
        * tests/process_vm_writev.c: Likewise.
        * tests/process_vm_readv.test: New test.
        * tests/process_vm_writev.test: Likewise.
        * tests/.gitignore: Add process_vm_readv and process_vm_writev.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add process_vm_readv.test and process_vm_writev.test.
        (EXTRA_DIST): Add process_vm_readv_writev.c.

        process_vm: use widen_to_ulong for local_iovcnt, renote_iovcnt, and flags
        * process_vm.c (SYS_FUNC(process_vm_readv),
        SYS_FUNC(process_vm_writev)): Use widen_to_ulong for local_iovcnt,
        renote_iovcnt, and flags parameters.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs: add widen_to_ulong macro.
        This is similar to widen_to_long, but for unsigned values.

        * defs.h (widen_to_ulong): New macro.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        process_vm: print pid argument as int.
        * process_vm.c (SYS_FUNC(process_vm_readv),
        SYS_FUNC(process_vm_writev)): Change conversion specifier for pid
        argument from "%ld" to "%d".

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        process_vm: remove syserror check for iovec printing.
        This check had been done by print_array inside tprint_iov anyway.

        * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for
        printing local_iov; do not check for syserror, provide decode_iov
        parameter to tprint_iov{,_upto} based on its value instead.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io: use umoven_or_printaddr_ignore_syserror as umove function in tprint_iov_upto
        This enables printing of iovec arrays even in case of failed syscall
        (failed syscall doesn't mean that iovec itself is inaccessible and
        useless).  One caveat here is that we should explicitly provide proper
        IOV_DECODE_* value based on syserror value in case printing is performed
        on exiting; we can't simply override it to IOV_DECODE_ADDR on exiting
        when syserror is up, since this may be called by code which tries to
        print iovec containing local data, which should be perfectly accessible
        (on the other hand, there are no cases of such behaviour at the moment).

        Since iovecs themselves are printed even if syscall has failed now,
        preadv test is updated to reflect this.  It is notable, though, that this
        is the only place where this case is checked.

        * io.c (tprint_iov_upto): Specify umoven_or_printaddr_ignore_syserror
        instead of umoven_or_printaddr as umoven_func parameter.
        (SYS_FUNC(readv), do_preadv): Specify decode_iov parameter value
        based on syserror(tcp) value.
        * scsi.c: (print_sg_io_v3_res, print_sg_io_v4_res): Likewise.
        * tests/preadv.c: Update expected output for the case when preadv
        with singe-item iovec failed.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move umoven_or_printaddr_ignore_syserror to util.c.
        * defs.h (umoven_or_printaddr_ignore_syserror): New prototype.
        * v4l2.c (umoven_or_printaddr_ignore_syserror): Move ...
        * util.c: ... here.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        v4l2: check for verbose flag in umoven_or_printaddr_ignore_syserror.
        This change makes behaviour of umoven_or_printaddr_ignore_syserror in
        line with umoven_or_printaddr when verbose flag is disabled.

        * v4l2.c (umoven_or_printaddr_ignore_syserror): Simply call printaddr
        when verbose flag is unset.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of kcmp syscall.
        * tests/kcmp.c: New file.
        * tests/kcmp.test: New test.
        * tests/.gitignore: Add kcmp.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add kcmp.test.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

        kcmp: print index parameters of unknown commands as kernel_ulong_t.
        * lookup_dcookie.c (SYS_FUNC(kcmp)): Use getarg_ull to retrieve idx1
        and idx2, print them using %#llx format in case of unknown command.

2016-10-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of inotify family syscalls.
        * tests/inotify.c: New file.
        * tests/inotify_init1.c: Likewise.
        * tests/inotify.test: New test.
        * tests/inotify_init1.test: Likewise.
        * tests/.gitignore: Add inotify and inotify_init1.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add inotify.test and inotify_init1.test.

        xlat: use IN_* prefix for inotify_init1 flag constants.
        * xlat/inotify_init_flags.in: Replace O_* prefix with IN_* prefix for
        O_NONBLOCK and O_CLOEXEC constants, provide fallback definitions.

        tests: check decoding of lookup_dcookie syscall.
        * tests/lookup_dcookie.c: New file.
        * tests/lookup_dcookie.test: New test.
        * tests/.gitignore: Add lookup_dcookie.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add lookup_dcookie.test.

2016-10-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        lookup_dcookie: print len parameter as kernel_ulong_t.
        It is size_t and without compat on x32/n32.

        * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Change conversion
        specifier from "%lu" to "%llu", use getarg_ull for len argument
        retrieval.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        defs.h: add offsetofend macro.
        Analogous to offsetof but returns structure offset after the specified
        field.  Useful for checking whether specific field is present in obtained
        data or specifying amount of data to copy based on the (last) field needed.

        * defs.h (offsetofend): New macro.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move ARG_STR and similar macros to tests.h.
        * tests/add_key.c (_STR, ARG_STR): Move ...
        * tests/tests.h: ... here.
        (ARG_ULL_STR): New macro.
        * tests/keyctl.c (ARG_STR): Remove.
        * tests/quotactl.h (ARG_STR): Likewise.
        * tests/request_key.c (ARG_STR): Likewise.

        tests: move LL_PAIR and LL_VAL_TO_PAIR macros to tests.h.
        * tests/fadvise.h (LL_PAIR, LL_VAL_TO_PAIR): Move ...
        * tests/tests.h: ... here.

        tests: check decoding of ioprio_get and ioprio_set syscalls.
        * tests/ioprio.c: New file.
        * tests/ioprio.test: New test.
        * tests/.gitignore: Add ioprio.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioprio.test.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: provide fallback definitions for CLOCK_* constants.
        Since new values have been added gradually over various kernel versions,
        it's better to define them explicitly in order to avoid situations when
        strace built with older kernel headers cannot decode some recently
        defined values.

        * xlat/clocknames.in: Add values for constants.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move fill_memory and fill_memory_ex into a separate file.
        * tests/fill_memory.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c.
        * tests/tests.h (fill_memory, fill_memory_ex): New prototypes.

        tests: add period parameter to fill_memory_ex.
        * tests/quotactl.h (fill_memory_ex): Add period parameter,
        use it as a divisor in non-constant part of value.
        (fill_memory): Specify period of 0x80 to fill_memory_ex call.
        * tests/quotactl-xfs.c (main): Likewise.

2016-10-05  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add a header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.14-1.
        * strace.spec.in: Likewise.

2016-10-04  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.14 release.
        * NEWS: Update for 4.14 release.

        Generate SEN numbers in a locale independent order.
        * generate_sen.sh: Sort SEN numbers using C collation rules.

2016-10-04  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that offsetof is provided by stddef.h.
        According to C89, <stddef.h> shall define offsetof macro.

        * defs.h: Include <stddef.h> unconditionally.
        [!offsetof]: Remove.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of add_key, keyctl, and request_key syscalls.
        * tests/add_key.c: New file.
        * tests/keyctl.c: Likewise.
        * tests/request_key.c: Likewise.
        * tests/add_key.test: New test.
        * tests/keyctl.test: Likewise.
        * tests/request_key.test: Likewise.
        * tests/.gitignore: Add add_key, keyctl, and request_key.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add add_key.test, keyctl.test, and request_key.test.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: use kernel_ulong_t and getarg_ull instead of long.
        This potentially fixes keyctl decoder for x32 personality.

        * keyctl.c (keyctl_update_key, keyctl_read_key, keyctl_instantiate_key,
        keyctl_instantiate_key_iov, keyctl_dh_compute): Change addr and len
        arguments to kernel_ulong_t.  Print len using %llu format.
        (keyctl_keyring_search): Change addr1 and addr2 arguments
        to kernel_ulong_t.
        (print_dh_params): Change addr argument to kernel_ulong_t.
        (SYS_FUNC(keyctl)): Retrieve arguments via getarg_ull, pass them
        to the appropriate handlers.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: fix parameter signedness.
        * keyctl.c (keyctl_update_key): Change addr and len arguments
        to unsigned.
        (keyctl_read_key): Likewise.
        (keyctl_instantiate_key): Likewise.
        (keyctl_instantiate_key_iov): Likewise.
        (keyctl_dh_compute): Likewise.
        (keyctl_keyring_search): Change addr1 and addr2 arguments to unsigned.
        (keyctl_chown_key): Change user and group arguments to unsigned.
        (keyctl_get_persistent): Change uid argument to unsigned.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: use printstr_ex for printing out buffer.
        keyctl_read_key had subtle bug by treating out buffer in KEYCTL_READ
        as NUL-terminated, which is not true.  We fix it by adding parameter to
        keyctl_read_key signalising whether buffer is NUL-terminated and using
        printstr_ex for printing (expectedly) NUL-terminated strings.

        * keyctl.c (keyctl_read_key): Add has_nul parameter.  Do not use -1 as
        string len.  Use printstr_ex for buffer output with user style depending
        on has_nul value.
        (SYS_FUNC(keyctl)): Specify has_nul parameter to keyctl_read_key
        by comparing cmd value with KEYCTL_READ.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Add printstr_ex which allows for providing user quotation style.
        This is useful for providing QUOTE_OMIT_TRAILING_0 and maybe other
        flags.

        * defs.h (printstr_ex): New prototype.
        (printstr): Change to a wrapper around printstr_ex with zero user style.
        * util.c (printstr): Rename to ...
        (printstr_ex) ... new function, add user_style argument which is or'ed
        with computed style.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add quote_string flag signalising that string is NUL-terminated.
        It is useful in cases strings with size provided are expected to be
        NUL-terminated but are not trustworthy enough to call just plain
        printstr(str, -1).

        * defs.h (QUOTE_OMIT_TRAILING_0): New constant definition.
        * util.c (string_quote): Swallow terminating NUL if
        QUOTE_OMIT_TRAILING_0 is set.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: add support for KEYCTL_DH_COMPUTE.
        * keyctl.c (struct keyctl_dh_params): New structure.
        (print_dh_params, keyctl_dh_compute): New functions.
        (SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value.

2016-10-03  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: fix is_negated_errno for x32 personality.
        * syscall.c (is_negated_errno) [X86_64]: Do not truncate kernel_ulong_t
        to uint32_t for x32 personality.

        tests: fix another regression in qual_syscall.test.
        * tests/qual_syscall.test: Fix pattern_nonabbrev_verbose pattern.
        (check_output_mismatch): Print the pattern that triggered match failure.

        Use err_name, print unrecognized errno values as numbers.
        * syscall.c (trace_syscall_exiting): Use err_name() instead
        of open-coding it.  Print unrecognized errno values using %lu format
        instead of ERRNO_%lu as the latter prodices an invalid constant.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: print errno name in KEYCTL_REJECT in case it is available.
        * keyctl.c (keyctl_reject_key): Get errno string via err_name
        and print it if it is not NULL.

        Add function for getting errno string.
        * defs.h (err_name): New prototype.
        * syscall.c (err_name): New function.

2016-10-03  Dmitry V. Levin  <ldv@altlinux.org>

        struct tcb: change the type of u_error field from int to unsigned long.
        This is the type actually used for the error code on architectures
        that use a dedicated register.

        * defs.h (struct tcb): Change the type of u_error to unsigned long.
        * syscall.c (trace_syscall_exiting): Change the type of u_error variable
        to unsigned long, print it using %lu format, drop no longer needed
        explicit cast to unsigned long.
        (saved_u_error): Change type to unsigned long.

2016-10-02  Dmitry V. Levin  <ldv@altlinux.org>

        Use tprints instead of tprintf in a few more places.
        * btrfs.c (btrfs_print_qgroup_inherit, btrfs_print_tree_search,
        btrfs_ioctl): Replace tprintf with tprints for printing strings without
        format specifiers.
        * net.c (print_group_req): Likewise.
        * scsi.c (scsi_ioctl): Likewise.
        * term.c (decode_termios, decode_termio): Likewise.
        * userfaultfd.c (uffdio_ioctl): Likewise.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command.
        Since this command doesn't have any additional arguments, the comma does
        not needed.  Since this is the only command which lacks additional
        arguments, it's better to add special case for it rather than add
        printing of comma to all other commands.

        * keyctl.c (SYS_FUNC(keyctl)): Add check for command not being
        KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument
        from the rest.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: use getarg_ull for printing generic arguments.
        Otherwise it is erroneous on x32, for example.

        * keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier
        and getarg_ull for fallback argument printing.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        keyctl: use printuid for printing UID/GID.
        UID/GID are unsigned except special -1 value (which is also special in
        context of specific keyctl commands), so special printing function
        should be used.

        * keyctl.c (keyctl_chown_key, keyctl_get_persistent): Use printuid
        instead of printf with "%d" conversion for printing UID/GID.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        io: handle data_size of -1 as unlimited data in print_iovec.
        Otherwise it can be depleted and print_iovec starts printing empty
        strings.

        * io.c (print_iovec): Interpret c->data_size of -1 as unlimited data
        and do not decrease it in this case.

2016-10-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix typo in qual_syscall.test.
        Fix test regression introduced by commit v4.13-225-g55334ef.

        * tests/qual_syscall.test: Fix typo.

2016-09-30  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance -e abbrev=set, -e raw=set, and -e verbose=set.
        Enhance abbrev=, raw=, and verbose= to accept the same syntax as trace=.
        For example, this allows such syntax as -e verbose=file.

        * syscall.c (lookup_class): Define before qual_syscall.
        (qualify): Move the loop based on lookup_class ...
        (qual_syscall): ... here.
        * tests/qual_syscall.test: Check it.

2016-09-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests/qual_syscall.test: rewrite without ls.
        * tests/qual_syscall.test: Invoke ./umovestr instead of ls.
        Update expected output.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of fadvise64 and fadvise64_64 syscalls.
        * tests/fadvise.h: New file.
        * tests/fadvise64.c: Likewise.
        * tests/fadvise64_64.c: Likewise.
        * tests/fadvise64.test: New test.
        * tests/fadvise64_64.test: Likewise.
        * tests/.gitignore: Add fadvise64 and fadvise64_64.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fadvise64.test, fadvise64_64.test.
        (EXTRA_DIST): Add fadvise.h.

2016-09-28  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: implement fetching the 7th subcall argument.
        * syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last
        argument of 7-arg syscalls.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        x32: use proper decoder for fadvise64 syscall.
        fadvise_64_64 decoder used before this change prints different sign
        of the "len" argument (loff_t vs size_t).

        * linux/x32/syscallent.h (fadvise64): Replace SEN(fadvise64_64)
        with SEN(fadvise64).

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        fadvise: use getarg_ull for obtaining len argument of fadvise64 syscall.
        Since its type is size_t, it is 64-bit wide on x32 and special care
        should be taken in order to obtain it.

        * fadvise.c (SYS_FUNC(fadvise64)): Use getarg_ull for obtaining value
        of "len" syscall argument.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        util: add getarg_ll and getarg_ull functions.
        These allow retrieving specific argument in full taking into account
        peculiarities of runtimes which employ tcp->ext_arg (e.g. x32).

        * defs.h (getarg_ll, getarg_ull): New prototypes.
        * util.c (getarg_ll, getarg_ull): New functions.
        (printargs): Use getarg_ull.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        fadvise: change printing of len argument to unsigned in fadvise64 syscall
        The kernel declares fadvise64 as
        long sys_fadvise64(int fd, loff_t offset, size_t len, int advice);

        * fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from
        "%ld" to "%lu" for printing len argument since kernel expects argument
        of type size_t.

2016-09-28  Dmitry V. Levin  <ldv@altlinux.org>

        sh64, sparc64: use proper decoder for fadvise64_64 syscall.
        This change is no-op yet, but things will change when decoder
        of fadvise64 syscall get fixed.

        * linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64)
        with SEN(fadvise64_64).
        * linux/sparc64/syscallent.h (fadvise64_64): Likewise.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of fallocate syscall.
        * configure.ac (AC_CHECK_FUNCS): Add fallocate.
        * tests/fallocate.c: New file.
        * tests/fallocate.test: New test.
        * tests/.gitignore: Add fallocate.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fallocate.test.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        fallocate: change print format of offset and len arguments to signed.
        Since types of these arguments are off_t and kernel actually expects
        signed values in order to fail when negative values are provided,
        lets display these values as signed.

        * fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for
        printing "offset" and "len" syscall arguments from %llu to %lld.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add default values for falloc_flags constants.
        In order to avoid dependence of declared constants to headers available
        on build system.

        * xlat/falloc_flags.in: Add default values for constants.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of getcpu syscall.
        * tests/getcpu.c: New file.
        * tests/getcpu.test: New test.
        * tests/.gitignore: Add getcpu.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getcpu.test.

        tests: make magic values in ioctl_block test distinctive.
        * tests/ioctl.block (init_magic): Add iterator value to magic value
        in order to enable detection of potential 4-byte aligned shifts.

        tests: additional getcwd decoding checks.
        * tests/getcwd.c (main): Add more checks for getcwd arguments decoding.

        tests: check decoding of quotactl syscall.
        * configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h,
        and sys/quota.h.
        * tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs,
        and quotactl-xfs-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add quotactl.test, quotactl-v.test,
        quotactl-xfs.test, and quotactl-xfs-v.test.
        (EXTRA_DIST): Add quotactl.h
        * quotactl.h: New file.
        * quotactl.c: Likewise.
        * quotactl-v.c: Likewise.
        * quotactl-xfs.c: Likewise.
        * quotactl-xfs-v.c: Likewise.
        * quotactl.test: New test.
        * quotactl-v.test: Likewise.
        * quotactl-xfs.test: Likewise.
        * quotactl-xfs-v.test: Likewise.

2016-09-27  Dmitry V. Levin  <ldv@altlinux.org>

        quota: ensure that names of structure fields are printed properly.
        * quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros.
        (decode_cmd_data): Use them to print structure fields.

        Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros.
        * defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
        Add support of char types.
        * tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
        Likewise.

        quota: move Q_QUOTAON handling to subcommand switch statement.
        * quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ...
        (decode_cmd_data): ... here.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: remove legacy subcommand decoding support code.
        Support for these quota subcommands by linux kernels has been dropped
        long time ago (between 2.5.16 and 2.5.17), so lets drop it in order
        to minimize amount of code which should be subjected to testing and
        structured conversion.

        * quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo,
        struct v1_dqstats, struct v2_dqstats): Remove.
        (decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA,
        Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS,
        and Q_V2_GETSTATS subcommands.
        (SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: add realtime block limits fields to XFS disk quota printing code.
        * quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit
        and d_rtb_softlimit fields to struct xfs_dqblk printing code.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: add packed attribute to struct if_dqblk definition.
        Since the only difference between 32-bit and 64-bit environments
        regarding this structure is its padding, lets just add packed attribute
        to its definition instead of going full mpers.

        * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: Add decoding for Q_XQUOTARM subcommand.
        * quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand
          switch.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: add dispatch of SYNC subcommands.
        Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway.

        * quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand
        dispatch switch since id/addr arguments for these subcommands are known
        to be ignored.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: add missing prefixes to struct field names.
        * quota.c (decode_cmd_data): Print field names in accordance with
        their definition.

        quota: fix indentation inside subcommand dispatching switch statement.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: avoid printing id argument for those commands that ignore it.
        As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO,
        Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF,
        Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and
        Q_V2_GETSTATS subcommands, do not print it for these subcommands.

        * quota.c (decode_cmd_data): Add id argument parameter, add printing
        of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA,
        Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA,
        Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands.
        (SYS_FUNC(quotactl)): Remove printing of id argument, pass it
        to decode_cmd_data.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

        quota: use printuid for id parameter printing.
        * quota.c (SYS_FUNC(quotactl)): Since id call argument is used for
        user/group/project ID which all have special semantics for -1,
        print it the same way as UIDs are printed.

        quota: display quota subcommand as a macro.
        * quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values
        (which also lacks shift of the left part) with QCMD macro call.

2016-09-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use VERBOSE macro in waitid and waitid-v tests.
        * tests/waitid-v.c (VERBOSE_RUSAGE): Remove.
        (VERBOSE): Define to 1.
        * tests/waitid.c (sprint_rusage): Check VERBOSE instead
        of VERBOSE_RUSAGE.

        tests: use VERBOSE macro in wait4 and wait4-v tests.
        * tests/wait4-v.c (VERBOSE_RUSAGE): Remove.
        (VERBOSE): Define to 1.
        * tests/wait4.c (sprint_rusage): Check VERBOSE instead
        of VERBOSE_RUSAGE.

        tests: use VERBOSE macro in msg_control and msg_control-v tests.
        * tests/msg_control-v.c (VERBOSE_MSGHDR): Remove.
        (VERBOSE): Define to 1.
        * tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead
        of VERBOSE_MSGHDR.

        tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests.
        * tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove.
        (VERBOSE): Define to 1.
        * tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead
        of VERBOSE_MMSGHDR.

        tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests.
        * tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove.
        (VERBOSE): Define to 1.
        * tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead
        of VERBOSE_IOCTL.

        tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests.
        * tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove.
        (VERBOSE): Define to 1.
        * tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL.

        tests: use VERBOSE macro in execveat and execveat-v tests.
        * tests/execveat-v.c (VERBOSE_EXECVEAT): Remove.
        (VERBOSE): Define to 1.
        * tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT.

        tests: use VERBOSE macro in execve and execve-v tests.
        * tests/execve-v.c (VERBOSE_EXECVE): Remove.
        (VERBOSE): Define to 1.
        * tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE.

2016-09-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add VERBOSE macro.
        Introduce VERBOSE macro (defaults to 0) that is expected to be defined
        to 1 by code testing "strace -v" output.

        * tests/tests.h [!VERBOSE] (VERBOSE): New macro.

2016-09-20  Dmitry V. Levin  <ldv@altlinux.org>

        decode_open: print the mode argument when O_TMPFILE flag is set.
        O_TMPFILE reqires the mode argument (just like O_CREAT), so print it.

        * open.c (STRACE_O_TMPFILE): New macro.
        (decode_open): Print the mode argument when O_TMPFILE flag is set.
        * tests/open.c (main): Check it.
        Fixes RH#1377846.

2016-09-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc in tests/ptrace.c.
        * tests/ptrace.c (errstr): New static variable.
        (do_ptrace): Initialize it using sprintrc.
        (test_peeksiginfo, main): Use errstr.

        tests: use sprintrc in tests/netlink_protocol.c.
        * tests/netlink_protocol.c (main): Use sprintrc.

        tests: use sprintrc in tests/fchownat.c.
        * tests/fchownat.c (main): Use sprintrc.

        tests: use sprintrc in tests/fchmodat.c.
        * tests/fchmodat.c (main): Use sprintrc.  Add more fchmodat decoding tests.

        tests: use sprintrc in tests/fchmod.c.
        * tests/fchmod.c (main): Use sprintrc.  Add more fchmod decoding tests.
        * tests/fchmod.test: Update the value specified for strace -a parameter.

        tests: use sprintrc in tests/getgroups.c.
        * tests/getgroups.c (main): Use sprintrc.

        tests: use sprintrc in tests/setgroups.c.
        * tests/setgroups.c (main): Use sprintrc.

2016-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests/utime.c: rewrite without assert.
        * tests/utime.c: Do not include <assert.h>.
        (main): Use sprintrc instead of assert.

        tests/xattr.c: rewrite without assert.
        * tests/xattr.c: Do not include <assert.h>.
        (main): Use sprintrc instead of assert.

        tests: use sprintrc in tests/xchownx.c.
        * tests/xchownx.c (main): Do not include <errno.h>.  Use sprintrc.

        tests/xstatfsx.c: fix potential errno clobbering.
        * tests/xstatfsx.c (main): Use sprintrc.

2016-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        Add more fs magic constants.
        Add *_MAGIC constants defined for some relatively widespread
        non-mainline filesystems.

        * xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC,
        VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants.

2016-09-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix whitespace for explicit type casts in futex test.

2016-09-14  Dmitry V. Levin  <ldv@altlinux.org>

        Add more fs magic constants.
        Add *_MAGIC constants defined inside linux fs but not explicitly
        exported via linux uapi.

        * xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC,
        EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC,
        BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC,
        FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC,
        VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER
        constants.

2016-09-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update fs *_MAGIC constants.
        Add fs *_MAGIC constants exported by linux uapi.

        * xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants
        defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h,
        respectively.

2016-09-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround limited semctl implementation in musl.
        musl libc forwards semctl command argument for 8 known commands only,
        for all the rest it passes 0 instead.

        * tests/ipc_sem.c (main): Update semctl expected output.

2016-09-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more IPC decoding checks.
        * tests/ipc_msg.c: Additional msgget (parameter format) and msgctl
        (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT
        commands) checks.
        * tests/ipc_sem.c: Additional semget and semctl checks.
        * tests/ipc_shm.c: Additional shmget and shmctl checks.
        * tests/semop.c: Additional semop checks.  Add checks for semtimedop.
        * tests/semop.test: Add explicit -e parameter in order to trace both
        semop and semtimedop.
        * tests/shmxt.c: Additional shmat and shmdt checks.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

        .mailmap: add addresses of Dr. David Alan Gilbert.
        * .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid
        duplications in CREDITS file.

2016-09-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

        .mailmap: add canonical name for Eugene Syromyatnikov.
        This is needed due to apparent deviation in spelling of commit author
        name in several commits.

        * .mailmap: Add canonical name for Eugene Syromyatnikov.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

        Update generic ioctl entries from linux 4.8.
        * linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.

2016-09-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        x32: update ioctl entries from linux 4.8.
        * linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh.

        maint: update for linux 4.8.
        * maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and
        xen/evtchn.h files.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc_grep in tests/ipc_shm.c.
        * tests/ipc_shm.c (main): Use sprintrc_grep.

        tests: use sprintrc_grep in tests/ipc_sem.c.
        * tests/ipc_sem.c (main): Use sprintrc_grep.

2016-09-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc_grep in tests/ipc_msg.c.
        * tests/ipc_msg.c (main): Use sprintrc_grep.

2016-09-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc in tests/chmod.c.
        * tests/chmod.c (main): Use sprintrc.  Add more chmod decoding tests.

2016-09-09  Dmitry V. Levin  <ldv@altlinux.org>

        ipc: fix printing of nsops argument of semop and semtimedop syscalls.
        According to POSIX, nsops argument of semop syscall has type size_t,
        but the kernel treats nsops argument of semop and semtimedop syscalls
        as unsigned int.

        * ipc_sem.c (tprint_sembuf_array): Change type of "count" argument
        from unsigned long to unsigned int, print it using %u format.

2016-09-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests/aio.c: bring indentation in conformance with the rest of the file.

2016-09-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use predefined constant in aio_context_t checks in aio test.
        Also fix io_cancel and io_destroy checks which did not check correct
        printing of context argument properly.

        * tests/aio.c (main): Update syscall checks in order to use newly
        defined bogus_ctx constant.

2016-09-09  Dmitry V. Levin  <ldv@altlinux.org>

        Mark io_setup and io_destroy as memory mapping related syscalls.
        As io_setup syscall allocates some memory using do_mmap_pgoff, and
        io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY
        flag for all sysentries of io_setup and io_destroy using the following
        oneliner:
        sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h

        * linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM.

2016-09-08  Dmitry V. Levin  <ldv@altlinux.org>

        travis: add x86 musl.
        * .travis.yml (matric): Add musl-gcc/x86.
        * travis-build.sh [TARGET == x86]: Specify --target along with --build
        to configure.
        * travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC.
        [CC == musl-gcc && TARGET == x86]: Add -m32 to $CC.  Specify --build
        and --target to musl configure invocation.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: use PRI__*64 macros in aio test.
        It was incorrectly assumed that __*64 types are long long on all
        platforms, despite strace having specially crafted macros in order
        to handle precisely this architecture discrepancy.
        The commit fixes this oversight.

        * tests/aio.c (main): Use PRI__*64 macros for correct format conversion
        specifiers for __*64-typed values.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        ipc: fix printing of integer arguments.
        * ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int
        by the kernel, cast it to int and print it using %d format.
        * ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise,
        for semid argument.
        (SYS_FUNC(semget)): Likewise, for nsems argument.
        (SYS_FUNC(semctl)): Likewise, for semid and semnum arguments.
        * ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument.
        * ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise.

2016-09-08  Dmitry V. Levin  <ldv@altlinux.org>

        ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls
        * ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel
        is __kernel_key_t (i.e. int), cast key_t argument to int
        and print it using %#x format.
        * ipc_sem.c (SYS_FUNC(semget)): Likewise.
        * ipc_shm.c (SYS_FUNC(shmget)): Likewise.
        * tests/ipc_msg.c (main): Test it.
        * tests/ipc_sem.c (main): Likewise.
        * tests/ipc_shm.c (main): Likewise.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more sched_getattr and sched_setattr decoding checks.
        * tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr
        decoding checks.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: change type of sched_nice field to signed in sched_xetattr test.
        Kernel headers declare this field as s32, and strace prints it with %d
        specifier.

        * tests/sched_xetattr.c (main): Change type of sched_nice field of struct
        sched_attr to int32_t, update format specifiers accordingly.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add sprintrc_grep function to libtests.
        New sprintrc_grep function is sprintrc function equivalent suitable for
        tests where grep-base pattern matching is employed.

        * tests/tests.h (sprintrc_grep): New prototype.
        * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration.
        (sprintrc_ex): New function, renamed from sprintrc and updated to
        support different formats.
        (sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW.
        (sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: perform more strict structure allocation in sched_xetattr test.
        Use tail_alloc with precise size of the structure.

        * tests/sched_xetattr.c (main): Eliminate usage of anonymous union type.
        Rename sched to sched_attr.  Change type of sched_attr to struct
        pointer.  Use tail_alloc for sched_attr allocation, update printf
        statements accrodingly.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: split long lines in sched_xetattr test.
        * tests/sched_xetattr.c (main): Split long lines.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests/aio.c: fix for x32 personality.
        * tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit
        and io_getevents until strace learns how to print 64-bit pointers on x32
        and on x86_64 for x32 personality.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

        aio: print aio_context_t as a pointer type.
        As aio_context_t is treated by the kernel as a pointer,
        print it using printaddr.

        * aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t
        argument using printnum_ptr.
        (SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel),
        SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr.
        * tests/aio.c (sprint_aio_context_t): Remove.
        (main): Update expected output.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests/aio.c: rewrite without assert.
        * tests/aio.c: Do not include <assert.h>.
        (main): Use sprintrc instead of assert.

2016-09-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add more aio decoding checks.
        * tests/aio.c (sprint_aio_context_t): New function.
        (main): Use it; add more checks.

2016-09-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add suffix and cast to 64-bit constants in aio test.
        This helps to avoid warnings like
        "integer constant is too large for ‘long’ type"
        reported by some versions of gcc on 32-bit platforms.

        * tests/aio.c (main): Add ULL suffix to 64-bit constants
        and cast them to unsigned long.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of perf_event_open syscall.
        * tests/perf_event_open.c: New file.
        * tests/perf_event_open.test: New test.
        * tests/.gitignore: Add perf_event_open.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add perf_event_open.test.

        Makefile.am: use pwd instead of realpath.
        * Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1)
        instead of less widespread realpath(1) utility from GNU coreutils.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use sprintrc in tests/xetpriority.c.
        * tests/xetpriority.c (main): Use sprintrc.

        tests: use sprintrc in vhangup.test.
        * tests/vhangup.c (main): Use sprintrc.

        tests: use sprintrc in tests/sockname.c.
        * tests/sockname.c (test_sockname_syscall): Use sprintrc.

        tests: use sprintrc in signalfd4.test.
        * tests/signalfd4.c (main): Use sprintrc.

        tests: use sprintrc in setrlimit.test.
        * tests/setrlimit.c (main): Use sprintrc.

        tests: use sprintrc in set_mempolicy.test.
        * tests/set_mempolicy.c (main, print_nodes): Use sprintrc.

        tests: use sprintrc in openat.test.
        * tests/openat.c (main): Use sprintrc.

        tests: use sprintrc in open.test.
        * tests/open.c (main): Use sprintrc.

        tests: use sprintrc in move_pages.test.
        * tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc.

        tests: use sprintrc in mlockall.test.
        * tests/mlockall.c (main): Use sprintrc.

        tests: use sprintrc in mlock.test.
        * tests/mlock.c (main): Use sprintrc.

        tests: use sprintrc in epoll_create1.test.
        * tests/epoll_create1.c (main): Use sprintrc.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fix printing of min_nr and nr arguments of io_getevents syscall.
        * tests/aio.c (main): Change output format for min_nr and nr arguments
        in io_getevents check to %ld, cast these arguments to long.

        tests: use sprintrc for return code output in aio test.
        * tests/aio.c (main): Use sprintrc for return code output.

        tests: add more tests for ched_rr_get_interval decoding.
        * tests/sched_rr_get_interval.c (main): Check decoding of invalid
        timespec pointer and successful syscall invocation.

        tests: use sprintrc for return code output in sched_rr_get_interval test
        * tests/sched_rr_get_interval.c (main): Use sprintrc for return code
        output.

        tests: add more tests for sched_getscheduler and sched_xetscheduler.
        * tests/sched_xetscheduler.c (main): Check for decoding of invalid PID
        in sched_getscheduler and sched_setscheduler, invalid address
        of sched_param structure, and invalid policy value.

        tests: use sprintrc for return code output in sched_xetscheduler test.
        * tests/sched_xetscheduler.c (main): Use sprintrc for return code output.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        aio: use printfd for fd printing.
        struct iocb contains two fields with fd semantics: aio_fildes and
        aio_resfd.  It is quite reasonable to use the appropriate function for
        printing them (apart from just "%d").

        * aio.c (print_common_flags): Add struct tcb pointer to parameter list;
        use printfd for printing aio_resfd field.
        (print_iocb_header): Add struct tcb pointer to parameter list;
        use printfd for printing aio_fildes field.
        (print_iocb): Provide tcp argument to print_iocb_header
        and print_common_flags.
        (SYS_FUNC(io_cancel)): Likewise.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

        sh64: wire up new syscalls.
        * linux/sh64/syscallent.h [380..393]: New entries.

2016-09-02  Dmitry V. Levin  <ldv@altlinux.org>

        sh: wire up new syscalls.
        * linux/sh/syscallent.h [369..382]: New entries.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

        avr32: wire up preadv2 and pwritev2 syscalls.
        * linux/avr32/syscallent.h [326]: Add preadv2 entry.
        [327]: Add pwritev2 entry.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: check decoding of readahead syscall.
        * configure.ac (AC_CHECK_FUNCS): Add readahead.
        * tests/readahead.c: New file.
        * tests/readahead.test: New test.
        * tests/.gitignore: Add readahead.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add readahead.test.

2016-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: move sprintrc function to libtests.
        * tests/tests.h (sprintrc): New prototype.
        * tests/futex.c (sprintrc): Move to ...
        * tests/sprintrc.c: ... new file.
        * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c.

        tests/futex: add support to sprintrc for return codes other than 0 and -1
        * tests/futex.c (sprintrc): Print the actual return code provided,
        not just "0".  Check snprintf return code.

        tests/futex: increase sprintrc static buffer size.
        * tests/futex.c (sprintrc): Increase buffer size from 256 to 4096.

        tests/futex: rename retstr to sprintrc.
        * tests/futex.c (retstr): Rename to sprintrc.
        (main): Convert all retstr calls to sprintrc.

2016-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

        readahead: fix print format for the "count" argument.
        According to documentation and kernel's syscalls.h, its type is size_t,
        so "%lu" format should be used instead of "%ld".

        * readahead.c (SYS_FUNC(readahead)): Fix conversion specifier
        for the "count" argument.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll
        Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros
        instead of explicit casts with unpredictable sign extension semantics.

        * tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull
        instead of explicit cast.
        (print_stat): Use zero_extend_signed_to_ull and
        sign_extend_unsigned_to_ll instead of explicit casts.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add sign_extend_unsigned_to_ll macro.
        * tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h.

2016-08-31  Eugene Syromiatnikov  <evgsyr@gmail.com>

        Refactor common sa_handler printing code.
        * xlat/sa_handler_values.in: New file.
        * signal.c: Include "xlat/sa_handler_values.h".
        (get_sa_handler_str, print_sa_handler): New functions.
        (SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

        Update TCP* constants.
        * xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux
        kernel commit v4.8-rc1~140^2~226.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Update SCTP_* constants.
        * xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO,
        and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits
        v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and
        v4.8-rc1~140^2~148^2~3, respectively.

        Update fs *_MAGIC constants.
        * xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced
        by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74,
        respectively.

        Update KEXEC_ARCH_* constants.
        * xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux
        kernel commit v4.8-rc1~16^2~41.

        Update ETH_P_* constants.
        * xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel
        commit v4.8-rc1~140^2~65^2~8.

        Update BPF_* constants.
        * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced
        by linux kernel commit v4.8-rc1~140^2~212^2~2.
        * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced
        by linux kernel commit v4.8-rc1~140^2~64^2~10.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove HAVE_SIGACTION checks.
        The syscall parsers guarded by HAVE_SIGACTION check have to be compiled
        regardless of libc sigaction function availability.

        * configure.ac (AC_CHECK_FUNCS): Remove sigaction.
        * signal.c: Remove HAVE_SIGACTION checks.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove obsolescent autoconf macro AC_TYPE_SIGNAL.
        All supported systems are expected to have C89 conforming sematics.

        * configure.ac (AC_TYPE_SIGNAL): Remove.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove obsolescent autoconf macro AC_C_CONST.
        All supported systems are expected to have the 'const' keyword.

        * configure.ac (AC_C_CONST): Remove.

2016-08-30  Eugene Syromiatnikov  <evgsyr@gmail.com>

        tests: check decoding of futex syscall.
        * tests/futex.c: New file.
        * tests/futex.test: New test.
        * tests/.gitignore: Add futex.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add futex.test.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: do not pretend <linux/futex.h> is included.
        As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is
        never defined and therefore the inclusion of <linux/futex.h> guarded by
        HAVE_LINUX_FUTEX_H makes no sense.

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

        * futex.c [HAVE_LINUX_FUTEX_H]: Remove.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: avoid printing val when it is not used by the futex command.
        This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET
        command.

        * futex.c (SYS_FUNC(futex)): Remove common printing of val argument.
        Add printing of val argument for all futex commands except
        FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set.
        * xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and
        FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel
        since commit v4.5-rc1~172^2.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: fix formatting of unknown command argument.
        Use alternate form for printing hexadecimal numbers to avoid confusion.
        Use printaddr to print uaddr as the latter is interpreted as a pointer
        in all currently supported futex operations.

        * futex.c (SYS_FUNC(futex)): Fix formatting of unknown command
        argument.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: add handling of FUTEX_FD command.
        Since obsolete FUTEX_FD command is known and used to have some expected
        argument format, print FUTEX_FD using that format.

        * futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: fix formatting of val3 hexadecimal argument.
        * futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET,
        print hexadecimal val3 argument in alternate form to avoid confusion.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

        futex: fix FUTEX_WAKE_OP compare function mask.
        According to the initial and current (v4.7) kernel implementations,
        in FUTEX_WAKE_OP case the compare function does not have
        FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24.

        * futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT
        for 27th bit of val3 in FUTEX_WAKE_OP case.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c.
        * bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS.
        * tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
        Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
        to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC.
        [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
        Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
        to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC.
        [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
        Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
        to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC.
        [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
        Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
        to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC.

        Based on patch by James Clarke <jrtc27@jrtc27.com>.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove redundant check for PTRACE_LISTEN availability.
        As ptrace.h already ensures that PTRACE_LISTEN is defined,
        there is no need to check this fact in other places.

        * strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused autoconf macro AC_TYPE_GETGROUPS.
        strace code does not use GETGROUPS_T.

        * configure.ac (AC_TYPE_GETGROUPS): Remove.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused autoconf macro AC_TYPE_MODE_T.
        strace code already redefines mode_t.

        * configure.ac (AC_TYPE_MODE_T): Remove.

2016-08-30  James Clarke  <jrtc27@jrtc27.com>

        Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64.
        SPARC has a different PTRACE_DETACH value correctly defined in
        sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one.
        PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h,
        so use that instead.

        * strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH
        to PTRACE_SUNDETACH ...
        * ptrace.h [SPARC || SPARC64]: ... here.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        Remove obsolescent autoconf macro AC_HEADER_STDC.
        All systems supported by strace are expected to have C89 conforming
        header files.

        * configure.ac (AC_HEADER_STDC): Remove.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unneeded autoconf macro AC_HEADER_DIRENT.
        strace code already includes <dirent.h> unconditionally.

        * configure.ac (AC_HEADER_DIRENT): Remove.

2016-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unneeded autoconf macro AC_HEADER_STDBOOL.
        strace code assumes C99.

        * configure.ac (AC_HEADER_STDBOOL): Remove.
        * defs.h: Include <stdbool.h> unconditionally.

2016-08-27  Dmitry V. Levin  <ldv@altlinux.org>

        Remove obsolescent autoconf macro AC_HEADER_STAT.
        No systems supported by strace are expected to have the bug workarounded
        by AC_HEADER_STAT macro.

        * configure.ac (AC_HEADER_STAT): Remove.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally.
        glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated
        inclusion of <sys/sysmacros.h> by <sys/types.h>.  The method used
        for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer
        defines MAJOR_IN_SYSMACROS, which consequently breaks build.

        Let's assume that all systems supported by strace provide major, minor,
        and makedev macros via <sys/sysmacros.h>.

        * configure.ac (AC_HEADER_MAJOR): Remove.
        * mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove.
        Include <sys/sysmacros.h> unconditionally.
        * print_struct_stat.c: Likewise.
        * tests/mknod.c: Likewise.
        * tests/mknodat.c: Likewise.
        * tests/xstatx.c: Likewise.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

        btrfs: mpersify struct btrfs_ioctl_vol_args_v2.
        This complements commit v4.11-719-gfb0c609.

        * btrfs.c (struct_btrfs_ioctl_vol_args_v2): New type.  Mpersify it.
        (btrfs_print_qgroup_inherit): Change qgi_addr type to unsigned long.
        (btrfs_ioctl): Replace struct btrfs_ioctl_vol_args_v2 with
        struct_btrfs_ioctl_vol_args_v2.

2016-08-29  Elvira Khabirova  <lineprinter0@gmail.com>

        mpers.awk: relax union member name absence check.
        This fixes mpersing of unions containing nameless members,
        e.g. struct btrfs_ioctl_vol_args_v2.

        * mpers.awk (what_is): Print names of union_type members as is.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        Revert "tests/xstatx.c: fix stat syscall tests on mips64"
        Previous commit effectively changed types of st_atime, st_ctime, and
        st_mtime members of struct stat and struct stat64 to signed integers,
        making the mips64 workaround obsolete.

        This reverts commit 3fb84bfc79949c145197c61fbf04ce18464e9112.

        * tests/xstatx.c (create_sample) [__mips64]: Remove.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify parsers of struct stat and struct stat64.
        On many architectures that support multiple personalities,
        struct stat differ between personalities.  While old code could handle
        these differences, there are some architectures, e.g. sparc64, that also
        have different struct stat64.  Rewrite parsers using mpers functionality
        to fix these issues.

        * fetch_struct_stat.c: New file.
        * fetch_struct_stat64.c: Likewise.
        * print_struct_stat.c: Likewise.
        * oldstat.c: Likewise.
        * stat.c: Likewise.
        * stat.h: Likewise.
        * stat64.c: Likewise.
        * file.c: Remove.
        * printstat.h: Likewise.
        * linux/aarch64/stat32.h: Likewise.
        * linux/powerpc64/stat32.h: Likewise.
        * linux/riscv/stat32.h: Likewise.
        * linux/sparc64/stat32.h: Likewise.
        * linux/tile/stat32.h: Likewise.
        * linux/x32/stat32.h: Likewise.
        * linux/x86_64/stat32.h: Likewise.
        * Makefile.am (strace_SOURCES): Add fetch_struct_stat.c,
        fetch_struct_stat64.c, print_struct_stat.c, oldstat.c, stat.c, stat.h,
        and stat64.c.  Remove file.c, printstat.h, linux/aarch64/stat32.h,
        linux/powerpc64/stat32.h, linux/riscv/stat32.h, linux/sparc64/stat32.h,
        linux/tile/stat32.h, linux/x32/stat32.h, and linux/x86_64/stat32.h.
        * configure.ac (AC_CHECK_MEMBERS): Add struct stat64.st_mtime_nsec.
        * defs.h (struct strace_stat): New declaration.
        (print_struct_stat): New prototype.
        * linux/dummy.h (sys_fstatat64): Remove.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: check for struct stat64, struct stat, and their members.
        * m4/mpers.m4 (st_MPERS_STRUCT_STAT): New macro.
        (st_MPERS): Use it.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh.
        This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts
        of source code.

        * Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS
        passed to mpers.sh.
        * mpers_test.sh: Likewise.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        Move redefinition of stat types to asm_stat.h.
        * file.c: Move redefinition of types that might be used
        to define struct stat ...
        * linux/asm_stat.h: ... here.
        * tests/xstatx.c: Remove redefinition of stat types.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: provide a replacement of <asm/stat.h> for x32 personality.
        For the reason described in commit v4.10-517-gcfde1e3, a correct
        definition of struct stat for x32 personality is necessary to enable
        "asm_stat.h" with -mx32 on x86_64.

        * linux/x32/asm_stat.h: Rename to ...
        * linux/x86_64/asm_stat.h: ... new file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h".

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        x32/asm_stat.h: provide definitions for i386 personality.
        This enables x32/asm_stat.h with -m32.

        * linux/x32/asm_stat.h [__x86_64__ && __ILP32__]: Redirect stat.
        Include "linux/asm_stat.h".
        (struct stat): Define for [__x86_64__ && __ILP32__] only.
        (struct __old_kernel_stat): Remove.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce a separate SEN entry for fstatat64 syscall.
        * linux/dummy.h (sys_fstatat64): Redirect to sys_newfstatat.
        * linux/32/syscallent.h: Replace SEN(newfstatat) with SEN(fstatat64).
        * linux/alpha/syscallent.h: Likewise.
        * 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-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * pathtrace.c (pathtrace_match): Handle SEN_fstatat64.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        Do not check for struct stat.st_{a,c}time_nsec.
        Assume that the check for struct stat.st_mtime_nsec is enough.
        Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec,
        struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec,
        and struct stat.st_ctim.tv_nsec.
        * file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
        HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove.
        * printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
        HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with
        HAVE_STRUCT_STAT_ST_MTIME_NSEC.
        * tests/xstatx.c: Likewise.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        Add sign_extend_unsigned_to_ll macro.
        * defs.h (sign_extend_unsigned_to_ll): New macro, mirrors
        zero_extend_signed_to_ull.

        zero_extend_signed_to_ull: add short int support.
        * defs.h (zero_extend_signed_to_ull): Add short int support.
        * tests/tests.h: Likewise.

        Rename widen_to_ull to zero_extend_signed_to_ull.
        * defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull.
        All callers changed.
        * tests/tests.h: Likewise.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: remove obsolete code.
        Remove remains of solaris personality support.
        This complements commit v4.10-45-gdf4dd8b.

        * file.c [SPARC || SPARC64] (SYS_FUNC(xstat), SYS_FUNC(fxstat)): Remove.

2016-08-22  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix decoding of struct stat64 related syscalls.
        For some reason, struct stat and struct stat64 are different on sparc64.
        This change fixes decoding of struct stat64 related syscalls for sparc64
        personality, sparc32 personality on sparc64 needs more work.

        * file.c (printstat64) [SPARC64]: Do not use printstat.
        (SYS_FUNC(newfstatat)): Likewise.

2016-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: fill old_value argument in timer{,fd}_xettime tests.
        This is needed in order to differentiate it from the value returned
        by the call.  As a consequence, it enables revealing possible bugs
        in syscall parsers, for example, when the value read on syscall
        entering and not on syscall exiting, as it was the case with
        timerfd_settime parser.

        * tests/timer_xettime.c (main): Fill old.its field with value different
        from the expected one upon call return.
        * tests/timerfd_xettime.c: Likewise.

2016-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Fix old_value argument retrieval in timerfd_settime parser.
        This is done similar to timer_settime syscall parser.

        * time.c (SYS_FUNC(timerfd_settime)): Retrieve old_value argument
        on exiting and not on entering.  Return 0 instead of RVAL_DECODED
        since the call hasn't been decoded in full on entering.

2016-08-21  Richard W.M. Jones  <rjones@redhat.com>

        Add RISC-V architecture support.
        The original port of strace was done by Palmer Dabbelt
        (eecs.berkeley.edu), based on strace 4.9.

        * configure.ac: Define RISCV for riscv*.
        * clone.c [RISCV]: Define ARG_* macros as for OR1K.
        * defs.h [RISCV] (SUPPORTED_PERSONALITIES): Define to 2.
        [RISCV] (NEED_UID16_PARSERS): Define to 1.
        * linux/riscv/arch_regs.c: New file.
        * linux/riscv/errnoent1.h: Likewise.
        * linux/riscv/get_error.c: Likewise.
        * linux/riscv/get_scno.c: Likewise.
        * linux/riscv/get_syscall_args.c: Likewise.
        * linux/riscv/ioctls_arch0.h: Likewise.
        * linux/riscv/ioctls_arch1.h: Likewise.
        * linux/riscv/ioctls_inc0.h: Likewise.
        * linux/riscv/ioctls_inc1.h: Likewise.
        * linux/riscv/signalent1.h: Likewise.
        * linux/riscv/stat32.h: Likewise.
        * linux/riscv/syscallent.h: Likewise.
        * linux/riscv/syscallent1.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.

2016-08-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Move SH-specific argument number calculation to getllval.
        This change prevents scattering of ll-related hacks and simplifies
        pread/pwrite syscalls parsers' logic a bit.

        * util.c (getllval): Add fixup for arg_no for SuperH when argument
        number is equal to 3.
        * io.c (PREAD_OFFSET_ARG): Remove.
        (SYS_FUNC(pread)): Always use argument number 3 for "count" argument
        printing.
        (SYS_FUNC(pwrite)): Likewise.

2016-08-21  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix sigreturn decoding for sparc personality.
        * linux/sparc/arch_sigreturn.c (arch_sigreturn): Parametrize
        member types of struct signal_frame.
        * linux/sparc64/arch_sigreturn.c (sparc64_arch_sigreturn,
        sparc32_arch_sigreturn): New functions.
        (arch_sigreturn): Use them.

2016-08-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compat decoding of struct sigaction.sa_mask on big endian architectures
        * signal.c (decode_new_sigaction) [SUPPORTED_PERSONALITIES > 1 &&
        SIZEOF_LONG > 4]: Use LONG_LONG to convert sa_mask from 32-bit
        struct sigaction to 64-bit struct sigaction.

2016-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of indirect shmat's return code for non-native personalities
        * ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data
        to obtain return code of indirect shmat subcall.

2016-08-18  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix sparc personality decoding of mmap64's offset argument.
        * linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff.

2016-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix decoding of the forth argument of semctl syscall.
        On sparc64, unlike all other architectures where semctl is an indirect
        ipc subcall, the forth argument is passed directly.

        * ipc_sem.c (SYS_FUNC(semctl)) [SPARC64]: Print 4th argument without
        indirection in case of native personality.

2016-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        Add sparc64 specific ptrace constants.
        * xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64,
        PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64.

        sparc64: fix sign extension bug of syscall args for sparc personality.
        * linux/sparc64/get_syscall_args.c (get_syscall_args): Zero-extend
        syscall args from 32 bit for sparc personality.

2016-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix tty ioctl numbers.
        The structures defined in asm/termbits.h have the same size
        on sparc and sparc64.

        * linux/sparc64/ioctls_arch0.h (TCGETS, TCGETS2, TCSETS, TCSETS2,
        TCSETSF, TCSETSF2, TCSETSW, TCSETSW2): Sync with
        linux/sparc/ioctls_arch0.h

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        evdev.c: fix typo in comment.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Drop support of dummy members of struct stat.
        As st_flags, st_fstype, and st_gen members of struct stat are not filled
        by the kernel, there is no use supporting them.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_flags,
        struct stat.st_fstype, and struct stat.st_gen.
        * file.c [STAT32_PERSONALITY, HAVE_STRUCT_STAT64]: Do not undefine
        HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE,
        and HAVE_STRUCT_STAT_ST_GEN.
        * printstat.h (DO_PRINTSTAT): Do not check for
        HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE,
        and HAVE_STRUCT_STAT_ST_GEN.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that struct stat contains st_blksize, st_blocks, and st_rdev.
        Our test suite already assumes that struct stat contains st_blksize,
        st_blocks, and st_rdev members, and there haven't been any complaints.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize,
        struct stat.st_blocks, and struct stat.st_rdev.
        * printstat.h (DO_PRINTSTAT): Do not check for
        HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS,
        and HAVE_STRUCT_STAT_ST_RDEV.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix pause.test when pause syscall is not available.
        * tests/pause.c (main): Fix expected output when pause syscall
        is not available.

2016-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc64, sparc64: fix redefinitions of ARCH_PC_REG.
        This fixes compilation warning that ARCH_PC_REG is redefined.

        * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Undefine before
        the new definition.
        * linux/sparc64/arch_regs.c (ARCH_PC_REG): Likewise.

2016-08-14  Dmitry V. Levin  <ldv@altlinux.org>

        s390x, x32: remove redundant definitions of ARCH_PC_REG.
        * linux/s390x/arch_regs.c (ARCH_PC_REG): Remove, it is already defined
        in just included linux/s390/arch_regs.c.
        * linux/x32/arch_regs.c (ARCH_PC_REG): Remove, it is already defined
        in just included linux/x86_64/arch_regs.c.

2016-08-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check for leaks of placeholder descriptors.
        * tests/redirect-fds.c: New file.
        * tests/redirect-fds.test: New test.
        * tests/.gitignore: Add redirect-fds.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add redirect-fds.test.

        tests/init.sh: print exit code of failed commands.
        * init.sh (run_prog, run_prog_skip_if_failed): When the program fails,
        add its exit code to the diagnostic message.
        (run_strace): When strace fails, add its exit code to the diagnostic
        message.
        (run_strace_merge): When strace-log-merge fails, add its exit code
        to the diagnostic message.

2016-08-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix leakage of placeholder descriptors to tracees.
        As a side effect of commit v4.11-211-g0736d4e, strace used to leak
        placeholders for standard descriptors to tracees thus affecting their
        behaviour.  Fix this by setting close-on-exec flag on placeholder
        descriptors.

        * strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor
        that is going to be returned to the caller.
        (fd_is_placeholder): New array.
        (ensure_standard_fds_opened, redirect_standard_fds): New functions.
        (startup_child): Use redirect_standard_fds.
        (init): Use ensure_standard_fds_opened.

2016-08-12  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix decoding of uid and gid-related syscalls.
        sparc64 has no native 16-bit uid/gid syscalls.

        * linux/sparc64/syscallent.h (chown, lchown, setuid, getuid, setgid,
        getgid, geteuid, getegid, getgroups, setgroups, fchown, setreuid,
        setregid, setfsuid, setfsgid): Change handlers from 16-bit to 32-bit.

2016-08-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix *stat64 tests on alpha.
        On some architectures including alpha, <asm/stat.h> provides a
        definition of struct stat that has no st_atime_nsec, st_mtime_nsec, and
        st_ctime_nsec fields.  At the same time, struct stat64 always has these
        fields.  Fix tests to take this difference into account.

        * tests/fstat64.c (STRUCT_STAT_IS_STAT64): New macro, defined to 1.
        * tests/lstat64.c (STRUCT_STAT_IS_STAT64): Likewise.
        * tests/stat64.c (STRUCT_STAT_IS_STAT64): Likewise.
        * tests/xstatx.c [!STRUCT_STAT] (STRUCT_STAT_IS_STAT64): New macro,
        defined to 0.
        [USE_ASM_STAT && STRUCT_STAT_IS_STAT64]:
        (HAVE_STRUCT_STAT_ST_ATIME_NSEC, HAVE_STRUCT_STAT_ST_CTIME_NSEC,
        HAVE_STRUCT_STAT_ST_MTIME_NSEC): Redefine to 1.

2016-08-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip rt_tgsigqueueinfo.test when the syscall is not available.
        * tests/rt_tgsigqueueinfo.c (main): Skip the test when the syscall
        is not available.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

        tests/fcntl.c: fix fcntl test on mips64.
        On mips64 the F_GETLK and F_SETLKW64 constants have identical values which
        causes the "wrong" constant to be printed by strace.

        tests/fcntl.c (test_flock64): Do not test F_SETLKW64 on mips64.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

        tests/nsyscalls.test: only trace the "syscall" syscall on mips o32.
        The "syscall" syscall only exists on o32 and causes strace to error out on
        64-bit mips ABIs. Pass MIPS_ABI from the configure script through to
        nsyscalls.test so the MIPS ABI can be checked.

        * configure.ac (MIPS_ABI): Substitute into output files.
        * tests/Makefile.am (MIPS_ABI): Export via AM_TEST_LOG_FLAGS.
        * tests/nsyscalls.test: Restrict special mips handling to mips o32.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

        tests/xstatx.c: fix stat syscall tests on mips64.
        For historical reasons the kernel struct stat represents times as unsigned
        32-bit integers on mips64. Therefore, while it's possible to give a file a
        timestamp before 1970 with futimens, reading the same timestamp through
        struct stat will give a positive time (around 2106).
        Workaround by using positive timestamps for testing on mips64.

        * tests/xstatx.c (create_sample): Use positive timestamps on mips64.

2016-08-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests/mlock2.c: fix test failure on mips64.
        * tests/mlock2.c (main): Pass unsigned long arguments to mlock2 syscall
        explicitly, to avoid unwanted sign extension issues.

        Based on patch by James Cowgill <james410@cowgill.org.uk>

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        Use <asm/unistd.h> instead of <sys/syscall.h>
        There are no users of SYS_* macros provided by <sys/syscall.h>,
        and definitions of __NR_* macros could be obtained directly
        from <asm/unistd.h>.

        * defs.h: Include <asm/unistd.h> instead of <sys/syscall.h>.
        * test/seccomp.c: Likewise.
        * test/threaded_execve.c: Likewise.
        * test/x32_lseek.c: Likewise.
        * test/x32_mmap.c: Likewise.
        * tests/_newselect.c: Likewise.
        * tests/access.c: Likewise.
        * tests/acct.c: Likewise.
        * tests/aio.c: Likewise.
        * tests/alarm.c: Likewise.
        * tests/attach-f-p.c: Likewise.
        * tests/bpf.c: Likewise.
        * tests/brk.c: Likewise.
        * tests/chmod.c: Likewise.
        * tests/chown.c: Likewise.
        * tests/chown32.c: Likewise.
        * tests/chroot.c: Likewise.
        * tests/clock_adjtime.c: Likewise.
        * tests/clock_nanosleep.c: Likewise.
        * tests/clock_xettime.c: Likewise.
        * tests/copy_file_range.c: Likewise.
        * tests/creat.c: Likewise.
        * tests/dup2.c: Likewise.
        * tests/dup3.c: Likewise.
        * tests/epoll_create.c: Likewise.
        * tests/epoll_create1.c: Likewise.
        * tests/epoll_ctl.c: Likewise.
        * tests/epoll_pwait.c: Likewise.
        * tests/epoll_wait.c: Likewise.
        * tests/eventfd.c: Likewise.
        * tests/execveat.c: Likewise.
        * tests/faccessat.c: Likewise.
        * tests/fchdir.c: Likewise.
        * tests/fchmod.c: Likewise.
        * tests/fchmodat.c: Likewise.
        * tests/fchown.c: Likewise.
        * tests/fchown32.c: Likewise.
        * tests/fchownat.c: Likewise.
        * tests/fcntl.c: Likewise.
        * tests/fcntl64.c: Likewise.
        * tests/fdatasync.c: Likewise.
        * tests/flock.c: Likewise.
        * tests/fstat.c: Likewise.
        * tests/fstat64.c: Likewise.
        * tests/fstatat64.c: Likewise.
        * tests/fstatfs.c: Likewise.
        * tests/fstatfs64.c: Likewise.
        * tests/fsync.c: Likewise.
        * tests/ftruncate.c: Likewise.
        * tests/ftruncate64.c: Likewise.
        * tests/futimesat.c: Likewise.
        * tests/get_mempolicy.c: Likewise.
        * tests/getcwd.c: Likewise.
        * tests/getdents.c: Likewise.
        * tests/getdents64.c: Likewise.
        * tests/getegid.c: Likewise.
        * tests/getegid32.c: Likewise.
        * tests/geteuid.c: Likewise.
        * tests/geteuid32.c: Likewise.
        * tests/getgid.c: Likewise.
        * tests/getgid32.c: Likewise.
        * tests/getgroups.c: Likewise.
        * tests/getgroups32.c: Likewise.
        * tests/getpgrp.c: Likewise.
        * tests/getrandom.c: Likewise.
        * tests/getresgid.c: Likewise.
        * tests/getresgid32.c: Likewise.
        * tests/getresuid.c: Likewise.
        * tests/getresuid32.c: Likewise.
        * tests/getrlimit.c: Likewise.
        * tests/getrusage.c: Likewise.
        * tests/getuid.c: Likewise.
        * tests/getuid32.c: Likewise.
        * tests/getxxid.c: Likewise.
        * tests/ioctl_uffdio.c: Likewise.
        * tests/ioperm.c: Likewise.
        * tests/iopl.c: Likewise.
        * tests/ipc.c: Likewise.
        * tests/kill.c: Likewise.
        * tests/lchown.c: Likewise.
        * tests/lchown32.c: Likewise.
        * tests/libmmsg.c: Likewise.
        * tests/libsocketcall.c: Likewise.
        * tests/link.c: Likewise.
        * tests/linkat.c: Likewise.
        * tests/llseek.c: Likewise.
        * tests/lseek.c: Likewise.
        * tests/lstat.c: Likewise.
        * tests/lstat64.c: Likewise.
        * tests/mbind.c: Likewise.
        * tests/membarrier.c: Likewise.
        * tests/memfd_create.c: Likewise.
        * tests/migrate_pages.c: Likewise.
        * tests/mkdir.c: Likewise.
        * tests/mkdirat.c: Likewise.
        * tests/mknod.c: Likewise.
        * tests/mknodat.c: Likewise.
        * tests/mlock.c: Likewise.
        * tests/mlock2.c: Likewise.
        * tests/move_pages.c: Likewise.
        * tests/newfstatat.c: Likewise.
        * tests/nsyscalls.c: Likewise.
        * tests/old_mmap.c: Likewise.
        * tests/oldselect.c: Likewise.
        * tests/open.c: Likewise.
        * tests/openat.c: Likewise.
        * tests/pause.c: Likewise.
        * tests/poll.c: Likewise.
        * tests/prctl-seccomp-filter-v.c: Likewise.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/preadv2-pwritev2.c: Likewise.
        * tests/prlimit64.c: Likewise.
        * tests/pselect6.c: Likewise.
        * tests/ptrace.c: Likewise.
        * tests/readdir.c: Likewise.
        * tests/readlink.c: Likewise.
        * tests/readlinkat.c: Likewise.
        * tests/reboot.c: Likewise.
        * tests/remap_file_pages.c: Likewise.
        * tests/rename.c: Likewise.
        * tests/renameat.c: Likewise.
        * tests/renameat2.c: Likewise.
        * tests/rmdir.c: Likewise.
        * tests/rt_sigpending.c: Likewise.
        * tests/rt_sigprocmask.c: Likewise.
        * tests/rt_sigsuspend.c: Likewise.
        * tests/rt_sigtimedwait.c: Likewise.
        * tests/rt_tgsigqueueinfo.c: Likewise.
        * tests/sched_get_priority_mxx.c: Likewise.
        * tests/sched_rr_get_interval.c: Likewise.
        * tests/sched_xetaffinity.c: Likewise.
        * tests/sched_xetattr.c: Likewise.
        * tests/sched_xetparam.c: Likewise.
        * tests/sched_xetscheduler.c: Likewise.
        * tests/sched_yield.c: Likewise.
        * tests/seccomp-filter-v.c: Likewise.
        * tests/seccomp-filter.c: Likewise.
        * tests/seccomp-strict.c: Likewise.
        * tests/select.c: Likewise.
        * tests/sendfile.c: Likewise.
        * tests/sendfile64.c: Likewise.
        * tests/set_mempolicy.c: Likewise.
        * tests/setdomainname.c: Likewise.
        * tests/setfsgid.c: Likewise.
        * tests/setfsgid32.c: Likewise.
        * tests/setfsuid.c: Likewise.
        * tests/setfsuid32.c: Likewise.
        * tests/setgid.c: Likewise.
        * tests/setgid32.c: Likewise.
        * tests/setgroups.c: Likewise.
        * tests/setgroups32.c: Likewise.
        * tests/sethostname.c: Likewise.
        * tests/setregid.c: Likewise.
        * tests/setregid32.c: Likewise.
        * tests/setresgid.c: Likewise.
        * tests/setresgid32.c: Likewise.
        * tests/setresuid.c: Likewise.
        * tests/setresuid32.c: Likewise.
        * tests/setreuid.c: Likewise.
        * tests/setreuid32.c: Likewise.
        * tests/setrlimit.c: Likewise.
        * tests/setuid.c: Likewise.
        * tests/setuid32.c: Likewise.
        * tests/signalfd4.c: Likewise.
        * tests/socketcall.c: Likewise.
        * tests/splice.c: Likewise.
        * tests/stat.c: Likewise.
        * tests/stat64.c: Likewise.
        * tests/statfs.c: Likewise.
        * tests/statfs64.c: Likewise.
        * tests/swap.c: Likewise.
        * tests/symlink.c: Likewise.
        * tests/symlinkat.c: Likewise.
        * tests/sync.c: Likewise.
        * tests/sync_file_range.c: Likewise.
        * tests/sync_file_range2.c: Likewise.
        * tests/syslog.c: Likewise.
        * tests/tee.c: Likewise.
        * tests/time.c: Likewise.
        * tests/timer_create.c: Likewise.
        * tests/timer_xettime.c: Likewise.
        * tests/timerfd_xettime.c: Likewise.
        * tests/times-fail.c: Likewise.
        * tests/times.c: Likewise.
        * tests/truncate.c: Likewise.
        * tests/truncate64.c: Likewise.
        * tests/ugetrlimit.c: Likewise.
        * tests/umount.c: Likewise.
        * tests/umount2.c: Likewise.
        * tests/uname.c: Likewise.
        * tests/unix-pair-send-recv.c: Likewise.
        * tests/unlink.c: Likewise.
        * tests/unlinkat.c: Likewise.
        * tests/userfaultfd.c: Likewise.
        * tests/utimes.c: Likewise.
        * tests/vhangup.c: Likewise.
        * tests/vmsplice.c: Likewise.
        * tests/waitid.c: Likewise.
        * tests/waitpid.c: Likewise.
        * tests/xet_robust_list.c: Likewise.
        * tests/xetpgid.c: Likewise.
        * tests/xetpriority.c: Likewise.
        * tests/xettimeofday.c: Likewise.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: replace SYS_clone2 with __NR_clone2.
        Migrate to __NR_* the last user of SYS_* macros provided
        by <sys/syscall.h>.

        * clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace
        SYS_clone2 with __NR_clone2.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        Make sure that tcp->s_ent and tcp->s_prev_ent do not point to freed memory
        This complements commit v4.13-33-g60d7ec8.

        * syscall.c (sysent_buf): New structure.
        (free_sysent_buf): New function.
        (get_scno): Use them.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        file.c: move definitions of struct stat32 to separate files.
        * linux/aarch64/stat32.h: New file.
        * linux/powerpc64/stat32.h: Likewise.
        * linux/sparc64/stat32.h: Likewise.
        * linux/tile/stat32.h: Likewise.
        * linux/x32/stat32.h: Likewise.
        * linux/x86_64/stat32.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions
        of struct stat32, include "stat32.h" instead.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: remove obsolete code.
        Remove remains of solaris personality support.
        This complements commit v4.10-45-gdf4dd8b.

        * file.c [SPARC || SPARC64]: Remove the code related to struct solstat.
        (printstat, printoldstat) [SPARC || SPARC64]: Remove.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix decoding of stat family syscalls.
        This complements commit v4.13-28-gaebfe83.

        * file.c [SPARC64]: Change STAT32_PERSONALITY to 1.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of invalid syscalls mapped to indirect subcalls.
        When the syscall number returned by arch_get_scno is a mapped indirect
        subcall (i.e. mapped subcall of socketcall or ipc syscall), do not
        mistakenly treat it as a valid indirect subcall.

        * defs.h (SCNO_IS_VALID): Treat scno with TRACE_INDIRECT_SUBCALL flag
        as invalid.
        * syscall.c (syscall_name): Do no shuffle scno.
        (trace_syscall_entering, trace_syscall_exiting): Use
        tcp->s_ent->sys_name instead of syscall_name.
        (get_scno): In case of invalid syscall, allocate a dynamic struct sysent
        containing an appropriate .sys_name.
        * tests/nsyscalls.c (main) [SYS_socket_subcall]: Check decoding
        of direct syscall number SYS_socket_subcall+1.
        (main) [SYS_ipc_subcall]: Check decoding of direct syscall number
        SYS_ipc_subcall+1.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        linux/subcall.h: remove redundant definitions.
        * linux/subcall.h: Remove definitions of non-existent socket
        and ipc subcalls.

        defs.h: simplify SUPPORTED_PERSONALITIES definition.
        * defs.h: Group definition of SUPPORTED_PERSONALITIES by value.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: simplify PERSONALITY1_WORDSIZE definition.
        Move definition of PERSONALITY1_WORDSIZE macro outside arch specific
        ifdefs.

        * defs.h [SPARC64 || X86_64 || X32 || AARCH64 || POWERPC64 || TILE]
        (PERSONALITY1_WORDSIZE): Remove.
        [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_WORDSIZE): Define to 4
        unconditionally.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: simplify PERSONALITY0_WORDSIZE definition.
        Move definition of PERSONALITY0_WORDSIZE macro outside arch specific
        ifdefs.

        * defs.h (PERSONALITY0_WORDSIZE): Define to SIZEOF_LONG unconditionally.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: swap personality numbers.
        Fix inconsistency between syscall and ioctl entries on sparc64.
        Make layout of personalities on sparc64 the same as on other
        architectures that support two personalities.

        * defs.h [SPARC64] (PERSONALITY0_WORDSIZE): Change to 8.
        [SPARC64] (PERSONALITY1_WORDSIZE): Change to 4.
        * linux/sparc64/get_scno.c (arch_get_scno): Swap personality numbers.
        * linux/sparc64/ioctls_arch1.h: Rename to ioctls_arch0.h.
        * linux/sparc64/ioctls_arch0.h: Rename to ioctls_arch1.h.
        * linux/sparc64/ioctls_inc0.h: Rename to ioctls_inc1.h.
        * linux/sparc64/ioctls_inc1.h: Rename to ioctls_inc0.h.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: cleanup personality specific macro definitions.
        Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS,
        PERSONALITY[12]_INCLUDE_PRINTERS_DECLS,
        PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS
        macros outside arch specific ifdefs.

        * defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove.
        [SPARC64 && HAVE_M32_MPERS]: Remove.
        [X86_64 && HAVE_M32_MPERS]: Remove.
        [X86_64 && HAVE_MX32_MPERS]: Remove.
        [X32 && HAVE_M32_MPERS]: Remove.
        [AARCH64 && HAVE_M32_MPERS]: Remove.
        [POWERPC64 && HAVE_M32_MPERS]: Remove.
        [TILE && HAVE_M32_MPERS]: Remove.
        (PERSONALITY0_INCLUDE_PRINTERS_DECLS,
        PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally.
        [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS]
        (PERSONALITY1_INCLUDE_PRINTERS_DECLS,
        PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS,
        MPERS_m32_IOCTL_MACROS): Define for
        [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case.
        (PERSONALITY2_INCLUDE_PRINTERS_DECLS,
        PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS,
        MPERS_mx32_IOCTL_MACROS): Define for
        [SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case.

2016-08-07  Dmitry V. Levin  <ldv@altlinux.org>

        Change #include guard trailing part comments.
        * defs.h: Change comment of the trailing part of #include guard.
        * flock.h: Likewise.
        * gcc_compat.h: Likewise.
        * ipc_defs.h: Likewise.
        * kernel_types.h: Likewise.
        * mpers_type.h: Likewise.
        * msghdr.h: Likewise.
        * printsiginfo.h: Likewise.
        * ptrace.h: Likewise.
        * regs.h: Likewise.
        * seccomp_fprog.h: Likewise.
        * sigevent.h: Likewise.
        * statfs.h: Likewise.
        * xlat.h: Likewise.

2016-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

        Unify usage of #include guards.
        This commit is an attempt to unify usage of include guards (in top-level
        headers, at least).  As a side note, different files with *.h extension
        have different semantics: for example, printargs.h is included multiple
        times in order to generate slightly varying code depending on values of
        macro definitions - maybe it's better to change extension of such files
        to something like *.inc.

        * defs.h: Add #include guard.
        * flock.h: Likewise.
        * ipc_defs.h: Likewise.
        * mpers_type.h: Likewise.
        * printsiginfo.h: Likewise.
        * ptrace.h: Likewise.
        * regs.h: Likewise.
        * seccomp_fprog.h: Likewise.
        * gcc_compat.h: Rename the macro used for #include guard.
        * msghdr.h: Likewise.
        * sigevent.h: Likewise.
        * kernel_types.h: Comment the trailing part of #include guard.
        * xlat.h: Add missing macro definition for #include guard.

2016-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add #include guards.
        * tests/tests.h: Add #include guard.

2016-08-05  Dmitry V. Levin  <ldv@altlinux.org>

        linux: add #include guards.
        * linux/dummy.h: Add #include guard.
        * linux/inet_diag.h: Likewise.
        * linux/netlink_diag.h: Likewise.
        * linux/sock_diag.h: Likewise.
        * linux/syscall.h: Likewise.
        * linux/unix_diag.h: Likewise.

2016-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests/umode_t.c: guard against libc printf format errors.
        * tests/umode_t.c (test_syscall): Use different printf format specifiers
        to detect libc printf format errors.

2016-08-04  Dmitry V. Levin  <ldv@altlinux.org>

        travis: use a suitable musl revision.
        There seems to be no readily available binary packages of musl that are
        sufficiently up to date to be used to build and test strace, so prepare
        a suitable musl from source.

        * travis-install.sh (musl-gcc): Do not add an extra repository,
        do not install musl-tools and linux-musl-dev packages.
        Download, build, and install a suitable musl revision instead.

2016-08-03  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of mode_t, umode_t, and umask types.
        Print numeric umode_t type using %#03ho format.
        Print return value of umask syscall using %#03lo format.
        When printing symbolic mode_t type, always print lower 9 bits,
        and print the numeric part using %#03o format.

        * defs.h (sprintmode): Remove.
        (print_symbolic_mode_t, print_numeric_umode_t,
        print_numeric_long_umask): New prototypes.
        * printmode.c (sprintmode): Remove.
        (print_symbolic_mode_t, print_numeric_umode_t,
        print_numeric_long_umask): New functions.
        * chmod.c (decode_chmod): Use print_numeric_umode_t.
        * ipc_msg.c (SYS_FUNC(msgget)): Likewise.
        * ipc_msgctl.c (print_msqid_ds): Likewise.
        * ipc_sem.c (SYS_FUNC(semget)): Likewise.
        * ipc_shm.c (SYS_FUNC(shmget)): Likewise.
        * ipc_shmctl.c (print_shmid_ds): Likewise.
        * mq.c (SYS_FUNC(mq_open)): Likewise.
        * open.c (decode_open, SYS_FUNC(creat)): Likewise.
        * umask.c (SYS_FUNC(umask)): Likewise.
        * mknod.c (decode_mknod): Use print_symbolic_mode_t.
        * printstat.h (DO_PRINTSTAT): Likewise.
        * syscall.c (trace_syscall_exiting): Use print_numeric_long_umask.
        * tests/umode_t.c: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/creat.c: Rewrite as a thin wrapper around umode_t.c
        * tests/mkdir.c: Likewise.
        * tests/mkdirat.c: Likewise.
        * tests/mknod.c: Extend test coverage of mknod syscall.
        * tests/mknodat.c: Extend test coverage of mknodat syscall.
        * tests/umask.c: Extend test coverage of umask syscall.
        * tests/creat.test: Update the value specified for strace -a parameter.
        * tests/mkdir.test: Likewise.
        * tests/mkdirat.test: Likewise.
        * tests/mknodat.test: Likewise.

2016-08-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: simplify attach-f-p.test.
        * tests/attach-f-p.c Simplify communications between threads
        by replacing per-thread timers with pipes.
        * tests/attach-f-p.test: Do not ignore signals.

        tests: cleanup attach-p-cmd.test.
        * tests/attach-p-cmd-cmd.c (main): Cleanup expected output.
        * tests/attach-p-cmd-p.c (main): Print expected output.
        * tests/attach-p-cmd.test: Do not print expected output.

        ip_mreq.test: rewrite from match_grep to match_diff.
        * tests/ip_mreq.c (main): Print expected output.
        * tests/ip_mreq.test: Use run_strace_match_diff.
        * tests/ip_mreq.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

        fanotify_mark.test: rewrite from match_grep to match_diff.
        * tests/fanotify_mark.c (main): Print expected output.
        * tests/fanotify_mark.test: Use run_strace_match_diff.
        * tests/fanotify_mark.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

        signalfd4.test: rewrite from match_grep to match_diff.
        * tests/signalfd4.c (get_sigset_size): New function.
        (main): Use it.  Print expected output.
        * tests/signalfd4.test: Use run_strace_match_diff.
        * tests/signalfd4.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

2016-07-31  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rename signalfd.test to signalfd4.test.
        * tests/signalfd.c: Rename to signalfd4.c.
        * tests/signalfd.test: Rename to signalfd4.test.
        * tests/signalfd.expected: Rename to signalfd4.expected.
        * tests/.gitignore: Replace signalfd with signalfd4.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Replace signalfd.test with signalfd4.test.
        (EXTRA_DIST): Replace signalfd.expected with signalfd4.expected.

2016-07-30  Dmitry V. Levin  <ldv@altlinux.org>

        memfd_create.test: rewrite from match_grep to match_diff.
        * tests/memfd_create.c (main): Print expected output.
        * tests/memfd_create.test: Use run_strace_match_diff.
        * tests/memfd_create.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

2016-07-29  Dmitry V. Levin  <ldv@altlinux.org>

        Set exit status to 1 if strace has not traced any processes.
        * strace.c (main): Initialize exit_code with 1 when no processes
        has been attached.
        * strace.1: Document it.
        * NEWS: Mention this change.

        Attach to the target process before attempting to attach to its siblings
        * strace.c (attach_tcb): Attach to tcp->pid first.

        Report the name of ptrace command when ptrace_attach_or_seize fails.
        * strace.c (ptrace_attach_cmd): New variable.
        (ptrace_attach_or_seize): Save last ptrace command's name
        to ptrace_attach_cmd.
        (attach_tcb, startup_child): Use it in error diagnostics.

        strace.c: refactor startup_attach.
        * strace.c (startup_attach): Move the inner part of the big loop
        over tcbtab elements ...
        (attach_tcb): ... to this new function.

        startup_attach: do not use atoi.
        * strace.c (startup_attach): Replace atoi with string_to_uint.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        Do not enable mpers runtime checks if mpers is not enabled.
        * m4/mpers.m4 (HAVE_RUNTIME): Enable iff both mpers and runtime
        work properly.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        linux/dummy_check.sh: remove obsolete script.
        Starting with commit v4.10-62-ga0bd374, function prototypes
        of syscall parsers are generated at build time.

        * linux/dummy_check.sh: Remove.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        generate_xlat_in.sh: remove obsolete script.
        This script has been created by commit v4.8-180-g0ed617b
        for the one-shot job of automatic convertion of xlat structures
        from *.c files to xlat/*.in files.

        * generate_xlat_in.sh: Remove.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use terse notation in designated initializers where appropriate.
        * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Initialize
        struct btrfs_ioctl_dev_replace_args using terse notation.
        * tests/clock_nanosleep.c (main): Initialize struct timespec
        using terse notation.
        * tests/nanosleep.c (main): Likewise.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use extended regular expressions where appropriate.
        When grep or sed is used with basic regular expressions containing
        '(', ')', '{', '}', '|', '?', and '+' special characters, convert them
        to extended regular expressions for better portability and readability.

        * generate_mpers_am.sh: Convert grep and sed BREs to EREs.
        * Makefile.am (ioctl_redefs%.h, m%_type_defs.h, m%_funcs.h,
        mpers_printer_decl_pattern, printers.h, %_printer_decls.h,
        %_printer_defs.h): Convert sed BREs to EREs.
        * generate_sen.sh: Likewise.
        * linux/mips/genstub.sh: Likewise.
        * make-dsc: Likewise.
        * mpers.sh: Likewise.
        * xlat/gen.sh: Likewise.
        * tests/Makefile.am (ksysent.h): Likewise.
        * tests/ksysent.sed: Likewise.
        * tests/pc.test: Likewise.
        * tests/strace-S.test: Likewise.
        * tests/strace-V.test: Likewise.
        * tests/strace-k.test: Likewise.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix extended regexps.
        * tests/adjtimex.c (main): Consistently quote curly braces
        in expected output.
        * tests/uio.expected: Likewise.

2016-07-27  Dmitry V. Levin  <ldv@altlinux.org>

        Post-release administrivia.
        * NEWS: Add header line for the next release.
        * debian/changelog.in: Add a changelog entry for 4.13-1.
        * strace.spec.in: Likewise.

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.13 release.
        * NEWS: Update for 4.13 release.

        Fix one more code pattern that might break gcc strict aliasing rules.
        * btrfs.c (btrfs_ioctl): Add one more expicit cast to "void *",
        to avoid breaking strict-aliasing rules reported by some gcc compilers.
        * syscall.c (decode_socket_subcall): Likewise.
        * util.c (next_set_bit): Likewise.
        * tests/btrfs.c (btrfs_test_send_ioctl): Likewise.

        Fix casts of ptrace's third argument.
        * strace.c (maybe_allocate_tcb): Replace "(char *) 0" with NULL
        as ptrace's third argument.
        * linux/sparc64/get_scno.c (arch_get_scno): Cast third argument
        of ptrace to "void *'.
        * syscall.c (get_regs): Likewise.
        * upeek.c (upeek): Likewise.
        * util.c (umoven): Likewise.

        tests/btrfs.c: do not include the same header file twice.
        * tests/btrfs.c: Do not include <sys/fcntl.h>, <fcntl.h> is enough.

        tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition.
        * tests/accept4.c: Check that O_CLOEXEC is defined.  Use O_CLOEXEC
        instead of SOCK_CLOEXEC.

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix vhangup.test.
        * tests/vhangup.c (main): Fix expected output for the case when
        the calling process has CAP_SYS_TTY_CONFIG capability.

        Reported-by: Yun-Chih Chen <b03902074@ntu.edu.tw>

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix chown.test.
        * tests/chown.test: Fix the value specified for strace -a parameter.

        Reported-by: Yun-Chih Chen <b03902074@ntu.edu.tw>

2016-07-25  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix syscall entries for x86_64 variants of io_setup and io_submit.
        * linux/x32/syscallent.h (64:io_setup, 64:io_submit): Change handler
        to printargs.

        tests/ipc.c: fix typo.

2016-07-24  Dmitry V. Levin  <ldv@altlinux.org>

        NEWS: Prepare for 4.13 release.

2016-07-23  Dmitry V. Levin  <ldv@altlinux.org>

        debian: add gcc-multilib to Build-Depends for relevant architectures.
        * debian/control (Build-Depends) [amd64, ppc64, sparc64, x32]:
        Add gcc-multilib to enable multiple personalities support.

2016-07-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of ipc syscall.
        * tests/ipc.c: New file.
        * tests/ipc.test: New test.
        * tests/.gitignore: Add ipc.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ipc.test.

        Fix corner cases of ipc syscall decoding.
        * xlat/ipccalls.in: New file.
        * ipc.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * linux/dummy.h (sys_ipc): Remove stub alias.
        * syscall.c (decode_ipc_subcall): Treat 1st argument of ipc syscall
        as "unsigned int".
        [S390 || S390X]: Skip ipc cubcalls that have non-zero version.
        [SPARC64]: Likewise, for the native personality.
        Save ipc cubcall version for later use by specific ipc parsers.
        * ipc_msg.c (SYS_FUNC(msgrcv)): Handle non-zero ipc subcall version.
        [SPARC64]: Handle non-ipc_kludge case for the native personality.
        * linux/subcall.h (msgrcv): Change nargs from 4 to 5.
        * linux/s390/syscallent.h (ipc): Change nargs from 6 to 5.
        * linux/s390x/syscallent.h (ipc): Likewise.

2016-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip netlink_protocol.test on old systems.
        * tests/netlink_protocol.c: Check that HAVE_SYS_XATTR_H is defined.
        Include <stdlib.h> and <sys/xattr.h>.
        (main): Check that system.sockprotoname attribute is supported.

        Do not print too many arguments of socketcall syscall.
        * socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args"
        syscall arguments.
        * tests/socketcall.c (test_socketcall): Update expected output.
        * tests/socketcall.test: Likewise.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests/nsyscalls.c: change the type of syscall arguments to kernel_ulong_t
        As most syscalls on x32 and mips n32 are actually 64-bit,
        check that 64-bit syscall arguments are decoded properly.

        This also workarounds x32 gcc sign extension bug
        reported by Eugene Syromyatnikov at
        https://sourceforge.net/p/strace/mailman/message/35150860/

        * tests/nsyscalls.c: Include "kernel_types.h".
        (main): Change the type of syscall arguments to kernel_ulong_t.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        x32, mips n32: make printargs print full 64-bit syscall arguments.
        As most of x32 syscalls are regular x86_64 syscalls, they should be
        printed by default as 64-bit syscalls, and syscall parsers at their
        discretion might print syscalls differently.  This is already
        implemented in 64-bit strace tracing x32 personality processes,
        and now x32 strace will also behave this way.

        Similar reasoning applies to mips n32.

        * util.c (printargs) [HAVE_STRUCT_TCB_EXT_ARG]: Print syscall arguments
        from ext_arg array using %llx format.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of socketcall syscall.
        * tests/socketcall.c: New file.
        * tests/socketcall.test: New test.
        * tests/.gitignore: Add socketcall.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add socketcall.test.

        Fix corner cases of socketcall syscall.
        * xlat/socketcalls.in: New file.
        * socketcall.c: New file.
        * Makefile.am (libstrace_a_SOURCES): Add it.
        * linux/dummy.h (sys_socketcall): Remove stub alias.
        * syscall.c (decode_socket_subcall): Treat 1st argument of socketcall
        as "int".  Do not substitute syscall until all socketcall arguments
        have been fetched successfully.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding and dumping of send and recv syscalls.
        * tests/unix-pair-send-recv.c: New file.
        * tests/unix-pair-send-recv.expected: Likewise.
        * tests/unix-pair-send-recv.test: New test.
        * tests/.gitignore: Add unix-pair-send-recv.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add unix-pair-send-recv.test.
        (EXTRA_DIST): Add unix-pair-send-recv.expected.

        tests: rename unix-pair-send-recv to unix-pair-sendto-recvfrom.
        * dumpio.expected: Rename to unix-pair-sendto-recvfrom.expected.
        * dumpio.test: Rename to unix-pair-sendto-recvfrom.test.
        * unix-pair-send-recv.c: Rename to unix-pair-sendto-recvfrom.c
        * .gitignore: Rename unix-pair-send-recv to unix-pair-sendto-recvfrom.
        * Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add unix-pair-sendto-recvfrom.test.
        (MISC_TESTS): Remove dumpio.test.
        (EXTRA_DIST): Rename dumpio.expected
        to unix-pair-sendto-recvfrom.expected.

        tests: check decoding of shutdown syscall.
        * tests/shutdown.c: New file.
        * tests/shutdown.test: New test.
        * tests/.gitignore: Add shutdown.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add shutdown.test.

        xlat/shutdown_modes.in: convert to modern syntax.
        * xlat/shutdown_modes.in: Replace open-coded xlat table with a list
        of constants.

        tests: check silent decoding of sendmmsg and recvmmsg syscalls.
        * tests/mmsg-silent.c: New file.
        * tests/mmsg-silent.test: New test.
        * tests/.gitignore: Add mmsg-silent.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mmsg-silent.test.

        Print unsent messages of failed sendmmsg syscall.
        * mmsghdr.c (decode_mmsgvec): Clear syserror for the time of printing
        struct mmsghdr array in !use_msg_len case.
        (SYS_FUNC(sendmmsg)): As failed sendmmsg syscall does not
        set msg_len fields, tell this to decode_mmsgvec.
        * tests/mmsg_name.c (test_mmsg_name): Check it.

        Print unsent messages of sendmmsg syscall.
        * defs.h (decode_mmsgvec): Add int argument.
        * mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field.
        (print_struct_mmsghdr): Print struct mmsghdr.msg_len only for
        msg_len_vlen first elements of struct mmsghdr array.
        (decode_mmsgvec): Add msg_len_vlen argument.
        (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec
        the number of elements of struct mmsghdr array that contain meaningful
        struct mmsghdr.msg_len.
        * tests/mmsg_name.c (test_mmsg_name): Check it.

        tests: check verbose decoding of msg_name* fields of struct mmsghdr array
        * tests/mmsg_name-v.c: New file.
        * tests/mmsg_name-v.test: New test.
        * tests/.gitignore: Add mmsg_name-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mmsg_name-v.test.

        tests: check decoding of msg_name* fields of struct mmsghdr array.
        * tests/mmsg_name.c: New file.
        * tests/mmsg_name.test: New test.
        * tests/.gitignore: Add mmsg_name.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mmsg_name.test.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of msg_name* fields of recvmmsg syscall's msghdr array argument
        As msg_namelen fields of recvmmsg syscall's struct msghdr array have
        the same read-write semantics as struct msghdr argument of recvmsg
        syscall, parser of recvmmsg syscall needs a similar fix.

        * mmsghdr.c (print_struct_mmsghdr): Increment p_user_msg_namelen field.
        (mmsgvec_data): New structure.
        (free_mmsgvec_data, save_mmsgvec_namelen): New functions.
        (decode_mmsgvec): Take into account the data saved
        by save_mmsgvec_namelen function.
        (SYS_FUNC(recvmmsg)): Use save_mmsgvec_namelen.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        mmsghdr.c: rewrite decode_mmsgvec using print_array.
        * fetch_struct_mmsghdr.c (sizeof_struct_mmsghdr): New mpers printer.
        * mmsghdr.c: Include <limits.h>.
        (print_struct_mmsghdr_config): New structure.
        (fetch_struct_mmsghdr_or_printaddr, print_struct_mmsghdr): New functions.
        (decode_mmsgvec): Rewrite using them and print_array.

        tests: check decoding of timeout argument of recvmmsg syscall.
        * tests/recvmmsg-timeout.c: New file.
        * tests/recvmmsg-timeout.test: New test.
        * tests/.gitignore: Add recvmmsg-timeout.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add recvmmsg-timeout.test.

        Fix printing of remaining timeout of recvmmsg syscall.
        * mmsghdr.c (SYS_FUNC(recvmmsg)): Do not print remaining timeout
        when the 5th syscall argument is NULL.
        * tests/mmsg.c (main): Update expected output.

        Remove configure checks for recvmmsg and sendmmsg.
        * configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg.

        tests: add recv_mmsg and send_mmsg functions to libtests.
        * tests/tests.h (recv_mmsg, send_mmsg): New prototype.
        * tests/libmmsg.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/mmsg.c Do not check for __NR_sendmmsg, __NR_recvmmsg,
        HAVE_SENDMMSG, and HAVE_RECVMMSG.  Do not include unused headers.
        (recv_mmsg, send_mmsg): Remove.

        tests: add socketcall function to libtests.
        * tests/tests.h (socketcall): New prototype.
        * tests/libsocketcall.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Use IOV_MAX instead of UIO_MAXIOV.
        IOV_MAX appears to be more portable than UIO_MAXIOV.

        * msghdr.c: Include <limits.h>. Remove fallback defintion of UIO_MAXIOV.
        (get_optmem_max): Replace UIO_MAXIOV with IOV_MAX.
        * tests/msg_control.c: Likewise.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Unabuse struct tcb.auxstr.
        As we've got a proper mechanism that parsers can use for storing private
        data between entering and exiting stages, all cases of struct tcb.auxstr
        abuse should go.

        * btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong
        instead of abusing tcp->auxstr.
        * file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
        * msghdr.c (SYS_FUNC(recvmsg)): Likewise.
        * net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise.
        * v4l2.c (print_v4l2_queryctrl): Likewise.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix race condition in decoding timeout argument of recvmmsg syscall.
        As the value returned by sprint_timespec points to a static area and may
        be overwritten by subsequent calls to sprint_timespec, it is not safe to
        save this value on entering syscall and use it later on exiting.

        * mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value
        returned by sprint_timespec to a dynamically allocated memory, and save
        the pointer using set_tcb_priv_data.  On exiting, restore it using
        get_tcb_priv_data.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix race condition in decoding rt_sigtimedwait's timeout argument.
        As the value returned by sprint_timespec points to a static area and may
        be overwritten by subsequent calls to sprint_timespec, it is not safe to
        save this value on entering syscall and use it later on exiting.

        * signal.c (SYS_FUNC(rt_sigtimedwait)): On entering syscall, copy the
        value returned by sprint_timespec to a dynamically allocated memory,
        and save the pointer using set_tcb_priv_data.  On exiting, restore it
        using get_tcb_priv_data.

2016-07-18  Patrik Jakobsson  <patrik.jakobsson@linux.intel.com>

        Add private data field to struct tcb.
        We need to be able to store private data in the struct tcb across it's
        lifetime.  To ensure proper deallocation of this stored data a callback
        must be provided along with the data.  The callback is executed
        automatically on exiting syscall, and when the life of the tcb ends.

        * defs.h (struct tcb): Add _priv_data and _free_priv_data fields.
        (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data):
        New prototypes.
        (get_tcb_priv_ulong, set_tcb_priv_ulong): New static inline functions.
        * strace.c (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data):
        New functions.
        (droptcb): Call free_tcb_priv_data.
        * syscall.c (trace_syscall_exiting): Call free_tcb_priv_data
        when clearing TCB_INSYSCALL flag.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: move parsers of sendmsg and recvmsg syscalls to msghdr.c.
        * defs.h (fetch_msghdr_namelen, decode_msghdr): Remove.
        * net.c (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Move ...
        * msghdr.c: ... here.
        (fetch_msghdr_namelen, decode_msghdr): Add static qualifier.

        net.c: move parsers of sendmmsg and recvmmsg syscalls to mmsghdr.c.
        * defs.h (decode_mmsgvec): Remove.
        * net.c: Do not include "msghdr.h".
        (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Move ...
        * mmsghdr.c: ... here.
        (decode_mmsgvec): Add static qualifier.

        msghdr.c: move all mmsghdr parsers to a separate file.
        * msghdr.h (print_struct_msghdr): New prototype.
        * msghdr.c (print_msghdr): Rename to print_struct_msghdr, remove
        static qualifier, all callers changed.
        (decode_mmsghdr, decode_mmsgvec, dumpiov_in_mmsghdr): Move to ...
        * mmsghdr.c: ... new file.
        * Makefile.am (strace_SOURCES): Add it.

2016-07-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable part of msg_name test on non-glibc systems.
        Sadly, musl recvmsg wrapper blindly dereferences 2nd argument,
        so limit the affected part of the test to glibc that doesn't.

        * tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test
        with inaccessible 2nd argument.

2016-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        Print struct iovec as a regular structure.
        * io.c (print_iovec): Print names of iov_base and iov_len fields.
        * tests/aio.c (main): Update expected output.
        * tests/inet-cmsg.c (main): Likewise.
        * tests/mmsg.c (main): Likewise.
        * tests/msg_name.c (test_msg_name): Likewise.
        * tests/preadv-pwritev.c (main): Likewise.
        * tests/preadv2-pwritev2.c (main): Likewise.
        * tests/preadv.c (main): Likewise.
        * tests/pwritev.c (main): Likewise.
        * tests/readv.c (main): Likewise.
        * tests/recvmsg.c (main): Likewise.
        * tests/vmsplice.c (main): Likewise.
        * tests/scm_rights-fd.test: Likewise.
        * tests/uio.expected: Likewise.

        tests: check decoding of msghdr.msg_name* arguments of recvmsg syscall.
        * tests/msg_name.c: New file.
        * tests/msg_name.test: New test.
        * tests/.gitignore: Add msg_name.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add msg_name.test.

2016-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of struct msghdr.msg_name* arguments of recvmsg syscall.
        As the msghdr.msg_namelen argument of recvmsg syscall has the same
        read-write semantics as the address length argument of recvfrom syscall,
        parser of recvmsg syscall needs a similar fix.

        * defs.h (fetch_msghdr_namelen): New prototype.
        (decode_msghdr): Add "int *" argument.
        * msghdr.c (print_msghdr): Likewise.  Treat it as a pointer to struct
        msghdr.msg_namelen passed to the kernel.  Pass to decode_sockaddr
        the size of socket address actually returned by the kernel.
        Print both user and kernel address lengths when the value changes.
        (decode_msghdr, decode_mmsghdr): Add "int *" argument,
        forward it to print_msghdr.
        (decode_mmsgvec): Update decode_mmsghdr invocation.
        (fetch_msghdr_namelen): New function.
        * net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation.
        (SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save
        struct msghdr.msg_namelen.  On exiting, pass the saved value
        to decode_msghdr.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        Update generic ioctl entries from linux 4.7.
        * linux/64/ioctls_inc.h: Update from linux v4.7 using ioctls_gen.sh.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.

2016-07-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        x32: update ioctl entries from linux 4.7.
        * linux/x32/ioctls_inc0.h: Update from linux v4.7 using ioctls_gen.sh.

        maint: update for linux 4.7.
        * maint/ioctls_sym.sh: Drop obsolete workarounds for linux/btrfs.h.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        block.c: remove BLKDAXGET support.
        BLKDAXGET was removed by linux kernel commit v4.7-rc1~78^2^2~4.

        * block.c: Do not define BLKDAXGET.
        (block_ioctl): Remove BLKDAXGET support.
        * tests/ioctl_block.c (main): Remove BLKDAXGET test.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of socklen argument of bind and sendto syscalls.
        * net.c (SYS_FUNC(bind)): Print 3rd syscall argument using %d format.
        (SYS_FUNC(sendto)): Print 6th syscall argument using %d format.

        tests: check decoding of sockaddr related arguments of recvfrom syscall.
        * configure.ac (AC_CHECK_FUNCS): Add recvfrom.
        * tests/recvfrom.c: New file.
        * tests/recvfrom.test: New test.
        * tests/.gitignore: Add recvfrom.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add recvfrom.test.

        Fix decoding of sockaddr related arguments of recvfrom syscall.
        * net.c (SYS_FUNC(recvfrom)): Use fetch_socklen.  Save the address
        length passed to the kernel and print it on error.  Do not print more
        bytes of the socket address than actually returned by the kernel.
        Print both user and kernel address lengths when the returned address
        is truncated.

        tests: check decoding of accept4 syscall.
        * configure.ac (AC_CHECK_FUNCS): Add accept4.
        * tests/accept4.c: New file.
        * tests/accept4.test: New test.
        * tests/.gitignore: Add accept4.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add accept4.test.

        tests: check decoding of accept syscall.
        * tests/accept.c: New file.
        * tests/accept.test: New test.
        * tests/.gitignore: Add accept.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add accept.test.

        tests: check decoding of getpeername syscall.
        * tests/getpeername.c: New file.
        * tests/getpeername.test: New test.
        * tests/.gitignore: Add getpeername.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getpeername.test.

        tests: check decoding of getsockname syscall.
        * tests/getsockname.c: New file.
        * tests/getsockname.test: New test.
        * tests/sockname.c: New file.
        * tests/.gitignore: Add getsockname.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getsockname.test.
        (EXTRA_DIST): Add sockname.c.

        Print both values of changing address length in sockname family syscalls
        * net.c (decode_sockname): Print both user and kernel address lengths
        when the value changes.
        * tests/net-y-unix.c (main): Update expected output.
        * tests/net-yy-unix.c (main): Likewise.
        * tests/net.expected: Likewise.

        Enhance diagnostics of address truncation in sockname family syscalls.
        * net.c (decode_sockname): Print both user and kernel address lengths
        when the returned address is truncated.
        * tests/sun_path.expected: Update expected output.

        Fix decoding of getsockname, getpeername, accept, and accept4 syscalls.
        * net.c (fetch_socklen): New function.
        (decode_sockname): Use it.  On entering syscall, decode early
        and return RVAL_DECODED when possible.  On error, print the address
        length passed to the kernel.  Do not print more bytes of the socket
        address than actually returned by the kernel.

2016-07-11  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare parsers of sockname family syscalls for the upcoming fix.
        * net.c (do_sockname): Rename to decode_sockname, drop second argument,
        do not print sock_type_flags, return RVAL_DECODED on exiting.
        (SYS_FUNC(accept), SYS_FUNC(getsockname)): Use decode_sockname instead
        of do_sockname, take its return code into account.
        (SYS_FUNC(accept4)): Likewise.  Print sock_type_flags when
        decode_sockname returns RVAL_DECODED.

2016-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        netlink: handle multipart netlink messages.
        Handle multipart netlink messages made of multiple struct nlmsghdr
        headers with associated payload in one byte stream.

        * netlink.c (fetch_nlmsghdr, print_nlmsghdr,
        decode_nlmsghdr_with_payload): New functions.
        (decode_netlink): Use them.
        * tests/netlink_parsing.c (send_query): Check them.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend netlink protocol check.
        * tests/netlink_protocol.c (send_query): Check that no part
        of netlink message is fetched beyond the end of message.
        Check decoding of zero address and zero length messages.
        Check decoding of messages with nlmsg_len exceeding message length.

2016-07-07  Fabien Siron  <fabien.siron@epita.fr>

        tests: check decoding of netlink protocol.
        * tests/netlink_protocol.test: New test.
        * tests/netlink_protocol.c: New file.
        * tests/.gitignore: Add netlink_protocol.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add netlink_protocol.test.

2016-07-07  Fabien Siron  <fabien.siron@epita.fr>

        Add a general netlink socket parser.
        Introduce a general socket netlink parser which prints the header and
        a string for the remaining part of the buffer.  It doesn't handle all
        the netlink flags and types yet because the parser needs more
        information, this will be implemented later.

        * net.c (decode_sockbuf): New function.
        (SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)):
        Use it instead of printstr.
        * msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto()
        for netlink sockets.
        * netlink.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (decode_netlink, getfdproto): New prototypes.
        (iov_decode): Add IOV_DECODER_NETLINK.
        * io.c (print_iovec): Use decode_netlink().
        * util.c (getfdproto): Remove static keyword.
        * xlat/netlink_flags.in: New file.
        * xlat/netlink_types.in: New file.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

        Update sigaltstack SS_* constants.
        * xlat/sigaltstack_flags.in: Add SS_AUTODISARM introduced
        by linux kernel commit v4.7-rc1~195^2.

        Update fs *_MAGIC constants.
        * xlat/fsmagic.in: Add NSFS_MAGIC, TRACEFS_MAGIC, BPF_FS_MAGIC,
        and UDF_SUPER_MAGIC introduced by linux kernel commits
        v3.19-rc1~53^2~7^2~1, v4.1-rc1~147^2~4, v4.4-rc1~141^2~17^2~1,
        and v4.7-rc1~161^2, respectively.

2016-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        Update KEYCTL_* constants.
        * xlat/keyctl_commands.in: Add KEYCTL_DH_COMPUTE introduced
        by linux kernel commit v4.7-rc1~124^2~2^2~2^2.

        Update input event constants.
        * xlat/evdev_keycode.in: Add KEY_* constants introduced
        by linux kernel commit v4.7-rc6~32^2~6^2.

2016-07-04  Dmitry V. Levin  <ldv@altlinux.org>

        Update RWF_* constants.
        * xlat/rwf_flags.in: Add RWF_DSYNC and RWF_SYNC introduced
        by linux kernel commit v4.7-rc1~158^2~1.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

        Update BPF_MAP_TYPE_* constants.
        * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_TRACEPOINT introduced
        by linux kernel commit v4.7-rc1~154^2~332^2~6.

2016-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr.c: limit output when printing excessively large messages.
        Limit output of struct msghdr.msg_control when
        struct msghdr.msg_controllen is greater than the maximum ancillary
        buffer size specified in /proc/sys/net/core/optmem_max file.

        * configure.ac (AC_CHECK_FUNCS): Add open64.
        * defs.h (read_int_from_file): New prototype.
        * util.c (read_int_from_file): New function.
        * msghdr.c (get_optmem_max): New function based on read_int_from_file.
        (decode_msg_control): Use it to check control_len argument.
        * tests/msg_control.c (test_big_len): New function.
        (main): Use it to test printing of excessively large messages.

2016-07-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add read_int_from_file function to libtests.
        * tests/overflowuid.c (read_int_from_file): New function.
        (check_overflow_id): Use it.
        * tests/tests.h (read_int_from_file): New prototype.

2016-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode.
        * msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen
        bytes of ip options in abbrev mode.
        * tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN.
        (test_sol_ip): Test IP_RETOPTS output in abbrev mode.

        msghdr.c: limit SCM_RIGHTS output in abbrev mode.
        * msghdr.c (print_scm_rights): Do not print more than max_strlen
        descriptors in abbrev mode.
        * tests/msg_control.c (DEFAULT_STRLEN): New macro.
        (print_fds): Use it.
        (test_scm_rights3): New function.
        (main): Use it to test SCM_RIGHTS output in abbrev mode.
        * tests/msg_control-v.c: New file.
        * tests/msg_control-v.test: New test.
        * tests/.gitignore: Add msg_control-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add msg_control-v.test.

2016-07-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of struct msghdr ancillary data.
        * tests/msg_control.c: New file.
        * tests/msg_control.test: New test.
        * tests/.gitignore: Add msg_control.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add msg_control.test.

2016-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr.c: reorganize struct cmsghdr handler.
        * msghdr.c (sock_ee): New structure.
        (print_scm_rights, print_scm_creds, print_scm_security,
        print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_ip_opts,
        print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr): Remove data_len
        argument validity check, don't print ", cmsg_data=" prefix here.
        (print_cmsg_ip_tos): Likewise.  Rename to print_cmsg_uint8_t.
        (cmsg_printer): New type.
        (cmsg_socket_printers, cmsg_ip_printers): New arrays.
        (print_cmsg_type_data): Use them to handle struct cmsghdr
        and its cmsg_data.

        msghdr.c: merge print_cmsg_ip_ttl and print_cmsg_ip_checksum.
        * msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint.
        (print_cmsg_ip_checksum): Remove.
        (print_cmsg_type_data): Replace print_cmsg_ip_ttl
        and print_cmsg_ip_checksum with print_cmsg_uint.

        msghdr.c: enhance representation of unprintable part of msg_control array
        * msghdr.c (decode_msg_control): When msg_control array has an
        unprintable part, print its address.

        msghdr.c: apply a sane limit to the length of IP_ORIGDSTADDR address.
        * msghdr.c (print_cmsg_ip_origdstaddr): Limit address length to the size
        of struct sockaddr_storage.

        msghdr.c: fix printing SCM_RIGHTS array.
        * msghdr.c (print_scm_rights): Do not print array elements outside
        bounds defined by struct cmsghdr.cmsg_len.

        msghdr.c: print unrecognized struct cmsghdr.cmsg_type in hex.
        * msghdr.c (print_cmsg_type_data): Use %#x format when printing
        struct cmsghdr.cmsg_type as an integer.

        msghdr.c: fix printing of struct in_pktinfo.
        * msghdr.c (print_cmsg_ip_pktinfo): Fix printing
        of struct in_pktinfo.ipi_addr.

        msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays.
        * msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data
        as an array of hexadecimal integers.
        * tests/inet-cmsg.c (print_opts): Update expected output.

        msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values.
        * msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos,
        print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an
        array element.
        * tests/inet-cmsg.c (print_ttl, print_tos): Update expected output.

        msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name
        * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
        print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
        print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr,
        print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents.
        * tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts,
        print_origdstaddr): Update expected output.
        * tests/scm_rights-fd.test: Likewise.

2016-06-27  Dmitry V. Levin  <ldv@altlinux.org>

        msghdr.c: print struct mmsghdr as a regular structure.
        * msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields.
        * tests/mmsg.c (main): Update expected output.

        net.c: move all msghdr and mmsghdr parsers to a separate file.
        * defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg):
        New prototypes.
        * msghdr.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * net.c: Move all msghdr and mmsghdr parsers to msghdr.c.

        Mpersify fetchers of struct msghdr and struct mmsghdr.
        * fetch_struct_msghdr.c: New file.
        * fetch_struct_mmsghdr.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32,
        fetch_msghdr, fetch_mmsghdr): Remove.
        (decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead
        of fetch_msghdr.
        (decode_mmsghdr): Change msg_len argument to use_msg_len.
        Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
        Return fetch_struct_mmsghdr's return code.
        (decode_mmsg): Rename to decode_mmsgvec.  Take addr and len arguments.
        Do not print vlen and flags.  Check decode_mmsghdr's return code.
        Print mmsghdr array using square brackets.
        (dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
        (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead
        of decode_mmsg.  Print vlen and flags.
        * tests/mmsg.c (main): Update expected output.

        net.c: move fallback definition of struct mmsghdr to a separate file.
        * msghdr.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * net.c: Include it.  Move fallback definition of struct mmsghdr there.
        * tests/mmsg.c: Include "msghdr.h".  Remove fallback definition
        of struct mmsghdr.

2016-06-26  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: print struct msghdr as a regular structure.
        * net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov,
        and msg_iovlen fields like other regular fields.
        * tests/inet-cmsg.c (main): Update expected output.
        * tests/mmsg.c (main): Likewise.
        * tests/recvmsg.c (main): Likewise.
        * tests/scm_rights-fd.test: Likewise.

        net.c: rename some internal functions for consistency and readability.
        * net.c (printcmsghdr): Rename to decode_msg_control.
        (do_msghdr): Rename to print_msghdr.
        (extractmsghdr): Rename to fetch_msghdr.
        (extractmmsghdr): Rename to fetch_mmsghdr.
        (printmsghdr): Rename to decode_msghdr.
        (printmmsghdr): Rename to decode_mmsghdr.
        All callers updated.

        net.c: when printing struct msghdr.msg_control, also print its name.
        * net.c (printcmsghdr): Skip control messages of zero length.
        Always print "msg_control=" before the control message.
        (do_msghdr): Print control message before its length, not after.
        * tests/inet-cmsg.c (main): Update expected output.
        * tests/scm_rights-fd.test: Likewise.

        Assume that libc provides struct msghdr.msg_control.
        * configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control.
        * net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check.

2016-06-25  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: move all sockaddr parsers to a separate file.
        * sockaddr_ll.c: Rename to sockaddr.c
        (print_sockaddr_data_ll): Add static keyword.
        * Makefile.am (strace_SOURCES): Likewise.
        * defs.h (print_sockaddr_data_ll): Remove.
        (addrfams): New prototype.
        * net.c: Move all sockaddr parsers to sockaddr.c.

        net.c: rename printsock to decode_sockaddr.
        * defs.h (printsock): Rename to decode_sockaddr.
        * net.c (printsock): Likewise.
        (do_msghdr, SYS_FUNC(bind), do_sockname, SYS_FUNC(sendto),
        SYS_FUNC(recvfrom)): Replace printsock with decode_sockaddr.

        defs.h: remove unused prototype.
        * defs.h (print_sock_optmgmt): Remove.

        tests: check decoding of sockaddr structures.
        * tests/net-sockaddr.c: New file.
        * tests/net-sockaddr.test: New test.
        * tests/.gitignore: Add net-sockaddr.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add net-sockaddr.test.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: fix printing AF_PACKET socket addresses.
        * defs.h (print_ifindex, print_sockaddr_data_ll): New prototypes.
        * net.c: Stop including "xlat/af_packet_types.h".
        (print_ifindex): Remove static keyword.
        (print_sockaddr_data_l): Remove.
        * sockaddr_ll.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/arp_hardware_types.in: New file.
        * xlat/ethernet_protocols.in: Likewise.

        net.c: skip details of too short socket addresses, part 2.
        * net.c (sa_printers): Add minimal address length for each socket family.
        (print_sockaddr): Call socket family specific sockaddr printer
        only when socket address length is greater or equal
        the minimal address length for the socket family.

        net.c: fix printing AF_BLUETOOTH socket addresses.
        * xlat/hci_channels.in: New file.
        * net.c (print_sockaddr_data_raw): New function.
        (print_sockaddr): Use it.
        [HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/hci_channels.h".
        [HAVE_BLUETOOTH_BLUETOOTH_H] (print_sockaddr_data_bt): Fix printing
        sockaddr_hci, sockaddr_sco, sockaddr_rc, and sockaddr_l2 structures.

        net.c: fix printing AF_IPX sockets addresses, part 2.
        * net.c (print_sockaddr_data_ipx): Print sockaddr_ipx.sipx_network
        using %#08x format.  Print elements of sockaddr_ipx.sipx_node array
        and sockaddr_ipx.sipx_type using %#02x format.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: fix printing AF_UNIX abstract socket addresses.
        AF_UNIX abstract socket address specified by sockaddr_un.sun_path
        is not a NUL-terminated string.

        * net.c (SIZEOF_SA_FAMILY): New macro.
        (print_sockaddr_data_un): Use it.  Specify actual address length
        in print_quoted_string calls.  Do not set QUOTE_0_TERMINATED flag
        when printing an abstract socket address.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: fix printing field names of struct sockaddr_nl.
        * net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups"
        to "nl_groups".  Print sockaddr_nl.nl_groups using %#08x format.
        * tests/net-yy-netlink.c (main): Update.

        net.c: fix printing struct sockaddr_in6.sin6_flowinfo.
        * net.c (print_sockaddr_data_in6): Convert sockaddr_in6.sin6_flowinfo
        from network order to host order before printing.

2016-06-23  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: do not print sockaddr_in6.sin6_scope_id unnecessarily.
        Prior to RFC2553, struct sockaddr_in6 had no sin6_scope_id field.
        As the kernel still accepts RFC2133 editions of struct sockaddr_in6,
        print sockaddr_in6.sin6_scope_id only when it is specified.

        * net.c (SIN6_MIN_LEN): New macro.
        (print_sockaddr_data_in6): Print sockaddr_in6.sin6_scope_id only when
        socket address length exceeds SIN6_MIN_LEN.

2016-06-23  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: fix printing raw data of socket addresses.
        * net.c (print_sockaddr): When printing socket address raw data, read
        exactly the number of data bytes specified for the socket addess.

        net.c: skip details of too short socket addresses.
        * net.c (print_sockaddr): Print socket address details only when
        the address size is greater than sizeof(struct sockaddr.sa_family).
        (print_sockaddr_data_un): Remove handling of addrlen == 2.
        * tests/net-y-unix.c (main): Update expected pattern.
        * tests/net-yy-unix.c (main): Likewise.
        * tests/net.expected: Likewise.

2016-06-22  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that libc provides struct sockaddr_in6.sin6_scope_id.
        * configure.ac (AC_CHECK_MEMBERS): Remove
        struct sockaddr_in6.sin6_scope_id.
        * net.c (print_sockaddr_data_in6): Remove
        HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check.

        Split print_sockaddr.
        * net.c (sockaddr_buf_t): Remove.
        (sockaddr_printer): New type.
        (sa_printers): New array of sockaddr_printer.
        (print_sockaddr): Use it.  Move printers of family specific
        sockaddr data to separate funcions.

2016-06-22  Fabien Siron  <fabien.siron@epita.fr>

        Add a enum for decoding to tprint_iov() and tprint_iov_upto()
        Introduce a new type iov_decode which will be used instead of the integer
        "decode" as a parameter.

        * defs.h (iov_decode): New enum.
        (tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
        * aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in
        tprint_iov() call.
        * keyctl.c (keyctl_instantiate_key_iov): Likewise.
        * process.c (ptrace): Likewise.
        * process_vm.c (process_vm_readv, process_vm_writev): Likewise.
        * io.c (writev, do_pwritev, vmsplice): Likewise.
        (print_iovec): Replace the condition with a switch.
        (tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
        (readv, do_preadv): Change type of "decode_iov" to enum iov_decode in
        tprint_iov_upto() call.
        * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
        print_sg_io_v4_res): Likewise.
        * net.c (do_msghdr): Adapt call of tprint_iov_upto().

2016-06-22  Dmitry V. Levin  <ldv@altlinux.org>

        printsock: fix zero padding of sockaddr buffer.
        Before this change printsock used to erroneously clear the last byte
        of sockaddr buffer.

        * net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer.
        Reserve additional byte after the sockaddr buffer for zero padding.
        Do not clear memory that is going to be overwritten by umoven.
        Clear the tail of sockaddr buffer that was not overwritten by umoven.

2016-06-21  Fabien Siron  <fabien.siron@epita.fr>

        Change printsock to return socket family.
        * defs.h (printsock): Change return type to int.
        * net.c (printsock): Likewise.  Return socket family on success
        and -1 in case of an error.

2016-06-21  Dmitry V. Levin  <ldv@altlinux.org>

        Unexport addrfams.
        * defs.h (addrfams): Remove.

        sock.c: use print_sockaddr.
        * sock.c (print_ifreq_addr): Remove.
        (PRINT_IFREQ_ADDR): New macro.
        (print_ifreq, decode_ifconf): Use it instead of print_ifreq_addr.

        Export print_sockaddr function.
        * defs.h (print_sockaddr): New prototype.
        * net.c (print_sockaddr): Remove static keyword.
        Change type of address pointer to "const void *".
        (print_cmsg_ip_recverr, print_group_req): Remove redundant casts
        in print_sockaddr invocations.

        xlat/addrfams.in: provide fallback definitions.
        * xlat/addrfams.in: add fallback definitions for constants.

        Update AF_* constants.
        * xlat/addrfams.in: Add AF_QIPCRTR.

        Assume that libc provides inet_ntop and inet_pton.
        * configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton.
        * net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove
        HAVE_INET_NTOP checks.
        * tests/ip_mreq.c: Remove HAVE_INET_PTON check.

        net.c: use SO_LINGER unconditionally.
        * net.c (print_linger, print_getsockopt, print_setsockopt): Do not check
        for SO_LINGER availability.

        net.c: use AF_BLUETOOTH unconditionally.
        * net.c (print_sockaddr, SYS_FUNC(socket)): Do not check
        for AF_BLUETOOTH availability.

2016-06-20  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use AF_UNIX over AF_LOCAL.
        As these constants have the same value 1, let's use and print only one
        of them, e.g. AF_UNIX.

        * xlat/addrfams.in (AF_LOCAL): Remove.
        * tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX.
        * tests/net-y-unix.c: Likewise.
        * tests/net-yy-unix.c: Likewise.
        * tests/netlink_unix_diag.c: Likewise.

2016-06-19  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: fix printing AF_IPX sockets.
        * net.c (print_sockaddr): Print sockaddr_ipx as a regular structure.
        (SYS_FUNC(socket)): Remove special handling of AF_IPX.

        net.c: use AF_IPX unconditionally.
        * net.c (sockaddr_buf_t, print_sockaddr, SYS_FUNC(socket)): Do not check
        for AF_IPX availability.

        Cleanup netipx/ipx.h availability check.
        * configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h.
        * net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__.

2016-06-19  Fabien Siron  <fabien.siron@epita.fr>

        Make getfdproto return enum instead of string.
        Introduce a new enum type sock_proto and use it instead of strings for socket
        protocols identification.

        * defs.h (sock_proto): New enum.
        (get_proto_by_name): New function.
        * socketutils.c (protocols): New static table.
        (print_sockaddr_by_inode): Use it.  Change type of "proto" argument
        to sock_proto.
        (get_proto_by_name): New function.
        * util.c (getfdproto): Use it.  Change return type to sock_proto.
        (printfd): Update.

2016-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        Split travis-ci.sh.
        * travis-ci.sh: Split into travis-build.sh, travis-install.sh,
        and travis-success.sh files.
        * .travis.yml (before_install, after_success, git): New mappings.
        (script): Change to travis-build.sh.
        (addons, install): Remove.
        (env): Remove matrix.
        (matrix): Replace exclude list with include list.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce HAVE_STRUCT_TCB_EXT_ARG macro.
        Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of
        "if defined LINUX_MIPSN32 || defined X32".

        * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32.
        (struct tcb): Check it instead of LINUX_MIPSN32 || X32.
        (RVAL_LUDECIMAL): Likewise.
        * io.c (print_lld_from_low_high_val): Likewise.
        * lseek.c (SYS_FUNC(lseek)): Likewise.
        * mem.c (SYS_FUNC(mmap)): Likewise.
        * syscall.c (trace_syscall_exiting): Likewise.
        * util.c (getllval): Likewise.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        btrfs: fix build with fresh linux/btrfs.h.
        Fix build with fresh <linux/btrfs.h> that provides a slightly different
        definition of struct btrfs_ioctl_defrag_range_args.

        * btrfs.c (btrfs_ioctl): Cast "len" member of
        struct btrfs_ioctl_defrag_range_args to uint64_t.
        * tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len"
        members of struct btrfs_ioctl_defrag_range_args to uint64_t.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN*
        <linux/btrfs.h> was introduced in linux v3.9-rc1 while some
        of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN
        and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2,
        or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1.

        * btrfs.c [!BTRFS_IOC_QUOTA_RESCAN]
        (struct btrfs_ioctl_quota_rescan_args): New structure.
        (BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros.
        [!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro.
        * tests/btrfs.c: Likewise.

        Reported-by: Li Er <phoooyb@gmail.com>

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: fix checks for btrfs specific structures.
        * configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for
        struct btrfs_ioctl_defrag_range_args.start and
        struct btrfs_ioctl_search_args_v2.buf_size.

2016-06-16  Elvira Khabirova  <lineprinter0@gmail.com>

        README: add system requirements and beautify the file.

2016-06-16  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add signal_receive.test.
        * tests/signal_receive.c: New file.
        * tests/signal_receive.test: New test.
        * tests/.gitignore: Add signal_receive.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (MISC_TESTS): Add signal_receive.test.

        tests: add signal2name function to libtests.
        * tests/tests.h (signal2name): New prototype.
        * tests/signal2name.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: use AF_INET6 unconditionally.
        * net.c (SYS_FUNC(socket)): Do not check for AF_INET6 availability.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: do not check for linux/in6.h.
        The last user of <linux/in6.h> was removed by commit v4.9-252-gf362a33.

        * configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: use AF_PACKET unconditionally.
        * net.c: Do not check for AF_PACKET availability.

        net.c: include <linux/if_packet.h> unconditionally.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h.
        * net.c: Include <linux/if_packet.h> unconditionally.

        net.c: use ICMP_FILTER unconditionally.
        * net.c: Do not check for ICMP_FILTER availability.

        net.c: include <linux/icmp.h> unconditionally.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h.
        * net.c: Follow the example of tests/net-icmp_filter.c and include
        <linux/icmp.h> unconditionally.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: use AF_NETLINK unconditionally.
        * net.c: Do not check for AF_NETLINK availability.

        net.c: include <linux/netlink.h> unconditionally.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h.
        * net.c: Follow the example of socketutils.c and include
        <linux/netlink.h> unconditionally.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

        Remove UNDEFINED_SCNO.
        Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID
        and since tcp->s_ent can only be set to &sysent[tcp->scno]
        (or to &unknown, but only when !SCNO_IS_VALID), there is no need
        to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno).

        * defs.h (UNDEFINED_SCNO): Remove.
        * syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting):
        Remove checks for UNDEFINED_SCNO.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests/attach-f-p.c: fix typo in comment.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

        strace.c: fix style in function definition.
        * strace.c (kill_save_errno): Move the type of return value
        to another line.

        Turn on more compiler warnings.
        * configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security,
        -Wignored-qualifiers, -Winit-self, -Wlogical-op,
        -Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration,
        -Wold-style-definition, -Wtype-limits.

        strace.c: fix a warning reported by -Wold-style-definition.
        * strace.c (usage): Add void to the list of function argments.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl_evdev.c: fix typo in comment.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

        Move printargs* functions to util.c.
        * syscall.c (printargs, printargs_u, printargs_d): Move ...
        * util.c: ... here.

        tests/xgetrlimit.c: fix a warning reported by -Wtype-limits.
        * tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants
        to the type of argument.

2016-06-11  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use printaddr for printing addresses.
        * bjm.c (SYS_FUNC(init_module)): Use printaddr.
        * clone.c (SYS_FUNC(clone)): Likewise.
        * evdev.c (ff_effect_ioctl): Likewise.
        * mtd.c (decode_mtd_oob_buf): Likewise.
        * net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)):
        Likewise.
        * print_sigevent.c (print_sigevent): Likewise.
        * printsiginfo.c (printsigval, print_si_info): Likewise.
        * signal.c (decode_new_sigaction): Likewise.
        * sysmips.c (SYS_FUNC(sysmips)): Likewise.
        * util.c (printpathn, printstr, umoven_or_printaddr): Likewise.
        * v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer,
        umoven_or_printaddr_ignore_syserror): Likewise.
        * tests/net-icmp_filter.c (main): Update.

        Based on patch by Eugene Syromyatnikov <evgsyr@gmail.com>.

2016-06-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests/attach-p-cmd-p.c: cleanup.
        * attach-p-cmd-p.c (handler): Move code ...
        (main): ... here.  Unblock SIGALRM only.
        Use alarm() instead of setitimer().
        Replace endless loop with a pause() call.
        Check that chdir() returns ENOENT.

        tests: enhance test coverage of SIGCHLD siginfo_t.
        * tests/siginfo.c: New file.
        * tests/siginfo.test: New test.
        * tests/wait.c: Remove.
        * tests/wait.expected: Remove.
        * tests/wait.test: Remove.
        * tests/.gitignore: Add siginfo, remove wait.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add siginfo.test, remove wait.test.
        (EXTRA_DIST): Remove wait.expected.

        tests: extend test coverage of waitid syscall.
        * tests/waitid.c: New file.
        * tests/waitid-v.c: Likewise.
        * tests/waitid.test: New test.
        * tests/waitid-v.test: Likewise.
        * tests/.gitignore: Add waitid and waitid-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add waitid.test and waitid-v.test.

        tests: extend test coverage of wait4 syscall.
        * tests/wait4.c: New file.
        * tests/wait4-v.c: Likewise.
        * tests/wait4.test: New test.
        * tests/wait4-v.test: Likewise.
        * tests/.gitignore: Add wait4 and wait4-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add wait4.test and wait4-v.test.

        tests: add widen_to_ull macro to tests.h.
        * tests.h (widen_to_ull): New macro, copied from defs.h

        Fix sign extension issues in the parser of struct rusage.
        * printrusage.c (printrusage): Do not cast members of struct rusage
        to type long, use widen_to_ull instead.

2016-06-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of waitpid syscall.
        * tests/waitpid.c: New file.
        * tests/waitpid.test: New test.
        * tests/.gitignore: Add waitpid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add waitpid.test.

2016-06-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add strace-E.test.
        * tests/strace-E.expected: New file.
        * tests/strace-E.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.
        (EXTRA_DIST): Add strace-E.expected.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        strace.spec.in: enable libunwind on more platforms.
        * strace.spec.in: Add libunwind-devel to BuildRequires for RHEL8 family.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec.
        Change make-dist to generate strace-*.tar.gz, strace.dsc,
        and strace.spec in addition to strace-*.tar.xz.

        * configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip.
        * make-dsc: New file.
        * make-dist: Use it.
        * .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        Parametrize debian/changelog.
        * configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME.
        (DEB_CHANGELOGTIME): New variable.
        (AC_CONFIG_FILES): Add debian/changelog.
        * strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME.
        * debian/changelog: Rename to ...
        * debian/changelog.in: ... this file.  Add parametrized entry.
        * debian/.gitignore: New file.

        git-version-gen: replace '-' with '.' in generated version.
        * git-version-gen: Replace '-' with '.' so version conforms to policies
        * configure.ac (SPEC_VERSION): Remove.
        * strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION.
        Remove %srcname.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

        Parametrize strace.spec.
        * configure.ac (SPEC_VERSION, CHANGELOGTIME): Define.
        (AC_CONFIG_FILES): Add strace.spec.
        * strace.spec: Rename to ...
        * strace.spec.in: ... this file.  Parametrize Version, srcname,
        and the last %changelog entry.  Initialize .tarball-version file.

        strace.spec: adopt for OBS.
        * strace.spec: Parametrize libunwind-devel BRs, BuildRoot, and %defattr.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove obsolete strace-f.test.
        strace-f.test is too inexact while fork-f.test does the right thing.

        * tests/strace-f.test: Remove.
        * tests/Makefile.am (MISC_TESTS): Remove it.
        * strace.spec (BuildRequires): Remove time.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: always distribute strace-k.test.
        Fix distribution of tests/strace-k.test file when configured
        without libunwind.

        * tests/Makefile.am (EXTRA_DIST): Add strace-k.test.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

        make-dist: skip news-check for non-releases.
        * make-dist: Run news-check only when the commit being built
        matches a release tag.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls.
        * tests/getrlimit.c: New file.
        * tests/setrlimit.c: Likewise.
        * tests/ugetrlimit.c: Likewise.
        * tests/xgetrlimit.c: Likewise.
        * tests/getrlimit.test: New test.
        * tests/setrlimit.test: Likewise.
        * tests/ugetrlimit.test: Likewise.
        * tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getrlimit.test, setrlimit.test,
        and ugetrlimit.test.
        (EXTRA_DIST): Add xgetrlimit.c.

        tests: check decoding of prlimit64 syscall.
        * tests/prlimit64.c: New file.
        * tests/prlimit64.test: New test.
        * tests/.gitignore: Add prlimit64.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prlimit64.test.

        Fix decoding of pid_t argument of prlimit64 syscall.
        * resource.c (SYS_FUNC(prlimit64)): Print pid_t syscall
        argument using %d format.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        Do not check for old sysctl enums.
        Assume that sysctl enums defined since linux v2.6 are always defined,
        with a signle exception: check for CTL_PROC which definition was removed
        in v2.6.18 and restored later in v2.6.23.

        * configure.ac (AC_CHECK_DECLS): Remove old constants.
        * xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT
        as unconditional.
        * xlat/sysctl_net.in: Mark constants older than NET_LLC
        as unconditional.
        * xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET
        as unconditional.
        * xlat/sysctl_net_ipv4.in: Mark constants older than
        NET_IPV4_IGMP_MAX_MSF as unconditional.
        * xlat/sysctl_net_ipv4_conf.in: Mark constants older than
        NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional.
        * xlat/sysctl_net_ipv4_route.in: Mark constants older than
        NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
        * xlat/sysctl_net_ipv6.in: Mark constants older than
        NET_IPV6_MLD_MAX_MSF as unconditional.
        * xlat/sysctl_net_ipv6_route.in: Mark constants older than
        NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
        * xlat/sysctl_net_unix.in: Mark all constants as unconditional.
        * xlat/sysctl_root.in: Mark constants older than CTL_ARLAN
        as unconditional.
        * xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT
        as unconditional.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: extend syntax.
        * xlat/gen.sh: Implement #conditional directive that turns on
        preprocessor checks turned off earlier by #unconditional directive.

2016-06-06  Elvira Khabirova  <lineprinter0@gmail.com>

        mpers.awk: remove unnecessary type attribute retrieval.
        * mpers.awk (what_is): Do not retrieve "type" attribute
        for "enumeration_type".

        tests/ptrace.c: fix fork() return value check.
        * tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value
        to pid_t.

        .gitignore: add missing files that should be ignored.
        * .gitignore: Add ioctl_redefs[12].h and libstrace.a.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        debian: sync with the package.
        * debian/control (Build-Depends) [amd64]: Remove libunwind-dev.
        * debian/changelog: Sync with 4.12-3.
        * debian/rules: Likewise.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace.
        * tests/strace-S.test: Measure wall clock time instead of system time.
        Use local "./readv" instead of system "date" as a sample executable.

        Reported-by: Steve McIntyre <steve@einval.com>

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests/strace-S.test: enhance error diagnostics.
        * tests/strace-S.test: If strace output does not meet expectations,
        print the output.

2016-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        .gitignore: sort the list of ignored patterns.
        * .gitignore: Sort.

2016-06-01  Dmitry V. Levin  <ldv@altlinux.org>

        maint: post-release administrivia.
        * NEWS: Add header line for the next release.

2016-05-31  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.12 release.
        * NEWS: Update for 4.12 release.
        * debian/changelog: 4.12-1.
        * strace.spec: 4.12-1.

        Sync strace.spec and debian/changelog with packages.
        * debian/changelog: Sync with 4.11-1.
        * strace.spec: Sync with 4.11.0.163.9720-2.

2016-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify hdio.c.
        * defs.h (hdio_ioctl): Remove.
        * hdio.c: Mpersify struct hd_geometry.
        (hdio_ioctl): Mpersify.

2016-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        loop.c: decode LOOP_SET_DIRECT_IO.
        * loop.c (loop_ioctl) [LOOP_SET_DIRECT_IO] : Handle LOOP_SET_DIRECT_IO.

        loop.c: fix printing of arrays.
        * loop.c (decode_loop_info): Use square brackets to print
        struct loop_info.lo_init and struct loop_info.reserved arrays.
        (decode_loop_info64): Use square brackets to print
        struct loop_info64.lo_init array.

        loop.c: fix printing of structure members' names.
        * loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_"
        prefix from printed names.

        loop.c: optimize decoding of paired ioctls.
        * loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS
        and LOOP_[GS]ET_STATUS64 ioctl pairs.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl_evdev.c: check EVIOCGUNIQ decoding.
        * tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding.

        tests/ioctl_mtd.c: fix build with musl.
        * tests/ioctl_mtd.c: Include <linux/ioctl.h>.

        tests: check decoding of 'M' type ioctls.
        * tests/ioctl_mtd.c: New file.
        * tests/ioctl_mtd.test: New test.
        * tests/.gitignore: Add ioctl_mtd.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_mtd.test.

        Mpersify mtd.c.
        * defs.h (mtd_ioctl): Remove.
        * mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers.
        (mtd_ioctl): Mpersify.

        mtd.c: refactor.
        * mtd.c (mtd_ioctl): Move parsers of structures to separate functions.

        Move parser of UBI_* ioctls to a separate file.
        * mtd.c (ubi_ioctl): Move to ...
        * ubi.c: ... new file.
        * Makefile.am (strace_SOURCES): Add it.

        tests: check decoding of EVIOC* ioctls.
        * tests/ioctl_evdev.c: New file.
        * tests/ioctl_evdev-v.c: Likewise.
        * tests/ioctl_evdev.test: New test.
        * tests/ioctl_evdev-v.test: Likewise.
        * tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test.

        Mpersify EVIOC* ioctl parser.
        * defs.h (evdev_abs): New xlat prototype.
        (evdev_ioctl): Remove.
        * evdev.c: Do not include "xlat/evdev_abs.h".
        Mpersify struct ff_effect and ioctl numbers.
        (evdev_ioctl): Mpersify.
        * NEWS: Mention this enhancement.

        evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT.
        * evdev.c (bit_ioctl): If event type is not unrecognized,
        print the argument as an address.

        evdev.c: fix printing of EV_PWR's argument.
        * evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument.

        evdev.c: fix indentation.
        * evdev.c: Fix indentation of print formats.

        evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ.
        * evdev.c (evdev_read_ioctl): Fix printing of the string returned
        in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests.

        evdev.c: fix EVIOCGVERSION decoding.
        * evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument
        using #x format.

        evdev.c: fix EVIOCGMTSLOTS decoding.
        * evdev.c (mtslots_ioctl): Use umove_or_printaddr.

        evdev.c: fix bitset decoding.
        * evdev.c (decode_bitset): Use umove_or_printaddr.

        evdev.c: fix decoding of struct input_id.
        * evdev.c (getid_ioctl): Use umove_or_printaddr.

        evdev.c: fix decoding of struct input_keymap_entry.
        * evdev.c (keycode_V2_ioctl): Use umove_or_printaddr.

        evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE.
        * evdev.c (keycode_ioctl): Use umove_or_printaddr.

        evdev.c: fix decoding of struct input_absinfo.
        * evdev.c (abs_ioctl): Use umove_or_printaddr.

        evdev.c: fix decoding of struct ff_effect.
        * evdev.c (ff_effect_ioctl): Use umove_or_printaddr.
        Fix printing of struct ff_effect.u member names.

        evdev.c: fix printing of struct ff_envelope.fade_level.
        * evdev.c (decode_envelope): Print struct ff_envelope.fade_level
        using #x format.

        evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE.
        * evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB
        and EVIOCREVOKE as unsigned long.

        evdev.c: fix EVIOCRMFF decoding.
        * evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int.

        evdev.c: move handling of EVIOCGBIT to a separate function.
        * evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ...
        (bit_ioctl): ... new function.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        evdev.c: reorder ioctl command checks.
        Change the order of ioctl command cheks to match the kernel:
        1st, check for fixed-number fixed-length commands,
        2nd, check for fixed-number variable-length commands,
        3rd, check for multi-number fixed-length commands,
        4thm check for multi-number variable-length commands.

        * evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder
        ioctl command checks.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        evdev.c: decode all directions except _IOC_READ on entering syscall.
        * evdev.c (evdev_write_ioctl): Remove exiting check.
        (evdev_read_ioctl): Move entering check ...
        (evdev_ioctl): ... here.  Add RVAL_DECODED to return code in _IOC_WRITE
        and default cases.

        evdev.c: fix indentation of preprocessor directives.
        * evdev.c: Fix indentation of preprocessor directives.
        Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H].

2016-05-28  Jeff Mahoney  <jeffm@suse.com>

        file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode.
        * file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first
        two elements of info array in abbrev mode.
        * tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly
        printed elements.

2016-05-27  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl.c: fix typo in decoding of EVIOCSABS's parameter.
        * ioctl.c (evdev_decode_number): Fix typo in printxval default value.

2016-05-27  Jeff Mahoney  <jeffm@suse.com>

        tests: check decoding of btrfs RDWR ioctls returned data.
        * tests/btrfs-vw.test: New file.
        * tests/btrfs-w.test: New file.
        * tests/Makefile.am (DECODER_TESTS): Add them.

        tests/btrfs.c: fix live btrfs_test_search_ioctls output.
        * tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf
        for BTRFS_IOC_TREE_SEARCH and fix missing whitespace.

        btrfs.c: don't use print_array in btrfs_print_tree_search.
        * btrfs.c (btrfs_print_tree_search): Don't use print_array.  The buffer
        represents a series of variable sized records, not an array.

        btrfs.c: fix print_array usage in btrfs_print_logical_ino_container.
        * btrfs.c: (btrfs_print_logical_ino_container) Fix the element count
        to reflect the number of records rather than the number of items.

2016-05-26  Jeff Mahoney  <jeffm@suse.com>

        tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH.
        * tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference
        to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests.

2016-05-26  Fabien Siron  <fabien.siron@epita.fr>

        Fix -yy documentation.
        * strace.c (usage): Fix description of -yy option.
        * strace.1: Likewise.

2016-05-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl_block.c: tweak magic constants to make the test more reliable
        * tests/ioctl_block.c (main): Change bad pointer to make
        its lower 32-bit part closer to -1U.

        tests/btrfs.c: check basic decoding of read-only ioctls.
        * tests/btrfs.c (btrfs_test_read_ioctls): New function.
        (main): Use it.

        tests: check decoding of BLK* ioctls.
        * configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup.
        * tests/ioctl_block.c: New file.
        * tests/ioctl_block.test: New test.
        * tests/.gitignore: Add ioctl_block.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_block.test.

        Mpersify BLK* ioctl parser.
        * defs.h (block_ioctl): Remove.
        * block.c: Mpersify struct blk_user_trace_setup,
        struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers.
        (block_ioctl): Mpersify.
        * NEWS: Mention this enhancement.

        block.c: optimize decoding of paired ioctls.
        * block.c (block_ioctl): Optimize decoding of commands that return
        a signed int.

        block.c: fix printing of uint64_t pairs.
        * block.c (block_ioctl): Print uint64_t values using PRIu64 format.

        block.c: fix printing of struct blk_user_trace_setup.
        * block.c (block_ioctl): Fix printing of comma before
        struct blk_user_trace_setup.name on exiting syscall.

        Move parser of 'X' type ioctls to a separate file.
        * fs_x_ioctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW
        to fs_x_ioctl.c.
        * defs.h (fs_x_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'.

        Move parser of HDIO_* ioctls to a separate file.
        * hdio.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * block.c: Do not include <linux/hdreg.h>.
        (block_ioctl): Move parser of HDIO_GETGEO to hdio.c.
        * defs.h (hdio_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03.

        Fix explicit casts of signed integer types to unsigned long long.
        * defs.h (widen_to_ull): New macro.
        * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place
        of explicit casts to unsigned long long.
        * io.c (print_lld_from_low_high_val): Likewise.
        * lseek.c (SYS_FUNC(llseek)): Likewise.
        * printsiginfo.c (print_si_info): Likewise.
        * printstat.h (DO_PRINTSTAT): Likewise.
        * sysinfo.c (SYS_FUNC(sysinfo)): Likewise.
        * times.c (SYS_FUNC(times)): Likewise.
        * fetch_struct_statfs.c (ASSIGN_NUMBER): Remove.
        (fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER
        with widen_to_ull.

        scsi.c: print __u64 types using PRI__u64 format.
        * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts
        to unsigned long long, print fields of type __u64 using PRI__u64 format.

2016-05-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of RTC_* ioctls.
        * configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc.
        * tests/ioctl_rtc.c: New file.
        * tests/ioctl_rtc-v.c: Likewise.
        * tests/ioctl_rtc.test: New test.
        * tests/ioctl_rtc-v.test: Likewise.
        * tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test.

        Mpersify RTC_* ioctl parser.
        * defs.h (rtc_ioctl): Remove.
        * rtc.c: Mpersify struct rtc_pll_info and ioctl numbers.
        (rtc_ioctl): Mpersify.
        * NEWS: Mention this enhancement.

        rtc.c: fix decoding of struct rtc_wkalrm.
        * rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time.

        file_ioctl.c: print file descriptors using printfd.
        * file_ioctl.c (print_file_dedupe_range_info): Print
        struct file_dedupe_range_info.dest_fd using printfd.
        (file_ioctl): Print struct file_clone_range.src_fd using printfd.

        rtc.c: do not print argument of ioctls that have no arguments.
        * rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF}
        and RTC_VL_CLR ioctls.

        rtc.c: decode RTC_PLL_GET and RTC_PLL_SET.
        * rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET

        rtc.c: optimize decoding of paired ioctls.
        * rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET,
        RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs.

        block.c: handle BLKDAXGET.
        * block.c [!BLKDAXGET] (BLKDAXGET): Define.
        (block_ioctl): Handle it.

        tests: check decoding of mount syscall.
        * tests/mount.c: New file.
        * tests/mount.test: New test.
        * tests/.gitignore: Add mount.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mount.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests/vhangup.c: diassociate from the controlling terminal first.
        * tests/vhangup.c (main): Call setsid before vhangup.

2016-05-24  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add vhangup.test.
        * tests/vhangup.c: New file.
        * tests/vhangup.test: New test.
        * tests/.gitignore: Add vhangup.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add vhangup.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        NEWS: Prepare for 4.12 release.

2016-05-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        tests/btrfs.c: fix build on x32.
        * tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL.
        * tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL
        is defined using unexported type "u64".

        btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME.
        * btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case
        if this constant is not defined.
        * tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part
        of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined.

        tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args.
        * tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members
        of struct btrfs_ioctl_clone_range_args using PRI__u64 format.

        tests/btrfs.c: tweak magic constants to make the test more reliable.
        * tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val
        to 0xdeadbeefbadc0ded.
        (btrfs_test_subvol_ioctls): Likewise.  Change bad_pointer
        to make their lower 32-bit parts closer to -1U.

        btrfs.c: print file descriptors using printfd.
        * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd,
        struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd
        using printfd.
        * tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls,
        btrfs_test_device_ioctls, btrfs_test_clone_ioctls,
        btrfs_test_send_ioctl): Update.

        tests/btrfs.c: do not print errno in case of fs type mismatch.
        * tests/btrfs.c (main): Use error_msg_and_fail instead of
        perror_msg_and_fail when the fs type of the given directory
        is not BTRFS_SUPER_MAGIC.

        tests/btrfs.c: fix indentation.
        * tests/btrfs.c: Fix indentation of preprocessor directives
        and function prototypes.

        tests/btrfs.c: sort included headers.
        * tests/btrfs.c: Sort included headers.

        tests/btrfs.c: do not use alloca.
        * tests/btrfs.c: Don't include <alloca.h>.
        (btrfs_test_subvol_ioctls): Allocate
        struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc.

        tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h>
        * tests/btrfs.c: Include "tests.h" first.
        Skip the test if [!HAVE_LINUX_BTRFS_H].  Skip parts of the test
        that use struct fiemap if [!HAVE_LINUX_FIEMAP_H].

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

        tests: add testing for btrfs ioctls.
        * tests/btrfs.c: New file.
        * tests/btrfs.test: New test.
        * tests/btrfs-v.test: Likewise.
        * tests/.gitignore: Add btrfs.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add btrfs.test and btrfs-v.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests/file_ioctl.c: use tail_alloc.
        * tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.

        tests/file_ioctl.c: fix build on systems without <linux/fiemap.h>
        * tests/file_ioctl.c: Include "tests.h" first.
        Skip the test if [!HAVE_LINUX_FIEMAP_H].

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

        tests: add testing for FS_IOC_FIEMAP.
        This is limited to FIEMAP.  FICLONE* and FIDEDUPERANGE originated in
        btrfs and will be tested there.

        * tests/file_ioctl.c: New file.
        * tests/file_ioctl.test: New test.
        * tests/.gitignore: Add file_ioctl.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add file_ioctl.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify btrfs.c.
        * btrfs.c: Mpersify 3 arch-specific structures
        and corresponding ioctl numbers.
        (btrfs_ioctl): Mpersify.
        * defs.h (btrfs_ioctl): Remove.

        btrfs.c: use print_array.
        * btrfs.c (print_btrfs_data_container_logical_ino,
        print_btrfs_data_container_ino_path, print_uint64,
        print_btrfs_ioctl_search_header, print_objectid_callback,
        print_btrfs_ioctl_space_info): New functions.
        (btrfs_print_logical_ino_container, btrfs_print_ino_path_container):
        Rewrite printers of struct btrfs_data_container.val array
        using print_array.
        (btrfs_print_qgroup_inherit): Rewrite printer of
        struct btrfs_qgroup_inherit.qgroups array using print_array.
        (btrfs_print_tree_search): Rewrite printer of
        struct btrfs_ioctl_search_header array using print_array.
        (btrfs_ioctl): Rewrite printer of
        struct btrfs_ioctl_send_args.clone_sources and
        struct btrfs_ioctl_space_args.spaces using print_array.

        btrfs.c: simplify BTRFS_IOC_GET_FSLABEL parser.
        * btrfs.c (btrfs_ioctl): Share code of parser of BTRFS_IOC_SET_FSLABEL
        with parser of BTRFS_IOC_GET_FSLABEL only on BTRFS_IOC_GET_FSLABEL's
        entering.

        btrfs.c: fix BTRFS_IOC_TREE_SEARCH_V2 output.
        * btrfs.c (btrfs_ioctl): Fix BTRFS_IOC_TREE_SEARCH_V2 output
        in case of EOVERFLOW and failed umove.

        btrfs.c: cleanup use of tcp->auxstr.
        * btrfs.c (btrfs_ioctl): Reset tcp->auxstr only if it is set.

        btrfs.c: cleanup struct btrfs_ioctl_get_dev_stats.nr_items check.
        * btrfs.c (btrfs_ioctl): Cleanup check of iterator of
        btrfs_ioctl_get_dev_stats.values array.

        btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX.
        * btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove.
        (btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name)
        instead of BTRFS_SUBVOL_NAME_MAX + 1.

        btrfs.c: mark some function arguments as const.
        * btrfs.c (btrfs_print_balance_args, btrfs_print_features,
        btrfs_print_qgroup_limit, btrfs_print_data_container_header,
        btrfs_print_logical_ino_container, btrfs_print_ino_path_container,
        btrfs_print_qgroup_inherit): Mark some function arguments as const.

        btrfs.c: use umove instead of umoven.
        * btrfs.c: Use umove instead of umoven and umove_or_printaddr
        instead of umoven_or_printaddr.

        btrfs.c: remove unused variable.
        * btrfs.c (btrfs_ioctl): Remove "ret" variable.

        btrfs.c: use printxval/printxval64 instead of printxvals.
        * btrfs.c (btrfs_ioctl): Do not call printxvals directly,
        use printxval/printxval64 wrappers that do the right thing.

        btrfs.c: fix indentation.
        * btrfs.c: Fix indentation of preprocessor directives and print formats.

        xlat/btrfs_dev_stats_values.in: cleanup.
        * xlat/btrfs_dev_stats_values.in: Remove HAVE_DECL_* defines,
        use #unconditional instead.

        file_ioctl.c: use print_array.
        * file_ioctl.c (file_ioctl): Rewrite printers of
        struct file_dedupe_range_info and struct fiemap_extent arrays
        using print_array.

        file_ioctl.c: fix indentation.
        * file_ioctl.c: Fix indentation of preprocessor directives
        and print formats.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        file_ioctl.c: include <linux/ioctl.h> instead of <sys/ioctl.h>
        Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
        no benefits for this parser.

        * file_ioctl.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        file_ioctl.c: fix build on systems without <linux/fiemap.h>
        * configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h.
        * file_ioctl.c: Do not include <linux/fiemap.h> and xlat/fiemap_*.h
        if [!HAVE_LINUX_FIEMAP_H].
        (file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H].

        ioctl.c: fix build.
        * ioctl.c (ioctl_decode): Move definition of "ret" variable
        to [ALPHA || POWERPC] case.
        [ALPHA || POWERPC]: Fix syntax error.

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

        ioctl: add decoding for FS_IOC_FIEMAP.
        * file_ioctl.c: Include <linux/fiemap.h>, "xlat/fiemap_flags.h",
        and "xlat/fiemap_extent_flags.h".
        (file_ioctl): Handle FS_IOC_FIEMAP.
        * ioctl.c (ioctl_decode): Use file_ioctl for decoding 'f' code ioctls.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        Add xlat/fiemap_flags.in and xlat/fiemap_extent_flags.in.
        * xlat/fiemap_flags.in: New file.
        * xlat/fiemap_extent_flags.in: Likewise.

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

        ioctl: add decoding support for btrfs ioctls.
        * btrfs.c: New file.
        * file_ioctl.c: Likewise.
        * Makefile.am (strace_SOURCES): Add them.
        * configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h.
        (AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags,
        struct btrfs_ioctl_fs_info_args.nodesize,
        struct btrfs_ioctl_defrag_range_args.start,
        and struct btrfs_ioctl_search_args_v2.buf_size.
        (AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums.
        * defs.h (btrfs_ioctl, file_ioctl): New prototypes.
        * ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl.
        * xlat/btrfs_balance_args.in: New file.
        * xlat/btrfs_balance_ctl_cmds.in: Likewise.
        * xlat/btrfs_balance_flags.in: Likewise.
        * xlat/btrfs_balance_state.in: Likewise.
        * xlat/btrfs_compress_types.in: Likewise.
        * xlat/btrfs_defrag_flags.in: Likewise.
        * xlat/btrfs_dev_replace_cmds.in: Likewise.
        * xlat/btrfs_dev_replace_results.in: Likewise.
        * xlat/btrfs_dev_replace_state.in: Likewise.
        * xlat/btrfs_dev_stats_flags.in: Likewise.
        * xlat/btrfs_dev_stats_values.in: Likewise.
        * xlat/btrfs_features_compat.in: Likewise.
        * xlat/btrfs_features_compat_ro.in: Likewise.
        * xlat/btrfs_features_incompat.in: Likewise.
        * xlat/btrfs_key_types.in: Likewise.
        * xlat/btrfs_qgroup_ctl_cmds.in: Likewise.
        * xlat/btrfs_qgroup_inherit_flags.in: Likewise.
        * xlat/btrfs_qgroup_limit_flags.in: Likewise.
        * xlat/btrfs_qgroup_status_flags.in: Likewise.
        * xlat/btrfs_scrub_flags.in: Likewise.
        * xlat/btrfs_send_flags.in: Likewise.
        * xlat/btrfs_snap_flags_v2.in: Likewise.
        * xlat/btrfs_space_info_flags.in: Likewise.
        * xlat/btrfs_tree_objectids.in: Likewise.

2016-05-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        x32: update ioctl entries from linux 4.6.
        * linux/x32/ioctls_inc0.h: Update from linux v4.6 using ioctls_gen.sh.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests/attach-f-p.c: sleep a bit more to let the tracer catch up.
        On noticeably lagging systems, the parent process may invoke its chdir
        call before the tracer gets notified about completion of its last child
        process.  Add extra sleep in the parent process to win the race.

        * tests/attach-f-p.c (main): Change timerid into a static array.
        Arm a timer in the parent process and wait for it.

2016-05-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests/attach-p-cmd-cmd.c: fix potential errno clobbering.
        * tests/attach-p-cmd-cmd.c (main): Call getpid before chdir.

        tests/net-yy-netlink.c: robustify against libc specific issues.
        * tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg
        as the latter has notible implementation differences that make
        the test unreliable.

        tests/net-yy-netlink.c: robustify against os specific issues.
        * tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr
        as NULL doesn't work well on some systems.

        tests/net-yy-{inet,netlink}.test: cleanup.
        * tests/net-yy-inet.test: Do not pass arguments to net-yy-inet
        as the latter does not accept them.
        * tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink
        as the latter does not accept them.

2016-05-22  Jeff Mahoney  <jeffm@suse.com>

        tests: define PRI__[dux]64 macros to print __s64 and __u64 values.
        Rather than cast every __u64 or __s64 before printing,
        define printing helpers for those types directly.

        This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330.

        * tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros.

2016-05-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove manual creation of memory mapping holes.
        We used to call tail_alloc(1) to create memory mapping holes around
        regular tail_alloc allocations.  This is no longer needed since regular
        tail_alloc allocations create additional memory mapping holes.

        * tests/clock_adjtime.c (main): Remove creation of memory mapping holes
        using tail_alloc(1).
        * tests/futimesat.c (main): Likewise.
        * tests/get_mempolicy.c (print_nodes, main): Likewise.
        * tests/getgroups.c (main): Likewise.
        * tests/getresugid.c (main): Likewise.
        * tests/ioctl_uffdio.c (main): Likewise.
        * tests/ioctl_v4l2.c (main): Likewise.
        * tests/move_pages.c (main): Likewise.
        * tests/net-icmp_filter.c (main): Likewise.
        * tests/ptrace.c (test_peeksiginfo, main): Likewise.
        * tests/pwritev.c (main): Likewise.
        * tests/set_mempolicy.c (print_nodes): Likewise.
        * tests/setgroups.c (main): Likewise.
        * tests/umovestr3.c (main): Likewise.
        * tests/utimes.c (main): Likewise.
        * tests/xattr.c (main): Likewise.

2016-05-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: make tail_alloc create additional memory mapping holes.
        * tests/tail_alloc.c (tail_alloc): Create additional memory mapping
        holes before and after the allocated memory.

2016-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: add support of conditionally compiled printers.
        We used to declare and define all printers marked with
        MPERS_PRINTER_DECL, including ifdef'ed ones.  That approach left us
        no way to conditionally compile mpersified printers, which was not
        a problem until btrfs ioctls appeared on the horizon.

        With this change, those mpersified printers that are not going
        to be compiled are also won't be declared and won't be added to
        struct_printers.

        This is implemented by filtering all source files containing
        MPERS_PRINTER_DECL markers through CPP.  As a nice side effect, this
        also lifts an ugly requirement of writing all MPERS_PRINTER_DECL
        declarations in a single line.

        * README-mpers: Update description of MPERS_PRINTER_DECL syntax.
        * defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into
        a recursive variadic macro.
        [!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro.
        All callers changed.
        * Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern):
        New variables.
        (CLEANFILES): Add $(mpers_preproc_files).
        (%.c.mpers.i): New rule.
        (printers.h, %_printer_decls.h, %_printer_defs.h): Use
        mpers_preproc_files instead of srcdir_mpers_source_files,
        use mpers_printer_decl_pattern.
        * .gitignore: Add /*.mpers.i.

2016-05-20  Dmitry V. Levin  <ldv@altlinux.org>

        Remove redundant declaration of v4l2_ioctl.
        There is no need to declare mpers printers in defs.h because
        they are already declared in printers.h or native_printer_decls.h.

        This complements commit 1e56814f77594a22a74ddee629639eb0bb7edf3a.

        * defs.h (v4l2_ioctl): Remove.

2016-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        Fix one more code pattern that might break gcc strict aliasing rules.
        * socketutils.c (receive_responses): Turn static buffer into a union
        to avoid breaking of gcc strict aliasing rules.
        * tests/netlink_inet_diag.c (check_responses): Likewise.
        * tests/netlink_netlink_diag.c (check_responses): Likewise.
        * tests/netlink_unix_diag.c (check_responses): Likewise.

2016-05-21  Fabien Siron  <fabien.siron@epita.fr>

        tests: add check for netlink protocol decoding with -yy option.
        * tests/netlink_netlink_diag.c: New file.
        * tests/net-yy-netlink.c: New file.
        * tests/net-yy-netlink.test: New test.
        * tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add net-yy-netlink.test.

2016-05-18  Fabien Siron  <fabien.siron@epita.fr>

        Add netlink domain sockets support to socketutils.
        * linux/netlink_diag.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * socketutils.c: Include it and "xlat/netlink_protocols.h".
        (netlink_send_query, netlink_parse_response, netlink_print): New
        functions.
        (print_sockaddr_by_inode): Hook up netlink_print.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests/pread64-pwrite64.c: robustify against os specific issues.
        Do not assume that pwrite64 syscall fails when only part of the
        specified memory buffer is accessible.  With some kernels, one
        accessible byte at the end of page is enough for pwrite64 syscall
        to return 1.

        * tests/pread64-pwrite64.c (main): Tweak the test that can lead
        to a partial write.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests/read-write.c: robustify against os specific issues.
        Do not assume that write syscall fails when only part of the specified
        memory buffer is accessible.  With some kernels, one accessible byte
        at the end of page is enough for write syscall to return 1.

        * tests/read-write.c (main): Tweak the test that can lead to a partial
        write.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

        umovestr3.test: extend test coverage.
        * tests/umovestr3.c: Include <sys/param.h>.
        (main): Test with each number between PATH_MAX-1 and 0.

        tests/timer_create.c: robustify against os specific issues.
        * tests/timer_create.c (main): Do not assume any specific error code
        returned by timer_create, print whatever it is.

        Fix some compilation warnings on older systems.
        * print_statfs.c (print_statfs_flags): Define only
        for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS].
        * tests/inet-cmsg.c (print_origdstaddr): Define only
        for [IP_ORIGDSTADDR].

        Update generic ioctl entries from linux 4.6.
        * linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * NEWS: Mention this.

        maint: update for linux 4.6.
        * maint/ioctls_sym.sh: Update workarounds for linux/kvm.h.

        Update SOL_* constants.
        * xlat/socketlayers.in: Add SOL_KCM.

        Update MSG_* constants.
        * xlat/msg_flags.in: Add MSG_BATCH.

        Update AF_* constants.
        * xlat/addrfams.in: Add AF_KCM.

2016-05-17  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add brk.test.
        * tests/brk.c: New file.
        * tests/brk.test: New test.
        * tests/.gitignore: Add brk.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add brk.test.

2016-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of invalid arguments of term ioctls.
        * term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls
        using printxval_long.

        mips: fix printing of invalid operations argument of sysmips syscall.
        * sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using
        printxval_long.

        bfin: fix printing of invalid flags argument of sram_alloc syscall.
        * sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using
        printflags_long.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of invalid arguments of prctl syscall.
        * prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument
        of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL,
        and PR_SET_SECCOMP using printxval_long.
        Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long.
        Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using
        printxval_long.
        * tests/prctl-seccomp-strict.c (main): Update.

        Fix printing of invalid flags argument of perf_event_open syscall.
        * numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall
        using printflags_long.

        or1k: fix printing of invalid 1st argument of or1k_atomic syscall.
        * or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using
        printxval_long.

        Fix printing of invalid flags argument of get_mempolicy syscall.
        * numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall
        using printxval_long.

        Fix printing of invalid mode argument of mbind syscall.
        * numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall
        using printxval_long.
        * tests/mbind.c (main): Update.

        Fix printing of invalid argument of MTDFILEMODE ioctl.
        * mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl
        using printflags_long.

        Fix printing of invalid flags argument of mount syscall.
        * mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long.

        Fix printing of invalid arguments of memory mapping related syscalls.
        * mem.c (print_mmap): Print 3rd and 4th arguments of syscall
        using printflags_long.
        (SYS_FUNC(mprotect)): Print 3rd argument of syscall using
        printflags_long.
        (SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long.
        (SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall
        using printflags_long.
        * tests/remap_file_pages.c (main): Update.

        Fix printing of invalid flags argument of kexec_load and kexec_file_load
        * kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print
        flags argument using printflags_long.

        Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall.
        * fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and
        F_ADD_SEALS operations using printflags_long.

        Fix printing of invalid flags argument of unshare syscall.
        * clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long.

        Introduce printflags_long and printxval_long.
        * defs.h (printflags_long, printxval_long): New static inline functions.

        Fix printing of invalid struct xfs_dqblk.d_flags.
        * quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags
        to uint8_t to avoid potential sign-extension bug when printing
        invalid struct xfs_dqblk.d_flags.

        Fix printing of invalid struct ubi_mkvol_req.vol_type.
        * mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type
        to unsigned short to avoid potential sign-extension bug when printing
        invalid struct ubi_mkvol_req.vol_type.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of prctl/arch_prctl operation argument.
        Consistently treat operation argument of prctl/arch_prctl syscalls
        as int to match the kernel behaviour.

        * prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument
        of syscalls to a variable of type unsigned int and use it in all
        subsequent checks and lookups.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of struct sched_attr.sched_flags.
        * sched.c (print_sched_attr): Print sched_flags using printflags64.

        Fix printing of struct statfs.f_flags.
        * print_statfs.c (print_statfs_flags): Print flags using printflags64.

        Fix printing of invalid struct ifreq.ifr_flags.
        * sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags
        to unsigned short to avoid potential sign-extension bug when printing
        invalid struct ifreq.ifr_flags.

        Fix printing of invalid struct pollfd.events.
        * poll.c (print_pollfd): Explicitly cast struct pollfd.events
        to unsigned short to avoid potential sign-extension bug when printing
        invalid struct pollfd.events.

        Fix printing of invalid struct sembuf.sem_flg.
        * ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg
        to unsigned short to avoid potential sign-extension bug when printing
        invalid struct sembuf.sem_flg.

        Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls.
        * fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence
        fields to unsigned short to avoid potential sign-extension bug when
        printing invalid l_type or l_whence fields.

        Fix printing of fanotify_mark mask argument.
        * fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of epoll_ctl operation argument.
        Consistently treat operation argument of epoll_ctl syscall as int
        to match the kernel behaviour.

        * epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall
        to a variable of type unsigned int and use it in all subsequent
        checks and lookups.
        * tests/epoll_ctl.c (invoke_syscall): New function.
        (main): Use it.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of invalid d_type in getdents syscall.
        * dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid
        potential sign-extension bug when printing invalid d_type.

        bfin: fix decoding of cacheflush syscall.
        * cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument
        using %lu format.  Print 3rd argument as flags.

        Fix decoding of BPF_MAP_UPDATE_ELEM flags.
        * bpf.c (bpf_map_update_elem): Print attr.flags using printxval64.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of fcntl/fcntl64 operation argument.
        Consistently treat operation argument of fcntl/fcntl64 syscalls as int
        to match the kernel behaviour.

        * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign
        2nd argument of syscall to a variable of type unsigned int
        and use it in all subsequent checks and lookups.
        * tests/struct_flock.c (invoke_test_syscall): New function.
        (test_flock_einval, test_flock): Use it.
        * tests/fcntl.c (test_flock64_einval): Use it.
        * tests/fcntl64.c (test_flock64_einval, test_flock64): Use it.

2016-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        Rename sprintflags64 to sprintflags.
        * defs.h (sprintflags): Remove.
        (sprintflags64): Rename to sprintflags.
        * util.c (sprintflags64): Rename to sprintflags.

        Prepare for transition from sprintflags64 to sprintflags.
        * fcntl.c (print_fcntl): Cast 3rd argument of sprintflags
        to unsigned long.
        * membarrier.c (SYS_FUNC(membarrier)): Likewise.
        * prctl.c (SYS_FUNC(prctl)): Likewise.
        * poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags
        to unsigned short.

2016-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        Rename xlookup64 to xlookup.
        * defs.h (xlookup): Remove.
        (xlookup64): Rename to xlookup.
        * util.c (xlookup64): Rename to xlookup.

        Prepare for transition from xlookup64 to xlookup.
        * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)):
        Cast 2nd argument of xlookup to unsigned long.
        * prctl.c (SYS_FUNC(prctl)): Likewise.
        * sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
        * time.c (do_adjtimex): Likewise.
        * ioprio.c (sprint_ioprio): Change type of the argument
        and local variables from int to unsigned int.
        * keyctl.c (print_keyring_serial_number): Cast 2nd argument
        of xlookup to unsigned int.
        * net.c (tprint_sock_type): Change type of the argument to unsigned int.
        * printmode.c (sprintmode): Likewise.
        * printsiginfo.c (printsigval):  Change type of si_code argument
        to unsigned int.

2016-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: fix build with old kernel headers.
        Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all
        required headers, resulting to omission of V4L2_* constants.

        This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files
        because they already include all necessary headers themselves.

        * configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>,
        and <linux/types.h> before <linux/videodev2.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: do not check for sys/ioctl.h and ioctls.h.
        Since sys/ioctl.h is included unconditionally when needed
        and ioctls.h doesn't exist, these checks are redundant.

        * configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        sock.c: include <linux/ioctl.h> instead of <sys/ioctl.h> or <ioctls.h>
        Include <linux/ioctl.h> for <linux/sockios.h> on alpha, sh, and sh64
        architectures because their <asm/sockios.h> use _IOR and _IOW macros
        but don't include anything that would define these macros.

        Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
        no benefits in this case.  <ioctls.h> simply doesn't exist.

        * sock.c [ALPHA || SH || SH64]: Include <linux/ioctl.h>
        instead of <sys/ioctl.h> or <ioctls.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: include <linux/ioctl.h> instead of <sys/ioctl.h>
        Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
        no benefits for parser of VIDIOC_* ioctls.

        * v4l2.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        printsiginfo: remove "verbose" argument.
        Remove erroneous use of verbose(tcp) as a printing limit
        for already fetched members of siginfo_t structure.

        * printsiginfo.h (printsiginfo): Remove boolean argument.
        * printsiginfo.c (printsigval): Remove boolean argument, print
        si_int and si_ptr members unconditionally.  All callers changed.
        (print_si_info): Remove boolean argument, print si_utime and si_stime
        members unconditionally.  All callers changed.
        (printsiginfo): Remove boolean argument.  All callers changed.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ptrace.c: tweak magic constants to make the test more reliable.
        * tests/ptrace.c (main): Change bad_request and bad_data to make they
        lower 32-bit parts closer to -1U.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl_v4l2.c: fix build on older systems.
        Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or
        V4L2_CTRL_CLASS_CAMERA.

        * tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the
        test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING].
        Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        Do not use htole32 function.
        htole32 function is not portable enough.

        * v4l2.c (print_pixelformat): Rewrite initialization of pixel format
        union without using of htole32.
        * tests/ioctl_v4l2.c (main): Likewise.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl_v4l2.c: fix typo.
        * tests/ioctl_v4l2.c (main)
        [!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected
        output string.

        tests: check decoding of ptrace syscall.
        * tests/ptrace.c: New file.
        * tests/ptrace.test: New test.
        * tests/.gitignore: Add ptrace.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ptrace.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: decode data argument of PTRACE_PEEKSIGINFO request.
        The data argument of PTRACE_PEEKSIGINFO request is a pointer
        to siginfo_t array.

        * printsiginfo.c (print_siginfo_t): New function.
        (print_siginfo_array): New mpers printer.
        * process.c (SYS_FUNC(ptrace)): Print data argument of
        PTRACE_PEEKSIGINFO request using print_siginfo_array.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request.
        * process.c (SYS_FUNC(ptrace)): Print data argument of
        PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog.

        ptrace: decode argument of PTRACE_GETEVENTMSG request.
        * process.c (SYS_FUNC(ptrace)): Print data argument of
        PTRACE_GETEVENTMSG request on exiting using printnum_ulong.

        ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests.
        * process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK
        and PTRACE_SETSIGMASK requests using print_sigset_addr_len.

        ptrace: return RVAL_DECODED for requests decoded on entering.
        * process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all
        ptrace requests except those that are partially decoded in exiting,

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: print PTRACE_O_* flags using printflags64.
        As flags argument has a long integer type, print it using printflags64
        because printflags takes unsigned int argument.

        * process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags
        using printflags64.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: print data argument of PTRACE_SEIZE et al requests as flags.
        * process.c (SYS_FUNC(ptrace)): Print data argument of
        PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags.

        ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo
        * process.c (SYS_FUNC(ptrace)): Print data argument of
        PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests
        as a signal number.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: decode addr argument of PTRACE_PEEKSIGINFO request.
        The addr argument of PTRACE_PEEKSIGINFO request is a pointer to
        a struct ptrace_peeksiginfo_args.

        * process.c: Include "xlat/ptrace_peeksiginfo_flags.h".
        (SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request
        as a struct ptrace_peeksiginfo_args.
        * xlat/ptrace_peeksiginfo_flags.in: New file.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests.
        For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument
        contains the size of the buffer pointed to by data argument.
        For PTRACE_SECCOMP_GET_FILTER request, addr argument contains
        an offset counter.

        * process.c (SYS_FUNC(ptrace)): Print addr argument of
        PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER
        requests using %lu format.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: do not print data argument of some requests on sparc.
        On sparc, kernel ignores data argument of PTRACE_GETREGS,
        PTRACE_SETREGS, PTRACE_GETFPREGS, and PTRACE_SETFPREGS requests.

        * process.c (SYS_FUNC(ptrace)) [SPARC || SPARC64]: Return RVAL_DECODED
        right after printing addr argument if request is one of PTRACE_GETREGS,
        PTRACE_SETREGS, PTRACE_GETFPREGS, or PTRACE_SETFPREGS.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests
        As kernel ignores addr and data arguments of PTRACE_ATTACH,
        PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request,
        we do not print them either.

        * process.c (SYS_FUNC(ptrace)): After printing pid argument, return
        RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT,
        PTRACE_KILL, or PTRACE_LISTEN.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: do not print arguments of PTRACE_TRACEME request.
        As kernel ignores arguments of PTRACE_TRACEME request,
        we do not print them either.

        * process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME,
        return early with RVAL_DECODED.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        ptrace: print request using printxval64.
        As first argument of ptrace syscall has a long integer type, print
        it using printxval64 because printxval takes unsigned int argument.

        * process.c (SYS_FUNC(ptrace)): Change type of "request" variable
        from "long" to "unsigned long", print it using printxval64 instead
        of printxval.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        Do not sign-extend siginfo_t.si_syscall.
        * printsiginfo.c (print_si_info): Explicitly cast si_syscall member
        of siginfo_t that has type "int" to "unsigned int", to avoid sign
        extension when passed to syscall_name function.

        Export print_seccomp_fprog for further use in parser of ptrace syscall.
        * defs.h (print_seccomp_fprog): New prototype.
        * seccomp.c (print_seccomp_fprog): Remove "static" keyword.
        Move printing of struct seccomp_fprog fields ...
        (print_seccomp_filter): ... here.

2016-05-11  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add munlockall.test.
        * tests/munlockall.c: New file.
        * tests/munlockall.test: New test.
        * tests/.gitignore: Add munlockall.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add munlockall.test.

        tests: add link.test.
        * tests/link.c: New file.
        * tests/link.test: New test.
        * tests/.gitignore: Add link.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add link.test.

2016-05-11  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding and dumping of preadv2 and pwritev2 syscalls.
        * tests/preadv2-pwritev2.c: New file.
        * tests/preadv2-pwritev2.test: New test.
        * tests/.gitignore: Add preadv2-pwritev2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add preadv2-pwritev2.

        Implement decoding of preadv2 and pwritev2 syscalls.
        * io.c: Include "xlat/rwf_flags.h".
        (do_preadv, do_pwritev, SYS_FUNC(preadv2), SYS_FUNC(pwritev2)):
        New functions.
        (SYS_FUNC(preadv)): Use do_preadv.
        (SYS_FUNC(pwritev)): Use do_pwritev.
        * linux/32/syscallent.h (preadv2, pwritev2): New entries.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * syscall.c (dumpio): Handle SEN_preadv2 and SEN_pwritev2.
        * xlat/rwf_flags.in: New file.
        * NEWS: Mention parsers of new syscalls.

2016-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of xattr family syscalls.
        * tests/xattr.c: Check decoding of all xattr family syscalls.
        * tests/xattr.test: Use run_strace_match_diff.
        * tests/xattr.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove it.

        tests: add print_quoted_memory function to libtests.
        * tests/print_quoted_string.c (print_quoted_memory): New function.
        (print_quoted_string): Use it.
        * tests/tests.h (print_quoted_memory): New prototype.

        Fix corner cases of xattr family syscalls decoding.
        * xattr.c (print_xattr_val): Do not take insize into account, print it
        as unsigned long.
        Do not decode xattr values of size larger than XATTR_SIZE_MAX.
        Use static buffer for fetching xattr values.
        (print_xattr_list): Do not decode string when size is zero.

2016-05-10  Dr. David Alan Gilbert  <dgilbert@redhat.com>

        userfaultfd: Add ioctl tests.
        * tests/ioctl_uffdio.c: New file.
        * tests/ioctl_uffdio.test: New test.
        * tests/.gitignore: Add ioctl_uffdio.
        * tests/Makefile.am (check_PROGRAMS):  Likewise.
        (DECODER_TESTS): Add ioctl_uffdio.test.

2016-05-10  Dr. David Alan Gilbert  <dgilbert@redhat.com>

        Decode UFFDIO_* ioctls.
        Decode the ioctls associated with the userfaultfd fd.
        Note that they tend to read from and also return result in it's data
        structure.

        * configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h.
        * userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder.
        * defs.h (uffdio_ioctl): New prototype.
        * ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in
        uffdio_ioctl.
        * xlat/uffd_*.in: Create flag xlat for all the IOCTLs.

2016-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        Update AX_CODE_COVERAGE.
        * m4/ax_code_coverage.m4: Update to serial 16.
        * Makefile.am (CODE_COVERAGE_LCOV_OPTIONS): Remove.
        (CODE_COVERAGE_GENHTML_OPTIONS): Update, add prefix.
        (CODE_COVERAGE_BRANCH_COVERAGE): Set to 1.

        strace-ff.test: fix race condition.
        * tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command.

        tests/epoll_pwait.c: fix for x32.
        * tests/epoll_pwait.c (main): Explicitly cast last syscall argument
        to kernel_ulong_t.

        strace-S.test: check "-S name"
        * tests/strace-S.test: Add a check for "-c -S name" output.

        Fix NULL dereference in "-S name" when syscall table has holes.
        * count.c (syscall_cmp): Do not pass NULL to strcmp.

        strace-S.test: cleanup.
        * tests/strace-S.test: Rewrite using sed.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add strace-S.test.
        * tests/strace-S.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        strace-ff.test: check that -ff does not create unexpected output files.
        * tests/strace-ff.expected: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/strace-ff.test: Use it.  Check that no other output files
        have been created.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add strace-ff.test.
        * tests/strace-ff.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        strace-V.test: cleanup.
        * tests/strace-V.test: Move config.h parser to a function.
        Rename $OUT to $EXP, swap arguments passed to match_diff.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add strace-V.test.
        * tests/strace-V.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of epoll_pwait syscall.
        * tests/epoll_pwait.c: New file.
        * tests/epoll_pwait.test: New test.
        * tests/.gitignore: Add epoll_pwait.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add epoll_pwait.test.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that sys/epoll.h exists.
        This header file was added in glibc-2.3.2,
        so it's safe to assume its availability.

        * configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h.
        * epoll.c: Include <sys/epoll.h> unconditionally.
        Compile [HAVE_SYS_EPOLL_H] code unconditionally.
        * tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H.
        * tests/epoll_wait.c: Likewise.

2016-05-08  Fabien Siron  <fabien.siron@epita.fr>

        Factorize send_query functions.
        * socketutils.c (send_query): New function.
        (inet_send_query, unix_send_query): Use it.

2016-05-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: relax timings.
        Allow nanosleep(2) to spend 10% more time to make the test suite
        more reliable on slow systems.

        * tests/count.test: Treat 1.1 seconds as valid output.
        * tests/strace-T.expected: Likewise.
        * tests/strace-r.expected: Likewise.

2016-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests/attach-f-p.c: increase timeouts.
        Increase timeouts to make the test more reliable on slow systems.

        * tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds,
        respectively.

2016-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused functions.
        * defs.h (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr):
        Remove.
        * util.c (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr):
        Likewise.

        v4l2.c: use print_array function.
        * v4l2.c (print_v4l2_ext_control, umoven_or_printaddr_ignore_syserror):
        New functions.
        (print_v4l2_ext_controls): Use them via print_array.

        uid.c: use print_array function.
        * uid.c (print_gid): New function.
        (print_groups): Use it via print_array.

        seccomp.c: use print_array function.
        * seccomp.c (decode_filter, decode_seccomp_fprog): Remove.
        (print_bpf_filter): New function.
        (print_seccomp_fprog): Use it via print_array.
        * tests/seccomp-filter-v.c (main): Update.

        scsi.c: use print_array function.
        * scsi.c (print_uchar): New function.
        (print_sg_io_buffer): Use it via print_array.

        poll.c: use print_array function.
        * poll.c (print_pollfd): Change for use as print_array callback.
        (decode_poll_entering): Use print_array.
        * tests/poll.c: Update.
        * tests/poll.test: Update.

        numa.c: use print_array function.
        * numa.c (print_node): New function.
        (print_nodemask): Use it via print_array.
        (print_page_array, print_int_array): Remove.
        (print_addr): New function.
        (print_status, print_int): Change for use as print_array callback.
        (SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status
        via print_array.
        * tests/move_pages.c: Update.
        * tests/set_mempolicy.c: Likewise.
        * tests/set_mempolicy.test: Likewise.

        mem.c: use print_array function.
        * mem.c [POWERPC] (print_protmap_entry): New function.
        [POWERPC] (SYS_FUNC(subpage_prot)): Use it via print_array.

        kexec.c: use print_array function.
        * kexec.c (print_seg): Change for use as print_array callback.
        (print_kexec_segments): Use print_array.

        ipc_sem.c: use print_array function.
        * ipc_sem.c (tprint_sembuf): Rename to print_sembuf, change signature
        for use as print_array callback.
        (tprint_sembuf_array): Use print_array.

        io.c: use print_array function.
        * io.c (print_iovec_config): New structure.
        (print_iovec): New function.
        (tprint_iov_upto): Use print_array.
        * tests/preadv.c (main): Update.
        * tests/pwritev.c (print_iovec, main): Likewise.

        epoll.c: use print_array function.
        * epoll.c (print_epoll_event): Change signature for use as print_array
        callback, all users updated.
        (print_epoll_event_array): Remove.
        (epoll_wait_common): Change to use print_array instead
        of print_epoll_event_array.

        aio.c: use print_array function.
        * aio.c (print_iocbp): New function.
        (SYS_FUNC(io_submit)): Use it via print_array.  Use widen_to_long
        to process long int argument.
        (print_io_event): Change to print struct io_event fetched elsewhere.
        (SYS_FUNC(io_cancel)): Update use of print_io_event.
        (SYS_FUNC(io_getevents)): Use print_io_event via print_array.
        Use widen_to_long to print long int arguments.
        * tests/aio.c (main): Check decoding of io_submit with negative "nr".

        Introduce print_array function for consistent decoding of arrays.
        * defs.h (print_array): New prototype.
        * util.c (print_array): New function.

2016-05-06  Dmitry V. Levin  <ldv@altlinux.org>

        Fix corner cases of ICMP_FILTER decoding.
        * net.c (print_icmp_filter): Print icmp_filter for any positive length.
        * tests/net-icmp_filter.c: New file.
        * tests/net-icmp_filter.test: New test.
        * tests/.gitignore: Add net-icmp_filter.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add net-icmp_filter.test.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: do not strip "1<<" prefix from xlat strings.
        * xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix
        from xlat strings to fix incorrect output.
        * tests/caps.awk: Update.

        Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests/xstatfsx.c: fix mips o32 support.
        mips o32 differs from all other 32-bit architectures by defining
        __kernel_fsid_t structure as an array of long ints.

        * tests/xstatfsx.c (print_statfs): Explicitly cast elements
        of PRINT_F_FSID array to unsigned int.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify VIDIOC_* ioctl parser.
        * v4l2.c: Mpersify arch-specific structures.
        (v4l2_ioctl): Mpersify.
        * tests/ioctl_v4l2.c: New file.
        * tests/ioctl_v4l2.test: New test.
        * tests/.gitignore: Add ioctl_v4l2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioctl_v4l2.test.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify ioctl macros.
        As values of some ioctl macros differ between personalities, these
        personality specific ioctl macros should be properly defined for
        mpersified code.  Implement this by redefining personality specific
        ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS.

        * Makefile.am (ioctl_macros_h): New variable.
        (ioctl_macros%.h): New rule.
        (BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h).
        (m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS.
        * defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro.
        [HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise.

        Acked-by: Elvira Khabirova <lineprinter0@gmail.com>

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of VIDIOC_* ioctls.
        * v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls.
        * tests/ioctl.c (main): Update.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

        nsyscalls.test: add mips o32 support.
        Out-of-range syscalls looks differently on mips o32.

        * tests/nsyscalls.c (main): Handle LINUX_MIPSO32.
        * tests/nsyscalls.test: Trace syscall called "syscall" on mips.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Remove initialization of big holes in syscallent.h files.
        There is no need to explicitly initialize big holes after conversion
        of syscallent.h files to use designated initializers.  For architectures
        that have some data at the end of syscallent.h this initialization of
        big holes is no-op, for others it just inflates the table unnecessarily.

        * linux/arc/syscallent.h: Remove initialization of arch specific block
        at the end of table.
        * linux/metag/syscallent.h: Likewise.
        * linux/nios2/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Likewise.
        * linux/arm/syscallent.h: Remove explicit initialization of a big hole
        before socket subcalls.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.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-compat.h: Remove explicit initialization
        of big holes between different mips ABIs.
        * linux/mips/syscallent-n64.h: Remove explicit initialization
        of big holes before socket subcalls and between different mips ABIs.
        * linux/mips/syscallent-o32.h: Likewise.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: make "1<<val" syntax work with 64-bit values.
        * xlat/gen.sh(cond_xlat, gen_header): Generate 1UUL<<val
        for 1<<val syntax.

        Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fix typo in XLAT_TYPE_PAIR.
        * xlat.h (XLAT_TYPE_PAIR): Take "type" parameter.

        Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of move_pages syscall.
        * numa.c (print_page_array, print_status, print_int, print_int_array):
        New functions.
        (SYS_FUNC(move_pages)): Rewrite using these functions.
        * tests/move_pages.c: New file.
        * tests/move_pages.test: New test.
        * tests/.gitignore: Add move_pages.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add move_pages.test.

        tests: check decoding of mbind syscall.
        * tests/mbind.c: New file.
        * tests/mbind.test: New test.
        * tests/.gitignore: Add mbind.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mbind.test.

2016-04-29  Jeff Mahoney  <jeffm@suse.com>

        Change type of struct xlat.val to uint64_t.
        Some ioctls have flags fields that are 64-bit.  A 32-bit val means
        these flags will never be matched or printed.

        * xlat.h: Include <stdint.h>.
        (struct xlat): Change type of val to uint64_t.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: extend syntax with #val_type directive.
        When #val_type directive is encountered, gen.sh starts using
        XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR,
        with #val_type's argument as a type.

        For example, "#val_type uint64_t" means values of type uint64_t.

        * xlat/gen.sh (gen_header, print_xlat, print_xlat_pair):
        Add val_type support.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat/gen.sh: prepare for adding #val_type directive support.
        This is essentially a no-op change that makes the following change
        easier to read.

        * xlat/gen.sh (print_xlat, print_xlat_pair): New functions.
        (cond_xlat, gen_header): Use them.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros.
        * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts
        to the specified type instead of unsigned int.
        (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts
        to the specified type instead of unsigned int.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        xlat: generate xlat pairs using new XLAT_PAIR macro.
        Before this change there were two forms of xlat entries: those that use XLAT
        or XLAT_END macros, and others verbatim entries.  This change converts
        the latter to use new XLAT_PAIR macro.

        This is necessary for the upcoming change of xlat.val type.

        * xlat.h (XLAT_PAIR): New macro.
        * xlat/gen.sh (cond_xlat, gen_header): Use it.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Explicitly cast argument of XLAT macro to unsigned int.
        This is necessary for the upcoming change of xlat.val type.

        * xlat.h (XLAT): Cast the argument to unsigned int.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

        Change type of {s,t}print_open_modes's argument to unsigned.
        As "flags" argument of sprint_open_modes and tprint_open_modes is
        involved only in bit operations, change its type to unsigned.

        * defs.h.c (sprint_open_modes, tprint_open_modes): Change type
        to unsigned int.
        * open.c (sprint_open_modes, tprint_open_modes): Likewise.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests/remap_file_pages.c: fix for the upcoming change of xlat.val type.
        The "flags" argument of remap_file_page syscall has type "unsigned
        long", so it is not correct to load most significant bits with garbage
        ans assume they are going to be ignored.

        * tests/remap_file_pages.c (main): Remove artificial garbage from flags.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce printflags64 function.
        This is necessary for the upcoming change of xlat.val type.

        * defs.h (printflags): Rename to printflags64, change type of integer
        argument to uint64_t.
        (printflags): New static inline function.
        * util.c (printflags): Rename to printflags64, change type of integer
        argument to uint64_t.  Print it using PRIx64 format.
        Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce sprintflags64 function.
        This is necessary for the upcoming change of xlat.val type.

        * defs.h (sprintflags): Rename to sprintflags64, change type of integer
        argument to uint64_t.
        (sprintflags): New static inline function.
        * util.c (sprintflags): Rename to sprintflags64, change type of integer
        argument to uint64_t.  Print it using PRIx64 format.
        Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        printxvals: change type of integer argument to uint64_t.
        This is necessary for the upcoming change of xlat.val type.
        All users of printxvals are already prepared for this change.

        * defs.h (printxvals): Change type of integer argument to uint64_t.
        * util.c (printxvals): Likewise.  Print it using PRIx64 format.
        Patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        xlat_search: change type of integer argument to uint64_t.
        This is necessary for the upcoming change of xlat.val type.
        All users of addflags are already prepared for this change.

        * defs.h (xlat_search): Change type of integer argument to uint64_t.
        * util.c (xlat_search): Likewise.  Pass it by pointer.
        (xlat_bsearch_compare): Treat first argument as a pointer.
        Patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce xlookup64 function.
        This is necessary for the upcoming change of xlat.val type.

        * defs.h (xlookup): Rename to xlookup64, change type of integer argument
        to uint64_t.
        (xlookup): New static inline function.
        * util.c (xlookup): Rename to xlookup64, change type of integer
        argument to uint64_t.
        Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        addflags: change type of integer argument to uint64_t.
        This is necessary for the upcoming change of xlat.val type.
        All users of addflags are already prepared for this change.

        * defs.h (addflags): Change type of integer argument to uint64_t.
        * util.c (addflags): Likewise.  Print it using PRIx64 format.
        Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce printxval64 wrapper.
        This is necessary for the upcoming change of xlat.val type.

        * defs.h (printxval64): New static inline function.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        Turn printxval macro into a static inline function.
        This is necessary for the upcoming change of xlat.val type.

        * defs.h (printxval): Change to static inline function.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of migrate_pages syscall.
        * tests/migrate_pages.c: New file.
        * tests/migrate_pages.test: New test.
        * tests/.gitignore: Add migrate_pages.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add migrate_pages.test.

        Fix decoding of migrate_pages syscall.
        * numa.c (SYS_FUNC(migrate_pages)): Print syscall arguments
        in the right order.

        tests: check decoding of set_mempolicy syscall.
        * tests/set_mempolicy.c: New file.
        * tests/set_mempolicy.test: New test.
        * tests/.gitignore: Add set_mempolicy.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add set_mempolicy.test.

        tests: check decoding of get_mempolicy syscall.
        * tests/get_mempolicy.c: New file.
        * tests/get_mempolicy.test: New test.
        * tests/.gitignore: Add get_mempolicy.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add get_mempolicy.test.

        numa: fix decoding of nodemask arrays.
        * numa.c (get_nodes): Rewrite an rename to print_nodemask.
        All callers updated.
        (SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)):
        Print a delimiter before nodemask argument.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of policy argument of get_mempolicy syscall.
        * numa.c (SYS_FUNC(get_mempolicy)): Print policy argument in square
        brackets to indicate indirect access.

        Fix decoding of pid_t argument of migrate_pages syscall.
        * numa.c (SYS_FUNC(migrate_pages)): Print pid_t syscall
        argument using %d format.

        tests: add printxval function to libtests.
        * tests/tests.h (printxval): New prototype.
        * tests/printxval.c: New file.
        * tests/Makefile.am  (libtests_a_SOURCES): Add it.

        tests: check decoding of remap_file_pages syscall.
        * tests/remap_file_pages.c: New file.
        * tests/remap_file_pages.test: New test.
        * tests/.gitignore: Add remap_file_pages.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add remap_file_pages.test.

2016-04-27  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add pause.test.
        * tests/pause.c: New file.
        * tests/pause.test: New test.
        * tests/.gitignore: Add pause.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add pause.test.

        tests: add kill.test.
        * tests/kill.c: New file.
        * tests/kill.test: New test.
        * tests/.gitignore: Add kill.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add kill.test.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of pid_t arguments of kill and tgkill syscalls.
        * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Print pid_t syscall
        arguments using %d format.

2016-04-27  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add mlock.test.
        * tests/mlock.c: New file.
        * tests/mlock.test: New test.
        * tests/.gitignore: Add mlock.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mlock.test.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        Move parsers of NUMA related syscalls to numa.c.
        * mem.c (get_nodes, SYS_FUNC(mbind), SYS_FUNC(set_mempolicy),
        SYS_FUNC(get_mempolicy), SYS_FUNC(migrate_pages), SYS_FUNC(move_pages)):
        Move ...
        * numa.c: ... here.
        * Makefile.am (strace_SOURCES): Add numa.c

        tests/umovestr3.c: robustify against os specific issues.
        * tests/umovestr3.c (main): Create extra gap before unreadable page.

        tests: extend test coverage of umovestr short read condition.
        * tests/umovestr3.c: New file.
        * tests/umovestr3.test: New test.
        * tests/.gitignore: Add umovestr3.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add umovestr3.test.

        tests: check decoding of out-of-range syscalls.
        * tests/nsyscalls.c: New file.
        * tests/nsyscalls.test: New test.
        * tests/.gitignore: Add nsyscalls.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add nsyscalls.test.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of 3rd argument of getdents/getdents64 syscalls.
        * dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument
        as unsigned int.
        * dirent64.c (SYS_FUNC(getdents64)): Likewise.
        * tests/getdents.c (main): Check it.
        * tests/getdents64.c (main): Likewise.

        Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument.
        * reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        .travis.yml: raise sleep delay.
        Previous sleep delay value seems to be not enough nowadays.

        .travis.yml (SLEEP_A_BIT): Raise sleep delay.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        Move definitions of MPOL_* constants to xlat files.
        * mem.c (MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND, MPOL_INTERLEAVE):
        Move to xlat/policies.in.
        (MPOL_F_NODE, MPOL_F_ADDR): Move to xlat/mempolicyflags.in.
        (MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL): Move
        to xlat/mbindflags.in.

        tests: check decoding of renameat2 syscall.
        * tests/renameat2.c: New file.
        * tests/renameat2.test: New test.
        * tests/.gitignore: Add renameat2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add renameat2.test.

        Add default values for RENAME_* constants.
        * xlat/rename_flags.in: Add default values.

        tests: check decoding of utimes syscall.
        * tests/utimes.c: New file.
        * tests/utimes.test: New test.
        * tests/.gitignore: Add utimes.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add utimes.test.

        tests: check decoding of futimesat syscall.
        * tests/futimesat.c: New file.
        * tests/futimesat.test: New test.
        * tests/.gitignore: Add futimesat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add futimesat.test.

        tests: extend test coverage of mknod syscall.
        * mknod.c (main): Check more corner cases of mode_t parser.
        * mknod.test: Update.

2016-04-26  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add sched_yield.test.
        * tests/sched_yield.c: New file.
        * tests/sched_yield.test: New test.
        * tests/.gitignore: Add sched_yield.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add sched_yield.test.

        tests: add sync.test.
        * tests/sync.c: New file.
        * tests/sync.test: New test.
        * tests/.gitignore: Add sync.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add sync.test.

        tests: add mknodat.test.
        * tests/mknodat.c: New file.
        * tests/mknodat.test: New test.
        * tests/.gitignore: Add mknodat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mknodat.test.

        tests: add unlink.test.
        * tests/unlink.c: New file.
        * tests/unlink.test: New test.
        * tests/.gitignore: Add unlink.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add unlink.test.

        tests: add reboot.test.
        * tests/reboot.c: New file.
        * tests/reboot.test: New test.
        * tests/.gitignore: Add reboot.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add reboot.test.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of statfs family syscalls.
        Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls
        by rewriting them using mpers infrastructure.

        * fetch_struct_statfs.c: New file.
        * fstatfs.c: Likewise.
        * fstatfs64.c: Likewise.
        * print_statfs.c: Likewise.
        * statfs.h: Likewise.
        * statfs64.c: Likewise.
        * statfs.c: Remove everything except SYS_FUNC(statfs).
        * configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>.
        Add checks for struct statfs and struct statfs64 in <asm/statfs.h>.
        Add checks for f_frsize and f_flags members of these structures.
        * defs.h (struct strace_statfs): New forward declaration.
        (print_struct_statfs, print_struct_statfs64): New prototypes.
        * Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c,
        statfs.c, and statfs64.c.
        (strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c,
        and statfs.h.
        * NEWS: Mention this fix.
        * tests/fstatfs.c: New file.
        * tests/fstatfs64.c: Likewise.
        * tests/statfs64.c: Likewise.
        * tests/xstatfs.c: Likewise.
        * tests/xstatfs64.c: Likewise.
        * tests/xstatfsx.c: Likewise.
        * tests/fstatfs.test: New test.
        * tests/fstatfs64.test: Likewise.
        * tests/statfs64.test: Likewise.
        * tests/statfs.c: Rewrite using xstatfs.c.
        * tests/statfs.test: Update.
        * tests/.gitignore: Add fstatfs, fstatfs64, and statfs64.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add  fstatfs.test, fstatfs64.test, and statfs64.test.
        (EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add printflags function to libtests.
        * tests/printflags.c: New file.
        * tests/tests.h (printflags): New prototype.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

        Move definition of struct xlat to a separate header file.
        Define struct xlat in a separate file so that it could be used later by
        tests without inclusion of defs.h header file.

        * defs.h (struct xlat, XLAT, XLAT_END): Move ...
        * xlat.h: ... here.
        * Makefile.am (strace_SOURCES): Add xlat.h.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: decode osf_statfs64 and osf_fstatfs64 syscalls.
        * linux/alpha/syscallent.h (osf_statfs64, osf_fstatfs64): Set nargs
        and handler.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix decoding of osf_statfs and osf_fstatfs syscalls.
        Do not attempt to print struct osf_statfs as if it was the same as
        struct statfs.  Since struct osf_statfs has never been decoded properly,
        it is probably too late to implement a decoder, so let's just print the
        pointer.

        * statfs.c [ALPHA] (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Move ...
        * alpha.c: ... here.  Replace printstatfs with printaddr.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        statfs: print f_flags field only when ST_VALID flag is set.
        * statfs.c (print_statfs_flags): New function.
        (printstatfs, printstatfs64, printcompat_statfs64): Use it.
        * xlat/statfs_flags.in (ST_VALID): Move to the head of the list.
        * tests/statfs.expected: Update.

2016-04-25  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add symlink.test.
        * tests/symlink.c: New file.
        * tests/symlink.test: New test.
        * tests/.gitignore: Add symlink.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add symlink.test.

        tests: add rmdir.test.
        * tests/rmdir.c: New file.
        * tests/rmdir.test: New test.
        * tests/.gitignore: Add rmdir.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add rmdir.test.

        tests: add setdomainname.test.
        * tests/setdomainname.c: New file.
        * tests/setdomainname.test: New test.
        * tests/.gitignore: Add setdomainname.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setdomainname.test.

        tests: add sched_rr_get_interval.test.
        * tests/sched_rr_get_interval.c: New file.
        * tests/sched_rr_get_interval.test: New test.
        * tests/.gitignore: Add sched_rr_get_interval.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add sched_rr_get_interval.test.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        statfs: decode f_flags field of struct statfs.
        * xlat/statfs_flags.in: New file.
        * statfs.c: Include "xlat/statfs_flags.h".
        (printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags.
        (printstatfs64) [_STATFS_F_FLAGS]: Likewise.
        (printcompat_statfs64): Likewise.
        * tests/statfs.expected: Update.

2016-04-25  Zev Weiss  <zev@bewilderbeest.net>

        statfs: don't quote f_type macro names.
        * statfs.c (sprintfstype): Don't add double-quotes to fs magic macros.
        * tests/statfs.expected: Remove double-quotes.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests/shmxt.c: robustify against arch specific issues.
        Do not treat failed shmat(SHM_RND) as a test failure.
        This change partially reverts commit
        bea707377d2ee3e1950bfa43537ef928163a5fa6.

        * tests/shmxt.c (main): Use SHM_RND in the second shmat call,
        do not treat its potential error as a test failure.

2016-04-23  Dmitry V. Levin  <ldv@altlinux.org>

        Rename PRI__s64 to PRI__d64.
        As PRI__*64 macros mirror PRI*64 macros from inttypes.h, follow the
        principle of least astonishment and name these macros the same way.

        * defs.h (PRI__s64): Rename to PRI__d64.

2016-04-23  Dmitry V. Levin  <ldv@altlinux.org>

        Fix old_mmap output when mmap arguments are unfetchable.
        * mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven
        to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr
        fails.
        * tests/old_mmap.c (main): Check it.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: fix old_mmap output for arm personality.
        * mem.c (SYS_FUNC(old_mmap)) [AARCH64]: Fetch mmap arguments
        as 32-bit integers.

        Define old_mmap parser only on architectures that use it.
        * mem.c (SYS_FUNC(old_mmap)): Define only on AARCH64, ARM, I386, X86_64,
        X32, M68K, S390, and S390X.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of mmap syscall.
        Check decoding of "old mmap" edition of mmap syscall
        on those architectures that define it.

        * tests/old_mmap.c: New file.
        * tests/old_mmap.test: New test.
        * tests/.gitignore: Add old_mmap.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add old_mmap.test.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of mincore syscall.
        * tests/mincore.c (print_mincore): New function.
        (test_mincore): Use it.  Check mincore with invalid vec address.
        Check mincore with length argument not a multiple of the page size.
        (main): Check with DEFAULT_STRLEN pages.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        Move parsers of sync_file_range and sync_file_range2 syscalls to libstrace
        For each given architecture only one of these two syscalls has a
        syscallent entry.  When each parser is placed into a separate file,
        moving to libstrace ensures that only one of them that is need
        is linked into strace executable.

        * sync_file_range.c (SYS_FUNC(sync_file_range2)): Move ...
        * sync_file_range2.c: ... here.
        * Makefile.am (strace_SOURCES): Move sync_file_range.c ...
        (libstrace_a_SOURCES): ... here.  Add sync_file_range2.c.
        (strace_SOURCES_c): Add filtered libstrace_a_SOURCES.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of clock_adjtime syscall.
        * tests/clock_adjtime.c: New file.
        * tests/clock_adjtime.test: New test.
        * tests/.gitignore: Add clock_adjtime.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add clock_adjtime.test.

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not include <assert.h> unnecessarily.
        Automatically change tests/*.c files using the following script:

        for f in tests/*.c; do
                grep -q '\<assert(' "$f" ||
                        sed -i '/# *include *<assert\.h>/d' "$f"
        done

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not include <errno.h> unnecessarily.
        Automatically change tests/*.c files using the following script:

        for f in tests/*.c; do
                grep -Fv errno.h "$f" |
                grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' ||
                        sed -i '/# *include *<errno\.h>/d' "$f"
        done

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests/xetpriority.c: print syscall() result using %ld format.

        tests/xetpgid.c: print syscall() result using %ld format.

        tests/xchownx.c: use errno2name.

        tests/userfaultfd.c: stop using assert.

        tests/unlinkat.c: print syscall() result using %ld format.

        tests/umount.c: use errno2name.

        tests/truncate64.c: cleanup.
        * tests/truncate64.c (main): Use errno2name, stop using assert.

        tests/truncate.c: cleanup.
        * tests/truncate.c (main): Use errno2name, stop using assert.

        tests/tee.c: stop using assert.

        tests/syslog.c: use errno2name.

        tests/sync_file_range2.c: stop using assert.

        tests/sync_file_range.c: stop using assert.

        tests/symlinkat.c: cleanup.

        tests/swap.c: cleanup.
        * tests/swap.c (error_msg): Remove.
        (main): Use errno2name.

        tests/splice.c: stop using assert.

        tests/setugid.c: cleanup.

        tests/sethostname.c: use errno2name.

        tests/setgroups.c: use errno2name.
        * tests/setgroups.c (errno2str): Remove.
        (main): Use errno2name.

        tests/seccomp-strict.c: cleanup.
        * tests/seccomp-strict.c (main): Use errno2name, stop using assert.

        tests/seccomp-filter.c: cleanup.
        * tests/seccomp-filter.c (main): Use errno2name, stop using assert.

        tests/sched_xetscheduler.c: print syscall() result using %ld format.

        tests/sched_xetparam.c: print syscall() result using %ld format.

        tests/renameat.c: print syscall() result using %ld format.

        tests/rename.c: print syscall() result using %ld format.

        tests/readv.c: cleanup.

        tests/pwritev.c: use errno2name.

        tests/preadv-pwritev.c: cleanup.

        tests/prctl-seccomp-strict.c: cleanup.
        * tests/prctl-seccomp-strict.c (main): Use errno2name,
        stop using assert.

        tests/openat.c: use errno2name.

        tests/open.c: use errno2name.

        tests/mlockall.c: cleanup.

        tests/mlock2.c: stop using assert.

        tests/mknod.c: print syscall() result using %ld format.

        tests/mkdirat.c: print syscall() result using %ld format.

        tests/lseek.c: cleanup.
        * tests/lseek.c (main): Use errno2name, stop using assert.

        tests/llseek.c: cleanup.
        * tests/llseek.c (main): Use errno2name, stop using assert.

        tests/linkat.c: print syscall() result using %ld format.

        tests/iopl.c: use errno2name.

        tests/ioperm.c: use errno2name.

        tests/getgroups.c: use errno2name.
        * tests/getgroups.c (errno2str): Remove.
        (main): Use errno2name.

        tests/ftruncate64.c: cleanup.
        * tests/ftruncate64.c (main): Use errno2name, stop using assert.

        tests/ftruncate.c: cleanup.
        * tests/ftruncate.c (main): Use errno2name, stop using assert.

        tests/fsync.c: print syscall() result using %ld format.

        tests/flock.c: print syscall() result using %ld format.

        tests/file_handle.c: use errno2name.

        tests/fdatasync.c: print syscall() result using %ld format.

        tests/fchownat.c: use errno2name.

        tests/fchmodat.c: use errno2name.

        tests/fchmod.c: use errno2name.

        tests/faccessat.c: print syscall() result using %ld format.

        tests/epoll_wait.c: print syscall() result using %ld format.

        tests/epoll_ctl.c: print syscall() result using %ld format.

        tests/epoll_create1.c: cleanup.
        * tests/epoll_create1.c (main): Use errno2name, stop using assert.

        tests/epoll_create.c: print syscall() result using %ld format.

        tests/dup3.c: print syscall() result using %ld format.

        tests/dup2.c: print syscall() result using %ld format.

        tests/dup.c: cleanup.

        tests/creat.c: stop using sys/stat.h.

        tests/copy_file_range.c: stop using assert.

        tests/chroot.c: use errno2name.

        tests/aio.c: use errno2name.

        tests: cleanup acct.test.
        * tests/acct.c (main): Use errno2name, stop using assert,
        change sample file name.
        * tests/acct.test: Update.

        tests: use errno2name()
        Automatically change tests/*.c files using the following sed regexp:
        sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g'

        tests/dup.c: include "tests.h"
        This is going to be necessary for the following commit.

2016-04-21  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add getpgrp.test.
        * tests/getpgrp.c: New file.
        * tests/getpgrp.test: New test.
        * tests/.gitignore: Add getpgrp.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getpgrp.test.

        tests: add access.test.
        * tests/access.c: New file.
        * tests/access.test: New test.
        * tests/.gitignore: Add access.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add access.test.

        tests: add fchdir.test.
        * tests/fchdir.c: New file.
        * tests/fchdir.test: New test.
        * tests/.gitignore: Add fchdir.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fchdir.test.

        tests: add mkdir.test.
        * tests/mkdir.c: New file.
        * tests/mkdir.test: New test.
        * tests/.gitignore: Add mkdir.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mkdir.test.

        tests: add getsid.test.
        * tests/getsid.c: New file.
        * tests/getsid.test: New test.
        * tests/.gitignore: Add getsid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getsid.test.

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add errno2name function to libtests.
        Add a simple translator of errno to its name, so one could
        simply use errno2name() instead of complex expressions like
        errno == EINVAL ? "EINVAL" : "EFAULT".

        * tests.h (errno2name): New prototype.
        * errno2name.c: New file.
        * Makefile.am (libtests_a_SOURCES): Add it.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: rename ECANCELLED to ECANCELED.
        hppa seems to be the only architecture that defines ECANCELLED synonym
        for ECANCELED constant, other architectures just define ECANCELED.
        Change the way how this constant is printed on hppa to be in line
        with other architectures.

        * linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        Remove parser of unimplemented timerfd syscall.
        timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1
        it was replaced by timerfd_* syscall family.

        * linux/avr32/syscallent.h (timerfd): Fix nargs.
        * linux/dummy.h (sys_timerfd): Add stub alias.
        * time.c (SYS_FUNC(timerfd)): Remove.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test
        If kernel implementation of strict seccomp mode is buggy, test programs
        will be killed by SIGKILL.  This is a known problem at least on
        x32 and mips.  Skip affected tests if this is the case.

        This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b.

        * tests/seccomp-strict.c (main): Remove workaround for x32.
        * tests/prctl-seccomp-strict.c: Likewise.
        * tests/seccomp-strict.test: Skip the test if the test program
        has been killed by SIGKILL.
        * tests/prctl-seccomp-strict.test: Likewise.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests/shmxt.c: do not use SHM_RND, it is unreliable.
        * tests/shmxt.c (main): Do not set SHM_RND flag.

        tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long)
        * tests/rt_sigsuspend.c (iterate): Do not assume that size will be less
        than sizeof(long) on the second iteration.

        prctl-seccomp-strict.test: robustify against unrelated prctl invocations
        * tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: adjust rt_sigpending to older kernels.
        With linux kernels older than v3.9-rc1, compat rt_sigpending syscall
        could fail with EFAULT in cases where on later kernels it succeeds.
        Adjust the test to handle both cases properly.

        * tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending
        failed with EFAULT.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: adjust readv/writev and preadv/pwritev tests to older kernels.
        With linux kernels older than v3.16-rc1, iovec based compat syscalls may
        return EINVAL in some cases where on later kernels they return EFAULT.
        Adjust tests to handle both cases properly.

        * tests/preadv-pwritev.c: Include <errno.h>.
        (main): Print either "EINVAL" or "EFAULT" depending on errno.
        * tests/pwritev.c: Likewise.
        * tests/readv.c: Likewise.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove obsolete non-strict uid tests.
        Recently added strict tests for uid/gid related syscalls
        made old uid tests obsolete.

        * tests/uid.awk: Remove.
        * tests/uid.c: Remove.
        * tests/uid.test: Remove.
        * tests/uid16.c: Remove.
        * tests/uid16.test: Remove.
        * tests/uid32.c: Remove.
        * tests/uid32.test: Remove.
        * tests/.gitignore: Remove uid, uid16, and uid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test.
        (EXTRA_DIST): Remove uid.awk.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of getuid/getgid family syscalls.
        Add strict tests for getuid, getuid32, getgid, getgid32, geteuid,
        geteuid32, getegid, and getegid32 syscalls.

        * tests/getegid.c: New file.
        * tests/getegid.test: New test.
        * tests/getegid32.c: New file.
        * tests/getegid32.test: New test.
        * tests/geteuid.c: New file.
        * tests/geteuid.test: New test.
        * tests/geteuid32.c: New file.
        * tests/geteuid32.test: New test.
        * tests/getgid.c: New file.
        * tests/getgid.test: New test.
        * tests/getgid32.c: New file.
        * tests/getgid32.test: New test.
        * tests/getuid.c: New file.
        * tests/getuid.test: New test.
        * tests/getuid32.c: New file.
        * tests/getuid32.test: New test.
        * tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid,
        * geteuid32, getegid, and getegid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test,
        geteuid32.test, getgid.test, getgid32.test, getuid.test,
        and getuid32.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend test coverage of getresgid32 syscall.
        * tests/getresgid32.c: New file.
        * tests/getresgid32.test: New test.
        * tests/.gitignore: Add getresgid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getresgid32.test.

        tests: extend test coverage of getresgid syscall.
        * tests/getresgid.c: New file.
        * tests/getresgid.test: New test.
        * tests/.gitignore: Add getresgid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getresgid.test.

        tests: extend test coverage of getresuid32 syscall.
        * tests/getresuid32.c: New file.
        * tests/getresuid32.test: New test.
        * tests/.gitignore: Add getresuid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getresuid32.test.

        tests: extend test coverage of getresuid syscall.
        * tests/getresugid.c: New file.
        * tests/getresuid.c: New file.
        * tests/getresuid.test: New test.
        * tests/.gitignore: Add getresuid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getresuid.test.
        (EXTRA_DIST): Add getresugid.c.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add symlinkat.test.
        * tests/symlinkat.c: New file.
        * tests/symlinkat.test: New test.
        * tests/.gitignore: Add symlinkat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add symlinkat.test.

        tests: add iopl.test.
        * tests/iopl.c: New file.
        * tests/iopl.test: New test.
        * tests/.gitignore: Add iopl.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add iopl.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32, powerpc, powerpc64: fix decoding of iopl syscall.
        * linux/mips/syscallent-o32.h (iopl): Fix nargs.
        * linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func.
        * linux/powerpc64/syscallent.h (iopl): Likewise.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add ioperm.test.
        * tests/ioperm.c: New file.
        * tests/ioperm.test: New test.
        * tests/.gitignore: Add ioperm.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add ioperm.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix corner cases of getgroups and setgroups syscall decoders.
        * uid.c (print_groups): New function.
        (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it.
        Print first syscall argument using %u format.
        * tests/getgroups.c: New file.
        * tests/getgroups.test: New test.
        * tests/getgroups32.c: New file.
        * tests/getgroups32.test: New test.
        * tests/setgroups.c: New file.
        * tests/setgroups.test: New test.
        * tests/setgroups32.c: New file.
        * tests/setgroups32.test: New test.
        * tests/.gitignore: Add getgroups, getgroups32, setgroups,
        and setgroups32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add getgroups.test, getgroups32.test,
        setgroups.test, and setgroups32.test.

        Cleanup setfsuid syscall decoder.
        * uid.c (SYS_FUNC(setfsuid)): Remove redundant check.

        tests: check decoding of setfsgid32 syscall.
        * tests/setfsgid32.c: New file.
        * tests/setfsgid32.test: New test.
        * tests/.gitignore: Add setfsgid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setfsgid32.test.

        tests: check decoding of setfsgid syscall.
        * tests/setfsugid.c: New file.
        * tests/setfsgid.c: New file.
        * tests/setfsgid.test: New test.
        * tests/.gitignore: Add setfsgid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setfsgid.test.
        (EXTRA_DIST): Add setfsugid.c.

        tests: check decoding of setfsuid32 syscall.
        * tests/setfsuid32.c: New file.
        * tests/setfsuid32.test: New test.
        * tests/.gitignore: Add setfsuid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setfsuid32.test.

        tests: check decoding of setfsuid syscall.
        * tests/setfsugid.c: New file.
        * tests/setfsuid.c: New file.
        * tests/setfsuid.test: New test.
        * tests/.gitignore: Add setfsuid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setfsuid.test.
        (EXTRA_DIST): Add setfsugid.c.

        tests: extend test coverage of setresgid32 syscall.
        * tests/setresgid32.c: New file.
        * tests/setresgid32.test: New test.
        * tests/.gitignore: Add setresgid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setresgid32.test.

        tests: extend test coverage of setresgid syscall.
        * tests/setresgid.c: New file.
        * tests/setresgid.test: New test.
        * tests/.gitignore: Add setresgid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setresgid.test.

        tests: extend test coverage of setresuid32 syscall.
        * tests/setresuid32.c: New file.
        * tests/setresuid32.test: New test.
        * tests/.gitignore: Add setresuid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setresuid32.test.

        tests: extend test coverage of setresuid syscall.
        * tests/setresugid.c: New file.
        * tests/setresuid.c: New file.
        * tests/setresuid.test: New test.
        * tests/.gitignore: Add setresuid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setresuid.test.
        (EXTRA_DIST): Add setresugid.c.

        tests: extend test coverage of setregid32 syscall.
        * tests/setregid32.c: New file.
        * tests/setregid32.test: New test.
        * tests/.gitignore: Add setregid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setregid32.test.

        tests: extend test coverage of setregid syscall.
        * tests/setregid.c: New file.
        * tests/setregid.test: New test.
        * tests/.gitignore: Add setregid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setregid.test.

        tests: extend test coverage of setreuid32 syscall.
        * tests/setreuid32.c: New file.
        * tests/setreuid32.test: New test.
        * tests/.gitignore: Add setreuid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setreuid32.test.

        tests: extend test coverage of setreuid syscall.
        * tests/setreugid.c: New file.
        * tests/setreuid.c: New file.
        * tests/setreuid.test: New test.
        * tests/.gitignore: Add setreuid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setreuid.test.
        (EXTRA_DIST): Add setreugid.c.

        tests: extend test coverage of setgid32 syscall.
        * tests/setgid32.c: New file.
        * tests/setgid32.test: New test.
        * tests/.gitignore: Add setgid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setgid32.test.

        tests: extend test coverage of setgid syscall.
        * tests/setgid.c: New file.
        * tests/setgid.test: New test.
        * tests/.gitignore: Add setgid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setgid.test.

        tests: extend test coverage of setuid32 syscall.
        * tests/setuid32.c: New file.
        * tests/setuid32.test: New test.
        * tests/.gitignore: Add setuid32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setuid32.test.

        tests: extend test coverage of setuid syscall.
        * tests/setugid.c: New file.
        * tests/setuid.c: New file.
        * tests/setuid.test: New test.
        * tests/.gitignore: Add setuid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add setuid.test.
        (EXTRA_DIST): Add setugid.c.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add shmxt.test.
        * tests/shmxt.c: New file.
        * tests/shmxt.test: New test.
        * tests/.gitignore: Add shmxt.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add shmxt.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix decoding of shmat syscall.
        On alpha, shmat syscall is known as osf_shmat.

        * linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add semop.test.
        * tests/semop.c: New file.
        * tests/semop.test: New test.
        * tests/.gitignore: Add semop.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add semop.test.

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations
        * tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls.

        Reported-by: Steve McIntyre <steve@einval.com>

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests/pselect6.c: fix potential output mismatch.
        * tests/pselect6.c (main): In the last case of printing pselect6
        syscall, print the last argument the same way as in other cases.

        Reported-by: Steve McIntyre <steve@einval.com>

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of fchown32 syscall.
        * tests/fchown32.c: New file.
        * tests/fchown32.test: New test.
        * tests/.gitignore: Add fchown32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fchown32.test.

        tests: check decoding of fchown syscall.
        * tests/fchown.c: New file.
        * tests/fchown.test: New test.
        * tests/.gitignore: Add fchown.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fchown.test.

        tests: check decoding of lchown32 syscall.
        * tests/lchown32.c: New file.
        * tests/lchown32.test: New test.
        * tests/.gitignore: Add lchown32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add lchown32.test.

        tests: check decoding of lchown syscall.
        * tests/lchown.c: New file.
        * tests/lchown.test: New test.
        * tests/.gitignore: Add lchown.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add lchown.test.

        tests: check decoding of chown32 syscall.
        * tests/chown32.c: New file.
        * tests/chown32.test: New test.
        * tests/.gitignore: Add chown32.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add chown32.test.

        tests: check decoding of chown syscall.
        * tests/chown.c: New file.
        * tests/chown.test: New test.
        * tests/xchownx.c: New file.
        * tests/.gitignore: Add chown.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add chown.test.
        (EXTRA_DIST): Add xchownx.c.

        Fix decoding of 16-bit uid_t/git_t.
        * uid.c (printuid): Always cast value to uid_t.

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move kernel uid overflow check to libtests.
        This code used in two different places, so move it to the library.

        * tests/overflowuid.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/tests.h (check_overflowuid, check_overflowgid): New prototypes.
        * tests/uid.c (main): Use check_overflowuid.
        * tests/uid16.c (main): Likewise.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32.
        As x86_64 kernel does not support x32 syscall numbers in
        SECCOMP_MODE_STRICT, skip affected tests on x32.

        * tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out
        using error_msg_and_skip.
        * tests/prctl-seccomp-strict.c: Likewise.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add seccomp-filter.test.
        * tests/seccomp-filter.c: New file.
        * tests/seccomp-filter.test: New test.
        * tests/.gitignore: Add seccomp-filter.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add seccomp-filter.test.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

        seccomp: fix decoding of sock_fprog and sock_filter structures.
        Always print struct sock_fprog.len.
        Fix printing of unfetchable elements in sock_filter array.
        Fix printing of large sock_filter arrays.

        * seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and
        print_seccomp_fprog.
        (print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog.
        * tests/prctl-seccomp-filter-v.c (main): Update.
        * tests/seccomp-filter-v.c: New file.
        * tests/seccomp-filter-v.test: New test.
        * tests/.gitignore: Add seccomp-filter-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add seccomp-filter-v.test.

2016-04-11  Dmitry V. Levin  <ldv@altlinux.org>

        seccomp: print SECCOMP_* and BPF_* constants in a more compact way.
        * seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|".
        * tests/prctl-seccomp-filter-v.c: Update.

        tests: rename seccomp.test to prctl-seccomp-filter-v.test.
        * tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test.
        * tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c.
        * tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test.

        tests: add seccomp-strict.test.
        * tests/seccomp-strict.c: New file.
        * tests/seccomp-strict.test: New test.
        * tests/.gitignore: Add seccomp-strict.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add seccomp-strict.test.

        tests: add prctl-seccomp-strict.test.
        * tests/prctl-seccomp-strict.c: New file.
        * tests/prctl-seccomp-strict.test: New test.
        * tests/.gitignore: Add prctl-seccomp-strict.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add prctl-seccomp-strict.test.

        tests: bring lists back to the sorted order.

2016-04-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests/epoll_create1.c: extend for the case of ENOSYS.
        * epoll_create1.c: Make the test work in case of epoll_create1
        returning ENOSYS.

        tests/epoll_ctl.c: extend epoll_ctl coverage.
        * tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding.  Check
        decoding of long int descriptors and NULL struct epoll_event pointer.

2016-04-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add mlockall.test.
        * tests/mlockall.c: New file.
        * tests/mlockall.test: New test.
        * tests/.gitignore: Add mlockall.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mlockall.test.

2016-04-08  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add epoll_wait.test.
        * tests/epoll_wait.c: New file.
        * tests/epoll_wait.test: New test.
        * tests/.gitignore: Add epoll_wait.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add epoll_wait.test.

        tests: add epoll_ctl.test.
        * tests/epoll_ctl.c: New file.
        * tests/epoll_ctl.test: New test.
        * tests/.gitignore: Add epoll_ctl.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add epoll_ctl.test.

        tests: add epoll_create.test.
        * tests/epoll_create.c: New file.
        * tests/epoll_create.test: New test.
        * tests/.gitignore: Add epoll_create.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add epoll_create.test.

2016-04-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests/pread64-pwrite64.c: minor cleanup.
        * tests/pread64-pwrite64.c: Do not include <sys/uio.h>.

2016-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of swapon flags.
        * swapon.c (SYS_FUNC(swapon)): Print priority regardless
        of SWAP_FLAG_PREFER flag being set.
        * tests/swap.c (error_msg): Handle EINVAL.
        (main): Check decoding of swapon flags.

        tests/unlinkat.c: check AT_* decoding.
        * tests/unlinkat.c (main): Check decoding of AT_* constants.

        tests/linkat.c: check AT_* decoding.
        * tests/linkat.c (main): Check decoding of AT_* constants.

2016-04-06  Elliott Hughes  <enh@google.com>

        Improve decoding of Android's PR_SET_VMA prctl.
        Before:

          prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096,
                "atexit handlers") = 0

        After:

          prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096,
                "atexit handlers") = 0

        * prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA.
        * Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option.
        * xlat/prctl_options.in: Add PR_SET_VMA.

2016-04-06  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add mkdirat.test.
        * tests/mkdirat.c: New file.
        * tests/mkdirat.test: New test.
        * tests/.gitignore: Add mkdirat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mkdirat.test.

        tests: add swap.test.
        * tests/swap.c: New file.
        * tests/swap.test: New test.
        * tests/.gitignore: Add swap.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add swap.test.

        tests: add unlinkat.test.
        * tests/unlinkat.c: New file.
        * tests/unlinkat.test: New test.
        * tests/.gitignore: Add unlinkat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add unlinkat.test.

        tests: add linkat.test.
        * tests/linkat.c: New file.
        * tests/linkat.test: New test.
        * tests/.gitignore: Add linkat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add linkat.test.

2016-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add sync_file_range.test and sync_file_range2.test.
        * configure.ac (AC_CHECK_FUNCS): Add sync_file_range.
        * tests/sync_file_range.c: New file.
        * tests/sync_file_range2.c: Likewise.
        * tests/sync_file_range.test: New test.
        * tests/sync_file_range2.test: Likewise.
        * tests/.gitignore: Add sync_file_range and sync_file_range2.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test.

2016-04-05  Dmitry V. Levin  <ldv@altlinux.org>

        Add default values for SYNC_FILE_RANGE_* constants.
        * xlat/sync_file_range_flags.in: Add default values.

2016-04-05  Elliott Hughes  <enh@google.com>

        Fix sync_file_range2 output.
        Before:

          sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
            SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, )

        After:

          sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
            SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0)

        * sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", "
        in the right place.

2016-04-04  Dmitry V. Levin  <ldv@altlinux.org>

        Replace PF_* constants with AF_*
        AF_* constants appear to be more standardized, and in practice there's
        always a one to one relationship between AF_* and PF_*, so let's
        use AF_* instead of PF_*.

        * xlat/domains.in: Remove.
        * net.c: Do not define PF_UNSPEC.  Stop including "xlat/domains.h".
        Replace PF_* with AF_*.  Replace domains with addrfams.
        * tests/inet-cmsg.c: Replace PF_INET with AF_INET.
        * tests/net-yy-inet.c: Likewise.
        * tests/netlink_inet_diag.c: Likewise.
        * tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL.
        * tests/net-y-unix.c: Likewise.
        * tests/net-yy-unix.c: Likewise.
        * tests/netlink_unix_diag.c: Likewise.
        * tests/net.expected: Replace PF_ with AF_.

2016-04-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add read-write.test.
        * tests/read-write.c: New file.
        * tests/read-write.test: New test.
        * tests/.gitignore: Add read-write.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add read-write.test.

2016-04-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests/pread64-pwrite64.test: extend dumpio coverage.
        * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump):
        New functions.
        (main): Use them to test dumping of various data.
        * tests/pread64-pwrite64.test: Update.

        tests: add hexdump_memdup function to libtests.
        * tests/hexdump_strdup.c (hexdump_memdup): New function.
        (hexdump_strdup): Use it.
        * tests/tests.h (hexdump_memdup): New prototype.

        tests: add fchownat.test.
        * tests/fchownat.c: New file.
        * tests/fchownat.test: New test.
        * tests/.gitignore: Add fchownat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fchownat.test.

        tests: add fchmodat.test.
        * tests/fchmodat.c: New file.
        * tests/fchmodat.test: New test.
        * tests/.gitignore: Add fchmodat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fchmodat.test.

        Fix printing of negative offsets in pread64 and pwrite64 syscalls.
        * io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset
        using %lld format string.
        * tests/pread64-pwrite64.c: New file.
        * tests/pread64-pwrite64.test: New test.
        * tests/.gitignore: Add pread64-pwrite64.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (pread64_pwrite64_CPPFLAGS): New variable.
        (DECODER_TESTS): Add pread64-pwrite64.

        tests/hexdump_strdup.c: add support for longer strings.
        * tests/hexdump_strdup.c (hexdump_strdup): Output extra space character
        before hexdumping of the 9th symbol.

        tests/preadv-pwritev.c: fix typo in error diagnostics.
        * tests/preadv-pwritev.c (main): Fix typo in error message.

2016-04-01  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add chroot.test.
        * tests/chroot.c: New file.
        * tests/chroot.test: New test.
        * tests/.gitignore: Add chroot.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add chroot.test.

        tests: add fdatasync.test.
        * tests/fdatasync.c: New file.
        * tests/fdatasync.test: New test.
        * tests/.gitignore: Add fdatasync.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fdatasync.test.

        tests: add fsync.test.
        * tests/fsync.c: New file.
        * tests/fsync.test: New test.
        * tests/.gitignore: Add fsync.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add fsync.test.

        tests: add sethostname.test.
        * tests/sethostname.c: New file.
        * tests/sethostname.test: New test.
        * tests/.gitignore: Add sethostname.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add sethostname.test.

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently handle unsigned arguments of mmap* and remap_file_pages.
        Explicitly declare first 4 arguments of mmap* and all remap_file_pages
        arguments as unsigned to avoid potential sign extension issues.

        * mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall
        arguments to local variables of appropriate types.

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned.
        The second (level) and third (optname) arguments of getsockopt and
        setsockopt syscalls are enums, so treat them consistently as enums:
        use "unsigned int" type to avoid potential sign extension issues.

        * net.c (print_sockopt_fd_level_name, print_getsockopt,
        print_setsockopt): Change type of "level" and "name" arguments
        from "int" to "unsigned int".

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

        Add sentinel attribute to printxvals.
        * gcc_compat.h (ATTRIBUTE_SENTINEL): New macro.
        * defs.h (printxvals): Add ATTRIBUTE_SENTINEL.

        Cleanup parser of ptrace syscall.
        * process.c (print_user_offset_addr): New function for printing offset
        address in the tracee's USER area.
        (SYS_FUNC(ptrace)): Assign syscall arguments to local variables with
        appropriate types.  Print pid argument as int.  Use switch statement
        in the code that handles address argument.  Use print_user_offset_addr
        to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests.

2016-03-31  Jeff Mahoney  <jeffm@suse.com>

        Define PRI__[uxs]64 macros to print __s64 and __u64 values.
        Rather than cast every __u64 or __s64 before printing,
        define printing helpers for those types directly.

        * defs.h (PRI__s64, PRI__u64, PRI__x64): New macros.

2016-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        Implement dumping of preadv and pwritev syscalls.
        * syscall.c (dumpio): Add SEN_preadv and SEN_pwritev.
        * NEWS: Mention this.
        * tests/preadv-pwritev.c: New file.
        * tests/preadv-pwritev.test: New test.
        * tests/.gitignore: Add preadv-pwritev.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (preadv_pwritev_CPPFLAGS): New variable.
        (DECODER_TESTS): Add preadv-pwritev.

2016-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of preadv syscall in case of short read.
        * io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead
        of tprint_iov and specify syscall return value as a data size limit.
        * NEWS: Mention it.
        * tests/preadv.c (main): Add a test case for preadv short read.

        Fix printing of negative offsets in preadv and pwritev syscalls.
        * io.c (print_llu_from_low_high_val): Rename to
        print_lld_from_low_high_val, all callers changed.
        Print value as a signed integer.
        * tests/preadv.c: New file.
        * tests/preadv.test: New test.
        * tests/pwritev.c: New file.
        * tests/pwritev.test: New test.
        * tests/.gitignore: Add preadv and pwritev.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables.
        (DECODER_TESTS): Add preadv.test and pwritev.test.

        Fix printing of unreadable struct iovec.
        * io.c (tprint_iov_upto): If the first element of iovec array is
        unreadable, print its address without array markup.
        * tests/readv.c (main): Check it.

        tests: factor out a part common to many simply organized test scripts.
        * tests/init.sh (run_strace_match_diff): New function.
        * tests/acct.test: Rewrite using run_strace_match_diff.
        * tests/aio.test: Likewise.
        * tests/alarm.test: Likewise.
        * tests/chmod.test: Likewise.
        * tests/clock_nanosleep.test: Likewise.
        * tests/clock_xettime.test: Likewise.
        * tests/copy_file_range.test: Likewise.
        * tests/creat.test: Likewise.
        * tests/dup.test: Likewise.
        * tests/dup2.test: Likewise.
        * tests/dup3.test: Likewise.
        * tests/epoll_create1.test: Likewise.
        * tests/execveat-v.test: Likewise.
        * tests/execveat.test: Likewise.
        * tests/fchmod.test: Likewise.
        * tests/fcntl.test: Likewise.
        * tests/file_handle.test: Likewise.
        * tests/flock.test: Likewise.
        * tests/fork-f.test: Likewise.
        * tests/ftruncate.test: Likewise.
        * tests/ftruncate64.test: Likewise.
        * tests/getcwd.test: Likewise.
        * tests/getdents.test: Likewise.
        * tests/getdents64.test: Likewise.
        * tests/getrandom.test: Likewise.
        * tests/getrusage.test: Likewise.
        * tests/getxxid.test: Likewise.
        * tests/inet-cmsg.test: Likewise.
        * tests/init.sh: Likewise.
        * tests/membarrier.test: Likewise.
        * tests/mincore.test: Likewise.
        * tests/mknod.test: Likewise.
        * tests/mlock2.test: Likewise.
        * tests/mmsg.test: Likewise.
        * tests/nanosleep.test: Likewise.
        * tests/open.test: Likewise.
        * tests/openat.test: Likewise.
        * tests/pselect6.test: Likewise.
        * tests/readdir.test: Likewise.
        * tests/readlink.test: Likewise.
        * tests/readv.test: Likewise.
        * tests/recvmsg.test: Likewise.
        * tests/rename.test: Likewise.
        * tests/renameat.test: Likewise.
        * tests/rt_sigpending.test: Likewise.
        * tests/rt_sigprocmask.test: Likewise.
        * tests/rt_sigqueueinfo.test: Likewise.
        * tests/rt_sigsuspend.test: Likewise.
        * tests/rt_sigtimedwait.test: Likewise.
        * tests/rt_tgsigqueueinfo.test: Likewise.
        * tests/sched_get_priority_mxx.test: Likewise.
        * tests/sched_xetaffinity.test: Likewise.
        * tests/sched_xetparam.test: Likewise.
        * tests/sched_xetscheduler.test: Likewise.
        * tests/seccomp.test: Likewise.
        * tests/select.test: Likewise.
        * tests/sendfile.test: Likewise.
        * tests/sendfile64.test: Likewise.
        * tests/splice.test: Likewise.
        * tests/statx.sh: Likewise.
        * tests/sysinfo.test: Likewise.
        * tests/syslog.test: Likewise.
        * tests/tee.test: Likewise.
        * tests/time.test: Likewise.
        * tests/timer_create.test: Likewise.
        * tests/timer_xettime.test: Likewise.
        * tests/timerfd_xettime.test: Likewise.
        * tests/times-fail.test: Likewise.
        * tests/times.test: Likewise.
        * tests/truncate.test: Likewise.
        * tests/truncate64.test: Likewise.
        * tests/umask.test: Likewise.
        * tests/umount.test: Likewise.
        * tests/umount2.test: Likewise.
        * tests/userfaultfd.test: Likewise.
        * tests/vmsplice.test: Likewise.
        * tests/xet_robust_list.test: Likewise.
        * tests/xetitimer.test: Likewise.
        * tests/xetpgid.test: Likewise.
        * tests/xetpriority.test: Likewise.
        * tests/xettimeofday.test: Likewise.

        tests: introduce $NAME.
        * tests/init.sh (NAME): New variable, defined to ${ME_%.test}.
        (run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test}
        with $NAME.
        * tests/fcntl.test: Likewise.
        * tests/fstat.test: Likewise.
        * tests/mmap.test: Likewise.
        * tests/net-y-unix.test: Likewise.
        * tests/net-yy-inet.test: Likewise.
        * tests/net-yy-unix.test: Likewise.
        * tests/open.test: Likewise.
        * tests/openat.test: Likewise.
        * tests/poll.test: Likewise.
        * tests/ppoll.test: Likewise.
        * tests/readlink.test: Likewise.
        * tests/select.test: Likewise.
        * tests/statx.sh: Likewise.
        * tests/uname.test: Likewise.

2016-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: move definitions of $OUT and $ERR to init.sh.
        As virtually every test defines either one or both of OUT and ERR
        variables and these definitions are exactly the same, move definitions
        of these variables from individual tests to init.sh.

        * tests/init.sh (OUT, ERR): New variables.
        * tests/ipc.sh: Remove initialization of OUT variable.
        * tests/statx.sh: Likewise.
        * tests/*.test: Remove initialization of OUT and ERR variables.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: simplify sendfile.test and sendfile64.test.
        Use the executable itself for input by default.

        * tests/sendfile.c (main): Use av[0] instead of av[1] for input.
        * tests/sendfile64.c (main): Likewise.
        * tests/sendfile.test: Invoke run_prog without arguments.
        * tests/sendfile64.test: Likewise.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        open.test, openat.test: lift /proc requirement.
        While -P option needs /proc to match descriptors, it does not use
        /proc to match pathnames.  As these tests do not need descriptor
        match, the /proc requirement can be safely lifted.

        * tests/open.test: Lift /proc/self/fd/ requirement.
        * tests/openat.test: Likewise.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

        quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.
        * quota.c (if_nextdqblk): New structure.
        (decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.

        Update Q_* constants.
        * xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced
        by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6.

        Update CLONE_* constants.
        * xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP.
        The former was removed by linux kernel commit v2.6.38-rc1~217.
        The latter was introduced by linux kernel commit v4.6-rc1~67^2~8.

        Update BPF_MAP_TYPE_* constants.
        * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH,
        BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by
        linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and
        v4.6-rc1~91^2~212^2~1, respectively.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel
        commit v4.6-rc1~91^2~176.

        Update SEGV_* constants.
        * xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel
        commit v4.6-rc1~68^2~23.

        avr32: wire up copy_file_range syscall.
        * linux/avr32/syscallent.h [325]: Add copy_file_range entry.

2016-03-28  JayRJoshi  <jay.r.joshi100@gmail.com>

        tests/uname.test: check abbreviated output, use print_quoted_string.
        * tests/uname.c (main): Use print_quoted_string to print
        utsname members.  Add abbrev check.
        * tests/uname.test: Add abbrev check.

2016-03-28  Dmitry V. Levin  <ldv@altlinux.org>

        faccessat.test: robustify against libcs invoking faccessat syscall on their own
        * tests/faccessat.c (TMP_FILE): Rename to sample, change its value
        to "faccessat.sample".
        * tests/faccessat.test: Rewrite using openat.test.

        openat.test: robustify against libcs invoking openat syscall on their own
        * tests/openat.c (main): Rename fname to sample, change its value
        to "openat.sample".
        * tests/openat.test: Use -P option to filter out openat syscalls
        made by libc and dynamic linker.

        tests: add open.test.
        * tests/open.c: New file.
        * tests/open.test: New test.
        * tests/.gitignore: Add open.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add open.test.

2016-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        Update generic ioctl entries from linux 4.5.
        * linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh.
        * linux/32/ioctls_inc_align32.h: Likewise.
        * linux/32/ioctls_inc_align64.h: Likewise.
        * NEWS: Mention this.

2016-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        maint: update for linux 4.5.
        * maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files.
        Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files.
        Update path of saa6588.h and exynos-fimc.h files.

2016-03-25  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of device numbers in mknod and mknodat syscalls.
        * mknod.c (decode_mknod): Treat device number argument as unsigned int.
        * tests/mknod.c: Include <sys/sysmacros.h> or <sys/mkdev.h>
        for definition of makedev macro.
        (main): Add a check for a character special file.

2016-03-25  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix decoding of mknod and mknodat syscalls for sparc personality
        Remove remnants of solaris personality support in mknod parser
        that resulted to sparc personality being decoded as old solaris
        personality.  This complements commit v4.10-45-gdf4dd8b and fixes
        commit v4.10-46-g588a90f.

        * mknod.c (decode_mknod) [SPARC || SPARC64]: Remove.

2016-03-25  Katerina Koukiou  <k.koukiou@googlemail.com>

        tests: add openat.test.
        * tests/openat.c: New file.
        * tests/openat.test: New test.
        * tests/.gitignore: Add openat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add openat.test.

2016-03-25  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add renameat.test.
        * tests/renameat.c: New file.
        * tests/renameat.test: New test.
        * tests/.gitignore: Add renameat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add renameat.test.

        tests: add faccessat.test.
        * tests/faccessat.c: New file.
        * tests/faccessat.test: New test.
        * tests/.gitignore: Add faccessat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add faccessat.test.

        tests: add creat.test.
        * tests/creat.c: New file.
        * tests/creat.test: New test.
        * tests/.gitignore: Add creat.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add creat.test.

        tests: add mknod.test.
        * tests/mknod.c: New file.
        * tests/mknod.test: New test.
        * tests/.gitignore: Add mknod.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add mknod.test.

        tests: add syslog.test.
        * tests/syslog.c: New file.
        * tests/syslog.test: New test.
        * tests/.gitignore: Add syslog.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (DECODER_TESTS): Add syslog.test.

2016-03-23  JayRJoshi  <jay.r.joshi100@gmail.com>

        tests/scm_rights-fd.test: fix pathname regex.
        Pathname containing >, }, or non-printable characters was resulting
        in failing of the test.

        * tests/scm_rights-fd.test: Fix pathname regex and simplify things.

2016-03-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add strace-r.test.
        * tests/strace-r.expected: New file.
        * tests/strace-r.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.
        (EXTRA_DIST): Add strace-r.expected.

        tests: add strace-ttt.test.
        * tests/strace-ttt.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

        tests: add strace-tt.test.
        * tests/strace-tt.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

        tests: add strace-t.test.
        * tests/strace-t.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.

        tests: add strace-T.test.
        * tests/strace-T.expected: New file.
        * tests/strace-T.test: New test.
        * tests/Makefile.am (MISC_TESTS): Add it.
        (EXTRA_DIST): Add strace-T.expected.

2016-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: split out tests of specific decoders.
        Split TESTS into three groups: tests of specific decoders, libunwind
        tests, and all other tests.

        * tests/Makefile.am (TESTS): Move attach-f-p.test, attach-p-cmd.test,
        bexecve.test, count-f.test, count.test, detach-running.test,
        detach-sleeping.test, detach-stopped.test, dumpio.test,
        filter-unavailable.test, fork-f.test, ksysent.test, opipe.test,
        pc.test, qual_syscall.test, redirect.test, restart_syscall.test,
        strace-f.test, and vfork-f.test to MISC_TESTS.
        Move remaining tests except $(LIBUNWIND_TESTS) to DECODER_TESTS.
        Add $(DECODER_TESTS) and $(MISC_TESTS).

2016-03-23  JayRJoshi  <jay.r.joshi100@gmail.com>

        tests: add getcwd.test.
        * tests/getcwd.c: New file.
        * tests/getcwd.test: New test.
        * tests/.gitignore: Add getcwd.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add getcwd.test.

        tests: add print_quoted_string function to libtests.
        * tests/tests.h (print_quoted_string): New prototype.
        * tests/print_quoted_string.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-03-17  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add xetpriority.test.
        * resource.c (SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Print
        the second syscall argument using %d format.
        * tests/xetpriority.c: New file.
        * tests/xetpriority.test: New test.
        * tests/.gitignore: Add xetpriority.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add xetpriority.test.

2016-03-15  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add flock.test.
        * tests/flock.c: New file.
        * tests/flock.test: New test.
        * tests/.gitignore: Add flock.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add flock.test.

        tests: add sched_xetscheduler.test.
        * tests/sched_xetscheduler.c: New file.
        * tests/sched_xetscheduler.test: New test.
        * tests/.gitignore: Add sched_xetscheduler.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add sched_xetscheduler.test.

2016-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix SOCK_DIAG_BY_FAMILY tests.
        This complements commit v4.9-368-g301c65c.

        * tests/netlink_inet_diag.c (check_responses): Align "buf"
        on sizeof(long) boundary.
        * tests/netlink_unix_diag.c (check_responses): Likewise.

2016-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update EPOLL* constants.
        * xlat/epollevents.in: Add EPOLLWAKEUP and EPOLLEXCLUSIVE.

2016-03-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add count-f.test.
        * tests/count-f.c: New file.
        * tests/count-f.expected: Likewise.
        * tests/count-f.test: New test.
        * tests/.gitignore: Add count-f.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (count_f_LDADD): New variable.
        (EXTRA_DIST): Add count-f.expected.
        (TESTS): Add count-f.test.

2016-02-21  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: wire up copy_file_range syscall.
        * linux/hppa/syscallent.h [346]: Add copy_file_range entry.

2016-03-11  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: filter strace output in uname test.
        * tests/uname.test: Use uniq to filter strace output.

2016-03-10  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add sched_xetparam.test.
        * tests/sched_xetparam.c: New file.
        * tests/sched_xetparam.test: New test.
        * tests/.gitignore: Add sched_xetparam.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add sched_xetparam.test.

        tests: add sched_get_priority_mxx.test.
        * tests/sched_get_priority_mxx.c: New file.
        * tests/sched_get_priority_mxx.test: New test.
        * tests/.gitignore: Add sched_get_priority_mxx.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add sched_get_priority_mxx.test.

        tests: add dup.test, dup2.test, and dup3.test.
        * tests/dup.c: New file.
        * tests/dup.test: New test.
        * tests/dup2.c: New file.
        * tests/dup2.test: New test.
        * tests/dup3.c: New file.
        * tests/dup3.test: New test.
        * tests/.gitignore: Add dup, dup2, and dup3.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add dup.test, dup2.test, and dup3.test.

2016-03-10  Fabien Siron  <fabien.siron@epita.fr>

        tests: add fchmod.test.
        * tests/fchmod.c: New file.
        * tests/fchmod.test: New test.
        * tests/.gitignore: Add fchmod.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add fchmod.test.

2016-03-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add acct.test.
        * tests/acct.c: New file.
        * tests/acct.test: New test.
        * tests/.gitignore: Add acct.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add acct.test.

2016-03-07  Anchit Jain  <anchitjain1234@gmail.com>

        tests: add chmod.test.
        * tests/chmod.c: New file.
        * tests/chmod.test: New test.
        * tests/.gitignore: Add chmod.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add chmod.test.

2016-03-05  Nahim El Atmani  <naam@lse.epita.fr>

        Reduce memory usage while managing tcbs allocation.
        * strace.c (init):  Remove initial memory allocation for tcbtab.
        (expand_tcbtab): Do initial memory allocation when tcbtabsize == 0.

        Reviewed-By: Gabriel Laskar <gabriel@lse.epita.fr>
        Reported-by: haris iqbal <haris.phnx@gmail.com>

2016-03-01  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add umask.test.
        * tests/umask.c: New file.
        * tests/umask.test: New test.
        * tests/.gitignore: Add umask.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add umask.test.

        tests: add rename.test.
        * tests/rename.c: New file.
        * tests/rename.test: New test.
        * tests/.gitignore: Add rename.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rename.test.

        tests: add uname.test.
        * tests/uname.c: New file.
        * tests/uname.test: New test.
        * tests/.gitignore: Add uname.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add uname.test.

2016-02-20  Dmitry V. Levin  <ldv@altlinux.org>

        mips: wire up copy_file_range syscall.
        * linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry.
        * linux/mips/syscallent-n64.h [5320]: Likewise.
        * linux/mips/syscallent-o32.h [4360]: Likewise.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add rt_sigsuspend.test.
        * tests/rt_sigsuspend.c: New file.
        * tests/rt_sigsuspend.test: New test.
        * tests/.gitignore: Add rt_sigsuspend.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rt_sigsuspend.test.

        Print pid_t arguments of rt_sigqueueinfo and rt_tgsigqueueinfo as int.
        * signal.c (SYS_FUNC(rt_sigqueueinfo)): Print first syscall argument
        using %d format.
        (SYS_FUNC(rt_tgsigqueueinfo)): Print first and second syscall arguments
        using %d format.
        * tests/rt_tgsigqueueinfo.c: New file.
        * tests/rt_tgsigqueueinfo.test: New test.
        * tests/.gitignore: Add rt_tgsigqueueinfo.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rt_tgsigqueueinfo.test.

        getrusage.test: fix build on x32.
        * tests/getrusage.c: Include <stdint.h>
        (main): Print members of struct timeval using %ju format.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        getrusage.test: check that getrusage parser does not access extra memory
        Place struct rusage at the end of an allocated memory page followed by
        an inaccessible page.

        * tests/getrusage.c (main): Use tail_alloc.

2016-02-19  Fei Jie  <feij.fnst@cn.fujitsu.com>

        tests: add getrusage.test.
        * tests/getrusage.c: New file.
        * tests/getrusage.test: New test.
        * tests/.gitignore: Add getrusage.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add getrusage.test.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Print rt_sigtimedwait return value as a signal name.
        * signal.c (SYS_FUNC(rt_sigtimedwait)): Decode return value.
        * tests/rt_sigtimedwait.c: New file.
        * tests/rt_sigtimedwait.test: New test.
        * tests/.gitignore: Add rt_sigtimedwait.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rt_sigtimedwait.test.

        tests: add rt_sigprocmask.test.
        * tests/rt_sigprocmask.c: New file.
        * tests/rt_sigprocmask.test: New test.
        * tests/.gitignore: Add rt_sigprocmask.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rt_sigprocmask.test.

        Fix corner cases of rt_sigpending syscall decoder.
        * signal (print_sigset_addr_len_limit): New function, cloned from
        print_sigset_addr_len with added minimal length argument.
        Treat length less than minimal length or greater than NSIG/8 as invalid.
        Do not align length to 4-byte boundary.  Align destination buffer
        to 4-byte boundary and initialize it with zeroes so that subsequent
        call to sprintsigmask_n will not access uninitialized data.
        (print_sigset_addr_len): Turn into a wrapper around
        print_sigset_addr_len_limit with current_wordsize
        as a minimal length argument.
        (SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit
        instead of print_sigset_addr_len with 1 as a minimal length argument.
        * tests/rt_sigpending.c: New file.
        * tests/rt_sigpending.test: New test.
        * tests/.gitignore: Add rt_sigpending.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add rt_sigpending.test.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Change unix_diag requests back to use full dump instead of exact match.
        Unfortunately, 64-bit linux kernel has a bug in matching inode numbers
        greater than INT_MAX, so unix_diag exact match is not reliable.

        This partially reverts commit 69bfc89770152033d4aa0bc5673fc46e65d89838.

        * socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags,
        remove initialization of udiag_cookie.
        * tests/netlink_unix_diag.c (send_query): Remove "inode" argument,
        add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino
        and udiag_cookie.
        (check_responses): Remove "inode" argument and its use.
        (main): Remove invocation of inode_of_sockfd and passing of listening
        socket inode to send_query and check_responses.

2016-02-19  Michael Shigorin  <mike@altlinux.org>

        tests: avoid using cpp -dD.
        -dD is less portable across some peculiar preprocessors.

        tests/Makefile.am (ksysent.h): Use cpp -dM instead of cpp -dD.

2016-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add poll.test.
        * tests/poll.c: New file.
        * tests/poll.test: New test.
        * tests/.gitignore: Add poll.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add poll.test.

        Fix abbreviated output of poll and ppoll decoders.
        * poll.c (decode_poll_entering, decode_poll_exiting): Fix corner cases
        of abbreviated output.
        * tests/ppoll-v.expected: Update.
        * tests/ppoll.expected: Update.
        * tests/ppoll.test: Update.

        Print unfetchable address in poll and ppoll decoders.
        * poll.c (decode_poll_entering): Replace umove call with
        umove_or_printaddr.
        (decode_poll_exiting): Print unfetchable address when umove call fails.

        Print offsets in lseek and _llseek syscalls as signed integers.
        * lseek.c (SYS_FUNC(lseek)): Print offset using %lld format.
        (SYS_FUNC(llseek)): Likewise.  Treat high and low components of offset
        as unsigned long integers.
        * tests/llseek.c (main): Check that negative offset is printed properly.
        * tests/lseek.c (main): Likewise.

2016-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add xetpgid.test.
        * tests/xetpgid.c: New file.
        * tests/xetpgid.test: New test.
        * tests/.gitignore: Add xetpgid.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add xetpgid.test.

        tests: add alarm.test.
        * tests/alarm.c: New file.
        * tests/alarm.test: New test.
        * tests/.gitignore: Add alarm.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add alarm.test.

        Replace printargs_lu and printargs_ld with printargs_u and printargs_d.
        * defs.h (printargs_lu): Rename to printargs_u.
        (printargs_ld): Rename to printargs_d.
        * syscall.c (printargs_lu): Rename to printargs_u.  Replace %lu with %u.
        (printargs_ld): Rename to printargs_d.  Replace %ld with %d.
        * linux/dummy.h (sys_getpgrp): Change to printargs.
        (sys_alarm): Change to printargs_u.
        (sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp,
        sys_timer_delete, sys_timer_getoverrun): Change to printargs_d.

        Change printargs_lu and printargs_ld to return RVAL_DECODED.
        * syscall.c (printargs_lu, printargs_ld): Return RVAL_DECODED.

        redirect.test: fix the way how strace output is discarded.
        * tests/redirect.test: Disable tracing of syscalls, signals,
        and exit status instead of redirecting strace output to /dev/null.

        tests: extend coverage of struct iovec arrays.
        * tests/readv.c (main): Check decoding of empty, inaccessible,
        and partially inaccessible iovec arrays.
        * tests/readv.test: Update.

        Implement dumping of vmsplice syscall.
        * syscall.c (dumpio): Add SEN_vmsplice.
        * NEWS: Mention this.
        * tests/vmsplice.c: New file.
        * tests/vmsplice.test: New test.
        * tests/.gitignore: Add vmsplice.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add vmsplice.test.

        tests: add tee.test.
        * tests/tee.c: New file.
        * tests/tee.test: New test.
        * tests/.gitignore: Add tee.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add tee.test.

        Fix printing of negative offsets in splice syscall.
        * io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing
        offsets.
        * tests/splice.c: New file.
        * tests/splice.test: New test.
        * tests/.gitignore: Add splice.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add splice.test.

        Implement copy_file_range syscall decoding.
        * copy_file_range.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/32/syscallent.h (copy_file_range): New entry.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * 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/sparc/syscallent.h: Likewise.
        * linux/sparc64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * pathtrace.c (pathtrace_match): Add SEN_copy_file_range.
        * NEWS: Mention new syscall parser.
        * tests/copy_file_range.c: New file.
        * tests/copy_file_range.test: New test.
        * tests/.gitignore: Add copy_file_range.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add copy_file_range.test.

        Update fs *_MAGIC constants.
        * xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC.

        Update IPV6_* constants.
        * xlat/sockipv6options.in: Add IPV6_HDRINCL.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF
        and SO_ATTACH_REUSEPORT_EBPF.

        Update MADV_* constants.
        * xlat/madvise_cmds.in: Add MAD_FREE.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify execve and execveat tests.
        * tests/execve.c (main): Use one page gap between two mapped regions
        for an address that is more likely to be not yet mapped.
        * tests/execveat.c (main): Likewise.

        tests: simplify execve test.
        * tests/execve.c (main): Simplify the test assuming that execve syscall
        never returns ENOSYS.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix numbers of syscall arguments in syscall tables.
        This semi-automatic change brings syscall tables in sync with kernel's
        include/linux/syscalls.h file.

        * linux/aarch64/syscallent.h (recv): Fix nargs.
        * linux/alpha/syscallent.h (sigaltstack, init_module,
        sched_getscheduler, settimeofday): Likewise.
        * linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl,
        shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy,
        timerfd_create): Likewise.
        * linux/bfin/syscallent.h (signal, delete_module): Likewise.
        * linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler,
        io_cancel, set_tid_address, listxattr, llistxattr, flistxattr,
        removexattr, lremovexattr, fremovexattr): Likewise.
        * linux/i386/syscallent.h (signal, mmap): Likewise.
        * linux/ia64/syscallent.h (init_module, readv, writev,
        sched_getscheduler): Likewise.
        * linux/m68k/syscallent.h (signal, request_key): Likewise.
        * linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice):
        Likewise.
        * linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module,
        delete_module): Likewise.
        * linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module,
        delete_module): Likewise.
        * linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm,
        fstatfs64): Likewise.
        * linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise.
        * linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead,
        fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2,
        fallocate, preadv, pwritev, fanotify_mark): Likewise.
        * linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise.
        * linux/s390x/syscallent.h (signal, ipc): Likewise.
        * linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice):
        Likewise.
        * linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt,
        shmctl, fstatfs64, vmsplice): Likewise.
        * linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise.
        * linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64,
        readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc,
        sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise.
        * linux/x32/syscallent.h (64:recvmsg): Likewise.
        * linux/xtensa/syscallent.h (mremap, futex, reboot, init_module,
        delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat,
        futimesat, fchmodat, faccessat): Likewise.
        * NEWS: Mention this fix.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        s390: decode fadvise64 and fadvise64_64.
        * linux/s390/syscallent.h (fadvise64): Set sys_func.
        (fadvise64_64): Set nargs and sys_func.

        mips n64: use the most optimal parser for fadvise64 syscall.
        * linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64)
        with SEN(fadvise64).

        ia64: decode fstatfs64 and statfs64.
        * linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments.
        On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures
        pipe syscall does not take arguments.

        * linux/alpha/syscallent.h (pipe): Change nargs to 0.
        * linux/ia64/syscallent.h (pipe): Likewise.
        * linux/mips/syscallent-n32.h (pipe): Likewise.
        * linux/mips/syscallent-n64.h (pipe): Likewise.
        * linux/mips/syscallent-o32.h (pipe): Likewise.
        * linux/sh/syscallent.h (pipe): Likewise.
        * linux/sh64/syscallent.h (pipe): Likewise.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall.
        * net.c (do_pipe) [HAVE_GETRVAL2]: Remove.
        Always call decode_pair_fd on exiting.
        (SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe.

        Fix pathtrace match for pipe2 syscall.
        * pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors
        or paths to test, move SEN_pipe2 to the appropriate category.

        avr32: wire up missing syscalls.
        * linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier,
        and mlock2 entries.

2016-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check decoding of madvise, mlockall, mremap, and msync syscalls.
        * tests/mmap.c (main): Change output format from regexp to verbatim.
        Add tests for madvise, mlockall, mremap, and msync syscalls.
        * tests/mmap.test: Convert from match_grep to match_diff.
        Add madvise, mlockall, mremap, and msync syscalls to syscall filter.

2016-02-11  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify decoding of waitpid and wait4 syscalls.
        * wait.c (printwaitn): Replace "n" and "bitness" integer arguments
        with a single print_rusage function pointer.  All callers updated.

        waitid: print pid argument as int.
        * wait.c (SYS_FUNC(waitid)): As the type of second syscall argument
        in the kernel is pid_t, print it as int.

        waitid: always print 5th argument.
        * wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs
        as waitid syscall has 5 arguments.

        socketutils: add const qualifier to variables.
        * socketutils.c (cache_and_print_inode_details): Make "details"
        parameter const.
        (print_sockaddr_by_inode_cached): Make "e" variable const.
        (inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2
        members const.  Make "msg" variable const.
        (inet_parse_response): Make "data" parameter and diag_msg variable const.
        (receive_responses): Make "h" and "rc" variables const.
        (unix_send_query): Make struct nlmsghdr and struct unix_diag_req
        members const.  Make "msg" variable const.
        (unix_print): Make all parameters const.
        (print_sockaddr_by_inode): Make proto_name parameter const.

        print_sockaddr_by_inode: cleanup protocol lookup.
        * socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print,
        udp_v6_print): New functions.
        (print_sockaddr_by_inode): Make "protocols" array static, replace
        "family" and "protocol" members with "print" in its underlying
        structure.  Iterate through protocols array when the protocol name
        is specified.

2016-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: check that -f -p attaches to threads properly.
        Check that -f -p attaches and follows all threads of the given pid.

        * tests/attach-f-p.c: New file.
        * tests/attach-f-p.test: New test.
        * tests/.gitignore: Add attach-f-p.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (attach_f_p_LDADD): New variable.
        (TESTS): Add attach-f-p.test.

2016-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce libstrace.a for potentially conditional compilation units.
        Some files are used conditionally depending on architecture and
        configuration.  Create a library for the purpose of keeping such
        compilation units.

        * Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a.
        (libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS).
        (libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS).
        (libstrace_a_SOURCES): New variable, set to upeek.c.
        * util.c (upeek): Move ...
        * upeek.c: ... here.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        travis-ci: pass more gcov arguments to codecov.

        tests: extend coverage of struct itimerspec.
        * tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec
        pointer.

        tests: extend coverage of utimensat syscall.
        * tests/utimensat.c (main): Check decoding of NULL struct timespec
        pointer.

        tests: extend coverage of time syscall.
        * tests/time.c (main): Check decoding of NULL time_t pointer.

        tests: extend coverage of struct sigevent.
        * tests/timer_create.c (main): Check decoding of NULL struct sigevent
        pointer.  Check decoding of invalid sigev_notify value.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend coverage of execve and execveat syscalls.
        Check decoding of inaccessible or partially inaccessible arrays.

        * tests/execve-v.c: New file.
        * tests/execveat-v.c: Likewise.
        * tests/execve-v.test: New test.
        * tests/execveat-v.test: Likewise.
        * tests/execve.c: Rewrite.
        * tests/execveat.c: Likewise.
        * tests/execve.test: Likewise.
        * tests/execveat.test: Likewise.
        * tests/execve.expected: Remove.
        * tests/execve-v.expected: Likewise.
        * tests/execveat.expected: Likewise.
        * tests/execveat-v.expected: Likewise.
        * tests/.gitignore: Add execve-v and execveat-v.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add execve-v.test and execveat-v.test.
        (EXTRA_DIST): Remove execve.expected, execve-v.expected,
        execveat.expected, and execveat-v.expected.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of execve and execveat syscalls with invalid input.
        * execve.c (printargv): Fix decoding of inaccessible or partially
        inaccessible array.
        (printargc): Diagnose inaccessible or partially inaccessible array.
        (decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers.

        tests: extend coverage of capget syscall.
        * tests/caps.c (main): Check decoding of inaccessible cap_user_header_t
        and/or cap_user_data_t.
        * tests/caps.awk: Update match patterns.
        * tests/caps.test: Update.

        tests: extend coverage of sched_getaffinity syscall.
        * tests/sched_xetaffinity.c (main): Check decoding of pointer
        to inaccessible cpu_set_t.

        tests: extend coverage of utime syscall.
        * tests/utime.c (main): Check decoding of NULL struct utimbuf pointer.
        Check decoding of struct utimbuf located at the end of page boundary.
        * tests/utime.test: Update.

        tests: extend coverage of sysinfo syscall.
        * tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer.
        Check decoding of struct sysinfo located at the end of page boundary.
        * tests/sysinfo.test: Update.

        tests: extend coverage of adjtimex syscall.
        * tests/adjtimex.c (main): Check decoding of NULL struct timex pointer.
        Check decoding of struct timex located at the end of page boundary.
        * tests/adjtimex.test: Update.

        tests: check that strace does not retain stdin and stdout descriptors.
        * tests/redirect.test: New test.
        * tests/Makefile.am (TESTS): Add it.

        Create a dummy pipe descriptor instead of opening /dev/null.
        * strace.c (open_dev_null): Rename to open_dummy_desc.  All callers
        changed.  Create a pipe and return its first descriptor instead of
        opening /dev/null.

2016-02-08  Denys Vlasenko  <dvlasenk@redhat.com>

        If stdin/stdout aren't open on startup, open them to /dev/null.
        Otherwise, -oLOGFILE may end up using one of them. This conflicts
        with the previous change, which closes stdin/out in strace.

        * strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout,
        sanitize them: open /dev/null and dup it until fds 0,1,2
        are all used up.

2016-02-08  Denys Vlasenko  <dvlasenk@redhat.com>

        Close stdin/out after child is forked.
        Testcase:

        { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9'

        The writer (head) will be able to perform writes to write end of the pipe.
        With strace call removed, head will immediately get SIGPIPE.

        This change fixes this: now writer immediately gets SIGPIPE with strace too.

        * strace.c (startup_child): Close stdin/out and reopen them to /dev/null.

2016-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add opipe.test.
        Check that -o |pipe_command works.  In particular, check that
        strace waits for completion of piped command.

        * tests/opipe.test: New test.
        * tests/Makefile.am (TESTS): Add it.

2016-02-05  Keith Owens  <kaos.ocs@gmail.com>

        strace-graph: print the pid in the graph.
        * strace-graph: Prefix each command with its pid.

        strace-graph: cope with clone immediately followed by exit.
        * strace-graph: A clone() followed by exit() with no intervening fork
        or execve resulted in the new pid having no seq key.  That breaks when
        trying to use seq as an array reference.  Ensure that clone populates
        the new pid with an empty seq entry.

        strace-graph: handle recent strace output.
        * strace-graph: Fix regex for --SIG.  Ignore '+++ exited with <n> +++'
        lines.  Handle exit_group syscall as well as _exit.

        strace-graph: handle strace -T.
        * strace-graph: Ignore extra ' <time.spent>' field added by strace -T.

        strace-graph: use "strict" and "warnings" pragmas.
        * strace-graph: Set "use strict" and "use warnings" options.  Fix errors
        detected by strict/warnings.  $result is really a string, it can be "-1"
        followed by an error text.

2016-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        Add README.md file with links to build status and test coverage.

        travis-ci: prepare and submit test coverage report.

        tests: extend readlink and readlinkat coverage.
        * tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros.
        (main): Allocate memory for string and buffer passed to the syscall
        being tested using tail_alloc mechanism.  Create and cleanup test
        symlink.  Test syscall error path output.  Print hexquoted strings
        using hexquote_strndup.
        * tests/readlinkat.c: Likewise.
        * tests/readlink.test: Remove creation and cleanup of test symlinks.

        tests: add hexquote_strndup function to libtests.
        * tests/tests.h (hexquote_strndup): New prototype.
        * tests/hexquote_strndup.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

        readlinkat.test: use readlink.test.
        * tests/readlink.test (syscall): Initialize from $0.
        * tests/readlinkat.test: Source readlink.test.

2016-02-04  Gabriel Laskar  <gabriel@lse.epita.fr>

        Add configure --enable-code-coverage option.
        * m4/ax_code_coverage.m4: New file.
        * configure.ac: Use AX_CODE_COVERAGE.
        * Makefile.am: Add @CODE_COVERAGE_RULES@.
        (CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS,
        CODE_COVERAGE_IGNORE_PATTERN): New variables.
        (strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS).
        (strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS).
        (strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS).
        * .gitignore: Add *.gcda and *.gcno.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        Makefile.am: introduce strace_CFLAGS and derivatives.
        * Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS).
        (libmpers_CFLAGS): New variable, set to $(strace_CFLAGS).
        (libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables,
        set to $(libmpers_CFLAGS).

        Makefile.am: use strace_CPPFLAGS consistently.
        * Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS)
        with $(strace_CPPFLAGS).

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace net-fd.test with net-y-unix.test.
        Unlike the former test that was based on match_grep,
        the new one uses match_diff and does more rigorous testing.

        * tests/net-y-unix.c: New file.
        * tests/net-y-unix.test: New test.
        * tests/net-fd.test: Remove.
        * tests/net-fd.expected: Remove.
        * tests/.gitignore: Add net-y-unix.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Replace net-fd.test with net-y-unix.test.
        (net-fd.log): Remove.
        (EXTRA_DIST): Remove net-fd.expected.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        Implement caching of print_sockaddr_by_inode.
        As -yy parser, compared to -y, needs to do at least 5 extra syscalls
        (getxattr, socket, sendmsg, recvmsg, close) to print socket details,
        caching results of netlink conversations between strace and kernel
        noticeably reduces amount of system time spent by strace.

        The caching is safe since sockets do not change their addresses after
        successful bind or connect syscall.

        * defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes.
        * socketutils.c (cache_entry): New type.
        (CACHE_SIZE, CACHE_MASK): New macros.
        (cache): New static array.
        (cache_and_print_inode_details): New static function.
        (print_sockaddr_by_inode_cached): New function.
        (inet_parse_response, unix_parse_response): Use
        cache_and_print_inode_details.
        * util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached.
        (string_quote): Remove static qualifier.
        * NEWS: Mention this improvement.
        * tests/unix-yy.c (main): Update.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        Change unix_diag requests to use exact match instead of full dump.
        * socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags,
        initialize udiag_cookie.
        * tests/netlink_unix_diag.c (send_query): Remove "family" and "proto"
        arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags,
        initialize udiag_ino and udiag_cookie.
        (check_responses): Add "inode" argument, check inode match.
        (main): Pass listening socket inode to send_query and check_responses.

        Robustify netlink response parsers.
        * socketutils.c (inet_parse_response, unix_parse_response): Change
        return type from bool to int, return -1 on all parse errors except
        inode mismatch.
        (receive_responses): Stop on the first nlmsg_type that is not
        SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1.
        * tests/netlink_inet_diag.c (check_responses): Stop on short messages,
        on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose
        diagnostics for NLMSG_ERROR.
        * tests/netlink_unix_diag.c (check_responses): Likewise.

        inet_parse_response: add a safety check.
        * socketutils.c (inet_parse_response): Check that netlink message
        is large enough to contain a inet_diag_msg structure.

        receive_responses: avoid potential hangup.
        * socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after
        the first recvmsg call to avoid potential hangup.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace net-yy.test with net-yy-inet.test.
        Unlike the former test that was based on match_awk,
        the new one uses match_diff and does more rigorous testing.

        * tests/net-yy-inet.c: New file.
        * tests/net-yy-inet.test: New test.
        * tests/net-yy.test: Remove.
        * tests/net-yy-accept.awk: Remove.
        * tests/net-yy-connect.awk: Remove.
        * tests/inet-accept-connect-send-recv.c: Remove.
        * tests/.gitignore: Replace inet-accept-connect-send-recv
        with net-yy-inet.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Replace net-yy.test with net-yy-inet.test.
        (EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

        tests: replace unix-yy.test with net-yy-unix.test.
        Unlike the former test that was based on match_awk,
        the new one uses match_diff and does more rigorous testing.

        * tests/net-yy-unix.c: New file.
        * tests/net-yy-unix.test: New test.
        * tests/unix-yy.test: Remove.
        * tests/unix-yy-accept.awk: Remove.
        * tests/unix-yy-connect.awk: Remove.
        * tests/.gitignore: Add net-yy-unix.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Replace unix-yy.test with net-yy-unix.test.
        (EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk.

2016-02-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add inode_of_sockfd function to libtests.
        * tests/tests.h (inode_of_sockfd): New prototype.
        * tests/inode_of_sockfd.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

        unix_parse_response: add a safety check.
        * socketutils.c (unix_parse_response): Check that netlink message
        is large enough to contain a unix_diag_msg structure.

2016-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fixed decoding of mincore syscall's last argument.
        * mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector
        that were written by the kernel.
        * NEWS: Mention this fix.
        * tests/mincore.c: New file.
        * tests/mincore.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add mincore.
        (TESTS): Add mincore.test.
        * tests/.gitignore: Add mincore.

2016-01-23  Dmitry V. Levin  <ldv@altlinux.org>

        Move fallback -yy socket print from printfd to print_sockaddr_by_inode.
        * util.c (printfd): In -yy mode, move fallback print of proto:[inode] ...
        * socketutils.c (to print_sockaddr_by_inode): ... here.

2016-01-22  Dmitry V. Levin  <ldv@altlinux.org>

        Implement simultaneous use of -p option and tracing of a command.
        * strace.c (init): Allow -p option along with a command.
        (startup_child): In -D mode, record the parent of the tracer process
        as strace_child.
        (startup_attach): Save trace_tracer_pid before -D mode fork.
        When tracing a command in -f mode, do not check for the command's
        threads as it has no threads at this moment.
        Never attach to the tracer process.
        In -D mode, never attach to the parent of the tracer process,
        terminate that process only once at the end of startup_attach,
        and reset strace_child.
        * strace.1: Document that -p option can be used along with tracing
        of a command.
        * NEWS: Mention it.
        * tests/attach-p-cmd-cmd.c: New file.
        * tests/attach-p-cmd-p.c: Likewise.
        * tests/attach-p-cmd.test: New test.
        * tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        (TESTS): Add attach-p-cmd.test.

        This fixes Debian bug #549942.

2016-01-22  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix format of -P description.
        * strace.1 (-P): Write trailing using regular font.

2016-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use local nanosleep based sleep utility replacement.
        * tests/sleep.c: New file.
        * tests/.gitignore: Add sleep.
        * tests/Makefile.am (check_PROGRAMS): Likewise.
        * tests/count.test: Use it instead of system sleep utility.

        tests: add error_msg_and_fail function to libtests.
        * tests/tests.h (error_msg_and_fail): New prototype.
        * tests/error_msg.c (error_msg_and_fail): New function.

2016-01-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix dumping of recvmmsg syscall in case of short read.
        * net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov,
        pass data size limit to dumpiov_upto.
        * NEWS: Mention this fix.
        * tests/mmsg.c (main): Update.

        Fix dumping of recvmsg syscall in case of short read.
        * defs.h (dumpiov_in_msghdr): Add unsigned long argument.
        * net.c (dumpiov_in_msghdr): Add data_size argument.  Call dumpiov_upto
        instead of dumpiov, pass data_size to dumpiov_upto.
        * syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr.
        * NEWS: Mention this fix.
        * tests/recvmsg.c: New file.
        * tests/recvmsg.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add recvmsg.
        (TESTS): Add recvmsg.test.
        * tests/.gitignore: Add recvmsg.

        Fix decoding and dumping of readv syscall in case of short read.
        * defs.h (dumpiov_upto): New prototype.
        (dumpiov): Change to a wrapper around dumpiov_upto.
        * util.c (dumpiov): Rename to dumpiov_upto, add and check data_size
        argument.
        * io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead
        of tprint_iov and specify syscall return value as a data size limit.
        * syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead
        of dumpiov and specify syscall return value as a data size limit.
        * NEWS: Mention this fix.
        * tests/readv.c: New file.
        * tests/readv.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add readv.
        (TESTS): Add readv.test.
        * tests/.gitignore: Add readv.

        tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros.
        * tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros.
        * tests/aio.c (ARRAY_SIZE): Remove.
        * tests/mmsg.c (LENGTH_OF): Remove.

        tests: add hexdump_strdup function to libtests.
        * tests/tests.h (hexdump_strdup): New prototype.
        * tests/hexdump_strdup.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.

        tests: add tprintf function to libtests.
        * tests/tests.h (tprintf): New prototype.
        * tests/tprintf.c: New file.
        * tests/Makefile.am (libtests_a_SOURCES): Add it.
        * tests/mmsg.c: Use tprintf.

2016-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        quotactl: add Q_XGETQSTATV command decoding.
        * quota.c (fs_qfilestatv, fs_quota_statv): New structures.
        (decode_cmd_data): Handle Q_XGETQSTATV case.

        quotactl: add decoding of if_dqinfo.dqi_flags constants.
        * xlat/if_dqinfo_flags.in: New file.
        * quota.c: Include "xlat/if_dqinfo_flags.h".
        (decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags.

        quotactl: consistenly decode all write and unknown commands on entering.
        * quota.c (decode_cmd_data): Change return type to int.
        Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA,
        Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS,
        Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED
        for any other command.
        (SYS_FUNC(quotactl)): On entering, print third argument of any command.
        For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data
        and forward its return value.

        quotactl: fix Q_QUOTAON command decoding.
        * quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path.

        quotactl: print third argument as unsigned int.
        * quota.c (SYS_FUNC(quotactl)): Consistently print the third
        argument using "%u" format.

        quotactl: fix Q_XQUOTAOFF command decoding.
        * quota.c (decode_cmd_data): Print xfs quota flags argument.

        quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding.
        * quota.c (decode_cmd_data): As quota format value and xfs quota flags
        are in-memory constants, print it like an array of one element instead
        of a structure.

2016-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update quotactl constants.
        * xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1.
        * xlat/quotacmds.in: Add Q_XGETQSTATV.
        * xlat/quotatypes.in: Add PRJQUOTA.
        * xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD.

2016-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        Replace u_int{8,16,32,64} with uint{8,16,32,64}
        * util.c: Replace u_int{32,64} with uint{32,64}.
        * quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}.

        Move definitions of quotactl constants to xlat files.
        * quota.c (Q_*): Move to xlat/quotacmds.in.
        (USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in.
        (QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in.
        (XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in.
        (XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in.
        (QIF_*): Move to xlat/if_dqblk_valid.in.
        (IIF_*): Move to xlat/if_dqinfo_valid.in.

2016-01-15  Dmitry V. Levin  <ldv@altlinux.org>

        llseek.test: robustify against libcs invoking _llseek syscall on their own
        * tests/llseek.test: Filter out _llseek calls made with non-negative
        descriptor arguments.

        lseek.test: robustify against libcs invoking lseek syscall on their own.
        * tests/lseek.test: Filter out lseek calls made with non-negative
        descriptor arguments.

2016-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce.
        This fixes the test on platforms where both __NR_sendmmsg and
        HAVE_SENDMMSG are defined but the former is not implemented by the
        kernel and the second is implemented as an indirect syscall.

        * tests/mmsg.c (LENGTH_OF): New macro.
        (send_mmsg, recv_mmsg): Print expected output in case of ENOSYS.
        (main): Redirect stdout to a new descriptor.  Use LENGTH_OF.
        Print expected output.
        * tests/mmsg.test: Update.
        * tests/mmsg.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        aio.test: check memory access by aio decoders.
        * tests/aio.c (main): Place all objects passed to io_* syscalls
        at the end of memory pages followed by inaccessible pages.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        s390, s390x: fix printing of syscalls unknown to the kernel.
        On s390/s390x, syscalls with NR up to 255 can be implemented
        directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used.
        The latter method is allowed for NR < 256, too.

        When the syscall number specified directly or indirectly is recognized
        by the kernel, i.e. it is less than its NR_syscalls value, it is stored
        in %r2 and is available to arch_get_scno via s390_regset.gprs[2].
        For syscall numbers >= NR_syscalls this register is set to 0,
        but %r1 remains unchanged and could be used by arch_get_scno
        via s390_regset.gprs[1] to decide what the syscall number is.

        * linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero,
        take syscall number from s390_regset.gprs[1].
        * NEWS: Mention this fix.

        This fixes Debian bug #485979 and Fedora bug #1298294.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        s390, s390x: print all syscall arguments for syscall number 0.
        * linux/s390/syscallent.h [0]: Set nargs to MA.
        * linux/s390x/syscallent.h: Likewise.

        mips o32: alias sys_syscall to printargs.
        * linux/dummy.h (sys_syscall): Alias to printargs.
        * syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        travis-ci: update build matrix.
        Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix.

        * .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc.
        (env): Add matrix, remove global ENABLE_GCC_WERROR.
        (matrix): Add exclude, remove include.
        * travis-ci.sh: Add support for clang and musl-gcc.
        Use --enable-gcc-Werror for gcc build unconditionally.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: add support for DWARF files generated by clang.
        * mpers.awk: Define default_pointer_size.  Initialize byte_size
        for DW_TAG_pointer_type to default_pointer_size.  Set parent
        for DW_TAG_member only.  Handle DW_AT_count as an alternative
        to DW_AT_upper_bound.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: reorder some statements for better readability.
        * configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*,
        AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS,
        and AC_CHECK_HEADERS.

        scm_rights-fd.test: rewrite without fork.
        * tests/scm_rights.c (main): Rewrite without fork.
        Place all objects passed to sendmsg and recvmsg at the end
        of memory pages followed by inaccessible pages.
        * tests/scm_rights-fd.test: Update.

        tests: fix clang "duplicate 'const' declaration specifier" warnings.
        * tests/ksysent.c (pstr_t): Remove second const specifier.
        * tests/mmsg.c (main): Remove second const specifier from one[], two[],
        and three[].

        tests/times.c: fix clang compilation warning.
        * tests/times.c (main): Initialize dummy variable.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests/mmsg.c: fix build on rhel6/ppc.
        There are weird platforms that define __NR_sendmmsg but at the same time
        do not define __NR_recvmmsg.  Add a workaround for them.

        * configure.ac (AC_CHECK_FUNCS): Add recvmmsg.
        * tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        s390: fix sigreturn decoding on recent kernels.
        Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask
        of the compat signal frame, so remove the old workaround.

        * linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Update PTRACE_* constants.
        * ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define.
        * xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix struct sigevent decoding for musl.
        Do not rely on "struct sigevent.__pad" being located at the same address
        as "struct sigevent.sigev_notify_thread_id", it's not the case with musl
        libc.  Do not rely on struct sigevent definition at all to access
        sigev_notify_thread_id.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct sigevent._sigev_un._pad
        and struct sigevent.__pad.
        * sigevent.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * print_sigevent.c: Include it.
        * print_sigevent.c (struct_sigevent): Remove.
        (print_sigevent): Update all struct_sigevent users.
        * tests/timer_create.c: Include "sigevent.h".
        (main): Use struct_sigevent instead of struct sigevent,
        all struct sigevent clients changed.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: include <signal.h>
        All users of NSIG macro must include <signal.h>.
        This complements commit v4.10-184-g0e946ab.

        * syscall.c: Include <signal.h>.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        signal.c: fix musl libc compilation warning.
        musl libc defines SIGRTMAX to a function that returns signed int,
        which obviously makes gcc -Wsign-compare unhappy.

        * signal.c (signame): Cast ASM_SIGRTMAX to unsigned int.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix TEST_SYSCALL_{NR,STR} and STRUCT_STAT_STR macros for musl.
        The contents of TEST_SYSCALL_NAME and STRUCT_STAT macros was subject
        to macro expansion when used in definitions of TEST_SYSCALL_NR,
        TEST_SYSCALL_STR, and STRUCT_STAT_STR macros.

        As some libcs, e.g. musl libc, define lfs64 names as macros
        (stat64 as stat, lstat64 as lstat, etc.), this might result to incorrect
        expansion of TEST_SYSCALL_NR, TEST_SYSCALL_STR, and STRUCT_STAT_STR
        macros.  To avoid this problem, define these macros directly and remove
        TEST_SYSCALL_NAME macro.

        * tests/_newselect.c (TEST_SYSCALL_NAME): Remove.
        (TEST_SYSCALL_NR, TEST_SYSCALL_STR): New macros.
        * tests/fcntl.c: Likewise.
        * tests/fcntl64.c: Likewise.
        * tests/fstat.c: Likewise.
        * tests/fstatat64.c: Likewise.
        * tests/lstat.c: Likewise.
        * tests/newfstatat.c: Likewise.
        * tests/select.c: Likewise.
        * tests/stat.c: Likewise.
        * tests/fstat64.c (TEST_SYSCALL_NAME): Remove.
        (TEST_SYSCALL_NR, TEST_SYSCALL_STR, STRUCT_STAT_STR): New macros.
        * tests/lstat64.c: Likewise.
        * tests/stat64.c: Likewise.
        * tests/fstatx.c (TEST_SYSCALL_NR, nrify, nrify_): Remove.
        * tests/lstatx.c: Likewise.
        * tests/struct_flock.c (TEST_SYSCALL_NR, TEST_SYSCALL_STR, nrify,
        nrify_, stringify, stringify_): Remove.
        * tests/xselect.c: Likewise.
        * tests/xstatx.c: Check TEST_SYSCALL_STR instead of TEST_SYSCALL_NAME.
        (STRUCT_STAT_STR, TEST_SYSCALL_STR, stringify, stringify_): Remove.
        [!STRUCT_STAT] (STRUCT_STAT_STR): New macro.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests/struct_flock.c: fix musl libc compilation warnings.
        The size of off_t is not something one can rely upon.  For example,
        musl libc unconditionally defines it as an int64_t type on x86.
        A cast to the target type helps to avoid these libc differences.

        * configure.ac: Call AC_C_TYPEOF.
        * tests/struct_flock.c (TYPEOF_FLOCK_OFF_T): New macro.
        (test_flock_einval): Use it instead of off_t.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests/inet-cmsg.c: fix musl libc compilation warnings.
        The types that are used to define msg_namelen member of struct msghdr
        and cmsg_len member of struct cmsghdr differ between libcs.
        For example, glibc defines them as size_t, while musl libc - as type
        socklen_t.  Print these fields using %lu format to avoid issues caused
        by libc differences.

        * tests/inet-cmsg.c (main): Cast mh.msg_controllen and c->cmsg_len
        to unsigned long and print them using %lu format.

2016-01-11  Dmitry V. Levin  <ldv@altlinux.org>

        aio.test: include <fcntl.h> instead of <sys/fcntl.h>
        * tests/aio.c: Include <fcntl.h> instead of <sys/fcntl.h>.

        mmsg.test: check memory access by sendmmsg and recvmmsg decoders.
        * tests/tests.h (tail_memdup): New prototype.
        * tests/tail_alloc.c (tail_memdup): New function.
        * tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg
        at the end of memory pages followed by inaccessible pages.

        mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg.
        * tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg.
        Pass MSG_DONTWAIT to recvmmsg.
        * tests/mmsg.expected: Update.

2016-01-11  Dmitry V. Levin  <ldv@altlinux.org>

        mmsg.test: prefer direct sendmmsg/recvmmsg syscalls to libc wrappers.
        * tests/mmsg.c: Include <sys/syscall.h>.
        Check for __NR_sendmmsg as an alternative to HAVE_SENDMMSG.
        [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define.
        (send_mmsg, recv_mmsg): New functions.
        (main): Use them instead of sendmmsg and recvmmsg.

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        sigreturn.test: use RT_5 signal number instead of RT_2.
        Make the test compatible with musl libc that uses RT_2 internally.

        * tests/sigreturn.c (main): Replace RT_2 with RT_5.
        * tests/sigreturn.test: Likewise.

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        avr32: wire up accept4 syscall.
        * linux/avr32/syscallent.h [321]: Add accept4 entry.

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        sparc64: fix names of {s,g}etres{u,g}id syscalls.
        * linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names.

        sparc64: remove sparc32 syscall entries.
        * linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77,
        82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign.

        sparc: remove sparc64 syscall entries.
        * linux/sparc/syscallent.h [52, 163]: Unassign.

        sparc64: clone syscallent.h from sparc.
        * linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h.

        sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls
        * linux/sparc/syscallent.h [353]: Move mlock2 entry to 356.
        [353, 354, 355]: Add bind, listen, and setsockopt entries.
        * NEWS: Mention this.

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: do not use settimeofday wrapper provided by libc.
        Workaround limitations of settimeofday wrapper provided by musl libc.

        * tests/xettimeofday.c (main): Call settimeofday using syscall().

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl.test: robustify against libcs invoking ioctl syscall on their own.
        * tests/ioctl.test: Filter out from the log ioctl calls with standard
        descriptor arguments.

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls.
        Print the second return value of getxpid, getxuid, and getxgid syscalls
        that return a pair of values using the same mechanism as pipe syscall.

        * alpha.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid).
        [24]: Change SEN(getuid) to SEN(getxuid).
        [47]: Change SEN(getgid) to SEN(getxgid).
        * NEWS: Mention this enhancement.
        * tests/uid.awk: Update for getxgid output change.
        * tests/uid.test: Cleanup.
        * tests/getxxid.c: New file.
        * tests/getxxid.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add getxxid.
        (TESTS): Add getxxid.test.
        * tests/.gitignore: Add getxxid.

2016-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup parser of getpagesize syscall.
        * mem.c (SYS_FUNC(getpagesize)): Decode on entering syscall.

        alpha: alias getdtablesize to printargs.
        * linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs.
        * desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove.

2016-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: change text marker in fork-f and vfork-f tests.
        Use chdir syscalls instead of pwrite64 syscalls as a method of inserting
        text markers into strace output because the former are more portable.

        * tests/fork-f.c (logit): Rename to logit_. Use chdir instead of pwrite.
        (logit): New macro wrapper around logit_.
        (main): Update expected output.
        * tests/vfork-f.c: Likewise.
        * tests/fork-f.test: Update.

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing of 32-bit times syscall return value on 64-bit architectures
        This change complements commit v4.9-359-gd93d9f8 by fixing
        RVAL_UDECIMAL case.
        The only syscall that appears to be affected is the times syscall.

        * syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL,
        when current personality is 32-bit, print 32-bit return code.
        * NEWS: Mention this fix.

        Reported-by: Steve McIntyre <steve@einval.com>

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests/vfork-f.c: support platforms without vfork.
        On some platforms, e.g. hppa glibc, vfork() is implemented using fork
        syscall, so the test cannot rely on the parent process remaining blocked
        until the child process either terminates or calls execve.

        * tests/vfork-f.c (main): Explicitly block the parent until the child
        either terminates or calls execve.

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix and enhance decoding of sched_[gs]etaffinity syscalls.
        Print cpu_set_t as a set of integers, similar to the way
        fd_set is printed as a set of descriptors.

        * affinity.c: Include <sched.h>.
        (get_cpuset_size): New function.
        (print_affinitylist): Rewrite using get_cpuset_size and next_set_bit.
        (sched_getaffinity, sched_setaffinity): Print first two args as ints.
        * NEWS: Mention this enhancement.
        * tests/sched_xetaffinity.c: New file.
        * tests/sched_xetaffinity.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sched_xetaffinity.
        (TESTS): Add sched_xetaffinity.test.
        * tests/.gitignore: Add sched_xetaffinity.

        Reported-by: Joe Korty <joe.korty@ccur.com>

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: convert epoll_create1.test from match_grep to match_diff.
        * tests/epoll_create1.c (main): Print expected output.
        * tests/epoll_create1.test: Use match_diff instead of match_grep.
        * tests/epoll_create1.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected.

        tests/struct_flock.c: use libtests.
        * tests/struct_flock.c (create_sample): Return void,
        all callers changed.  Use perror_msg_and_fail.
        * tests/fcntl.c: Use SKIP_MAIN_UNDEFINED.
        * tests/fcntl64.c: Likewise.

        tests/file_handle.c: use libtests.
        * tests/file_handle.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/uid32.c: use libtests.
        * tests/uid32.c: Use SKIP_MAIN_UNDEFINED.

        tests/uid16.c: use libtests.
        * tests/uid16.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/uid.c: use libtests.
        * tests/uid.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/netlink_unix_diag.c: use libtests.
        * tests/netlink_unix_diag.c (send_query, check_responses, main):
        Use perror_msg_and_skip.

        tests/netlink_inet_diag.c: use libtests.
        * tests/netlink_inet_diag.c (send_query, check_responses, main):
        Use perror_msg_and_skip.

        tests/readdir.c: use libtests.
        * tests/readdir.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/getdents64.c: use libtests.
        * tests/getdents64.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/getdents.c: use libtests.
        * tests/getdents.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/ipc_shm.c: use libtests.
        * tests/ipc_shm.c (cleanup): New function.
        (main): Use it and perror_msg_and_skip.

        tests/ipc_sem.c: use libtests.
        * tests/ipc_sem.c (cleanup): New function.
        (main): Use it and perror_msg_and_skip.

        tests/ipc_msg.c: use libtests.
        * tests/ipc_msg.c (cleanup): New function.
        (main): Use it and perror_msg_and_skip.

        tests/ipc_msgbuf.c: use libtests.
        * tests/ipc_msgbuf.c (cleanup): New function.
        (main): Use it and perror_msg_and_skip.

        tests/mq.c: use libtests.
        * tests/mq.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/utimensat.c: use libtests.
        * tests/utimensat.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/ppoll.c: use libtests.
        * tests/ppoll.c (main): Use assert, perror_msg_and_skip,
        and perror_msg_and_fail.

        tests/mmsg.c: use libtests.
        * tests/mmsg.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/ip_mreq.c: use libtests.
        * tests/ip_mreq.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/ioctl.c: use libtests.
        * tests/ioctl.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use %m printf format specifier.

        tests/pipe.c: use libtests.
        * tests/pipe.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_fail and perror_msg_and_skip.

        tests/getrandom.c: use libtests.
        * tests/getrandom.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/signalfd.c: use libtests.
        * tests/signalfd.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/pc.c: use libtests.
        * tests/pc.c (main): Use assert, get_page_size, perror_msg_and_fail,
        and perror_msg_and_skip.

        tests/uio.c: use libtests.
        * tests/uio.c: Use SKIP_MAIN_UNDEFINED.

        tests/bpf.c: use libtests.
        * tests/bpf.c: Use SKIP_MAIN_UNDEFINED.
        (main) Use perror_msg_and_skip.

        tests/aio.c: use libtests.
        * tests/aio.c: Use SKIP_MAIN_UNDEFINED.
        (main) Use perror_msg_and_skip.

        tests/sched_xetattr.c: use libtests.
        * tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED.
        (main) Use perror_msg_and_skip.

        tests/wait.c: use libtests.
        * tests/wait.c (main): Use perror_msg_and_fail.

        tests/vfork-f.c: use libtests.
        * tests/vfork-f.c (main): Use assert and perror_msg_and_fail.

        tests/fork-f.c: use libtests.
        * tests/fork-f.c (main): Use assert and perror_msg_and_fail.

        tests/userfaultfd.c: use libtests.
        * tests/userfaultfd.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert.

        tests/mlock2.c: use libtests.
        * tests/mlock2.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert.

        tests/membarrier.c: use libtests.
        * tests/membarrier.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert.

        tests/nanosleep.c: use libtests.
        * tests/nanosleep.c (main): Use assert, perror_msg_and_fail,
        and perror_msg_and_skip.

        tests/timerfd_xettime.c: use libtests.
        * tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/timer_xettime.c: use libtests.
        * tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/timer_create.c: use libtests.
        * tests/timer_create.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/clock_xettime.c: use libtests.
        * tests/clock_xettime.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/clock_nanosleep.c: use libtests.
        * tests/clock_nanosleep.c (main): Use assert and perror_msg_and_skip.

        tests/truncate64.c: use libtests.
        * tests/truncate64.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/truncate.c: use libtests.
        * tests/truncate.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/ftruncate64.c: use libtests.
        * tests/ftruncate64.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/ftruncate.c: use libtests.
        * tests/ftruncate.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests/llseek.c: use libtests.
        * tests/llseek.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/lseek.c: use libtests.
        * tests/lseek.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/readlinkat.c: use libtests.
        * tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/readlink.c: use libtests.
        * tests/readlink.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/xattr.c: use libtests.
        * tests/xattr.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/seccomp.c: use libtests.
        * tests/seccomp.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_fail and perror_msg_and_skip.

        tests/restart_syscall.c: use libtests.
        * tests/restart_syscall.c (main): Use assert, perror_msg_and_fail,
        and perror_msg_and_skip.

        tests/inet-cmsg.c: use libtests.
        * tests/inet-cmsg.c (main): Use perror_msg_and_skip.

        tests/eventfd.c: use libtests.
        * tests/eventfd.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip.

        tests/epoll_create1.c: use libtests.
        * tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert and perror_msg_and_skip.

        tests/mmap.c: use libtests.
        * tests/mmap.c (main): Use get_page_size and perror_msg_and_fail.

        tests/fanotify_mark.c: use libtests.
        * tests/fanotify_mark.c: Use SKIP_MAIN_UNDEFINED.

        tests/inet-accept-connect-send-recv.c: use libtests.
        * tests/inet-accept-connect-send-recv.c (main): Use perror_msg_and_skip
        and perror_msg_and_fail.

        tests/net-accept-connect.c: use libtests.
        * tests/net-accept-connect.c (main): Use perror_msg_and_skip
        and perror_msg_and_fail.

        tests/unix-pair-send-recv.c: use libtests.
        * tests/unix-pair-send-recv.c (main): Use perror_msg_and_skip
        and perror_msg_and_fail.

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests/xselect.c: use libtests.
        * tests/xselect.c (main): Use assert, perror_msg_and_fail,
        and perror_msg_and_skip.

        tests/pselect6.c: use libtests.
        * tests/pselect6.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert, perror_msg_and_fail, and perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests/oldselect.c: use libtests.
        * tests/oldselect.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_fail and perror_msg_and_skip.

        tests/select.c: use libtests.
        * tests/select.c: Use SKIP_MAIN_UNDEFINED.

        tests/_newselect.c: use libtests.
        * tests/_newselect.c: Use SKIP_MAIN_UNDEFINED.

        tests/fstatat.c: use libtests.
        * tests/fstatat.c: Use SKIP_MAIN_UNDEFINED.

        tests/newfstatat.c: use libtests.
        * tests/newfstatat.c: Use SKIP_MAIN_UNDEFINED.

        tests/fstatat64.c: use libtests.
        * tests/fstatat64.c: Use SKIP_MAIN_UNDEFINED.

        tests/xstatx.c: use libtests.
        * tests/xstatx.c: Use SKIP_MAIN_UNDEFINED.

        tests/stat64.c: use libtests.
        * tests/stat64.c: Use SKIP_MAIN_UNDEFINED.

        tests/stat.c: use libtests.
        * tests/stat.c: Use SKIP_MAIN_UNDEFINED.

        tests/lstat64.c: use libtests.
        * tests/lstat64.c: Use SKIP_MAIN_UNDEFINED.

        tests/lstat.c: use libtests.
        * tests/lstat.c: Use SKIP_MAIN_UNDEFINED.

        tests/fstat64.c: use libtests.
        * tests/fstat64.c: Use SKIP_MAIN_UNDEFINED.

        tests/fstat.c: use libtests.
        * tests/fstat.c: Use SKIP_MAIN_UNDEFINED.

        tests/statfs.c: use libtests.
        * tests/statfs.c (main): Use perror_msg_and_fail.

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests/xettimeofday.c: use libtests.
        * tests/xettimeofday.c (main): Use assert and perror_msg_and_skip.

        tests/utime.c: use libtests.
        * tests/utime.c (main): Use assert and perror_msg_and_skip.

        tests/filter-unavailable.c: use libtests.
        * tests/filter-unavailable.c (main): Use perror_msg_and_fail.

        tests/scm_rights.c: use libtests.
        * tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.

        tests/caps.c: use libtests.
        * tests/caps.c (main): Use perror_msg_and_skip.

        tests/rt_sigqueueinfo.c: use libtests.
        * tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip.

        tests/umount.c: use libtests.
        * tests/umount.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_fail.

        tests/umount2.c: use libtests.
        * tests/umount2.c (main): Use perror_msg_and_fail.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests/times.c: use libtests.
        * tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip.

2016-01-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests/times-fail.c: use assert.
        * tests/times-fail.c (main): Use assert.

        tests/memfd_create.c: use libtests.
        * tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED.

        tests/execveat.c: use libtests.
        * tests/execveat.c: Use SKIP_MAIN_UNDEFINED.

        tests/xetitimer.c: use libtests.
        * tests/xetitimer.c (main): Use perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests/sysinfo.c: use libtests.
        * tests/sysinfo.c (main): Use perror_msg_and_skip.

        tests/sigaltstack.c: use libtests.
        * tests/sigaltstack.c (main): Use perror_msg_and_skip.

        tests/adjtimex.c: use libtests.
        * tests/adjtimex.c (main): Use perror_msg_and_skip.

        tests/xet_robust_list.c: use libtests.
        * tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip and tail_alloc.

        tests/umovestr2.c: use libtests.
        * tests/umovestr2.c (main): Use get_page_size and tail_alloc.

        tests/umovestr.c: use libtests.
        * tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc.

        tests/time.c: use libtests.
        * tests/time.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use perror_msg_and_skip and tail_alloc.

        tests/sendfile64.c: use libtests.
        * tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
        and tail_alloc.

        tests/sendfile.c: use libtests.
        * tests/sendfile.c: Use SKIP_MAIN_UNDEFINED.
        (main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
        and tail_alloc.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: include tests.h instead of config.h.
        Automatically edit tests/*.c files using the following perl one-liner:

        perl -0777 -pi -e \
        's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \
        tests/*.c

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: introduce libtests.
        Introduce tests/libtests.a with common functions for use in tests.

        * tests/tests.h: New file.
        * tests/error_msg.c: Likewise.
        * tests/tail_alloc.c: Likewise.
        * tests/get_page_size.c: Likewise.
        * tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
        check_LIBRARIES, LDADD): New variables.
        (clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
        pc_LDADD, times_LDADD): Add $(LDADD).
        * tests/.gitignore: Add libtests.a.

2016-01-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enable strace-k.test only for --with-libunwind configurations.
        Also, since -k option does not support multiple personalities,
        add strace-k.test to XFAIL_TESTS when running mpers tests.

        * tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_,
        XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables.
        [USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test.
        (TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS).
        * bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am.
        * tests/strace-k.test: Do not check for -k option availability.

2016-01-02  Dmitry V. Levin  <ldv@altlinux.org>

        Move gcc compat macros to gcc_compat.h.
        * defs.h: Include "gcc_compat.h".
        (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
        ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
        ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
        * gcc_compat.h: ... here.
        * Makefile.am (strace_SOURCES): Add gcc_compat.h.

2015-12-31  Dmitry V. Levin  <ldv@altlinux.org>

        Move defs.h from noinst_HEADERS to strace_SOURCES.
        * Makefile.am (noinst_HEADERS): Move defs.h ...
        (strace_SOURCES): ... here.

2015-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        test: remove fork.c and vfork.c.
        These manual tests are obsoleted by fork-f.test and vfork-f.test.

        * test/fork.c: Remove.
        * test/vfork.c: Remove.
        * test/Makefile (PROGS): Remove fork and vfork.
        * test/.gitignore: Remove fork and vfork.

2015-12-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add fork-f.test and vfork-f.test.
        Check how strace -f follows fork and vfork syscalls.

        * tests/fork-f.c: New file.
        * tests/fork-f.test: New test.
        * tests/vfork-f.c: New file.
        * tests/vfork-f.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f.
        (TESTS): Add fork-f.test and vfork-f.test.
        * tests/.gitignore: Add fork-f and vfork-f.

2015-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall.
        * linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag.

2015-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        Set SYSCALL_NEVER_FAILS flag for umask syscall.
        Linux kernel always ANDs umask argument with 0700 and therefore
        this syscall never fails.

        * linux/*/syscallent*.h (umask): Set NF flag.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error
        On architectures that use dedicated registers to report syscall errors,
        check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
        in the syscall entry.  On architectures that use negated errno
        semantics, there is no way to distinguish a syscall error from a valid
        return code that looks like a syscall error, and the check for
        SYSCALL_NEVER_FAILS flag remains the only way to tell one case
        from another.

        * linux/alpha/get_error.c (get_error): Ignore check_errno.
        * linux/ia64/get_error.c: Likewise.
        * linux/mips/get_error.c: Likewise.
        * linux/nios2/get_error.c: Likewise.
        * linux/powerpc/get_error.c: Likewise.
        * linux/sparc/get_error.c: Likewise.
        * linux/sparc64/get_error.c: Likewise.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

        Handle unlikely errors from personality syscall.
        Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still
        might report a failure on some architectures due to obscure kernel
        bugs.  Check for this unlikely case and let users know that their
        kernel has gone bananas.

        * personality.c (SYS_FUNC(personality)): Do not parse syscall return
        value in case of syserror.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

        Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls.
        This should not be a user visible change unless the kernel does
        something completely unexpected.  In the latter case, let user see
        what is going on.

        * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate
        tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED.

2015-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance personality syscall decoding.
        * xlat/personality_options.in: Split into ...
        * xlat/personality_types.in: ... personality types and ...
        * xlat/personality_flags.in: ... personality flags.
        * personality.c: Include "xlat/personality_types.h"
        and "xlat/personality_flags.h" instead of "xlat/personality_options.h".
        (SYS_FUNC(personality)): Print PER_MASK part of personality as
        a symbolic value, and the rest of personality as a set of flags.
        * tests/personality.c (main): Add more test cases.
        * tests/personality.test: Update.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        sh, sh64: fix syscall flags in several syscall entries.
        * linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32):
        Set SYSCALL_NEVER_FAILS flag.
        (fchown32): Set TRACE_DESC flag.
        * linux/sh64/syscallent.h: Likewise.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Print personality value 0xffffffff properly.
        Value 0xffffffff of personality syscall first argument has a special
        meaning, it is not a set of personality flags.

        * personality.c (SYS_FUNC(personality)): If personality equals
        to 0xffffffff, print it verbatim.
        * tests/personality.c (main): Test it.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add personality.test.
        * tests/personality.c: New file.
        * tests/personality.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add personality.
        (TESTS): Add personality.test.
        * tests/.gitignore: Add personality.

        Enhance personality syscall decoding.
        * personality.c (SYS_FUNC(personality)): On entering syscall,
        print first argument not as a hex value but as a set of flags.
        On exiting syscall, print return code as a set of flags.
        * NEWS: Mention this enhancement.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Set SYSCALL_NEVER_FAILS flag for personality syscall.
        Starting with commit
        v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality
        syscall never fails to set the personality, but before commit
        v2.6.35-rc1-372-g485d527 it still could return an error.
        Starting with that commit, personality syscall never returns an error.

        * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality
        syscall entries.

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        Add personality emulation flags.
        * xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE,
        FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC,
        ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS,
        and ADDR_LIMIT_3GB.

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        arc, metag, nios2, or1k, tile: fix build.
        Fix build regression introduced by commit
        34683e3926d8c2daa368afb805da422ee7043396.

        * linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
        * linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
        * linux/nios2/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
        * pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
        * NEWS: Mention this build fix.

        Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

        packages: remove acl development library from build dependencies.
        Starting with commit v4.9-46-g681452b that removed all references
        to acl.h, we no longer use acl development library.

        * .travis.yml (addons.apt.packages): Remove libacl1-dev.
        * strace.spec (BuildRequires): Remove libacl-devel.

2015-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        packages/x86_64: enable experimental -k option.
        * debian/control (Build-Depends) [amd64]: Add libunwind-dev.
        * strace.spec (BuildRequires) [x86_64]: Add libunwind-devel.

        maint: post-release administrivia.
        * NEWS: Add header line for the next release.

2015-12-21  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.11 release.
        * NEWS: Update for 4.11 release.
        * debian/changelog: 4.11-1.
        * strace.spec: 4.11-1.

2015-12-20  Dmitry V. Levin  <ldv@altlinux.org>

        Sync strace.spec and debian/ with packages.
        * debian/changelog: Sync with 4.10-3.
        * debian/control: Likewise.
        * debian/rules: Likewise.
        * strace.spec: Sync with 4.10-3.

        .mailmap: add addresses of Kirill A. Shutemov.
        * .mailmap: Add both addresses of Kirill A. Shutemov here
        to avoid duplications in CREDITS file.

2015-12-19  Dmitry V. Levin  <ldv@altlinux.org>

        NEWS: Prepare for 4.11 release.

2015-12-18  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: wire up mlock2 syscall.
        * linux/ia64/syscallent.h [1346]: Add mlock2 entry.

2015-12-17  Dmitry V. Levin  <ldv@altlinux.org>

        Add copyright headers to some files which lack them.
        Before this change, all files that exist since 20th century had
        copyright headers, while most files that appeared later didn't.  This
        change fixes the inconsistency by adding missing copyright headers.

        It doesn't mean that copyright headers became maintained.  In my view,
        git history provides much better information on this subject and is much
        more accurate than copyright headers.

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests/aio.c: include <time.h>
        * tests/aio.c: Include <time.h> for struct timespec.

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.sh: switch to DWARF version 2 format for better portability.
        * mpers.sh (CFLAGS): Replace -gdwarf-4 with -gdwarf-2.

        mpers.awk: add support for DWARF version 2 format.
        * mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format.

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        Replace %Ld/%Lu printf format specifiers with %lld/%llu.
        As %Ld and %Lu printf format specifiers are not quite portable,
        replace them with %lld and %llu, respectively.

        * desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu.
        * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise.
        * times.c (SYS_FUNC(times)): Likewise.
        * fcntl.c (print_struct_flock64): Replace %Ld with %lld.
        * tests/ftruncate.c (main): Replace %Lu with %llu.
        * tests/ftruncate64.c (main): Likewise.
        * tests/getdents.c (print_dirent): Likewise.
        * tests/llseek.c (main): Likewise.
        * tests/lseek.c (main): Likewise.
        * tests/truncate.c (main): Likewise.
        * tests/truncate64.c (main): Likewise.
        * tests/xstatx.c (main): Likewise.
        * tests/pselect6.c (main): Replace %Ld with %lld.
        * tests/xselect.c(main): Likewise.

        Reported-by: Szabolcs Nagy <nsz@port70.net>

2015-12-16  Szabolcs Nagy  <nsz@port70.net>

        Fix SYS_FUNC and SEN macros for musl.
        The syscall_name argument was subject to macro expansion because
        it was passed down to other macros before it was prefixed.

        musl libc defines lfs64 names as macros (e.g. fstat64 as fstat)
        so SYS_FUNC(fstat64) was expanded to sys_fstat.

        This change adds the prefix before the name is passed to other macros,
        i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_.

        * defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument.
        (SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument.
        * linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix
        to MPERS_FUNC_NAME's argument.
        * syscall.c (SEN_NAME): Remove.
        (SEN): Replace SEN_NAME call with its definition.  Add sys_ prefix
        to SYS_FUNC_NAME's argument.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests/times.test: workaround libc bug on x32.
        As glibc times wrapper on x32 is known to wrongly truncate and then sign
        extend the syscall return value, invoke the syscall directly on x32.

        * tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]:
        Invoke times syscall using inline asm.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.awk: make fillers added to the output structure more predictable.
        * mpers.awk (array_seq): New function.
        (what_is): Use it for printing filler names.  Tweak return types.
        * mpers_test.sh: Use a more complicated sample type to test mpers
        machinery.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        Robustify mpers.awk against input containing index loops.
        Make mpers.awk check for potential index loops.  Such loops should not
        normally happen, but mpers.awk will not go into infinite recursion if
        they do.

        * mpers.awk (enter, leave): New functions.
        (what_is): Use them.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        Robustify mpers.awk against invalid input.
        Make mpers.awk check that accessed elements of the main array that
        are expected to have non-empty values really meet this requirement.

        * mpers.awk (array_get): New function.
        (what_is, END): Use it.
        * mpers_test.sh: Use a more complicated type to test mpers machinery.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN.
        * defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG.
        * configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove.
        * m4/long_long.m4: Remove.

2015-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused parser of xmknod syscall.
        The last reference to this parser was removed by commit
        v4.10-45-gdf4dd8b.

        * mknod.c [SPARC || SPARC64] (SYS_FUNC(xmknod)): Remove.

2015-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests/restart_syscall: add a workaround for old arm kernels.
        As arm kernels used to overwrite ARM_r0 with -EINTR after
        ERESTART_RESTARTBLOCK, update regexp to workaround this.

        * tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid
        alternative value for the first argument of restarted nanosleep syscall.

2015-12-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests/.gitignore: add ksysent.h.
        tests/ksysent.h is a generated file listed in CLEANFILES.
        This change complements commit v4.10-566-gbab4ef4.

        * tests/.gitignore: Add ksysent.h.

2015-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: make arm registers unsigned.
        Follow the x86_64 example and define registers in arm_pt_regs
        as unsigned, to avoid potential sign extension bugs.

        This also fixes --enable-gcc-Werror build.

        * linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type
        from int to uint32_t.

        Reported-by: Sergey Bolshakov <sbolshakov@altlinux.org>

2015-12-10  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add ksysent.test.
        Check that syscall names and numbers defined in syscallent files
        match kernel __NR_* constants defined by <asm/unistd.h>.

        Tested on various platforms, including the following combinations
        of architectures and kernel headers:

        x86_64: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.12, 3.11,
        3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel
        i386: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.11,
        3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel
        aarch64: 4.4-rc
        alpha: 4.3
        arm eabi: 4.4-rc, 4.2, 4.1
        hppa: 3.18
        ia64: 3.18
        mips o32: 4.1
        ppc: 3.18
        ppc64: 3.10-rhel, 2.6.32-rhel
        s390: 3.18
        s390x: 3.18
        sparc: 4.1
        sparc: 3.18
        x32: 3.19

        The only platform which is known at this moment to fail the test
        is CentOS-5 provided by OBS.  On x86_64 instance it fails with
        error: "prlimit64" syscall #300 is "fanotify_init" in syscallent.h
        and on i586 it similarly fails with
        error: "prlimit64" syscall #338 is "fanotify_init" in syscallent.h
        So this is a real platform bug that is not likely to be worked around
        on the strace side.

        * tests/ksysent.c: New file.
        * tests/ksysent.sed: Likewise.
        * tests/ksysent.test: New test.
        * tests/Makefile.am (AM_CPPFLAGS): Add -I$(builddir).
        (check_PROGRAMS): Add ksysent.
        (TESTS): Add ksysent.test.
        (EXTRA_DIST): Add ksysent.sed.
        (ksysent.h): New rule.
        (BUILT_SOURCES, CLEANFILES): Add ksysent.h.
        * tests/.gitignore: Add ksysent.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

        Document that syscall names match kernel __NR_* constants.
        * strace.1: Note syscall naming difference between architectures
        and the rule of choosing the right syscall name in each case.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: print all ia32 syscalls using printargs.
        Printing of ia32 syscalls on ia64 must have been broken for a long time.
        Do not pretend that it works, print ia32 syscalls using printargs
        instead.

        * linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros.
        Stop including"../dummy.h".  Include "../i386/syscallent.h" with
        SYS_FUNC_NAME macro temporarily redirected to printargs.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on architectures for which arch_sigreturn is not implemented.
        This complements commit 527b42ff8da3f52fa7c48eb766b2b57fb0f0b977.

        * linux/arch_sigreturn.c (arch_sigreturn): Define.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: swap 64-bit and 32-bit personalities.
        Let native 64-bit personality be personality 0, and 32-bit personality
        be personality 1, to follow the traditional layout used for other
        architectures.

        * defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and
        PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY.
        [AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*.
        * file.c [AARCH64 || defined X86_64 || defined X32]: Define
        STAT32_PERSONALITY for AARCH64 as well.
        * syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES.
        * linux/aarch64/errnoent1.h: Adjust comment.
        * linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check.
        * linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise.
        * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise.
        * linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality
        invocations.
        * linux/aarch64/ioctls_arch0.h: Swap with ...
        * linux/aarch64/ioctls_arch1.h: ... this file.
        * linux/aarch64/ioctls_inc0.h: Swap with ...
        * linux/aarch64/ioctls_inc1.h: ... this file.
        * linux/aarch64/syscallent.h: Swap with ...
        * linux/aarch64/syscallent1.h: ... this file.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        mips: fix fadvise64 syscall entries.
        * linux/mips/syscallent-n32.h [6216]: Change syscall handler
        from fadvise64 to fadvise64_64.
        * linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64"
        to "fadvise64"
        * linux/mips/syscallent-o32.h [4254]: Likewise.

        xtensa: wire up syncfs syscall.
        * linux/xtensa/syscallent.h [179]: Add syncfs entry.

        sh, sh64: fix syscall entries.
        * linux/sh/syscallent.h [322]: Fix timerfd_create entry.
        * linux/sh64/syscallent.h [350]: Likewise.
        [0]: Fix restart_syscall entry.

        powerpc, powerpc64: wire up mlock2 syscall.
        * linux/powerpc/syscallent.h [378]: Add mlock2 entry.
        * linux/powerpc64/syscallent.h: Likewise.

        hppa: fix syscall entries.
        * linux/hppa/syscallent.h: Swap [343] and [344] entries.

        avr32: update syscall entries.
        * linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall.
        [284 ... 320]: New entries.

        m68k: fix syscall names.
        * linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32"
        to "atomic_cmpxchg_32".

        sparc: update syscall names.
        * linux/sparc/syscallent.h [160]: Rename "sched_setaffinity"
        to "sched_set_affinity".
        [161]: Rename "sched_getaffinity" to "sched_get_affinity".

        powerpc, powerpc64: update syscall names.
        * linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer".
        [225]: Rename "tux" to "tuxcall".
        [256]: Rename "debug_setcontext" to "sys_debug_setcontext".
        * linux/powerpc64/syscallent.h: Likewise.

        alpha: update syscall entries.
        * linux/alpha/syscallent.h [224 ... 228]: Add stub entries.
        [100]: Rename "osf_getpriority" to "getpriority".
        [255]: Rename "osf_subsysinfo" to "osf_subsys_info".
        [303]: Rename "adjtimex32" to "old_adjtimex".
        [319]: Rename "sysctl" to "_sysctl".
        [320]: Remove.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix mmap syscall entries.
        Change syscall names to match kernel __NR_* constants.

        * linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2".
        * linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap".
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * tests/mmap.c (main): Remove old_mmap from expected output.
        * tests/mmap.test: Remove old_mmap from the list of mmap syscalls.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix select and _newselect syscall entries.
        Change syscall names to match kernel __NR_* constants.
        This reverts commit ddcf54969d253582ab2cfdcab8ede9cdae3fb171.

        * linux/arm/syscallent.h [82]: Rename "oldselect" to "select".
        [142]: Rename "select" to "_newselect".
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h [82]: Likewise.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/hppa/syscallent.h [142]: Rename "select" to "_newselect".
        * linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect".
        * linux/mips/syscallent-n64.h [5022]: Likewise.
        * linux/mips/syscallent-o32.h [4142]: Likewise.
        * linux/s390/syscallent.h [142]: Rename "select" to "_newselect".
        * linux/sparc/syscallent.h [230]: Rename "select" to "_newselect".
        * tests/oldselect.test: Rename oldselect to select.  Convert
        from match_grep to match_diff.
        * tests/oldselect.expected: Likewise.
        * xselect.c: New file, based on select.c.
        * tests/_newselect.c: New file.
        * tests/select.c: Replace with a wrapper around xselect.c.
        * tests/select.test: Parametrize.
        * tests/_newselect.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add _newselect.
        (TESTS): Add _newselect.test.
        (EXTRA_DIST): Add xselect.c.
        * tests/.gitignore: Add _newselect.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix exit syscall entries.
        Change syscall names to match kernel __NR_* constants.

        * linux/avr32/syscallent.h [1]: Rename "_exit" to "exit".
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/x32/syscallent.h [60]: Rename "_exit" to "exit".
        * linux/x86_64/syscallent.h: Likewise.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix pread64 and pwrite64 syscall entries.
        Change syscall names to match kernel __NR_* constants.

        * linux/alpha/syscallent.h [349]: Rename "pread" to "pread64".
        [350]: Rename "pwrite" to "pwrite64".
        * linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64".
        [1149]: Rename "pwrite" to "pwrite64".
        * linux/sh/syscallent.h [180]: Rename "pread" to "pread64".
        [181]: Rename "pwrite" to "pwrite64".
        * linux/sh64/syscallent.h: Likewise.
        * linux/x32/syscallent.h [17]: Rename "pread" to "pread64".
        [18]: Rename "pwrite" to "pwrite64".
        * linux/x86_64/syscallent.h: Likewise.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: sort the list of tests.
        * tests/Makefile.am (TESTS): Sort the list of regular tests.
        * tests/.gitignore: Sort.

        ia64: fix remap_file_pages syscall entry.
        * linux/ia64/syscallent.h (1125): Set to remap_file_pages.

        bfin, i386: remove sysentry for nonexistent security syscall.
        * linux/bfin/syscallent.h (223): Remove.
        * linux/i386/syscallent.h: Likewise.

        build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS.
        * tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (lstat64_CFLAGS): Rename to lstat64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (mmap64_CFLAGS): Rename to mmap64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (stat64_CFLAGS): Rename to stat64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (statfs_CFLAGS): Rename to statfs_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (truncate64_CFLAGS): Rename to truncate64_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
        (uio_CFLAGS): Rename to uio_CPPFLAGS,
        replace $(AM_CFLAGS) with $(AM_CPPFLAGS).

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Move x32 <asm/stat.h> replacement to x32 specific directory.
        As tests-m*32/Makefile.am files now refer to proper arch specific
        directories, it's possible to relocate x32 <asm/stat.h> replacement
        to its arch specific directory.

        * linux/x86_64/asm_stat.h: Move ...
        * linux/x32/asm_stat.h: ... here, remove x32 guard.
        * Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        build: set arch specific -m switches in tests-m*32/Makefile.am files properly
        * tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables.
        (AM_CPPFLAGS): Use ARCH_MFLAGS.
        * bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am,
        add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS.

        build: initialize ARCH variable in tests-m*32/Makefile.am files properly
        * configure.ac (arch_m32): Set to sparc on sparc64, powerpc on
        powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases.
        (arch_mx32): Set to x32 on x86_64, $arch in other cases.
        (AC_SUBST): Add arch_m32 and arch_mx32.
        * bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am.
        Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am.

2015-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add umount.test and umount2.test.
        * tests/umount.c: New file.
        * tests/umount2.c: Likewise.
        * tests/umount.test: New test.
        * tests/umount2.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add umount and umount2.
        (TESTS): Add umount.test and umount2.test.
        * tests/.gitignore: Add umount and umount2.

        avr32: fix umount2 syscall entry.
        * linux/avr32/syscallent.h: Rename umount to umount2.

        Update umount2 flags.
        * umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ...
        * xlat/umount_flags.in: ... here.  Add UMOUNT_NOFOLLOW.

2015-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        Print the first argument of umount2 syscall as a path.
        * umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr.

        This fixes Debian bug #785050.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        prctl: add PR_CAP_AMBIENT parser.
        * xlat/pr_cap_ambient.in: New file.
        * prctl.c: Include "xlat/pr_cap_ambient.h".
        (SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.

        prctl: finish decoding of several commands on entering syscall.
        * prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of
        PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK,
        PR_GET_TIMING, and PR_CAPBSET_READ commands.

        Fix build on systems that lack EM_FRV definition.
        * xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check.

        times.test: workaround buggy libc.
        * tests/times.c: Include <sys/syscall.h>.
        (main): On systems where user's and kernel's long types are the same,
        prefer direct times syscall over libc's times function because
        the latter is more prone to return value truncation.

        times.test: reduce cpu time consumption, increase struct tms diversity.
        * tests/times.c (main): Reduce cpu time consumption fourfold,
        make the parent process consume less cpu time than the child process
        so that members of the structure returned by times syscall would be
        more likely to contain different values.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        mips n32, x32: fix printing of times syscall return value.
        As times syscall returns kernel's long value, it has to be printed as
        RVAL_LUDECIMAL on systems where long type is less than kernel's long.

        * times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]:
        Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        unix-yy.test: fix portability issue.
        * tests/unix-yy-connect.awk (r_close_listen): Quote square brackets
        that are not part of a bracket expression.

        inet-cmsg.test: skip the test when the network is not functional.
        * tests/inet-cmsg.c (main): Return 77 if inet datagram socket
        cannot be bound to INADDR_LOOPBACK.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser
        As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands
        in fcntl64 syscall only, do not parse their structures in fcntl parser.

        * xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ...
        * xlat/fcntl64cmds.in: ... here.
        * fcntl.c: Include "xlat/fcntl64cmds.h".
        (print_fcntl): Move printing of first two syscall arguments
        and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ...
        (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here.
        * tests/fcntl.c: New file, based on struct_flock.c.
        * tests/fcntl64.c: Likewise.
        * tests/struct_flock.c (test_flock_einval, create_sample): New functions.
        (test_flock): Use test_flock_einval.
        (test_flock64, main): Remove.
        * tests/fcntl.test: New test.
        * tests/fcntl64.test: Likewise.
        * tests/struct_flock.test: Remove.
        * tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64,
        remove struct_flock.
        (TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test.
        (EXTRA_DIST) Add struct_flock.c.
        * tests/.gitignore: Add fcntl and fcntl64, remove struct_flock.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        print_fcntl: finish with unrecognized commands on entering syscall.
        * fcntl.c (print_fcntl): Merge two switch statements.

2015-12-04  Elvira Khabirova  <lineprinter0@gmail.com>

        fcntl: create a separate parser for fcntl64 syscall.
        * fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl).
        (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it.
        * linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64).
        * 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/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        travis-ci: add build matrix.

        tests: replace old stat tests with stat.test and stat64.test.
        * tests/stat.c: Replace with a wrapper around lstatx.c
        * tests/stat.test: Replace with a wrapper around statx.sh.
        * tests/stat32-v.test: Remove.
        * tests/stat32.c: Remove.
        * tests/stat64-v.test: Remove.
        * tests/stat64.c: New file.
        * tests/stat64.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64.
        (stat_CFLAGS): Rename to stat64_CFLAGS.
        (TESTS): Replace stat32-v.test and stat64-v.test with stat64.test.
        * tests/.gitignore: Replace stat32 with stat64.

        tests: add lstat.test and lstat64.test.
        * tests/lstat.c: New file.
        * tests/lstat64.c: Likewise.
        * tests/lstatx.c: Likewise.
        * tests/lstat.test: New test.
        * tests/lstat64.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64.
        (lstat64_CFLAGS): Define.
        (TESTS): Add lstat.test and lstat64.test.
        (EXTRA_DIST): Add lstatx.c.
        * tests/.gitignore: Add lstat and lstat64.

        tests: add fstat.test and fstat64.test.
        * tests/fstat.c: New file.
        * tests/fstat64.c: Likewise.
        * tests/fstatx.c: Likewise.
        * tests/fstat.test: New test.
        * tests/fstat64.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64.
        (fstat64_CFLAGS): Define.
        (TESTS): Add fstat.test and fstat64.test.
        (EXTRA_DIST): Add fstatx.c.
        * tests/.gitignore: Add fstat and fstat64.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: prepare for detailed testing of stat family syscalls.
        Parametrize code from fstatat.c to support <asm/stat.h>
        as an alternative to <sys/stat.h> and move it to a separate file.

        * tests/statx.sh: New file, based on fstatat64.test.
        * tests/fstatat64.test: Use it.
        * tests/newfstatat.test: Likewise.
        * tests/xstatx.c: New file, based on fstatat.c.
        * tests/fstatat.c: Use it.
        * tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c.
        * tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME.
        * tests/newfstatat.c: Likewise.

2015-12-04  Gabriel Laskar  <gabriel@lse.epita.fr>

        ioctl: allow to stop decoding number.
        For some ioctls, like from drm, the identification of the correct ioctl
        is done by custom code.  Specifying IOCTL_NUMBER_STOP_LOOKUP on
        return of ioctl_decode_command_number() disables further calls to
        ioctl_lookup().

        * defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED,
        IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state
        decoding.
        * ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when
        ioctl_decode_command_number() returns a value with
        IOCTL_NUMBER_STOP_LOOKUP flag is set.

        Suggested-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip restart_syscall.test on x32.
        The syscall number of restart_syscall returned by the kernel in case
        of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see
        https://lkml.org/lkml/2015/11/30/790

        Until that improves, skip the test on x32.

        * tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix decoding of i386 personality lseek syscall.
        On x32, tcp->ext_arg is not initialized for i386 personality,
        so tcp->u_arg has to be used instead.

        * lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64, x32: add a replacement for <asm/stat.h>
        Some old kernel headers, Ubuntu 14.04 in particular, provide
        <asm/stat.h> editions that are completely wrong for x32.
        Workaround this issue by providing a replacement.

        * linux/x86_64/asm_stat.h: New file.
        * linux/x32/asm_stat.h: Likewise.
        * Makefile.am (strace_SOURCES): Add them.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        Add a wrapper around <asm/stat.h>
        * linux/asm_stat.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Use it.

        kernel_types.h: protect from double inclusion.
        * kernel_types.h: Add #include guard.

2015-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        fstatat64.test: lift /proc requirement.
        While -P option needs /proc to match descriptors, it does not use
        /proc to match pathnames.  As this test does not need descriptor
        match, the /proc requirement can be safely lifted.

        * tests/fstatat64.test: Lift /proc/self/fd/ requirement.

2015-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add fstatat64.test and newfstatat.test.
        * configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens.
        * tests/fstatat.c: New file.
        * tests/fstatat64.c: Likewise.
        * tests/newfstatat.c: Likewise.
        * tests/fstatat64.test: New test.
        * tests/newfstatat.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat.
        (fstatat64_CFLAGS, newstatat_CFLAGS): Define.
        (TESTS): Add fstatat64.test and newfstatat.test.
        (EXTRA_DIST): Add fstatat.c.
        * tests/.gitignore: Add fstatat64 and newfstatat.

2015-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, ppc, sh, sh64: fix fstatat64 syscall entries.
        * linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.

        ppc64: clone syscallent.h from ppc.
        * linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h
        with entries for numbers 192..197, 204, 226, and 254 unassigned.

        tests: add lseek.test and llseek.test.
        * tests/llseek.c: New file.
        * tests/lseek.c: Likewise.
        * tests/llseek.test: New test.
        * tests/lseek.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add llseek and lseek.
        (TESTS): Add llseek.test and lseek.test.
        * tests/.gitignore: Add llseek and lseek.

        tests: add ftruncate64.test and truncate64.test.
        * tests/ftruncate64.c: New file.
        * tests/truncate64.c: Likewise.
        * tests/ftruncate64.test: New test.
        * tests/truncate64.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64.
        (ftruncate64_CFLAGS, truncate64_CFLAGS): Define.
        (TESTS): Add ftruncate64.test and truncate64.test.
        * tests/.gitignore: Add ftruncate64 and truncate64.

        tests: add ftruncate.test and truncate.test.
        * tests/ftruncate.c: New file.
        * tests/truncate.c: Likewise.
        * tests/ftruncate.test: New test.
        * tests/truncate.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add ftruncate and truncate.
        (TESTS): Add ftruncate.test and truncate.test.
        * tests/.gitignore: Add ftruncate and truncate.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        build: robustify linux/fcntl.h check.
        * configure.ac (AC_CHECK_TYPES): Support older linux kernel headers
        by including <sys/types.h> before <linux/fcntl.h>.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: move inclusion of arch specific files to the end of file.
        Move inclusion of arch specific files that define static functions to
        the end of syscall.c.

        * syscall.c (get_syscall_result_regs, get_error, getregs_old):
        New forward declarations.
        (arch_get_scno): Move forward.
        Move inclusion of "get_scno.c", "get_syscall_args.c",
        "get_syscall_result.c", "get_error.c", and "getregs_old.c"
        to the end of file.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: change getregs_old to forward ptrace return code.
        * linux/x86_64/getregs_old.c (getregs_old): Change to return ptrace
        return code.
        * syscall.c (get_regs) [ARCH_REGS_FOR_GETREGSET && X86_64]: Use
        getregs_old return code.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup print_pc.
        Apparently, there are only two types of instruction pointer printers
        depending on the architecture: those that print a register that was
        fetched earlier, and those that fetch a register themselves using upeek.
        With this change, architectures of the first type have ARCH_PC_REG
        defined in their arch_regs.c file, architectures of the first type
        have ARCH_PC_PEEK_ADDR defined there, and the common code in syscall.c
        uses these macros to print the instruction pointer.

        * Makefile.am (EXTRA_DIST): Remove linux/*/print_pc.c.
        * linux/*/print_pc.c: Remove.
        * linux/aarch64/arch_regs.c(ARCH_PC_REG): Define macro.
        * linux/arc/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/arm/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/avr32/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/i386/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/ia64/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/metag/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/mips/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/nios2/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/or1k/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/powerpc64/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/powerpc/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/s390/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/s390x/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/sparc64/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/sparc/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/tile/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/x32/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/x86_64/arch_regs.c(ARCH_PC_REG): Likewise.
        * linux/alpha/arch_regs.c(ARCH_PC_PEEK_ADDR): Define macro.
        * linux/bfin/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/crisv10/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/crisv32/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/hppa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/m68k/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/microblaze/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/sh64/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/sh/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * linux/xtensa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
        * syscall.c (print_pc): Stop including "print_pc.c".
        Use ARCH_PC_REG or ARCH_PC_PEEK_ADDR.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        cleanup: make get_scno.c files more readable.
        Make get_scno.c files more self-contained.  While they are still
        being included by syscall.c, the latter no longer provides
        a function framework for them.

        * linux/aarch64/get_scno.c (arch_get_scno): Define.
        * linux/alpha/get_scno.c: Likewise.
        * linux/arc/get_scno.c: Likewise.
        * linux/arm/get_scno.c: Likewise.
        * linux/avr32/get_scno.c: Likewise.
        * linux/bfin/get_scno.c: Likewise.
        * linux/crisv10/get_scno.c: Likewise.
        * linux/hppa/get_scno.c: Likewise.
        * linux/i386/get_scno.c: Likewise.
        * linux/ia64/get_scno.c: Likewise.
        * linux/m68k/get_scno.c: Likewise.
        * linux/metag/get_scno.c: Likewise.
        * linux/microblaze/get_scno.c: Likewise.
        * linux/mips/get_scno.c: Likewise.
        * linux/nios2/get_scno.c: Likewise.
        * linux/or1k/get_scno.c: Likewise.
        * linux/powerpc/get_scno.c: Likewise.
        * linux/powerpc64/get_scno.c: Likewise.
        * linux/s390/get_scno.c: Likewise.
        * linux/sh/get_scno.c: Likewise.
        * linux/sh64/get_scno.c: Likewise.
        * linux/sparc/get_scno.c: Likewise.
        * linux/sparc64/get_scno.c: Likewise.
        * linux/tile/get_scno.c: Likewise.
        * linux/x86_64/get_scno.c: Likewise.
        * linux/xtensa/get_scno.c: Likewise.
        * syscall.c (arch_get_scno): New declaration.
        Include "get_scno.c" in file scope.
        (get_scno): Use arch_get_scno.

        Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        cleanup: make get_syscall_args.c files more readable.
        Make get_syscall_args.c files more self-contained.  While they are
        still being included by syscall.c, the latter no longer defines
        get_syscall_args function.

        * linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c"
        with get_syscall_args temporarily defined to arm_get_syscall_args.
        (get_syscall_args): Define.
        * linux/alpha/get_syscall_args.c (get_syscall_args): Define.
        * linux/arc/get_syscall_args.c: Likewise.
        * linux/arm/get_syscall_args.c: Likewise.
        * linux/avr32/get_syscall_args.c: Likewise.
        * linux/bfin/get_syscall_args.c: Likewise.
        * linux/crisv10/get_syscall_args.c: Likewise.
        * linux/hppa/get_syscall_args.c: Likewise.
        * linux/i386/get_syscall_args.c: Likewise.
        * linux/ia64/get_syscall_args.c: Likewise.
        * linux/m68k/get_syscall_args.c: Likewise.
        * linux/metag/get_syscall_args.c: Likewise.
        * linux/microblaze/get_syscall_args.c: Likewise.
        * linux/mips/get_syscall_args.c: Likewise.
        * linux/nios2/get_syscall_args.c: Likewise.
        * linux/or1k/get_syscall_args.c: Likewise.
        * linux/powerpc/get_syscall_args.c: Likewise.
        * linux/s390/get_syscall_args.c: Likewise.
        * linux/sh/get_syscall_args.c: Likewise.
        * linux/sh64/get_syscall_args.c: Likewise.
        * linux/sparc/get_syscall_args.c: Likewise.
        * linux/tile/get_syscall_args.c: Likewise.
        * linux/x86_64/get_syscall_args.c: Likewise.
        * linux/xtensa/get_syscall_args.c: Likewise.
        * syscall.c (get_syscall_args): Remove.
        Include "get_syscall_args.c" in file scope.

        Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        cleanup: make get_syscall_result.c files more readable.
        Make get_syscall_result.c files more self-contained.  While they are
        still being included by syscall.c, the latter no longer provides
        a function framework for them.

        * linux/alpha/get_syscall_result.c (get_syscall_result_regs): Define.
        * linux/bfin/get_syscall_result.c: Likewise.
        * linux/crisv10/get_syscall_result.c: Likewise.
        * linux/hppa/get_syscall_result.c: Likewise.
        * linux/m68k/get_syscall_result.c: Likewise.
        * linux/microblaze/get_syscall_result.c: Likewise.
        * linux/sh/get_syscall_result.c: Likewise.
        * linux/sh64/get_syscall_result.c: Likewise.
        * linux/xtensa/get_syscall_result.c: Likewise.
        * syscall.c [!ARCH_REGS_FOR_GETREGSET && !ARCH_REGS_FOR_GETREGS]:
        Define USE_GET_SYSCALL_RESULT_REGS macro.
        [USE_GET_SYSCALL_RESULT_REGS]: Include "get_syscall_result.c".
        (get_syscall_result) [USE_GET_SYSCALL_RESULT_REGS]: Stop including
        "get_syscall_result.c".  Call get_syscall_result_regs.

        Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        cleanup: make get_error.c files more readable.
        Make get_error.c files more self-sustained.  While they are still being
        included by syscall.c, the latter no longer defines get_error function.

        * linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error
        temporarily defined to arm_get_error.
        (get_error): Define.
        * linux/alpha/get_error.c (get_error): Define.
        * linux/arc/get_error.c: Likewise.
        * linux/arm/get_error.c: Likewise.
        * linux/avr32/get_error.c: Likewise.
        * linux/bfin/get_error.c: Likewise.
        * linux/crisv10/get_error.c: Likewise.
        * linux/hppa/get_error.c: Likewise.
        * linux/i386/get_error.c: Likewise.
        * linux/ia64/get_error.c: Likewise.
        * linux/m68k/get_error.c: Likewise.
        * linux/metag/get_error.c: Likewise.
        * linux/microblaze/get_error.c: Likewise.
        * linux/mips/get_error.c: Likewise.
        * linux/nios2/get_error.c: Likewise.
        * linux/or1k/get_error.c: Likewise.
        * linux/powerpc/get_error.c: Likewise.
        * linux/s390/get_error.c: Likewise.
        * linux/sh/get_error.c: Likewise.
        * linux/sh64/get_error.c: Likewise.
        * linux/sparc/get_error.c: Likewise.
        * linux/sparc64/get_error.c: Likewise.
        * linux/tile/get_error.c: Likewise.
        * linux/x86_64/get_error.c: Likewise.
        * linux/xtensa/get_error.c: Likewise.
        * syscall.c: Include "get_error.c" in file scope.
        (get_error): Remove.  Move arch independent code ...
        (get_syscall_result): ... here.  Update get_error invocation.

        Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        cleanup: make arch_sigreturn.c files more readable.
        Make arch_sigreturn.c files more self-sustained.  While they are
        still being included by sigreturn.c, the latter no longer defines
        arch_sigreturn function.

        * linux/alpha/arch_sigreturn.c (arch_sigreturn): Define.
        * linux/arm/arch_sigreturn.c: Likewise.
        * linux/crisv10/arch_sigreturn.c: Likewise.
        * linux/i386/arch_sigreturn.c: Likewise.
        * linux/ia64/arch_sigreturn.c: Likewise.
        * linux/m68k/arch_sigreturn.c: Likewise.
        * linux/microblaze/arch_sigreturn.c: Likewise.
        * linux/mips/arch_sigreturn.c: Likewise.
        * linux/powerpc/arch_sigreturn.c: Likewise.
        * linux/s390/arch_sigreturn.c: Likewise.
        * linux/sparc/arch_sigreturn.c: Likewise.
        * linux/tile/arch_sigreturn.c: Likewise.
        * linux/x32/arch_sigreturn.c: Remove code.
        Include "x86_64/arch_sigreturn.c".
        * linux/x86_64/arch_sigreturn.c: Stop including "x32/arch_sigreturn.c".
        Include "i386/arch_sigreturn.c" with arch_sigreturn temporarily defined
        to i386_arch_sigreturn.
        (arch_sigreturn): Define.  Add x32 personality support there.
        * sigreturn.c: Remove arch_sigreturn header and footer.

        Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Add initial Travis CI support.
        * .travis.yml: New file.
        * travis-ci.sh: Likewise.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: remove temporary files left after two tests.
        * tests/net-yy.test: Remove "$LOG"-connect and "$LOG"-accept.
        * tests/unix-yy.test: Likewise.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip stat32-v.test on x32.
        Explicitly skip 32-bit stat test on x32 even if libc pretends
        to support it.

        * tests/stat.c (main) [__x86_64__ && __ILP32__]: Skip.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix ipc_msgbuf.test on x32.
        * tests/ipc_msgbuf.c: Include "config.h" and "kernel_types.h".
        (main): Replace "long" with "kernel_long_t" in struct msgbuf.

        x32: fix pselect6 decoding.
        * desc.c: Include "kernel_types.h".
        (umove_kulong_array_or_printaddr): New function.
        (SYS_FUNC(pselect6)): Use it.

        x32: fix sigreturn decoding.
        * linux/x32/arch_sigreturn.c: Implement x32_rt_sigreturn decoding.
        * linux/x86_64/arch_sigreturn.c: Handle (current_personality == 0)
        case only.
        Include "x32/arch_sigreturn.c" instead of "i386/arch_sigreturn.c".

        x32: fix struct dirent decoding.
        * kernel_types.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_TYPES): Check for __kernel_long_t
        and __kernel_ulong_t in <asm/posix_types.h>.
        * dirent.c: Stop including <dirent.h>.
        (kernel_dirent): Remove.
        Include "kernel_types.h".
        (print_old_dirent, SYS_FUNC(getdents)): Print variables
        of kernel_ulong_t type using %Lu format.
        * syscall.c (kernel_long_t, kernel_ulong_t): Remove.
        Include "kernel_types.h".
        * tests/getdents.c (kernel_dirent): Remove.
        Include "kernel_types.h".
        (print_dirent): Print variables of kernel_ulong_t type using %Lu format.

2015-11-26  Elvira Khabirova  <lineprinter0@gmail.com>

        Refer to -h on incorrect usage.
        * defs.h (error_msg_and_help): New prototype.
        * strace.c (error_msg_and_help): New function.
        (error_opt_arg, init): Use it.
        (usage): Remove unnecessary arguments.
        * count.c: Use the new function.

        Rearrange flags descriptions in the usage text.
        * strace.c (usage): Rearrange descriptions.
        * tests/strace-k.test: Change the option detecting regexp accordingly.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: run in "set -x" mode if VERBOSE variable is non-null.
        * tests/init.sh: Enter "set -x" mode if $VERBOSE is non-null.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix match_diff usage.
        Fix argument order in match_diff invocations:
        the first argument has to be actual output,
        the second argument has to be expected output.

        * tests/aio.test: Swap match_diff arguments.
        * tests/clock_nanosleep.test: Likewise.
        * tests/clock_xettime.test: Likewise.
        * tests/file_handle.test: Likewise.
        * tests/getdents.test: Likewise.
        * tests/getdents64.test: Likewise.
        * tests/getrandom.test: Likewise.
        * tests/inet-cmsg.test: Likewise.
        * tests/ioctl.test: Likewise.
        * tests/membarrier.test: Likewise.
        * tests/mlock2.test: Likewise.
        * tests/nanosleep.test: Likewise.
        * tests/pselect6.test: Likewise.
        * tests/readdir.test: Likewise.
        * tests/readlink.test: Likewise.
        * tests/readlinkat.test: Likewise.
        * tests/rt_sigqueueinfo.test: Likewise.
        * tests/seccomp.test: Likewise.
        * tests/select.test: Likewise.
        * tests/sendfile.test: Likewise.
        * tests/sendfile64.test: Likewise.
        * tests/struct_flock.test: Likewise.
        * tests/sysinfo.test: Likewise.
        * tests/time.test: Likewise.
        * tests/timer_create.test: Likewise.
        * tests/timer_xettime.test: Likewise.
        * tests/timerfd_xettime.test: Likewise.
        * tests/times-fail.test: Likewise.
        * tests/times.test: Likewise.
        * tests/umovestr2.test: Likewise.
        * tests/userfaultfd.test: Likewise.
        * tests/utime.test: Likewise.
        * tests/utimensat.test: Likewise.
        * tests/xet_robust_list.test: Likewise.
        * tests/xetitimer.test: Likewise.
        * tests/xettimeofday.test: Likewise.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: fix x32 personality support in print_llu_from_low_high_val.
        x86 is the only personality supported on x86_64
        that has 32-bit syscall arguments.

        * io.c (print_llu_from_low_high_val) [X86_64]: Fix
        current_personality == 2 case.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: fix x32 personality support in getllval.
        x86 is the only personality supported on x86_64
        that has 32-bit syscall arguments.

        * util.c (getllval) [X86_64]: Fix current_personality == 2 case.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests/file_handle: fix expected output.
        * tests/file_handle.c (main): Parametrize handle_type
        in open_by_handle_at parser output.

        startup_attach: fix compilation warning.
        * strace.c (startup_attach): Split single error_msg statement with
        variable number of arguments to silence a compilation warning.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        .gitignore: add mpers_xlat.h.
        Ignore mpers_xlat.h generated since commit v4.10-454-g5cb45b2.

        * .gitignore: Add /mpers_xlat.h.

        Reported-by: Elvira Khabirova <lineprinter0@gmail.com>

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add struct_flock.test.
        * tests/struct_flock.c: New file.
        * tests/struct_flock.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add struct_flock.
        (TESTS): Add struct_flock.test.
        * tests/.gitignore: Add struct_flock.

        Convert parsers of flock structures to new mpers infrastructure.
        * fetch_struct_flock.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * fcntl.c (print_struct_flock64): New function.
        (printflock64): Use fetch_struct_flock64 and print_struct_flock64.
        (printflock): Use fetch_struct_flock and print_struct_flock64.

        fcntl.c: implement decoding for all known operations.
        * xlat/f_owner_types.in: New file.
        * xlat/f_seals.in: Likewise.
        * fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h".
        (print_f_owner_ex): New function.
        (SYS_FUNC(fcntl)): Use it.
        Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW,
        F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG,
        F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG.

        fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag.
        * fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code
        for F_DUPFD and F_DUPFD_CLOEXEC operations.

        fcntl.c: remove redundant ifdefs.
        * fcntl.c (USE_PRINTFLOCK64): Remove macro.
        (printflock64): Define unconditionally.
        (SYS_FUNC(fcntl)): Do not check for USE_PRINTFLOCK64,
        F_DUPFD_CLOEXEC, F_NOTIFY, F_SETLEASE, and F_GETLEASE macros.

        Update F_* constants.
        * xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS,
        F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK.
        Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD,
        F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK,
        F_RSETLKW, F_SHARE, and F_UNSHARE.
        Add default values.

        Update LOCK_* constants.
        * xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW.
        Add default values.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        fcntl.c: use <linux/fcntl.h> instead of <fcntl.h>
        Include <linux/fcntl.h> for proper definitions of F_* constants
        and flock structures.

        * configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64,
        struct __kernel_flock, and struct __kernel_flock64 in <linux/fcntl.h>.
        * flock.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * fcntl.c: Include it instead of <fcntl.h>.
        (struct flock64): Remove.
        (printflock): Use struct_kernel_flock instead of struct flock.
        (printflock64): Use struct_kernel_flock64 instead of struct flock64.

2015-11-26  Elvira Khabirova  <lineprinter0@gmail.com>

        mpers: fix compound types with arbitrary member alignments.
        * mpers.sh: Compound types are now represented as packed
        with character arrays as explicit fillers inbetween members
        and at the end.

2015-11-26  Mike Frysinger  <vapier@gentoo.org>

        Support C libraries without System V shared memory/ipc.
        Some systems (like Bionic) omit support for SysV related code.  That
        means no C library headers for strace to include.  Add configure tests
        to probe the headers from the kernel and use them when they are
        available.

        It might make more sense to never rely on the C library's headers as
        there is no guarantee or requirement that the structure layout between
        apps and the C library match that what is passed to the kernel.

        * configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h,
        linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h,
        sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h.
        * ipc_defs.h: Include <sys/ipc.h> or <linux/ipc.h> depending
        on what is available.
        * ipc_msg.c: Replace <sys/ipc.h> with "ipc_defs.h".
        Fallback to <linux/msg.h> when available.
        * ipc_msgctl.c: Include <sys/msg.h>, <asm/msgbuf.h>, or <linux/msg.h>
        based on what is available.  Note missing support for old ipc structs.
        * ipc_sem.c: Include <sys/sem.h> or <linux/sem.h> depending
        on what is available.  Only decode sembuf when available.
        * ipc_shm.c: Fallback to <linux/shm.h> when available.
        * ipc_shmctl.c: Include <sys/shm.h>, <asm/shmbuf.h>, or <linux/shm.h>
        based on what is available.  Note missing support for old ipc structs.
        * print_mq_attr.c: Fallback to <linux/mqueue.h> when available.

2015-11-25  Dmitry V. Levin  <ldv@altlinux.org>

        CREDITS.in: add Jian Zhen.
        Thanks to Jian Zhen for donation of https://github.com/strace/ and
        strace.io.

        * CREDITS.in: Add Jian Zhen.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Fix syscall entries of unimplemented getpmsg and putpmsg syscalls.
        * linux/ia64/syscallent.h (getpmsg): Change SEN(printargs)
        to SEN(getpmsg).
        (putpmsg): Change SEN(printargs) to SEN(putpmsg).
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/arm/syscallent.h (getpmsg, putpmsg): Set sys_flags to TN.
        * linux/bfin/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/hppa/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/i386/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/m68k/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/microblaze/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/powerpc/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/s390/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/s390x/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/x32/syscallent.h (getpmsg, putpmsg): Likewise.
        * linux/x86_64/syscallent.h (getpmsg, putpmsg): Likewise.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Remove parsers of getpmsg and putpmsg syscalls.
        These system calls are not implemented in the Linux kernel.

        * linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated
        syscalls.
        * Makefile.am (strace_SOURCES): Remove stream.c.
        * stream.c: Remove.
        * xlat/pmsgflags.in: Remove.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Remove parser of query_module syscall.
        Since query_module syscall is present only in kernels before Linux 2.6
        and strace does not support those kernels, there is no use to keep this
        parser any longer.

        * bjm.c: Do not include <sys/*>, "xlat/qm_which.h",
        and "xlat/modflags.h".
        (MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)):
        Remove.
        * linux/dummy.h (sys_query_module): Add stub alias.
        * xlat/modflags.in: Remove.
        * xlat/qm_which.in: Remove.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

        Fix syscall entries of deprecated sysfs syscall.
        * linux/alpha/syscallent.h (sysfs): Change nargs from 5 to 3.
        * linux/hppa/syscallent.h (sysfs): Likewise.
        * linux/mips/syscallent-n32.h (sysfs): Likewise.
        * linux/mips/syscallent-n64.h (sysfs): Likewise.

        Move sysfs syscall to deprecated category.
        * linux/dummy.h (sys_sysfs): Move to the list of deprecated syscalls.

        Fix syscall entries of deprecated bdflush syscall.
        * linux/alpha/syscallent.h (bdflush): Change nargs from 0 to 2.
        * linux/arm/syscallent.h (bdflush): Likewise.
        * linux/avr32/syscallent.h (bdflush): Likewise.
        * linux/bfin/syscallent.h (bdflush): Likewise.
        * linux/hppa/syscallent.h (bdflush): Likewise.
        * linux/i386/syscallent.h (bdflush): Likewise.
        * linux/ia64/syscallent.h (bdflush): Likewise.
        * linux/m68k/syscallent.h (bdflush): Likewise.
        * linux/microblaze/syscallent.h (bdflush): Likewise.
        * linux/powerpc/syscallent.h (bdflush): Likewise.
        * linux/s390/syscallent.h (bdflush): Likewise.
        * linux/s390x/syscallent.h (bdflush): Likewise.
        * linux/sh/syscallent.h (bdflush): Likewise.
        * linux/sh64/syscallent.h (bdflush): Likewise.
        * linux/sparc/syscallent.h (bdflush): Likewise.

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        Implement name_to_handle_at and open_by_handle_at syscalls decoding.
        * file_handle.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_name_to_handle_at, sys_open_by_handle_at):
        Remove stub aliases.
        * pathtrace.c (pathtrace_match): Add SEN_name_to_handle_at.
        * tests/file_handle.c: New file.
        * tests/file_handle.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add file_handle.
        (TESTS): Add file_handle.test.
        * tests/.gitignore: Add file_handle.

        Implement lookup_dcookie syscall decoding.
        * lookup_dcookie.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_lookup_dcookie): Remove stub alias.

        Implement kexec_file_load syscall decoding.
        * xlat/kexec_file_load_flags.in: New file.
        * kexec.c: Include "xlat/kexec_file_load_flags.h".
        (SYS_FUNC(kexec_file_load)): New function.
        * linux/dummy.h (sys_kexec_file_load): Remove stub alias.
        * pathtrace.c (pathtrace_match): Add SEN_kexec_file_load.

        Implement kcmp syscall decoding.
        * kcmp.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_kcmp): Remove stub alias.
        * xlat/kcmp_types.in: New file.

        Implement iopl syscall decoding.
        * iopl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_iopl): Remove stub alias.

        Implement ioperm syscall decoding.
        * ioperm.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_ioperm): Remove stub alias.

        net: fix printing of IP_RECVOPTS/IP_RETOPTS cmsg options.
        * net.c (print_cmsg_ip_opts): Print each byte as unsigned char.

        userfaultfd: fix pathtrace support.
        * pathtrace.c (pathtrace_match): Add SEN_userfaultfd.

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        Implement IPPROTO_IP control messages decoding.
        * net.c: Include "xlat/ip_cmsg_types.h".
        (print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
        print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum,
        print_cmsg_ip_origdstaddr): New functions.
        (print_cmsg_type_data): Add generic SOL_IP level decoding.
        Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS,
        IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM,
        and SCM_SECURITY type messages.
        * xlat/ip_cmsg_types.in: New file.
        * xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS.
        * tests/inet-cmsg.c: New file.
        * tests/inet-cmsg.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add inet-cmsg.
        (TESTS): Add inet-cmsg.test.
        * tests/.gitignore: Add inet-cmsg.

        Suggested-by: Orion Poplawski <orion@cora.nwra.com>

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

        Simplify control messages printers.
        Do not pass sizeof(struct cmsghdr) to every cmsg printer.

        * net.c (printcmsghdr): Pass pointer to cmsg_data and length
        of cmsg_data to print_cmsg_type_data.
        (print_cmsg_type_data): Update prototype.  Pass pointer to cmsg_data
        and length of cmsg_data to cmsg printers.
        (print_scm_rights, print_scm_creds, print_scm_security): Update.

2015-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        net: factor out address printing code to a separate function.
        * net.c (sockaddr_buf_t): New type.
        (print_sockaddr): New function.
        (printsock, print_group_req): Use it.

2015-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: skip xlat struct definitions in mpers mode.
        Avoid duplicate definitions of xlat structures in files
        compiled in mpers mode.

        Each xlat file defines the corresponding xlat struct with
        either global or local visibility using the following rules:

        - if xlat struct declaration is available in defs.h,
          a global definition is provided in regular mode,
          and nothing is provided in mpers mode;
        - otherwise, if xlat file is included by a mpers source file,
          a global definition is provided in regular mode
          (unless no mpers mode is supported on this architecture,
          in that case, a local definition is provided instead),
          and a declaration is provided in mpers mode;
        - otherwise, a local definition is provided in regular mode,
          and an error message is printed in mpers mode.

        Fallback definitions of constants provided by xlat files
        remain available in all modes.

        * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh.
        * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove.
        * generate_mpers_am.sh: Generate mpers_xlat.h.
        * Makefile.am (EXTRA_DIST): Add mpers_xlat.h.
        * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally.
        * print_timex.c: Include "xlat/adjtimex_modes.h" and
        "xlat/adjtimex_status.h" unconditionally.
        * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ...
        (cond_def): ... here.
        (gen_header): Check also mpers_xlat.h for global declarations
        of xlat structures.
        Process input file twice, first time print directives
        only, second time print everything.
        Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif.
        * xlat/getrandom_flags.in: Cleanup.

2015-11-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite getdents test in C for better coverage.
        * tests/getdents.awk: Remove.
        * tests/getdents.out: Remove.
        * tests/getdents.c: New file.
        * tests/getdents.test: Rewrite.
        * tests/getdents64.c: New file.
        * tests/getdents64.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64.
        (TESTS): Add getdents64.test.
        (EXTRA_DIST): Remove getdents.awk and getdents.out.
        * tests/.gitignore: Add getdents and getdents64.

2015-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add readdir.test.
        * tests/readdir.c: New file.
        * tests/readdir.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add readdir.
        (TESTS): Add readdir.test.
        * tests/.gitignore: Add readdir.

        Mpersify parsers of readdir and getdents syscalls.
        * defs.h (dirent_types): New xlat prototype.
        * dirent.c: Stop including "xlat/direnttypes.h".
        (kernel_dirent): New typedef.  Mpersify it.
        (print_old_dirent): Use it instead of old_dirent_t.
        (SYS_FUNC(getdents)): Use it instead of struct kernel_dirent.
        Rename direnttypes to dirent_types.
        (SYS_FUNC(getdents64)): Move ...
        * dirent64.c: ... here.  Rename direnttypes to dirent_types.
        Include "xlat/dirent_types.h".
        * Makefile.am (strace_SOURCES): Add dirent64.c.
        * xlat/direnttypes.in: Rename to xlat/dirent_types.in.

2015-11-19  Gabriel Laskar  <gabriel@lse.epita.fr>

        getdents: fix typos in array output.
        Array should be enclosed by square brakets, and elements should be
        separated by commas.

        * dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos
        in array output.
        * tests/getdents.awk: Update regexps to match fixed output.
        * tests/getdents.out: Update output.

2015-11-19  Dmitry V. Levin  <ldv@altlinux.org>

        printcmsghdr: move type and data decoders to a separate function.
        * net.c (print_scm_rights, print_scm_creds, print_scm_security): Change
        to return void.  Move printing of struct cmsghdr closing '}' ...
        (printcmsghdr): ... here.  Move type and data decoders to ...
        (print_cmsg_type_data): ... new function.

2015-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that libc provides sendmsg.
        Starting with commit v4.6-281-g7af9f35, we implicitly assume that
        HAVE_SENDMSG is always defined.  Therefore, the check for sendmsg
        availability is redundant and could be safely removed.

        * configure.ac (AC_CHECK_FUNCS): Remove sendmsg.
        * linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove
        stub aliases.
        * net.c [HAVE_SENDMSG]: Define unconditionally.
        * syscall.c (dumpio) [HAVE_SENDMSG]: Likewise.

2015-11-18  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: move fallback definition of SCM_SECURITY to xlat/
        * net.c: Move fallback definition of SCM_SECURITY ...
        * xlat/scmvals.in: ... here.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Implement mlock2 syscall decoding.
        * mem.c: Include "xlat/mlock_flags.h".
        (SYS_FUNC(mlock2)): New function.
        * xlat/mlock_flags.in: New file.
        * xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values.
        * linux/dummy.h (mlock2): Remove.
        * tests/mlock2.c: New file.
        * tests/mlock2.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add mlock2.
        (TESTS): Add mlock2.test.
        * tests/.gitignore Add mlock2.

        Implement membarrier syscall decoding.
        * membarrier.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/membarrier_cmds.in: New file.
        * linux/dummy.h (membarrier): Remove.
        * tests/membarrier.c: New file.
        * tests/membarrier.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add membarrier.
        (TESTS): Add membarrier.test.
        * tests/.gitignore: Add membarrier.

        Implement userfaultfd syscall decoding.
        * userfaultfd.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/uffd_flags.in: New file.
        * linux/dummy.h (userfaultfd): Remove.
        * tests/userfaultfd.c: New file.
        * tests/userfaultfd.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add userfaultfd.
        (TESTS): Add userfaultfd.test.
        * tests/.gitignore: Add userfaultfd.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: wire up kcmp syscall.
        ia64 has kcmp syscall starting with linux kernel commit
        v4.3-rc7-1-gd305c47.

        * linux/ia64/syscallent.h (kcmp): New entry.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc: wire up direct sysv ipc syscalls.
        Starting with linux commit v4.3-rc3-33-ga342361, powerpc has
        direct sysv ipc syscalls in addition to traditional ipc syscall.

        * linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd,
        msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

        Wire up userfaultfd, membarrier, and mlock2 syscalls.
        * linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases.
        * linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries.
        * linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise.
        * linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise.
        * linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise.
        * linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
        * linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        sprintflags: skip zero flags.
        Tweak sprintflags behaviour to match printflags.

        * util.c (sprintflags): Skip zero flags unless the value passed
        to sprintflags is also zero.

2015-11-16  Mike Frysinger  <vapier@gentoo.org>

        printflags: handle empty xlats.
        If the set of headers are unable to produce a valid list, printflags
        will try to pass NULL to tprints which crashes.  Add a sanity check
        for this edge case.

        * util.c (printflags): Check xlat->str is not NULL.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        mpers: forward mpers_DEFS to mpers.sh.
        mpers_DEFS has to be forwarded to mpers.sh so that config.h would be
        properly included by defs.h at preprocessor stage.

        * Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of
        options to mpers.sh's CPPFLAGS.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ioctl: workaround glibc ioctl wrapper on powerpc.
        * tests/ioctl.c (main) [POWERPC] Disable TCGETS test.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc: wire up switch_endian syscall.
        powerpc has switch_endian syscall starting with linux commit
        v4.0-rc4-67-g529d235.

        * linux/powerpc/syscallent.h (switch_endian): New entry.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: reserve more space for new syscalls.
        Move socket subcalls further down the table to make room
        for new syscalls.

        * linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        m68k: wire up direct socket syscalls.
        Starting with linux commit v4.3-rc3-1-g5b3f33e, m68k has direct
        socket syscalls in addition to traditional socketcall syscall.

        * linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen,
        accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
        sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

        i386: wire up direct socket syscalls.
        Starting with linux commit v4.2-rc1-64-g9dea5dc, x86 has direct
        socket syscalls in addition to traditional socketcall syscall.

        * linux/i386/syscallent.h (socket, socketpair, bind, connect, listen,
        accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
        sendmsg, recvfrom, recvmsg, shutdown): New entries.

2015-11-11  Heiko Carstens  <heiko.carstens@de.ibm.com>

        s390, s390x: update syscall tables.
        * linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0.
        * linux/s390x/syscallent.h: Likewise.

2015-11-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix *_printer_defs.h rules ambiguousness.
        There is an ambiguousness in *_printer_defs.h rules definition:

        $ grep '^[^ ]*_defs\.h: ' Makefile.am
        m%_defs.h: $(srcdir_mpers_source_files)
        %_printer_defs.h: $(srcdir_mpers_source_files)

        While it appears to work with GNU make, it has to be fixed nevertheless.

        * Makefile.am (m%_defs.h): Rename to m%_type_defs.h.
        (mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h.
        (mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h.
        * mpers_type.h: Rename m32_defs.h to m32_type_defs.h,
        mx32_defs.h to mx32_type_defs.h.
        * .gitignore: Likewise.

        Reported-by: Elliott Hughes <enh@google.com>

2015-10-09  Dmitry V. Levin  <ldv@altlinux.org>

        fcntl.c: make use of RVAL_DECODED.
        * fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations.

2015-10-08  Dmitry V. Levin  <ldv@altlinux.org>

        desc.c: move parser of fcntl syscall to a separate file.
        * fcntl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c.

        desc.c: move parser of flock syscall to a separate file.
        * flock.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * desc.c (SYS_FUNC(flock)): Move to flock.c.

2015-10-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix false uio.test failures.
        * tests/uio.c (main): Use descriptor number 0 in pread/pwrite
        and preadv/pwritev syscalls.
        * tests/uio.expected: Update regexps.

        Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>

2015-10-01  Gabriel Laskar  <gabriel@lse.epita.fr>

        Fix make -j builds.
        In files generated by mpers scripts, includes directives are taken from
        original files where the type definition was done.  This causes to
        include defs.h in multiple files.  defs.h includes printers.h header,
        which is a generated header.

        This patch add an explicit dependency to printers.h for the mpers
        scripts.

        * Makefile.am (mpers-m%.stamp): Add printers.h to order-only
        prerequisites.

2015-09-29  Mike Frysinger  <vapier@gentoo.org>

        mpers: fix shell code to conform better to POSIX.
        The `echo -n` behavior is non-portable, so use printf instead.

        * generate_mpers_am.sh: Change `echo -n` to `printf`.

2015-09-23  Gabriel Laskar  <gabriel@lse.epita.fr>

        ioctl: fix ioctl command number decoding in case of conflicts.
        When a command number was decoded through ioctl_decode_command_number(),
        there was no check for conflicts with other potential ioctls numbers.

        For example:
                ioctl(fd, MCE_GET_RECORD_LEN, &i);
        output:
                ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0
        instead of:
                ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0

        * ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding
        in case of conflicts.
        * tests/ioctl.c (main): Add a case for command number conflicts.

2015-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: convert ioctl.test from match_grep to match_diff.
        * tests/ioctl.c (main): Print expected output.
        * tests/ioctl.test: Use match_diff instead of match_grep.
        * tests/ioctl.expected: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected.

2015-09-20  Dmitry V. Levin  <ldv@altlinux.org>

        Convert parser of seccomp filter program to new mpers infrastructure.
        * seccomp_fprog.h: New file.
        * fetch_seccomp_fprog.c: New file.
        * Makefile.am (strace_SOURCES): Add them.
        * seccomp.c: Include "seccomp_fprog.h".
        (print_seccomp_filter): Use fetch_seccomp_fprog.

2015-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests/init.sh: enhance match_grep error diagnostics.
        * tests/init.sh (match_grep): Check patterns one by one,
        output only those patterns that didn't match.

        tests/init.sh: fix comment.
        * tests/init.sh (match_awk): Fix usage description.

        tests: add one more case to select.test.
        * tests/select.c (main): Check how timeout is printed
        on exiting syscall.

        tests: uncouple pselect6 from select.test.
        * tests/select.c Do not include <string.h>.
        Include <sys/syscall.h>.
        [!__NR_select]: Skip the test.
        (main): Remove pselect6 support, test just select syscall.
        * tests/select.test: Remove all pselect6 checks, test just
        select syscall.

        tests: robustify select test.
        * tests/select.c: Do not include <assert.h>.
        (main): Skip the test instead of assertions.
        Add some padding to the timeval structure.

        tests: add one more case to pselect6.test.
        * tests/pselect6.c (main): Check how timeout is printed
        on exiting syscall.

        tests: robustify pselect6 test.
        * tests/pselect6.c: Do not include <assert.h> and <string.h>.
        Include <sys/syscall.h>.
        [!__NR_pselect6]: Skip the test.
        (main): Skip the test instead of assertions.
        Add some padding to the timespec structure.

        Convert another parser of struct timeval to new mpers infrastructure.
        * print_time.c (sprint_timeval): New mpers printer.
        [ALPHA] (sprint_timeval32): New function.
        * defs.h [ALPHA] (sprint_timeval32): New prototype.
        (bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove.
        * desc.c (decode_select): Replace bitness parameter with two printers.
        Use them instead of printtv_bitness and sprinttv.
        (sys_oldselect, sys_select): Pass print_timeval and sprint_timeval
        to decode_select.
        [ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32
        to decode_select.
        (pselect6): Pass print_timespec and sprint_timespec to decode_select.
        * time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat,
        struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove.

        Convert another parser of struct timespec to new mpers infrastructure.
        * print_time.c (sprint_timespec): New mpers printer.
        * defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
        (sprint_timespec): Remove.
        * time.c (sprint_timespec): Remove.
        * net.c (sys_recvmmsg): Update callers.
        * poll.c (decode_poll_exiting): Likewise.

        tests: add another case to pselect6 test.
        * tests/pselect6.c: Include <sys/time.h>.
        (handler): New function.
        (main): Install an interval timer.
        Use it to check how ERESTARTNOHAND is printed.

        Fix decoding of gettimeofday and settimeofday.
        * time.c (print_timezone): new function.
        (sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval
        to print struct timezone.
        [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it
        instead of print_timeval32 to print struct timezone.
        * tests/xettimeofday.c: New file.
        * tests/xettimeofday.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add xettimeofday.
        (TESTS): Add xettimeofday.
        * tests/.gitignore: Add xettimeofday.

        Convert parser of struct timeval to new mpers infrastructure.
        * defs.h (printtv, printtv_special): Remove.
        [ALPHA] (print_timeval32, print_timeval32_pair): New prototypes.
        * print_time.c (print_timeval): New mpers printer.
        [ALPHA] (print_timeval32, print_timeval32_pair): New functions.
        * time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval
        instead of printtv.
        [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday):
        Use print_timeval32 instead of printtv_bitness.
        * utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair
        instead of printtv_bitness.

        Convert parser of struct timespec to new mpers infrastructure.
        * defs.h (print_timespec): Remove.
        * print_time.c (print_timespec): New mpers printer.
        * futex.c (sys_futex): Use print_timespec instead of printtv.
        * ipc_sem.c (sys_semtimedop): Likewise.
        * mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise.
        * time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise.
        (print_timespec): Remove.

        Remove unused parser of adjtime syscall.
        * time.c (sys_adjtime): Remove.

        Fix decoding of clock_nanosleep.
        * time.c (sys_clock_nanosleep): Use is_erestart,
        temporarily_clear_syserror, and restore_cleared_syserror.
        * tests/clock_nanosleep.c: New file.
        * tests/clock_nanosleep.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep.
        (TESTS): Add clock_nanosleep.test.
        * tests/.gitignore: Add clock_nanosleep.

        Add is_erestart helper function.
        * defs.h (is_erestart): New prototype.
        * syscall.c (is_erestart): New function.
        * time.c (sys_nanosleep): Use is_erestart,
        temporarily_clear_syserror, and restore_cleared_syserror.

        Add helper functions to clear/restore syserror.
        * defs.h (temporarily_clear_syserror, restore_cleared_syserror):
        New prototypes.
        * syscall.c (saved_u_error): New variable.
        (temporarily_clear_syserror, restore_cleared_syserror): New functions.
        * aio.c (sys_io_getevents): Use temporarily_clear_syserror
        and restore_cleared_syserror.
        * mq.c (sys_mq_timedreceive): Likewise.
        * signal.c (sys_rt_sigtimedwait): Likewise.

        tests: add nanosleep.test.
        * tests/nanosleep.c: New file.
        * tests/nanosleep.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add nanosleep.
        (TESTS): Add nanosleep.test.
        * tests/.gitignore: Add nanosleep.

        tests: rewrite restart_syscall in C.
        * tests/restart_syscall.c: New file.
        * tests/restart_syscall.expected: Remove.
        * tests/restart_syscall_unknown.expected: Remove.
        * tests/restart_syscall.test: Update to use restart_syscall.
        * tests/Makefile.am (check_PROGRAMS): Add restart_syscall.
        (EXTRA_DIST): Remove restart_syscall.expected
        and restart_syscall_unknown.expected.
        * tests/.gitignore: Add restart_syscall.

        Properly initialize siginfo_t object passed to print_stopped function.
        * strace.c (trace): Clear the whole siginfo_t variable before passing it
        to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a
        part of the structure.

        tests: add clock_xettime.test.
        * tests/clock_xettime.c: New file.
        * tests/clock_xettime.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add clock_xettime.
        (TESTS): Add clock_xettime.test.
        * tests/.gitignore: Add clock_xettime.

        Convert parser of struct itimerval to new mpers infrastructure.
        * defs.h [ALPHA] (print_itimerval32): New prototype.
        * print_time.c (print_itimerval): New mpers printer.
        [ALPHA] (timeval32_t): New typedef.
        [ALPHA] (print_timeval32_t, print_itimerval32): New functions.
        * time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead
        of printitv.
        [ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32
        instead of printitv_bitness.
        (tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove.

        tests: add xetitimer.test.
        * tests/xetitimer.c: New file.
        * tests/xetitimer.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add xetitimer.
        (TESTS): Add xetitimer.test.
        * tests/.gitignore: Add xetitimer.

        Convert parser of struct itimerspec to new mpers infrastructure.
        * print_time.c (print_itimerspec): New mpers printer.
        * time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd,
        sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv.

2015-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        print_time.c: introduce print_timespec_t helper.
        * print_time.c (time_fmt): New constant string.
        (print_timeval_t): Use it.
        (print_timespec_t): New function.
        (print_timespec_t_utime): Use it.

        tests: add timerfd_xettime.test.
        * tests/timerfd_xettime.c: New file.
        * tests/timerfd_xettime.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime.
        (TESTS): Add timerfd_xettime.test.
        * tests/.gitignore: Add timerfd_xettime.

        tests: add timer_xettime.test.
        * tests/timer_xettime.c: New file.
        * tests/timer_xettime.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add timer_xettime.
        (TESTS): Add timer_xettime.test.
        * tests/.gitignore: Add timer_xettime.

        time.c: move parser of time syscall to print_time.c.
        * time.c (current_time_t_is_int32): Remove.
        (sys_time): Move ...
        * print_time.c: ... here.  Mpersify time_t.

        print_time.c: remove unused function parameters.
        * print_time.c (print_timespec_t_utime, print_timeval_t): Remove
        "struct tcb *" parameter.
        (print_timespec_utime_pair, print_timeval_pair): Update callers.

        Add struct timex.tai support.
        * configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai.
        * print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field.
        * tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise.

        Convert parser of struct timex to new mpers infrastructure.
        * defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes.
        * print_timex.c (struct_timex): New typedef.  Mpersify it.
        [IN_MPERS]: Do not include "xlat/adjtimex_modes.h"
        and "xlat/adjtimex_status.h".
        [SUPPORTED_PERSONALITIES > 1]: Remove.
        (tprint_timeval): Remove.
        (tprint_timex): Rename to print_timex.  Mpersify it.
        * time.c (do_adjtimex): Rename tprint_timex to print_timex.
        * tests/adjtimex.c: New file.
        * tests/adjtimex.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add adjtimex.
        (TESTS): Add adjtimex.test.
        * tests/.gitignore: Add adjtimex.

        Move parser of struct timex to a separate file.
        * print_timex.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * time.c (tprint_timex32, tprint_timex): Move to print_timex.c.

        Enhance parser of struct sigevent.
        * print_sigevent.c (print_sigevent): Always print names
        of struct_sigevent fields along with their values.
        Print signal name of sigev_signo for those sigev_notify values
        that require valid signal numbers.
        * tests/timer_create.c: New file.
        * tests/timer_create.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add timer_create.
        (TESTS): Add timer_create.test.
        * tests/.gitignore: Add timer_create.

2015-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        Convert parser of struct sigevent to new mpers infrastructure.
        * defs.h (sigev_value): New prototype.
        (printsigevent): Remove.
        * print_sigevent.c (struct_sigevent): New typedef.  Mpersify it.
        [IN_MPERS]: Do not include "xlat/sigev_value.h".
        (printsigevent32): Remove.
        (printsigevent): Rename to print_sigevent.  Mpersify it.
        * mq.c (sys_mq_notify): Rename printsigevent to print_sigevent.
        * time.c (sys_timer_create): Likewise.

        Move parser of struct sigevent to a separate file.
        * print_sigevent.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * time.c (printsigevent32, printsigevent): Move to print_sigevent.c.

        time.c: move fallback definitions of SIGEV_* values to xlat/
        * time.c: Move fallback definitions of SIGEV_* values ...
        * xlat/sigev_value.in: ... here.

        Simplify use of mpers printers.
        * native_defs.h: New file.
        * syscall.c: Include it.
        * mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h".
        * defs.h (MPERS_PRINTER_NAME): Remove.
        [SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ...
        * Makefile.am (printers.h): ... here.
        Add macro definitions for mpers printers.
        (m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion
        of "$(mpers_PREFIX)printer_decls.h".
        (strace_SOURCES): Add native_defs.h.
        * README-mpers: Update instructions for using mpers printers.
        * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly.
        * mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly.
        * process.c (sys_ptrace): Call printsiginfo_at directly.
        * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise.
        * resource.c (sys_getrusage): Call printrusage directly.
        * utimes.c (sys_utimensat): Call print_timespec_utime_pair directly.
        (sys_utimes, sys_futimesat): Call print_timeval_pair directly.
        * wait.c (printwaitn): Call printrusage directly.
        (sys_waitid): Call printrusage and printsiginfo_at directly.

2015-09-15  Dmitry V. Levin  <ldv@altlinux.org>

        Add a new helper function umove_ulong_array_or_printaddr.
        * defs.h (umove_ulong_array_or_printaddr): New prototype.
        * util.c (umove_ulong_array_or_printaddr): New function.
        * desc.c (sys_pselect6): Use it instead of open-coding
        a proxy struct parser for different personalities.
        * io.c (tprint_iov_upto): Use it instead of open-coding
        a struct iovec parser for different personalities.
        * kexec.c (print_kexec_segments): Use it instead of open-coding
        a struct kexec_segment parser for different personalities.
        (print_seg): Pass arguments using an array.

        tests: add pselect6.test.
        * tests/pselect6.c: New file.
        * tests/pselect6.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add pselect6.
        (TESTS): Add pselect6.test.
        * tests/.gitignore: Add pselect6.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

        Rename umove_long_or_printaddr to umove_ulong_or_printaddr.
        Rename the recently added function to reflect what kind of data type
        it actually deals with: unsigned long int, without sign extension.

        * defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr,
        chage 3rd argument to unsigned long *.
        * util.c (umove_long_or_printaddr): Likewise.
        * aio.c (sys_io_submit): Update callers.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64, ppc64, sparc64, tile: hook up mpers printers.
        * defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS,
        PERSONALITY0_INCLUDE_PRINTERS_DECLS,
        and PERSONALITY0_INCLUDE_PRINTERS_DEFS.
        [POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS,
        PERSONALITY1_INCLUDE_PRINTERS_DECLS,
        and PERSONALITY1_INCLUDE_PRINTERS_DEFS.
        [SPARC64 && HAVE_M32_MPERS]: Likewise.
        [TILE && HAVE_M32_MPERS]: Likewise.

2015-09-14  Anton Blanchard  <anton@samba.org>

        Add PowerPC specific ptrace constants.
        * xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update SCTP_* constants.
        * xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF,
        SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO,
        SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3,
        and SCTP_GET_ASSOC_STATS.

        Update F_* constants.
        * xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS,
        and F_GET_SEALS.

        Update RENAME_* constants.
        * xlat/rename_flags.in: Add RENAME_WHITEOUT.

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS,
        SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU,
        SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL,
        SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS.

        Update INPUT_PROP_* constants.
        * xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER.

        Update KEY_* constants.
        * xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A,
        KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D.

        Update FALLOC_FL_* constants.
        * xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE.

        Update AF_* and PF_* constants.
        * xlat/addrfams.in: Add AF_IB and AF_MPLS.
        * xlat/domains.in: Add PF_IB and PF_MPLS.

        Update TCP_* constants.
        * xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO,
        TCP_SAVE_SYN, and TCP_SAVED_SYN.

        Update PACKET_* constants.
        * xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP,
        PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS,
        PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA.

        Update BPF_MAP_TYPE_* constants.
        * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY.

        Update IPPROTO_* constants.
        * xlat/inet_protocols.in: Add IPPROTO_MPLS.

        Update IP_* constants.
        * xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT.

        Update PTRACE_O_* constants.
        * ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP.
        * xlat/ptrace_setoptions_flags.in: Add it.

        Update PR_* constants.
        * xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE,
        and PR_CAP_AMBIENT.

        Update SECBIT_* constants.
        * xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE
        and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        mpers.m4: workaround missing gnu/stubs-*.h files.
        On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation
        checks fail.  As we want to support multiple personalities despite of
        this limitation, workaround the check by creating empty gnu stub files
        if necessary.

        * m4/mpers.m4 (st_MPERS): Check for the gnu stub file.  Create an empty
        gnu stub file if the system one is missing.
        * Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add times-fail.test.
        * tests/times-fail.c: New file.
        * tests/times-fail.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add times-fail.
        (TESTS): Add times-fail.test.
        * tests/.gitignore: Add times-fail.

2015-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

        tests: add times.test.
        * tests/times.c: New file.
        * tests/times.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add times.
        (TESTS): Add times.test.
        (times_LDADD): Define.
        * tests/.gitignore: Add times.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify parser of times syscall.
        Fix multiple personalities support in parser of times syscall by
        mpersifying struct tms.

        * times.c (tms_t): New typedef.  Mpersify it.
        (sys_times): Use it instead of struct tms.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add sysinfo.test.
        * tests/sysinfo.c: New file.
        * tests/sysinfo.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sysinfo.
        (TESTS): Add sysinfo.test.
        * tests/.gitignore: Add sysinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify parser of sysinfo syscall.
        Fix multiple personalities support in parser of sysinfo syscall by
        mpersifying struct sysinfo.

        * sysinfo.c (sysinfo_t): New typedef.  Mpersify it.
        (sys_sysinfo): Use it instead of struct sysinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Enhance msgctl syscall decoding.
        Make parser of msgctl syscall print struct msqid_ds.

        * ipc_msgctl.c (msqid_ds_t): New typedef.  Mpersify it.
        (print_msqid_ds): New function.  Use msqid_ds_t.
        (sys_msgctl): Use print_msqid_ds.
        * tests/ipc_msg.c: Update for struct msqid_ds support.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Enhance shmctl syscall decoding.
        Make parser of shmctl syscall print struct shmid_ds.

        * ipc_shmctl.c (shmid_ds_t): New typedef.  Mpersify it.
        (print_shmid_ds): New function.  Use shmid_ds_t.
        (sys_shmctl): Use print_shmid_ds.
        * tests/ipc_shm.c: Update for struct shmid_ds support.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add ipc_msgbuf.test.
        * tests/ipc_msgbuf.c: New file.
        * tests/ipc_msgbuf.expected: Likewise.
        * tests/ipc_msgbuf.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf.
        (TESTS): Add ipc_msgbuf.test.
        (EXTRA_DIST): Add ipc_msgbuf.expected.
        * tests/.gitignore: Add ipc_msgbuf.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify tprint_msgsnd and tprint_msgrcv.
        Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv
        by converting tprint_msgbuf into a mpersified printer.

        * print_msgbuf.c (msgbuf_t): New typedef.  Mpersify it.
        (tprint_msgbuf): Use it instead of long.
        Wrap function name into MPERS_PRINTER_DECL.
        * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified
        tprint_msgbuf.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add mq.test.
        * tests/mq.c: New file.
        * tests/mq.expected: Likewise.
        * tests/mq.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add mq.
        (TESTS): Add mq.test.
        (EXTRA_DIST): Add mq.expected.
        (mq_LDADD): Add -lrt.
        * tests/.gitignore: Add mq.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify parsers of mq_open and mq_getsetattr syscalls.
        Fix multiple personalities support in parsers of mq_open and
        mq_getsetattr by converting printmqattr into a mpersified printer.

        * print_mq_attr.c (mq_attr_t): New typedef.  Mpersify it.
        (printmqattr): Use it instead of struct mq_attr.  Wrap function name
        into MPERS_PRINTER_DECL.
        * mq.c (mq_open, mq_getsetattr): Use mpersified printmqattr.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add wait.test.
        * tests/wait.c: New file.
        * tests/wait.expected: Likewise.
        * tests/wait.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add wait.
        (TESTS): Add wait.test.
        (EXTRA_DIST): Add wait.expected.
        * tests/.gitignore: Add wait.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify parsers of getrusage, waitpid, wait4, and waitid syscalls.
        Fix multiple personalities support in parsers of getrusage, waitpid,
        wait4, and waitid syscalls by converting printrusage into a mpersified
        printer.

        * defs.h (printrusage): Remove.
        * printrusage.c (rusage_t): New typedef.  Mpersify it.
        (printrusage): Use it instead of struct rusage.
        Wrap function name into MPERS_PRINTER_DECL.
        * resource.c (sys_getrusage): Use mpersified printrusage.
        * wait.c (printwaitn, sys_waitid): Likewise.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add rt_sigqueueinfo.test.
        * tests/rt_sigqueueinfo.c: New file.
        * tests/rt_sigqueueinfo.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo.
        (TESTS): Add rt_sigqueueinfo.test.
        * tests/.gitignore: Add rt_sigqueueinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify printsiginfo_at printer.
        Fix multiple personalities support in parsers of ptrace,
        rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls
        by converting printsiginfo_at into a mpersified printer.

        * printsiginfo.c (siginfo_t): Mpersify.
        (printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL.
        * defs.h (printsiginfo_at): Remove.
        * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified
        printsiginfo_at.
        * process.c (sys_ptrace): Likewise.
        * wait.c (sys_waitid): Likewise.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify parser of sigaltstack syscall.
        Fix multiple personalities support in parser of sigaltstack syscall by
        mpersifying stack_t typedef.

        * sigaltstack.c (stack_t): Mpersify.
        (print_stack_t): Use it.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Mpersify parser of utime syscall.
        Fix multiple personalities support in parser of utime syscall by using
        mpersified utimbuf_t typedef.

        * utime.c (utimbuf_t): New typedef.  Mpersify it.
        (sys_utime): Use it instead of a locally defined union.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add utimensat.test.
        * tests/utimensat.c: New file.
        * tests/utimensat.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add utimensat.
        (TESTS): Add utimensat.test.
        * configure.ac (AC_CHECK_FUNCS): Add utimensat.
        * tests/.gitignore: Add utimensat.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        Mpersify parsers of utimes, futimesat, and utimensat syscalls.
        Fix multiple personalities support in parsers of utimes, futimesat,
        and utimensat syscalls by introducing two mpersified printers:
        print_timeval_pair and print_timespec_utime_pair.

        * print_time.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * utimes.c (decode_utimes): Remove.
        (sys_utimes, sys_futimesat): Use print_timeval_pair instead
        of decode_utimes.
        (sys_utimensat): Use print_timespec_utime_pair instead of decode_utimes.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

        Add mpers support.
        Add a subsystem for semi-automatical definition of how parsers should
        work with personality-dependent (mpers) types of tracee's data.  Create
        auxiliary libraries containing mpers syscall parsers and printer
        functions, one library for each possible nonnative target personality.

        Currently some parsers do not handle differences in definitions of data
        types between personalities, namely LP64 and ILP32.  When
        this is the case, long integers, pointers, and all compound
        types containing long and pointer members may be printed incorrectly,
        because of differences in sizes, offsets and alignments.

        Since in most cases these are the only differences in desired behaviour
        of parsers and printers for different personalities, a correct way
        would be to compile one source code into multiple parsers, differing
        only in definitions of mpers types.

        To get a definition of a given type for nonnative personality
        a very basic .c file containing a declaration of a variable of this type
        is being compiled for this personality (using -m32 or -mx32 compiler
        flag).  Information about the type is then being extracted from
        this binary's DWARF debug info with an awk script and put
        into a corresponding header file.  Resulting headers are being used to
        compile mpers variations of syscall parsers and printer functions.

        In addition to syscall parsers, there can occur a need to create mpers
        printing functions, which then can be called from many places
        in the code (for example, printsiginfo_at).  Such functions (printers)
        are marked in a special manner.

        For each possible nonnative target personality a library is being
        created, containing mpers variations of syscall parsers and printers.
        Only syscall parsers from files marked in a special manner and specially
        marked functions from such files are being recompiled and included
        in these libraries.

        generate_mpers_am.sh is called by bootstrap to find the files
        from strace_SOURCES which include MPERS_DEFS.  During compilation,
        these files are being inspected for inclusions of DEF_MPERS_TYPE,
        and nonnative variations of each included type are being generated
        by an awk script.

        Mpers parser names are being modified during inclusions of syscallent
        headers for nonnative personalities.  Pointers to printers are
        being stored in structs struct_printers, and a master
        pointer printers is being updated on every set_personality.

        * README-mpers: New README explaining how to use mpers support.
        * empty.h: New empty file.
        * generate_mpers_am.sh: New file.
        * mpers.awk: Likewise.
        * mpers.sh: Likewise.
        * mpers_test.sh: Likewise.
        * mpers_type.h: Likewise.
        * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h.
        (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning
        of the file.
        (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a.
        (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh.
        (BUILT_SOURCES, CLEANFILES): Add new generated files:
        native_printer_decls.h, native_printer_defs.h, printers.h,
        [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS]
        $(mpers_mx32_targets).
        (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS,
        mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES,
        libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables.
        (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h,
        %_printer_decls.h, %_printer_defs.h, clean-local,
        native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets):
        New targets.
        * bootstrap: Add generate_mpers_am.sh.
        * configure.ac: Add AC_PROG_RANLIB.
        * m4/mpers.m4: Add HAVE_MPERS variable.  Add $st_cv_mpers checks.
        * defs.h: Include mpers_type.h.
        Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME.
        Redefine SYS_FUNC_NAME.  Define MPERS_PRINTER_DECL.
        [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS,
        PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS
        for X86_64, X32.
        [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS,
        PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS
        for X86_64.
        Add fallback definitions of
        PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS,
        PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS,
        PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS,
        PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS.
        * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS,
        PERSONALITY2_INCLUDE_FUNCS,
        PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS,
        PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS,
        PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS.
        (printers): New struct.  Update it when needed.
        * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h,
        m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32,
        mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h,
        mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h,
        native_printer_decls.h, native_printer_defs.h, and printers.h.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

        tests: convert readlink.test and readlinkat.test from match_awk to match_diff
        * tests/readlink.c (main): Print expected output.
        * tests/readlinkat.c (main): Likewise.
        * tests/readlink.test: Use match_diff instead of match_awk.
        * tests/readlinkat.test: Likewise.
        * tests/readlink.awk: Remove.
        * tests/readlinkat.awk: Likewise.
        * tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk.

        tests: convert getrandom.test from match_awk to match_diff.
        * tests/getrandom.c (main): Print expected output.
        * tests/getrandom.test: Use match_diff instead of match_awk.
        * tests/getrandom.awk: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove getrandom.awk.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: convert select.test from match_awk to match_diff.
        * tests/select.c (main): Print expected output.
        * tests/select.test: Use match_diff instead of match_awk.
        * tests/select.awk: Remove.
        * tests/Makefile.am (EXTRA_DIST): Remove select.awk.

        tests: convert several tests from match_grep to match_diff.
        * tests/sendfile.test: Use match_diff instead of match_grep.
        * tests/sendfile64.test: Likewise.
        * tests/time.test: Likewise.
        * tests/utime.test: Likewise.
        * tests/xet_robust_list.test: Likewise.
        * tests/sendfile.c (main): Update match patterns for match_diff.
        * tests/sendfile64.c (main): Likewise.
        * tests/time.c (main): Likewise.
        * tests/utime.c (main): Likewise.
        * tests/xet_robust_list.c (main): Likewise.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix match_diff usage.
        The first argument of match_diff should be the file with expected
        output, the second argument - the file with actual output.

        * tests/aio.test: Swap match_diff arguments.
        * tests/restart_syscall.test: Likewise.
        * tests/seccomp.test: Likewise.
        * tests/umovestr2.test: Likewise.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

        build: fix -I options.
        * configure.ac (AM_INIT_AUTOMAKE): Add nostdinc.
        * Makefile.am (AM_CPPFLAGS): Append -I$(builddir) and -I$(srcdir).
        * tests/Makefile.am (AM_CPPFLAGS): Likewise.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

        aio: rewrite from libaio.h to linux/aio_abi.h.
        * configure.ac (AC_CHECK_HEADERS): Remove libaio.h.
        * aio.c: Assume that <linux/aio_abi.h> is available,
        include it instead of <libaio.h>.
        [!IOCB_RESFD]: Remove.
        (enum iocb_sub): Remove SUB_POLL.
        (tprint_lio_opcode): Update.
        (print_common_flags): Use IOCB_FLAG_RESFD instead of IOCB_RESFD,
        rename fields of struct iocb.
        (iocb_is_valid, print_iocb_header, print_iocb): New functions.
        (sys_io_submit): Use print_iocb.
        (print_io_event): Fix struct io_event decoding.
        (sys_io_cancel): Use print_iocb_header.
        * strace.spec (BuildRequires): Remove libaio-devel.
        * tests/aio.c (main): Test IOCB_CMD_PREADV, io_cancel,
        and struct io_event decoding.
        * tests/aio.test (syscalls): Add io_cancel.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix multiple personalities support in parser of io_submit syscall.
        Introduce a new helper function to fetch tracee's long integers
        and use it to fix multiple personalities support in io_submit parser.

        * defs.h (umove_long_or_printaddr): New prototype.
        * util.c (umove_long_or_printaddr): New function.
        * aio.c (sys_io_submit): Use it to fetch tracee's pointers.
        * tests/aio.c: New file.
        * tests/aio.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add aio.
        (TESTS): Add aio.test.
        * tests/.gitignore: Add aio.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build on systems that lack O_CLOEXEC definition.
        * tests/epoll_create1.c (main): Check that O_CLOEXEC is defined.
        * tests/eventfd.c (main): Likewise.
        * tests/signalfd.c (main): Likewise.

        tests: fix build on systems that lack AT_FDCWD definition.
        * tests/readlinkat.c: Stop including <fcntl.h>.
        (main): Replace AT_FDCWD with -100.

        Fix printing of io_getevents first argument.
        * aio.c (sys_io_getevents): Print first argument using "%lu" format.

2015-08-26  Mike Frysinger  <vapier@gentoo.org>

        decode extend getsockopt/setsockopt options.
        Currently the code assumes the set of valid options between getsockopt
        and setsockopt are exactly the same and thus maintains one list.  The
        kernel unfortunately does not do this -- it allows for different opts
        between the get and set functions.  See the {g,s}et_opt{min,max} fields
        in the various netfilter subcores.

        To support this, extend the printxval function to take multiple sets of
        xlats as varargs.  Then we add the new get/set lists, and pass them down
        in the net code when decoding things.

        A simple example is iptables; before:
                getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0
                getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0
        after:
                getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0
                getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0

        If these were setsockopt calls, then 0x40 & 0x41 would be
        IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS.

        * configure.ac: Check for netfilter headers.
        * defs.h (printxvals): New prototype.
        (printxval): Change to a define.
        * net.c: Include netfilter headers and new sockopts headers.
        (print_sockopt_fd_level_name): Add a is_getsockopt argument.  Change SOL_IP
        and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more
        xlats down.
        (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true.
        (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false.
        * util.c (printxval): Rename to ...
        (printxvals): ... this.  Rewrite to be varargs based.
        * xlat/getsockipoptions.in: New xlat list.
        * xlat/getsockipv6options.in, xlat/setsockipoptions.in,
        xlat/setsockipv6options.in: Likewise.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems that lack VIDIOC_CREATE_BUFS definition.
        * v4l2.c (v4l2_ioctl): Check that v4l2_ioctl is defined.

        Fix build on systems that lack EM_ARM/EM_OPENRISC definitions.
        * xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB
        with EM_ARM check.  Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check.

2015-08-25  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems that lack UBI_IOCVOLCRBLK/UBI_IOCVOLRMBLK definitions
        * mtd.c (ubi_ioctl): Check that UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK
        are defined.

        Fix build on systems that lack O_CLOEXEC definition.
        * xlat/efd_flags.in: Check that O_CLOEXEC is defined.
        * xlat/epollflags.in: Likewise.
        * xlat/sfd_flags.in: Likewise.
        * xlat/timerfdflags.in: Fix O_CLOEXEC check.

2015-08-21  Elvira Khabirova  <lineprinter0@gmail.com>

        printsiginfo.c: fix integer conversions.
        * printsiginfo.c (printsigsource): Print si_pid and si_uid as unsigned
        integers.
        (printsigval): Print si_int as signed int.

2015-08-20  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of times syscall return value.
        Always print return value of successful times syscall
        as unsigned long integer.

        * times.c (sys_times): Return RVAL_UDECIMAL unless syserror.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

        mq.c: remove repeated code.
        * mq.c (sys_mq_open): Use printmqattr instead of implementing it again.
        [HAVE_MQUEUE_H]: Remove.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

        ipc_msg.c: fix multiple personalities support in msgrcv ipc subcall.
        When msgrcv syscall is an ipc subcall, msgp (pointer to struct msgbuf)
        and msgtyp (message type) syscall arguments are passed via proxy
        structure which definition significantly depends on tracee's
        wordsize.

        * ipc_msg.c (fetch_msgrcv_args): New function.
        (sys_msgrcv): Use it.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

        ipc.c: split into separate files.
        In preparation for upcoming mpers-related changes,
        split ipc.c into independent groups of parsers.

        * ipc_defs.h: New file.
        * ipc_msg.c: Likewise.
        * ipc_msgctl.c: Likewise.
        * ipc_sem.c: Likewise.
        * ipc_shm.c: Likewise.
        * ipc_shmctl.c: Likewise.
        * mq.c: Likewise.
        * print_mq_attr.c: Likewise.
        * print_msgbuf.c: Likewise.
        * ipc.c: Remove.
        (sys_mq_open, sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify,
        sys_mq_getsetattr): Move to mq.c.
        (sys_msgget, tprint_msgsnd, sys_msgsnd, tprint_msgrcv, sys_msgrcv): Move
        to ipc_msg.c.
        (sys_msgctl): Move to ipc_msgctl.c.
        (tprint_sembuf, tprint_sembuf_array, sys_semop, sys_semtimedop,
        sys_semget, syssemctl): Move to ipc_sem.c.
        (sys_shmget, sys_shmat, sys_shmdt): Move to ipc_shm.c.
        (sys_shmctl): Move to ipc_shmctl.c.
        (printmqattr): Move to print_mq_attr.c.
        (tprint_msgbuf): Move to print_msgbuf.c.
        (IPC_64, PRINTCTL): Move to ipc_defs.h.
        * defs.h (struct xlat resource_flags): New prototype.
        * Makefile.am (strace_SOURCES): Remove ipc.c.  Add ipc_defs.h, mq.c,
        ipc_msg.c, ipc_msgctl.c, ipc_sem.c, ipc_shm.c, ipc_shmctl.c,
        print_mq_attr.c, and print_msgbuf.c.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

        .gitignore: add sen.h and sys_func.h.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add sendfile.test and sendfile64.test.
        * tests/sendfile.c: New file.
        * tests/sendfile64.c: New file.
        * tests/sendfile.test: New test.
        * tests/sendfile64.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sendfile and sendfile64.
        (TESTS): Add sendfile.test and sendfile64.test.
        * tests/.gitignore: Add sendfile and sendfile64.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        sendfile: decode file offset both on entering and exiting syscall.
        When sendfile is called with a valid pointer to a file offset variable,
        kernel updates this variable on successfull exit from syscall.

        * sendfile.c (sys_sendfile, sys_sendfile64): Print tcp->u_arg[2]
        on exiting syscall as well as on entering.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        io.c: move sendfile parsers to a separate file.
        * sendfile.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * io.c (sys_sendfile, sys_sendfile64): Move to sendfile.c

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        Make printnum_* functions return boolean status.
        With this change, printnum_* functions return true iff they
        successfully fetched necessary data from tracee's memory.

        * defs.h (printnum_short, printnum_int, printnum_int64,
        printnum_long_int, printpair_int, printpair_int64): Return bool.
        * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        mips: print _MIPS_SIM in configure.ac for debug purposes.
        * configure.ac [MIPS]: Print _MIPS_SIM.

        xtensa: fix several syscall entries.
        * linux/xtensa/syscallent.h: Fix nargs in splice, tee, vmsplice,
        pselect6, ppoll, epoll_pwait, and set_robust_list syscall entries.

        ia64: fix syscall numbers for set_robust_list, get_robust_list, and splice syscalls
        * linux/ia64/syscallent.h: Place syscall entries for set_robust_list,
        get_robust_list, and splice in correct order.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for get_robust_list and set_robust_list decoding.
        * tests/xet_robust_list.c: New file.
        * tests/xet_robust_list.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add xet_robust_list.
        (TESTS): Add xet_robust_list.test.
        * tests/.gitignore: Add xet_robust_list.

        Simplify printing of get_robust_list first argument.
        * get_robust_list.c (sys_get_robust_list): Print first argument
        using "%d" format.

2015-08-18  Elvira Khabirova  <lineprinter0@gmail.com>

        Fix io_setup first argument printing.
        * aio.c (sys_io_setup): Print first argument using "%u" format.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix printing tracee's long integers.
        Replace ambiguous printnum_long that used to fetch native long integers
        from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong
        that fetch tracee's pointer, signed long, and unsigned long integers.

        * defs.h (printnum_long, printpair_long): Remove prototypes.
        (printnum_int64, printpair_int64): Remove macros, declare functions
        unconditionally.
        [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
        New prototype.
        (printnum_ptr, printnum_slong, printnum_ulong): New macros.
        * aio.c (sys_io_setup): Use printnum_ulong.
        * block.c (block_ioctl): Use printnum_slong and printnum_ulong.
        * get_robust_list.c (sys_get_robust_list): Use printnum_ptr
        and printnum_ulong.
        * io.c (print_off_t): Remove.
        (sys_sendfile): Use printnum_ulong.
        * ipc.c (sys_semctl): Use printnum_ptr.
        * prctl.c (sys_prctl): Likewise.
        * process.c (sys_ptrace): Likewise.
        * rtc.c (rtc_ioctl): Use printnum_ulong.
        * util.c (printnum_long, printpair_long): Remove.
        (printnum_int64, printpair_int64): Define unconditionally.
        [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
        New function.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix time syscall decoding for some personalities.
        * time.c (current_time_t_is_int32): Define.
        (sys_time): Use it, printnum_int, and printnum_int64 instead
        of printnum_long.
        * tests/time.c: New file.
        * tests/time.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add time.
        (TESTS): Add time.test.
        * tests/.gitignore: Add time.

2015-08-18  Mike Frysinger  <vapier@gentoo.org>

        signal: SIGSYS: decode si_syscall & si_arch fields.
        When receiving SIGSYS, the si_syscall & si_arch fields are set to known
        values, so make sure we decode their values into the symbol settings.
        This makes stracing seccomp failures much easier.

        * defs.h (syscall_name): New prototype.
        * printsiginfo.c: Include linux/audit.h and xlat/audit_arch.h.
        (print_si_info): Decode si_syscall & si_arch for SIGSYS.
        * syscall.c (undefined_scno_name): Delete.
        (syscall_name): New function.
        (trace_syscall_entering): Change undefined_scno_name to syscall_name.
        (trace_syscall_exiting): Likewise.
        * xlat/audit_arch.in: New file.

2015-08-18  Elvira Khabirova  <lineprinter0@gmail.com>

        ipc.c: remove unnecesarry #ifdef IPC_64.
        * ipc.c (PRINTCTL): Remove #ifdef IPC_64 check as IPC_64 is always
        defined at this point.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

        resource.c: move times parser to a separate file.
        * times.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * resource.c (sys_times): Move to times.c.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

        sysctl.c: remove KERN_JAVA_* defines handling.
        This has been obsoleted by binfmt_misc since Linux 2.1.43.

        * sysctl.c (sys_sysctl): Remove KERN_JAVA_INTERPRETER
        and KERN_JAVA_APPLETVIEWER.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

        sysinfo.c: remove obsolete code.
        struct sysinfo members totalhigh, freehigh and mem_unit are present
        since Linux 2.3.48.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct sysinfo checks.
        * sysinfo.c (sys_sysinfo): Remove HAVE_STRUCT_SYSINFO_* checks.

2015-08-15  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

        tests: add readlink.test and readlinkat.test.
        * tests/readlink.c: New file.
        * tests/readlink.awk: Likewise.
        * tests/readlinkat.c: Likewise.
        * tests/readlinkat.awk: Likewise.
        * tests/readlink.test: New test.
        * tests/readlinkat.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat.
        (TESTS): Add readlink.test and readlinkat.test.
        (EXTRA_DIST): Add readlink.awk and readlinkat.awk.
        * tests/.gitignore: Add readlink and readlinkat.

2015-08-09  Dmitry V. Levin  <ldv@altlinux.org>

        Print nanoseconds along with seconds in stat family syscalls.
        * configure.ac (AC_CHECK_MEMBERS): Add stat.st_atim.tv_nsec,
        stat.st_ctim.tv_nsec, stat.st_mtim.tv_nsec, stat.st_atime_nsec,
        stat.st_atime_csec, and stat.st_mtime_nsec.
        * file.c: Explicitly define HAVE_STRUCT_STAT_ST_ATIME_NSEC,
        HAVE_STRUCT_STAT_ST_CTIME_NSEC and HAVE_STRUCT_STAT_ST_MTIME_NSEC
        for locally defined types.
        * printstat.h (DO_PRINTSTAT): Print st_atime_nsec, st_ctime_nsec,
        and st_mtime_nsec members.
        * tests/stat.c [_FILE_OFFSET_BITS == 64]: Use st_atime_nsec,
        st_ctime_nsec, and st_mtime_nsec via st_atim.tv_nsec, st_ctim.tv_nsec,
        and st_mtim.tv_nsec.
        (main): Print st_atime_nsec, st_ctime_nsec, and st_mtime_nsec members.

        This fixes Fedora bug #1251176.

2015-08-03  Dmitry V. Levin  <ldv@altlinux.org>

        signalfd4: fix flags decoding.
        * configure.ac (AC_CHECK_FUNCS): Add eventfd.
        (AC_CHECK_HEADERS): Add sys/signalfd.h.
        * signalfd.c: Include <fcntl.h>.
        [HAVE_SYS_SIGNALFD_H] Include <sys/signalfd.h>.
        Include "xlat/sfd_flags.h".
        (do_signalfd): Use sfd_flags for flags decoding.
        * xlat/sfd_flags.in: New file.
        * tests/signalfd.c: Likewise.
        * tests/signalfd.expected: Likewise.
        * tests/signalfd.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add signalfd.
        (TESTS): Add signalfd.test.
        (EXTRA_DIST): Add signalfd.expected.
        * tests/.gitignore: Add signalfd.

        signalfd, signalfd4: mark return code with RVAL_FD flag.
        * signalfd.c (do_signalfd): Set RVAL_FD flag in the return code.

        signal.c: move signalfd parsers to a separate file.
        * signalfd.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c

        perf_event_open: mark return code with RVAL_FD flag.
        * perf.c (sys_perf_event_open): Set RVAL_FD flag in the return code.

        pipe, pipe2, socketpair: print returned descriptors using printfd.
        * net.c (printpair_fd, decode_pair_fd): New functions.
        (do_pipe, sys_socketpair): Use them.

        socket: mark return code with RVAL_FD flag.
        * net.c (sys_socket): Set RVAL_FD flag in the return code.
        * tests/net-yy-accept.awk: Update socket and bind regexps.
        * tests/unix-yy-accept.awk: Likewise.
        * tests/net-yy-connect.awk: Update socket and connect regexps.
        * tests/unix-yy-connect.awk: Likewise.

        timerfd, timerfd_create: mark return code with RVAL_FD flag.
        * time.c (sys_timerfd, sys_timerfd_create): Set RVAL_FD flag
        in the return code.

2015-08-02  Dmitry V. Levin  <ldv@altlinux.org>

        inotify_init1: mark return code with RVAL_FD flag.
        * inotify.c (sys_inotify_init1): Set RVAL_FD flag in the return code.

        fanotify_init: mark return code with RVAL_FD flag.
        * fanotify.c (sys_fanotify_init): Set RVAL_FD flag in the return code.

        Fix epoll_create syscall decoding.
        * epoll.c (sys_epoll_create): New function.
        * linux/dummy.h (sys_epoll_create): Remove.

        epoll_create1: mark return code with RVAL_FD flag.
        * epoll.c (sys_epoll_create1): Set RVAL_FD flag in the return code.

        epoll_create1: fix pathtrace support.
        * pathtrace.c (pathtrace_match): Add SEN_epoll_create1.

        epoll_create1: fix flags decoding.
        * xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition
        for EPOLL_CLOEXEC.
        * tests/epoll_create1.c: New file.
        * tests/epoll_create1.expected: Likewise.
        * tests/epoll_create1.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add epoll_create1.
        (TESTS): Add epoll_create1.test.
        (EXTRA_DIST): Add epoll_create1.expected.
        * tests/.gitignore: Add epoll_create1.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        desc.c: move epoll parsers to a separate file.
        * epoll.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * desc.c (sys_epoll_create1, print_epoll_event, sys_epoll_ctl,
        print_epoll_event_array, epoll_wait_common, epoll_wait, epoll_pwait):
        Move to epoll.c.

        eventfd2: fix flags decoding.
        * configure.ac (AC_CHECK_HEADERS): Add sys/eventfd.h.
        * eventfd.c: Include <fcntl.h>.
        [HAVE_SYS_EVENTFD_H] Include <sys/eventfd.h>.
        Include "xlat/efd_flags.h".
        (do_eventfd): Use efd_flags for flags decoding.
        * xlat/efd_flags.in: New file.
        * tests/eventfd.c: New file.
        * tests/eventfd.expected: Likewise.
        * tests/eventfd.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add eventfd.
        (TESTS): Add eventfd.test.
        (EXTRA_DIST): Add eventfd.expected.
        * tests/.gitignore: Add eventfd.

        eventfd: print first argument as unsigned int.
        * eventfd.c (do_eventfd): Explicitly cast initial value to unsigned int.

        Mark eventfd return code with RVAL_FD flag.
        * eventfd.c (do_eventfd): Set RVAL_FD flag in the return code.

        desc.c: move eventfd parsers to a separate file.
        * eventfd.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c.

        Update PERF_FLAG_* constants.
        * xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC,
        provide fallback definitions.

        desc.c: move perf_event_open parser to a separate file.
        * perf.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * desc.c (sys_perf_event_open): Move to perf.c.

2015-08-01  Elvira Khabirova  <lineprinter0@gmail.com>

        time.c: remove obsolete code from adjtimex parser.
        Linux versions 1.3.28 and below are not supported.

        * time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove.

2015-08-01  Elvira Khabirova  <lineprinter0@gmail.com>

        ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/
        * ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in.
        Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in.
        Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests/ppoll: replace SIGABRT with SIGHUP.
        Use SIGHUP instead of SIGABRT, the number of the former
        is more portable across architectures.

        * tests/ppoll.c (test2): Replace SIGABRT with SIGHUP.
        * tests/ppoll.expected: Update regexp.
        * tests/ppoll-v.expected: Likewise.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

        decode_poll_exiting: reserve more space in output buffer.
        * poll.c (decode_poll_exiting): Reserve more space in output buffer.

2015-07-30  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup poll/ppoll decoders.
        * poll.c (decode_poll): Split into print_pollfd, decode_poll_entering,
        and decode_poll_exiting.
        (sys_poll, sys_ppoll): Update callers.
        * tests/ppoll.c: New file.
        * tests/ppoll.expected: Likewise.
        * tests/ppoll-v.expected: Likewise.
        * tests/ppoll.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add ppoll.
        (TESTS): Add ppoll.test.
        (EXTRA_DIST): Add ppoll.expected and ppoll-v.expected.
        * tests/.gitignore: Add ppoll.

        poll: print timeout argument as int.
        * poll.c (sys_poll): Explicitly cast timeout argument to int.

        stream.c: move poll and ppoll parsers to a separate file.
        * poll.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c.

        Assume that <poll.h> is available.
        * configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h.
        * pathtrace.c: Include <poll.h> unconditionally.
        * stream.c: Likewise.
        [HAVE_SYS_POLL_H]: Compile unconditionally.
        [!HAVE_SYS_POLL_H]: Remove.

        tests: add oldselect.test.
        * tests/oldselect.c: New file.
        * tests/oldselect.expected: Likewise.
        * tests/oldselect.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add oldselect.
        (TESTS): Add oldselect.test.
        (EXTRA_DIST): Add oldselect.expected.
        * tests/.gitignore: Add oldselect.

2015-07-30  Elvira Khabirova  <lineprinter0@gmail.com>

        Fix oldselect decoding on 64-bit architectures.
        As struct sel_arg_struct is an array of 32-bit values,
        fetch it using an intermediate array on 64-bit architectures.

        * desc.c (sys_oldselect): Rename args to long_args.
        [SIZEOF_LONG == 4] Alias oldselect_args to long_args.
        [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args.
        * linux/sh64/syscallent.h (oldselect): Remove.

2015-07-30  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: use printaddr.
        * net.c (printsock, sys_recvfrom): Use printaddr.

2015-07-30  Denys Vlasenko  <dvlasenk@redhat.com>

        net.c: recvfrom fixes.
        This change fixes these three problems (before/after is shown):

        On interrupted syscall, flags are not decoded:

            -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS
            +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS

        If peer address is unavalable (example: anon sockets from socketpair()),
        kernel returns socklen of 0, but we ignore that and show bogus sockaddr data:

            -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10
            +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10

        SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock():

            -               printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
            +               printsock(tcp, tcp->u_arg[4], fromlen);

2015-07-29  Elliott Hughes  <enh@google.com>

        prctl: decode Android-specific PR_SET_VMA.
        Android kernels have a prctl to name VMAs.

        * prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA.

2015-07-29  Dmitry V. Levin  <ldv@altlinux.org>

        mips: fix stub files.
        This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

        * linux/mips/genstub.sh: Output SEN(printargs) instead of printargs.

        Reported-by: Elliott Hughes <enh@google.com>

2015-07-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc.
        * configure.ac: Check how union bpf_attr.log_buf initialization works.
        * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF.

        Implement sched_getattr and sched_setattr syscalls decoding.
        * xlat/sched_flags.in: New file.
        * sched.c: Include "xlat/sched_flags.h".
        (print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions.
        * linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove.
        * tests/sched_xetattr.c: New file.
        * tests/sched_xetattr.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sched_xetattr.
        (TESTS): Add sched_xetattr.test.
        * tests/.gitignore: Add sched_xetattr.

        Implement memfd_create syscall decoding.
        * memfd_create.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_memfd_create): Remove.
        * pathtrace.c (pathtrace_match): Add SEN_memfd_create.
        * xlat/memfd_create_flags.in: New file.
        * tests/memfd_create.c: New file.
        * tests/memfd_create.expected: Likewise.
        * tests/memfd_create.test: New test.
        * tests/Makefile.am: (check_PROGRAMS): Add memfd_create.
        (TESTS): Add memfd_create.test.
        (EXTRA_DIST): Add memfd_create.expected.
        * tests/.gitignore: Add memfd_create.

2015-07-28  Elliott Hughes  <enh@google.com>

        Fix builds where HAVE_MQUEUE_H isn't defined.
        Android doesn't have <mqueue.h>.

        * ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation.

2015-07-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests/restart_syscall: skip if nanosleep looks uninterrupted.
        * tests/restart_syscall.test: Skip if restart_syscall is not detected
        and nanosleep syscall looks uninterrupted.

        Implement execveat syscall decoding.
        * execve.c (decode_execve): New function.
        (sys_execve): Use it.
        (sys_execveat): New function.
        * linux/dummy.h (sys_execveat): Remove.
        * tests/execveat.c: New file.
        * tests/execveat.expected: Likewise.
        * tests/execveat-v.expected: Likewise.
        * tests/execveat.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add execveat.
        (TESTS): Add execveat.test.
        (EXTRA_DIST): Add execveat.expected and execveat-v.expected.
        * tests/.gitignore: Add execveat.

        execve: fix support of personalities with different word size.
        * execve.c (printargc): Do not assume that host and target pointers have
        the same size.
        * tests/execve.c: New file.
        * tests/execve.expected: Likewise.
        * tests/execve-v.expected: Likewise.
        * tests/execve.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add execve.
        (TESTS): Add execve.test.
        (EXTRA_DIST): Add execve.expected and execve-v.expected.
        * tests/.gitignore: Add execve.

        Implement bpf syscall decoding.
        * bpf.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h.
        * linux/dummy.h (sys_bpf): Remove.
        * pathtrace.c (pathtrace_match): Add SEN_bpf.
        * xlat/bpf_commands.in: New file.
        * xlat/bpf_map_types.in: New file.
        * xlat/bpf_map_update_elem_flags.in: New file.
        * xlat/bpf_prog_types.in: New file.
        * tests/bpf.c: New file.
        * tests/bpf.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add bpf.
        (TESTS): Add bpf.test.
        * tests/.gitignore: Add bpf.

2015-07-25  Dmitry V. Levin  <ldv@altlinux.org>

        prctl: fix decoding of unrecognized commands.
        The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong:
        when the first argument is already printed, printargs cannot be called.

        * prctl.c (print_prctl_args): New function.
        (sys_prctl): Use it.

2015-07-23  Dmitry V. Levin  <ldv@altlinux.org>

        Macroize -m32/-mx32 configure checks.
        Prepare for additional configure checks that would be needed
        for new multiple personalities support.

        * m4/mpers.m4: New file.
        * configure.ac: Use it.

2015-07-22  Dmitry V. Levin  <ldv@altlinux.org>

        tests/uid: import uid overflow check from tests/uid16.
        * tests/uid.c (main): Skip if the uid returned by getuid matches
        /proc/sys/kernel/overflowuid.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        sh64: fix inotify_{add,rm}_watch syscall entries.
        * linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch):
        Set sys_func.

        microblaze: fix several syscall entries.
        * linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1,
        dup3, pipe2, inotify_init1, recvmmsg): Set sys_func.

        hppa: fix several syscall entries.
        * linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink,
        mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr,
        clock_nanosleep, signalfd, timerfd): Set sys_func.

        ia64: fix getpagesize syscall entry.
        * linux/ia64/syscallent.h (getpagesize): Fux nargs.

        avr32: fix fstatat64 syscall entry.
        * linux/avr32/syscallent.h (fstatat64): Set sys_func.

        alpha: fix 2 dummy osf syscall entries.
        * linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs.
        (osf_sigstack): Fix nargs and sys_name.

        alpha, arm, ia64, mips, sh64: fix semop syscall entries.
        * linux/alpha/syscallent.h (semop): Fix nargs, set sys_func.
        * linux/ia64/syscallent.h (semop): Set sys_func.
        * linux/mips/syscallent-n32.h (semop): Likewise.
        * linux/mips/syscallent-n64.h (semop): Likewise.
        * linux/arm/syscallent.h (semop): Fix nargs.
        * linux/sh64/syscallent.h (semop): Likewise.

        m68k: fix getpagesize decoding.
        * linux/m68k/syscallent.h (getpagesize): Set sys_func.
        * mem.c [M68K] (sys_getpagesize): Define.

        tests/ip_mreq: skip if basic setsockopt operations fail.
        * tests/ip_mreq.c (main): Return 77 if basic
        IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: use -lpthread instead of -pthread.
        On some obscure systems, -lpthread is more likely to work than -pthread.

        * tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to
        filter_unavailable_LDADD and change to -lpthread.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: fix utimensat syscall entry.
        * linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        linux/mips/syscallent-compat.h: use designated initializers.
        Change linux/mips/syscallent-compat.h to use designated initializers
        like normal syscallent.h files.

        * linux/mips/syscallent-compat.h: Use designated initializers.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

        linux/mips/syscallent-compat.h: fix initalization of empty entries.
        This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

        * linux/mips/syscallent-compat.h: Fix initalization of empty entries.

2015-07-20  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused parsers of getmsg and putmsg.
        * stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove.
        Stop including "xlat/msgflags.h".
        * xlat/msgflags.in: Remove.

        sigreturn: make use of RVAL_DECODED.
        * sigreturn.c (arch_sigreturn): New function.
        (sys_sigreturn): Use it.  Return RVAL_DECODED.
        * linux/alpha/arch_sigreturn.c: Update.
        * linux/crisv10/arch_sigreturn.c: Likewise.
        * linux/m68k/arch_sigreturn.c: Likewise.
        * linux/microblaze/arch_sigreturn.c: Likewise.
        * linux/x86_64/arch_sigreturn.c: Likewise.

        or1k_atomic.c: make use of RVAL_DECODED.
        * or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED.

        Update openat parser for the RVAL_DECODED change.
        * open.c (sys_openat): Update for RVAL_DECODED.

        bjm.c: make use of RVAL_DECODED.
        * bjm.c (sys_create_module, sys_delete_module, sys_init_module,
        sys_finit_module): Update for RVAL_DECODED.

        access.c: make use of RVAL_DECODED.
        * access.c (decode_access, sys_faccessat): Update for RVAL_DECODED.

        affinity.c: make use of RVAL_DECODED.
        * affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED.

        affinity.c: use printaddr and umove_or_printaddr.
        * affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr.
        (sys_sched_getaffinity): Remove redundant u_rval check.

        aio.c: enhance io_* syscalls decoding.
        * aio.c (sys_io_setup): Use printnum_int64 and printnum_long.
        (sys_io_destroy, sys_io_submit): Update for RVAL_DECODED.
        (sys_io_submit): Use umove_or_printaddr and printaddr.
        Enclose iocb array in square brackets.
        Change to traditional structure output format.
        (print_io_event): New function.
        (sys_io_cancel, sys_io_getevents): Use it.
        (sys_io_cancel): Use umove_or_printaddr and printaddr.
        (sys_io_getevents): Use printaddr.

        cacheflush.c: make use of RVAL_DECODED.
        * cacheflush.c (sys_cacheflush): Update for RVAL_DECODED.

        cacheflush.c: use printaddr.
        * cacheflush.c (sys_cacheflush): Use printaddr.

        capability.c: make use of RVAL_DECODED.
        * capability.c (sys_capset): Update for RVAL_DECODED.

        capability.c: use printaddr and umove_or_printaddr.
        * capability.c (get_cap_header): Use printaddr.
        (print_cap_data): Use printaddr and umove_or_printaddr.

        chdir.c: make use of RVAL_DECODED.
        * chdir.c (sys_chdir): Update for RVAL_DECODED.

        chmod.c: make use of RVAL_DECODED.
        * chmod.c (decode_chmod): Change to return void.
        (sys_chmod, sys_fchmodat): Update callers.  Update for RVAL_DECODED.
        (sys_fchmod): Update for RVAL_DECODED.

        clone.c: make use of RVAL_DECODED.
        * clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED.

        Alias sys_epoll_create to printargs_ld.
        * desc.c (sys_epoll_create): Remove.
        * linux/dummy.h (sys_epoll_create): Alias to printargs_ld.

        desc.c: make use of RVAL_DECODED.
        * desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1,
        sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update
        for RVAL_DECODED.

        desc.c: do not use xmalloc, use umove_or_printaddr and printaddr.
        * desc.c (printflock64, printflock): Use umove_or_printaddr.
        (decode_select): Do not use xmalloc.  Use umoven_or_printaddr
        and printaddr.
        (sys_oldselect): Use printaddr.
        (sys_epoll_ctl): Use umoven_or_printaddr and printaddr.
        (print_epoll_event_array): New function.
        (sys_epoll_wait_common): Use it.
        (sys_pselect6): Use umove_or_printaddr.
        (sys_eventfd2): Use printaddr.

        xlat/epollctls.in: add default values.
        * xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add
        default values.

        dirent.c: do not use xmalloc.
        * dirent.c (print_old_dirent): Use umove_or_printaddr.
        (sys_readdir): Use printaddr.
        (sys_getdents, sys_getdents64): Do not use xmalloc for dirents,
        treat malloc failure the same way as umoven failure.  Use printaddr.

        execve.c: make use of RVAL_DECODED.
        * execve.c (sys_execve, sys_execv): Update for RVAL_DECODED.

        execve.c: use printaddr and umove_or_printaddr.
        * execve.c (printargv): Use umoven_or_printaddr.
        (sys_execve, sys_execv): Use printaddr.

        fadvise.c: make use of RVAL_DECODED.
        * fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED.

        fallocate.c: make use of RVAL_DECODED.
        * fallocate.c (sys_fallocate): Update for RVAL_DECODED.

        fanotify.c: make use of RVAL_DECODED.
        * fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update
        for RVAL_DECODED.

        fchownat.c: make use of RVAL_DECODED.
        * fchownat.c (sys_fchownat): Update for RVAL_DECODED.

        file.c: use umove_or_printaddr.
        * file.c (printstat32, printstatsol): Remove.
        (printstat, printstat64, printoldstat): Use umove_or_printaddr.

        futex.c: enhance futex syscall decoding.
        * futex.c (sys_futex): Use switch statement.  Use printaddr.
        Print uint32_t syscall arguments using %u format.
        Update for RVAL_DECODED.

        get_robust_list.c: use printnum_long.
        * get_robust_list.c (sys_get_robust_list): Use printnum_long.

        getcpu.c: use printnum_int and printaddr.
        * getcpu.c (sys_getcpu): Use printnum_int and printaddr.

        getcwd.c: use printaddr.
        * getcwd.c (sys_getcwd): Use printaddr.

        getrandom.c: use printaddr.
        * getrandom.c (sys_getrandom): Use printaddr.

        hostname.c: make use of RVAL_DECODED.
        * hostname.c (sys_sethostname): Update for RVAL_DECODED.

        hostname.c: use printaddr.
        * hostname.c (sys_gethostname): Use printaddr.

        inotify.c: make use of RVAL_DECODED.
        * inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch,
        sys_inotify_init1): Update for RVAL_DECODED.

        io.c: make use of RVAL_DECODED.
        * io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile,
        sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update
        for RVAL_DECODED.

        Use printnum_int64 instead of print_loff_t.
        * defs.h (print_loff_t): Remove.
        * io.c (print_loff_t): Remove.
        (sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t.
        * mtd.c (mtd_ioctl): Likewise.

        io.c: use printaddr and umove_or_printaddr.
        * io.c (sys_read, sys_pread): Use printaddr.
        (tprint_iov_upto): Do not fetch data in case of syserror.
        Use printaddr.
        (sys_readv, sys_preadv): Remove redundant check for syserror.
        (print_off_t): Use printnum_int and printnum_long.
        (print_loff_t): Use umove_or_printaddr.

        ioprio.c: make use of RVAL_DECODED.
        * ioprio.c (sys_ioprio_set): Update for RVAL_DECODED.

        ipc.c: use printaddr and umove_or_printaddr.
        * ipc.c (sys_msgctl): Use printaddr.
        (tprint_msgbuf): New function.
        (tprint_msgsnd, tprint_msgrcv): Use it.
        (sys_msgrcv): Use umove_or_printaddr.
        (tprint_sembuf): Rename to tprint_sembuf_array.
        (tprint_sembuf): New function.
        (tprint_sembuf_array): Use it.
        (sys_semop, sys_semtimedop): Update callers.
        (sys_shmctl, sys_shmat, sys_shmdt): Use printaddr.
        (sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr.
        * tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp.
        * tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp.

        kexec.c: use printaddr and umove_or_printaddr.
        * kexec.c (print_seg): New function.
        (print_kexec_segments): Use it.  Use printaddr and umove_or_printaddr.
        (kexec_load): Use printaddr.  Update for RVAL_DECODED.

        keyctl.c: make use of RVAL_DECODED.
        * keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
        (keyctl_join_session_keyring, keyctl_handle_key,
        keyctl_set_reqkey_keyring): Remove.
        (keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
        keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
        keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
        keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
        keyctl_setperm_key): Change to return void.
        Update for RVAL_DECODED.
        (sys_keyctl): Update callers.  Update for RVAL_DECODED.

        keyctl.c: use printaddr.
        * keyctl.c (keyctl_read_key): Use printaddr.

        ldt.c: make use of RVAL_DECODED.
        * ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area):
        Update for RVAL_DECODED.

        ldt.c: use printaddr and umove_or_printaddr.
        * ldt.c [I386 || X86_64 || X32] (print_user_desc):
        Use umove_or_printaddr.
        [I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr.
        [(M68K || MIPS] (set_thread_area): Likewise.
        [I386 || X86_64 || X32] (set_thread_area): Do not fetch data
        if !verbose.
        [I386 || X86_64 || X32] (get_thread_area): Remove redundant check
        for syserror.

        link.c: make use of RVAL_DECODED.
        * link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update
        for RVAL_DECODED.

        lseek.c: make use of RVAL_DECODED.
        * lseek.c (sys_lseek): Update for RVAL_DECODED.

        lseek.c: use printnum_int64.
        * lseek.c (sys_llseek): Use printnum_int64.

        mem.c: make use of RVAL_DECODED.
        * mem.c (print_mmap): Change to return void.
        Update for RVAL_DECODED.
        (sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff,
        sys_mmap_4koff): Update callers.  Update for RVAL_DECODED.
        (sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise,
        sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind,
        sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot):
        Update for RVAL_DECODED.

        mem.c: use printaddr and umove_or_printaddr.
        * mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap,
        sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes,
        sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr.
        (sys_get_mempolicy): Use printaddr and umove_or_printaddr.

        mknod.c: make use of RVAL_DECODED.
        * mknod.c (decode_mknod): Change to return void.
        Update for RVAL_DECODED.
        (sys_mknod, sys_mknodat): Update callers.  Update for RVAL_DECODED.
        [SPARC || SPARC64] (xmknod): Update for RVAL_DECODED.

        mount.c: make use of RVAL_DECODED.
        * mount.c (sys_mount): Update for RVAL_DECODED.

        mount.c: use printaddr.
        * mount.c (sys_mount): Use printaddr.

        Alias sys_connect to sys_bind.
        * linux/dummy.h (sys_connect): Alias to sys_bind.
        * net.c (sys_connect): Remove.

        net.c: make use of RVAL_DECODED.
        * net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto,
        sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED.

        net.c: use printaddr and umove_or_printaddr.
        * net.c (printsock): Use printaddr and umove_or_printaddr.
        (printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname,
        sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred,
        print_tpacket_stats, print_icmp_filter, print_getsockopt,
        print_group_req, print_tpacket_req, print_packet_mreq,
        print_setsockopt): Use printaddr.
        (print_mreq, print_mreq6): Use umove_or_printaddr.

2015-07-18  Elvira Khabirova  <lineprinter0@gmail.com>

        tests: add sigaltstack.test.
        * tests/sigaltstack.c: New file.
        * tests/sigaltstack.expected: Likewise.
        * tests/sigaltstack.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sigaltstack.
        (TESTS): Add sigaltstack.test.
        (EXTRA_DIST): sigaltstack.expected.
        * tests/.gitignore: Add sigaltstack.

        bootstrap: delete personality test directories beforehand.
        * bootstrap: Delete tests-m32 and tests-mx32 directories
        before creating them.

2015-07-18  Dmitry V. Levin  <ldv@altlinux.org>

        defs.h: do not include <signal.h>
        * printsiginfo.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h: Do not include <signal.h>.
        (printsiginfo): Remove.
        * printsiginfo.c: Include <signal.h> and "printsiginfo.h".
        * strace.c: Likewise.
        * sigaltstack.c: Include <signal.h>.
        * signal.c: Likewise.
        * sigreturn.c: Likewise.
        * time.c: Likewise.

        resource.c: move printrusage and printrusage32 to a separate file.
        * printrusage.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * resource.c (printrusage, [ALPHA] printrusage32): Move
        to printrusage.c.

        open.c: make use of RVAL_DECODED.
        * open.c (decode_open, sys_creat): Update for RVAL_DECODED.

        personality.c: make use of RVAL_DECODED.
        * personality.c (sys_personality): Update for RVAL_DECODED.

        printsiginfo.c: use umove_or_printaddr.
        * printsiginfo.c (printsiginfo_at): Use umove_or_printaddr.

        prctl.c: make use of RVAL_DECODED.
        * prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl.
        (sys_prctl, sys_arch_prctl): Update for RVAL_DECODED.

        prctl.c: use printaddr and umove_or_printaddr.
        * prctl.c (prctl_exit): Use printaddr and umove_or_printaddr.

        process.c: use printaddr.
        * process.c (sys_ptrace): Use printaddr.

        process_vm.c: make use of RVAL_DECODED.
        * process_vm.c (sys_process_vm_writev): Update for RVAL_DECODED.

        process_vm.c: use printaddr.
        * process_vm.c (sys_process_vm_readv): Use printaddr.

        reboot.c: make use of RVAL_DECODED.
        * reboot.c (sys_reboot): Update for RVAL_DECODED.

        Enhance quotactl decoding.
        * quota.c (decode_cmd_data): Use umove_or_printaddr.
        (sys_quotactl): Do not disable the parser in verbose mode.
        Decode all "set" commands on entering syscall.

        readahead.c: make use of RVAL_DECODED.
        * readahead.c (sys_readahead.c): Update for RVAL_DECODED.

        readlink.c: use printaddr.
        * readlink.c (decode_readlink): Use printaddr.

        renameat.c: make use of RVAL_DECODED.
        * renameat.c (sys_renameat, sys_renameat2): Update for RVAL_DECODED.

        resource.c: make use of RVAL_DECODED.
        * resource.c (sys_setrlimit, sys_getpriority, sys_setpriority):
        Update for RVAL_DECODED.

        resource.c: use umove_or_printaddr.
        * resource.c (print_rlimit64, print_rlimit32, printrusage32,
        printrusage, sys_times): Use umove_or_printaddr.
        (decode_rlimit64): Remove.
        (decode_rlimit): Remove redundant checks.
        [defined(current_wordsize) && current_wordsize != 4] (decode_rlimit):
        Define to print_rlimit64.
        (sys_prlimit64): Replace decode_rlimit64 with print_rlimit64.

        sched.c: make use of RVAL_DECODED.
        * sched.c (sys_sched_setscheduler, sys_sched_setparam,
        sys_sched_get_priority_min): Update for RVAL_DECODED.

        sched.c: use printnum_int and printaddr.
        * sched.c (sys_sched_setscheduler, sys_sched_getparam,
        sys_sched_setparam): Use printnum_int for sched_param decoding.
        (sched_rr_get_interval): Use printaddr.

        scsi.c: use printaddr.
        * scsi.c (print_sg_io_buffer): Use printaddr.

2015-07-17  Dmitry V. Levin  <ldv@altlinux.org>

        seccomp.c: make use of RVAL_DECODED.
        * seccomp.c (sys_seccomp): Update for RVAL_DECODED.

        seccomp.c: use printaddr and umove_or_printaddr.
        * seccomp.c (decode_fprog, decode_seccomp_set_mode_strict):
        Use printaddr.
        (print_seccomp_filter): Use umove_or_printaddr.

        sigaltstack.c: use printaddr and umove_or_printaddr.
        * sigaltstack.c (print_stack_t): Use umove_or_printaddr and printaddr.

        signal.c: make use of RVAL_DECODED.
        * signal.c (sys_sigsuspend, sys_kill, sys_tgkill, sys_rt_sigsuspend,
        sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, sys_restart_syscall,
        do_signalfd): Update for RVAL_DECODED.

        signal.c: use printaddr and umove_or_printaddr.
        * signal.c (print_sigset_addr_len, decode_old_sigaction):
        Use printaddr and umove_or_printaddr.
        (sys_signal): Use printaddr.
        (sys_sigprocmask, sys_sigpending, sys_rt_sigprocmask,
        sys_rt_sigpending): Remove redundant checks for syserror.
        (decode_new_sigaction): Use umove_or_printaddr.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        sram_alloc.c: make use of RVAL_DECODED.
        * sram_alloc.c [BFIN] (sys_sram_alloc): Update for RVAL_DECODED.

        statfs.c: use umove_or_printaddr.
        * statfs.c (printstatfs, printstatfs64, printcompat_statfs64):
        Use umove_or_printaddr.

        swapon.c: make use of RVAL_DECODED.
        * swapon.c (sys_swapon): Update for RVAL_DECODED.

        swapon.c: move fallback definitions of swap options to xlat/
        * swapon.c: Move definitions of SWAP_FLAG_* flags ...
        * xlat/swap_flags.in: ... here.

        sync_file_range2: fix typo in flags decoding.
        * sync_file_range.c (sys_sync_file_range2): Fix typo in flags decoding.

        sync_file_range.c: make use of RVAL_DECODED.
        * sync_file_range.c (sys_sync_file_range, sys_sync_file_range2): Update
        for RVAL_DECODED.

        syslog.c: use umove_or_printaddr and RVAL_DECODED.
        * sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED.

        sysinfo.c: use umove_or_printaddr.
        * sysinfo.c (sys_sysinfo): Use umove_or_printaddr.

        syslog.c: make use of RVAL_DECODED.
        * syslog.c (sys_syslog): Update for RVAL_DECODED.

        syslog.c: use printaddr.
        * syslog.c (sys_syslog): Use printaddr.

        sysmips.c: cleanup.
        * sysmips.c [MIPS] (sys_sysmips): Use switch statement.  Use printaddr.
        Fix misprinted ", " delimiter.

        sysmips.c: make use of RVAL_DECODED.
        * sysmips.c [MIPS] (sys_sysmips): Update for RVAL_DECODED.

        time.c: make use of RVAL_DECODED.
        * time.c (sys_settimeofday, sys_osf_settimeofday, sys_clock_settime,
        sys_timerfd, sys_timerfd_create, sys_timerfd_settime): Update
        for RVAL_DECODED.
        (timerfd_gettime): Decode struct itimerspec argument on exiting syscall.

        time.c: use printaddr, printnum_int, and umoven_or_printaddr.
        * time.c (sys_nanosleep): Use printaddr.
        (printitv_bitness, tprint_timex32, tprint_timex, printsigevent32,
        printsigevent): Use umoven_or_printaddr.
        (sys_timer_create): Use printnum_int.
        (sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer,
        do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove
        redundant checks for syserror.

        sprinttv: do not fetch data in case of syserror.
        * time.c (sprinttv): Do not fetch data in case syserror.
        Print address instead of {...} in case of umove failure.
        (sys_gettimeofday, sys_osf_gettimeofday, sys_adjtime, sys_clock_gettime,
        clock_nanosleep): Remove now redundant checks for syserror.

        truncate.c: make use of RVAL_DECODED.
        * truncate.c (sys_truncate, sys_truncate64, sys_ftruncate,
        sys_ftruncate64): Update for RVAL_DECODED.

        umask.c: make use of RVAL_DECODED.
        * umask.c (sys_umask): Update for RVAL_DECODED.

        umount.c: make use of RVAL_DECODED.
        * umount.c (sys_umount2): Update for RVAL_DECODED.

        utimes.c: make use of RVAL_DECODED.
        * utimes.c (decode_utimes): Change to return void.
        Update for RVAL_DECODED.
        (sys_utimes, sys_futimesat, sys_utimensat, sys_osf_utimes):
        Update callers.  Update for RVAL_DECODED.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests/uid.test: adopt for alpha.
        Make the test work on alpha that has getxuid syscall instead of getuid.

        * tests/uid.awk (BEGIN): Update getuid regexp to match both getuid
        and getxuid syscalls.
        * tests/uid.c (main): Allow __NR_getxuid as an alternative
        to __NR_getuid.
        * tests/uid.test: If getuid syscall is not available, probe for
        getxuid syscall.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

        uid.c: make use of RVAL_DECODED.
        * uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown,
        sys_setgroups): Update for RVAL_DECODED.

        uid.c: use printaddr and umoven_or_printaddr.
        * uid.c (get_print_uid): Use umoven_or_printaddr.
        (sys_getresuid): Do not check for syserror, get_print_uid now does
        the right thing.
        (sys_setgroups, sys_getgroups): Add const qualifier to local variables
        that are assigned once.  Use printaddr.

        ia64: wire up utimensat syscall.
        * linux/ia64/syscallent.h (utimensat): New entry.

        decode_utimes: enclose timespec array in square brackets.
        * utimes.c (decode_utimes): enclose timespec array in square brackets
        instead of curly brackets.

        uname.c: use umove_or_printaddr.
        * uname.c (sys_uname): Use umove_or_printaddr.

        tests: add utime.test.
        * tests/utime.c: New file.
        * tests/utime.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add utime.
        (TESTS): Add utime.test.
        * tests/.gitignore: Add utime.

        utime.c: make use of RVAL_DECODED.
        * utime.c (sys_utime): Update for RVAL_DECODED.

        utime.c: use umoven_or_printaddr.
        * utime.c (sys_utime): Use umoven_or_printaddr.

2015-07-15  Dmitry V. Levin  <ldv@altlinux.org>

        wait.c: use printaddr and umove_or_printaddr.
        * wait.c (waitid): Do not check for NULL the address passed
        to printrusage.
        (printwaitn): Likewise.
        Use printaddr and umove_or_printaddr for fetching wait status.

        wait: move fallback definitions of wait options to xlat/
        * wait.c: Move definitions of __W* flags ...
        * xlat/wait4_options.in: ... here.

        tests: add xattr.test.
        * tests/xattr.c: New file.
        * tests/xattr.expected: Likewise.
        * tests/xattr.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add xattr.
        (TESTS): Add xattr.test.
        (EXTRA_DIST): Add xattr.expected.
        * tests/.gitignore: Add xattr.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

        xattr.c: make use of RVAL_DECODED.
        * xattr.c (sys_setxattr, sys_fsetxattr, sys_removexattr,
        sys_fremovexattr): Update for RVAL_DECODED.

        print_xattr_val: do not fetch data in case of !verbose || syserror.
        * xattr.c (print_xattr_val): Do not fetch data in case
        of !verbose || syserror.   Use printaddr.

        print_xattr_list: use printaddr.
        * xattr.c (print_xattr_list): Use printaddr.

        print_xattr_val: remove unused argument.
        * xattr.c (print_xattr_val): Remove unused "failed" argument.
        (sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Update
        all callers.

        print_xattr_list: remove redundant address check.
        * xattr.c (print_xattr_list): Do not check for NULL the address passed
        to printstr.

        ipc.c: make use of RVAL_DECODED.
        * ipc.c (sys_mq_notify, sys_mq_open, sys_mq_timedreceive,
        sys_mq_timedsend, sys_msgctl, sys_msgget, sys_msgsnd, sys_semctl,
        sys_semget, sys_semop, sys_semtimedop, sys_shmctl, sys_shmdt,
        sys_shmget): Update for RVAL_DECODED.
        (sys_shmat): Decode all arguments on entering syscall.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

        umoven_or_printaddr: do not fetch data if not in verbose mode.
        After this change, umoven_or_printaddr and its callers, including
        printnum_* and printpair_*, will not fetch data in !verbose mode.

        * util.c (umoven_or_printaddr): Do not call umoven if !verbose.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

        Change printnum_* printers to honor syserror.
        With this change, printnum_* printers will not attempt to fetch data
        in case of exiting(tcp) && syserror(tcp).
        All "at exiting" decoders that call these printers have been made
        ready for this change in previous commits.

        * util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr.
        * prctl.c (prctl_exit): Use printnum_int and printnum_long.
        (sys_arch_prctl): Do not check for syserror.

2015-07-13  Dmitry V. Levin  <ldv@altlinux.org>

        term.c: enhance tty ioctl parser.
        Decode as much data on entering syscall as possible.

        * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
        decode_modem_flags): New functions.
        (term_ioctl): Use them.  Update for RVAL_DECODED.

2015-07-12  Elvira Khabirova  <lineprinter0@gmail.com>

        Change comparisons with function pointers to comparisons with SENs.
        * pathtrace.c (pathtrace_match): Change all comparisons with function
        pointers to a single SEN based switch.
        * syscall.c (dumpio, trace_syscall_entering): Change all comparisons
        with function pointers to comparisons with SENs.
        * ipc.c (sys_ipc): Remove.
        * sock.c (sys_socketcall): Likewise.
        * linux/dummy.h (sys_ipc, sys_socketcall): New aliases.

        Add unique syscall entry numbers (SENs)
        * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sen.h.
        (syscallent_names, syscallent_patterns, syscallent_files): New variables.
        (sen.h): New rule.
        * defs.h (struct sysent): Add sen field.
        * generate_sen.sh: New file.
        * linux/syscall.h: Include "sen.h".
        * syscall.c (SEN_NAME): New temporary macro.
        (SEN): Use it to prepend syscall entry number.

        Introduce SEN macro.
        * syscall.c (SEN): New temporary macro.
        * linux/dummy.h (sys_printargs): New macro.
        * linux/subcall.h: Wrap all sys_func entries using SEN.
        * linux/*/syscallent*.h: Likewise.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        scsi.c: enhance SG_IO ioctl parser.
        Fix SG_IO ioctl output in case of failed umove

        * scsi.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
        Update for RVAL_DECODED.
        (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
        print_sg_io_v4_res): Do not print address in case of failed umove.
        (scsi_ioctl): Use printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        ptp.c: enhance ptp ioctl parser.
        * ptp.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
        Update for RVAL_DECODED.
        (ptp_ioctl): Use umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        mtd.c: enhance mtd and ubi ioctl parsers.
        Decode as much data on entering syscall as possible.

        * xlat/mtd_file_mode_options.in: New file.
        * mtd.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
        Include "xlat/mtd_file_mode_options.h".
        Update for RVAL_DECODED.
        (mtd_ioctl, ubi_ioctl): Use printnum_int and umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        sock.c: enhance socket ioctl parser.
        Decode as much data on entering syscall as possible.

        * sock.c: Update for RVAL_DECODED.
        (print_addr): Remove.
        (print_ifreq_addr, print_ifreq, print_ifc_len, decode_ifconf): New
        functions.
        (sock_ioctl) Use them.  Use umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

        block.c: enhance block ioctl parser.
        * block.c: Update for RVAL_DECODED.
        Define BLKROTATIONAL and BLKZEROOUT.
        (block_ioctl): Decode them.  Use printnum_short, printnum_int,
        printnum_long, printpair_int64, and umove_or_printaddr.
        (print_blkpg_req, block_ioctl): Use umove_or_printaddr.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        blkpg_ops: add BLKPG_RESIZE_PARTITION constant.
        * xlat/blkpg_ops.in: Add BLKPG_RESIZE_PARTITION.

        Reported-by: Christian Neukirchen <chneukirchen@gmail.com>

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        loop.c: enhance loop ioctl parser.
        Decode as much data on entering syscall as possible.

        * loop.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
        Update for RVAL_DECODED.
        (decode_loop_info, decode_loop_info64): New functions.
        (loop_ioctl): Use them.  Decode LOOP_SET_STATUS, LOOP_SET_STATUS64,
        LOOP_SET_FD, LOOP_CHANGE_FD, LOOP_CTL_ADD and LOOP_CTL_REMOVE on
        entering syscall.
        Print LOOP_SET_FD and LOOP_CHANGE_FD arguments using printfd.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        rtc.c: enhance rtc ioctl parser.
        * rtc.c: Update for RVAL_DECODED.
        (print_rtc): Rename to print_rtc_time.
        (decode_rtc_time, decode_rtc_wkalrm): New functions.
        (rtc_ioctl): Use them.
        [RTC_VL_READ]: Decode RTC_VL_READ.
        Use printnum_long for RTC_IRQP_READ and RTC_EPOCH_READ decoding.

        Use printpair_int.
        * evdev.c (repeat_ioctl): Use printpair_int.
        * net.c (do_pipe, sys_socketpair): Likewise.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        Add several generic integer pairs printing functions.
        Add functions to fetch and print pairs of integer types.
        Note that these printers do not attempt to fetch data
        in case of exiting(tcp) && syserror(tcp).

        printnum_* printers will follow as soon as all callers are made ready
        for this change.

        * defs.h (printpair_int, printpair_long, printpair_int64): New
        prototypes.
        * util.c (DEF_PRINTPAIR): New macro.
        (printpair_int, printpair_long, printpair_int64): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        Add two generic integer printing functions.
        Add printnum_short and printnum_int64 in addition to already existing
        printnum_int and printnum_long.

        * defs.h (printnum_short, printnum_int64): New prototypes.
        * util.c (DEF_PRINTNUM): New macro.
        (printnum_int, printnum_long): Use DEF_PRINTNUM.
        (printnum_short, printnum_int64): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        Add address printing functions.
        printaddr is a simple function implementing "print NULL or address"
        idiom.
        umoven_or_printaddr is a wrapper around umoven that has the same return
        value semantics as umoven but also prints the address when the data
        is not going to be fetched (in case of exiting(tcp) && syserror(tcp))
        or cannot be fetched (umoven fails).
        umove_or_printaddr is a macro wrapper around umoven_or_printaddr that
        mirrors umove wrapper around umoven.

        * defs.h (printaddr, umoven_or_printaddr): New prototypes.
        (umove_or_printaddr): New macro.
        * util.c (printaddr, umoven_or_printaddr): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

        Implement RVAL_DECODED flag.
        Implement a method for "on entering" parsers to return
        "done with decoding" information to their callers.

        If a syscall parser called from trace_syscall_entering returns a value
        with RVAL_DECODED bit set, record this value in tcp->sys_func_rval
        and use it in trace_syscall_exiting instead of calling the parser on
        exiting syscall.

        If an ioctl parser returned RVAL_DECODED, this would tell
        SYS_FUNC(ioctl) that the decoding is finished but fallback printing of
        the ioctl command argument is needed, while e.g. RVAL_DONE+1 would mean
        that the decoding is finished and no fallback decoding is needed.

        * defs.h (struct tcb): Add sys_func_rval.
        (RVAL_DECODED): New macro.
        * syscall.c (trace_syscall_entering): Initialize tcp->sys_func_rval
        along with setting TCB_INSYSCALL flag.
        (trace_syscall_exiting): Use tcp->sys_func_rval instead of calling
        tcp->s_ent->sys_func when the former has RVAL_DECODED flag set.
        Reset tcp->sys_func_rval along with clearing TCB_INSYSCALL flag.
        * ioctl.c (sys_ioctl): Set RVAL_DECODED flag on exiting.
        Print ioctl argument iff RVAL_DECODED is set and fallback decoding
        is requested.

2015-07-05  Dmitry V. Levin  <ldv@altlinux.org>

        time.c: move rtc ioctl parser to a separate file.
        * rtc.c: new file
        * Makefile.am (strace_SOURCES): Add it.
        * time.c (print_rtc, rtc_ioctl): Move to rtc.c.

        term.c: fix typo.
        * term.c: Rename TCLFLSH to TCFLSH.

        Do not include sys/filio.h.
        * configure.ac (AC_CHECK_HEADERS): Remove sys/filio.h.
        * term.c: Do not include <sys/filio.h>.

2015-07-02  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl: prepare ioctl_decode_command_number for future changes.
        * ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*.
        (sys_ioctl): Update callers.

        ioctl: simplify ioctl_decode signature.
        * ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters.
        (sys_ioctl): Update callers.

        ioctl: consistently use name "code" for ioctl request code.
        * ioctl.c (evdev_decode_number, hiddev_decode_number,
        ioctl_decode_command_number): Rename "arg" to "code".

        Move ioctl syscall parser to ioctl.c.
        * io.c (sys_ioctl): Move ...
        * ioctl.c: ... here.
        (ioctl_lookup, ioctl_next_match, ioctl_print_code, ioctl_decode,
        ioctl_decode_command_number): Declare as static.
        * defs.h (ioctl_lookup, ioctl_next_match, ioctl_print_code,
        ioctl_decode, ioctl_decode_command_number): Remove.

        ioctl: remove obsolete registry of ioctl characters.
        * ioctl.c: Remove registry of ioctl characters.

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        Fix filtering of <unavailable> syscalls.
        * syscall.c (trace_syscall_exiting): Skip filtered syscalls also in case
        of get_regs or get_syscall_result failure.
        * tests/filter-unavailable.c: New file.
        * tests/filter-unavailable.expected: Likewise.
        * tests/filter-unavailable.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add filter-unavailable.
        (filter_unavailable_LDFLAGS): Add -pthread.
        (TESTS): Add filter-unavailable.test.
        (EXTRA_DIST): Add filter-unavailable.expected.
        * tests/.gitignore: Add filter-unavailable.

        Reported-by: Bryan Matsuo <bryan.matsuo@gmail.com>

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        Fix -qq option in conjunction with -o option.
        This change makes -qq option work in conjunction with -o option,
        thus complementing commit v4.7-222-g01997cf.

        * strace.c (init): Do not reset qflag.

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

        xtensa: wire up new syscalls.
        * linux/xtensa/syscallent.h (bpf, execveat): New entries.

        bfin: wire up new syscalls.
        * linux/bfin/syscallent.h (kcmp, finit_module, sched_setattr,
        sched_getattr, renameat2, seccomp, getrandom, memfd_create,
        bpf, execveat): New entries.

        alpha: wire up new syscalls.
        * linux/alpha/syscallent.h (getrandom, memfd_create, execveat):
        New entries.

2015-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip stat32 test if struct stat is defined incorrectly.
        If stat.st_mode returned by syscall is 0, it means that the definition
        of struct stat in <asm/stat.h> is incorrect.  This is the case e.g. on
        mips n32 where the only available stat syscall is 64-bit but at the same
        time struct stat defined by <asm/stat.h> is 32-bit.

        * tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0.

2015-06-17  Dmitry V. Levin  <ldv@altlinux.org>

        Consistenly use #ifdef to check for AC_DEFINE'd macros.
        * aio.c (print_common_flags): Use #ifdef in the check for
        HAVE_STRUCT_IOCB_U_C_FLAGS.
        * defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG.
        * net.c: Use #ifdef in the check for HAVE_SENDMSG.
        * syscall.c (dumpio): Likewise.
        * printstat.h (DO_PRINTSTAT): Use #ifdef in checks for
        HAVE_STRUCT_STAT_ST_* macros.
        * util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H.

        xattr: move fallback definitions of xattr flags to xlat/
        * xattr.c: Include <sys/xattr.h> insread of <linux/xattr.h>.
        Move definitions of XATTR_* flags ...
        * xlat/xattrflags.in: ... here.

        link: move fallback definitions of AT_* constants to xlat/
        * link.c: Move definitions of AT_* constants ...
        * xlat/at_flags.in: ... here.

        net: move fallback definitions of SOL_* constants to xlat/
        * net.c: Move definitions of SOL_* constants ...
        * xlat/socketlayers.in: ... here.

        futex: move fallback definitions of futex constants to xlat/
        * futex.c: Move definitions of FUTEX_OP_CMP_* constants ...
        * xlat/futexwakecmps.in: ... here.
        * futex.c: Move definitions of other FUTEX_OP_* constants ...
        * xlat/futexwakeops.in: ... here.
        * futex.c: Move definitions of remaining FUTEX_* constants except
        FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME flags ...
        * xlat/futexops.in: ... here.

        clone: move definitions of cloning flags to xlat/
        * clone.c: Include <sched.h>.  Move definitions of CLONE_* flags ...
        * xlat/clone_flags.in: ... here.

2015-06-16  Dmitry V. Levin  <ldv@altlinux.org>

        Update mount flags constants.
        * mount.c: Remove definitions of mount flags constants.
        * xlat/mount_flags.in: Update from linux v4.0, add default values.

        mount: update parser to match kernel behaviour.
        * mount.c (sys_mount): Do not decode type and data strings for
        MS_SHARED, MS_PRIVATE, MS_SLAVE, and MS_UNBINDABLE mount flags
        that do not imply valid strings.

        mount: robustify MS_MGC_VAL decoding.
        * mount.c (sys_mount): When printing mount flags, do not assume that
        (flags & MS_MGC_MSK) == MS_MGC_VAL.

2015-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        net: decode setsockopt() multicast arguments.
        * configure.ac (AC_CHECK_FUNCS): Add inet_pton.
        * net.c (print_mreq, print_mreq6): New functions.
        (print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP,
        IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP,
        IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST.
        * tests/ip_mreq.c: New file.
        * tests/ip_mreq.expected: Likewise.
        * tests/ip_mreq.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add ip_mreq.
        (TESTS): Add ip_mreq.test.
        (EXTRA_DIST): ip_mreq.expected.
        * tests/.gitignore: Add ip_mreq.

        Based on patch by Ben Noordhuis <info@bnoordhuis.nl>.

2015-06-08  Dmitry V. Levin  <ldv@altlinux.org>

        Update IPV6 socket options constants.
        * xlat/sockipv6options.in: Update from linux v4.0.

2015-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        net: factor out interface index printing code.
        * net.c (print_ifindex): New function.
        (printsock) [HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID]: Use it.

2015-05-25  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use error_msg instead of fprintf(stderr)
        * linux/alpha/get_scno.c: Use error_msg.
        * linux/arm/get_scno.c: Likewise.
        * linux/mips/get_scno.c: Likewise.
        * linux/sh/get_scno.c: Likewise.
        * linux/x86_64/get_scno.c: Likewise.
        * exit.c (sys_exit): Likewise.
        * pathtrace.c (pathtrace_select, pathtrace_match): Likewise.
        * strace.c (alloctcb, droptcb, detach, startup_attach,
        test_ptrace_seize, init, cleanup, print_debug_info,
        maybe_allocate_tcb, startup_tcb, trace): Likewise.
        * syscall.c (update_personality, trace_syscall_exiting,
        get_scno): Likewise.
        * unwind.c (DPRINTF): Likewise.
        * tests/bexecve.test: Update patterns.
        * tests/detach-stopped.test: Likewise.

        Consistently print OOM diagnostic messages.
        * bjm.c (sys_query_module): Use error_msg to print OOM diagnostics.
        * util.c (dumpiov, dumpstr): Likewise.

2015-05-25  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce memory allocation wrappers.
        Introduce wrappers to the following functions that do memory allocation:
        malloc, calloc, realloc, strdup.

        This commit is a follow-up to the related discussions in strace-devel ML:
        http://sourceforge.net/p/strace/mailman/message/33618180/
        http://sourceforge.net/p/strace/mailman/message/33733470/

        * defs.h (xmalloc, xcalloc, xreallocarray, xstrdup): New prototypes.
        * xmalloc.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * count.c (count_syscall, call_summary_pers): Use xcalloc.
        * desc.c (decode_select): Use xmalloc.
        * dirent.c (sys_getdents, sys_getdents64): Likewise.
        * net.c (sys_recvmmsg): Use xstrdup.
        * pathtrace.c (storepath): Use xreallocarray.
        (pathtrace_match): Use xmalloc.
        * strace.c (die_out_of_memory): Move to xmalloc.c.
        (expand_tcbtab): Use xcalloc and xreallocarray.
        (startup_child): Use xstrdup.
        (init): Use xmalloc, xcalloc, and xstrdup.
        * syscall.c (reallocate_qual): Use xreallocarray.
        (qualify): Use xstrdup.
        * unwind.c (unwind_tcb_init): Use xmalloc.
        (build_mmap_cache): Use xcalloc, xreallocarray, and xstrdup.
        (get_symbol_name): Use xreallocarray.
        (stacktrace_walk, queue_put): Use xmalloc.
        * util.c (printstr): Use xmalloc.
        * vsprintf.c (strace_vfprintf): Likewise.

2015-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        Fix ioctl entries on 32-bit architectures with 64-bit aligned structures
        Some ioctl constants are defined to different values on those 32-bit
        architectures where structures containing a 64-bit field are aligned on
        a 8-byte boundary and have a size multiple of 8 bytes, and on other
        32-bit architectures.

        * configure.ac: Check the size of a structure containing a 64-bit field.
        * linux/32/ioctls_inc.h: Rename to ...
        * linux/32/ioctls_inc_align32.h: ... this.
        * linux/32/ioctls_inc_align64.h: New file.
        * linux/32/ioctls_inc.h: Include either 32/ioctls_inc_align32.h
        or ioctls_inc_align64.h depending on SIZEOF_STRUCT_I64_I32.
        * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align32.h and
        * linux/32/ioctls_inc_align64.h.
        * tests/ioctl.c (main): Test for VIDIOC_ENUMINPUT.
        * tests/ioctl.expected: Check VIDIOC_ENUMINPUT decoding.

        Reported-by: Philippe De Muyter <phdm@macqel.be>

2015-05-21  Dmitry V. Levin  <ldv@altlinux.org>

        maint: make linux/kvm.h parseable on arm.
        * maint/ioctls_sym.sh [AARCH64 || ARM]: Add missing definitions for
        structures referenced from linux/kvm.h.

2015-05-21  Philippe De Muyter  <phdm@macqel.be>

        v4l2: add decoding for VIDIOC_S_CROP's arg.
        * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_S_CROP's arg.

2015-05-19  Ezequiel Garcia  <ezequiel@vanguardiasur.com.ar>

        Add support for Altera's Nios-II softcore architecture.
        This commit adds strace support for Altera's Nios-II.  The architecture
        is supported by Linux since v3.19, and it implements the generic syscall
        ABI.

        * configure.ac: Add nios2 support.
        * cacheflush.c [NIOS2] (sys_cacheflush): New function.
        * linux/nios2/*: New Nios-II specific files.
        * Makefile.am (EXTRA_DIST): Add them.

2015-05-19  Philippe De Muyter  <phdm@macqel.be>

        v4l2: VIDIOC_CROPCAP: add missing braces around arg printout.
        * v4l2.c (v4l2_ioctl): case VIDIOC_CROPCAP: add missing braces around arg
        printout.

2015-05-19  Dmitry V. Levin  <ldv@altlinux.org>

        maint: avoid effects of locale when sorting files.
        * maint/ioctls_gen.sh: Invoke sort with LC_COLLATE=C.
        * maint/ioctls_hex.sh: Likewise.
        * maint/ioctls_sym.sh: Likewise.

        Reported-by: Philippe De Muyter <phdm@macqel.be>

2015-04-18  Philippe De Muyter  <phdm@macqel.be>

        v4l2: add decoding for VIDIOC_CREATE_BUFS's arg.
        * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg.

2015-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: decode indirect syscall.
        Implement decoding of MIPS O32 specific indirect syscall.

        * syscall.c [LINUX_MIPSO32] (decode_mips_subcall, sys_syscall):
        New functions.
        (trace_syscall_entering) [LINUX_MIPSO32]: Use decode_mips_subcall.
        * linux/mips/syscallent-o32.h (4000): Change sys_func to sys_syscall.

        Reported-and-tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>

2015-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        debian: add gawk to Build-Depends.
        * debian/control (Build-Depends): Add gawk.
        Patch by Reiner Herrmann <reiner@reiner-h.de>.

        This fixes Debian bug #780992.

2015-04-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix bexecve.test for the case of mixed personalities.
        Fix bexecve.test when the executable being run does not match the
        native architecture.

        * tests/bexecve.test: Use "set_ptracer_any" instead of "sh".
        Allow for a personality switch notification in the strace output.

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for "resuming interrupted nanosleep"
        * tests/restart_syscall.test: New test.
        * tests/restart_syscall.expected: New file.
        * tests/restart_syscall_unknown.expected: Likewise.
        * tests/Makefile.am (TESTS): Add restart_syscall.test.
        (EXTRA_DIST): Add restart_syscall.expected
        (TEST_LOG_COMPILER): Change to "env".
        (OS, ARCH, AM_TEST_LOG_FLAGS): Define.
        and restart_syscall_unknown.expected.

        tests: strip executable bit from *.expected files.

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        Declare syscall parsers using SYS_FUNC macro.
        Introduce SYS_FUNC macro to declare and define all syscall parsers.

        * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h.
        (sys_func.h): New rule.
        * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros.
        * linux/syscall.h: Include "sys_func.h".
        [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers.
        Remove other declarations.
        * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs
        and osf_fstatfs syscall parsers.
        * *.c: Use SYS_FUNC to define syscall parsers.

2015-04-07  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix confusing "resuming interrupted unknown" message.
        Dmitry reported seeing the following:

            $ sleep 2 & sleep 1; ./strace -erestart_syscall -p $!
            [1] 12345
            Process 12345 attached
            restart_syscall(<... resuming interrupted unknown ...>) = 0

        Fixing it by replacing "unknown" with "system call".

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: workaround old gawk versions that do not provide @include support
        Some of our tests use GNU awk @include extension, but not all currently
        used versions of GNU awk support it.  Skip these tests if gawk does not
        provide @include support.

        * tests/init.sh (check_gawk): New function.
        (match_awk): Use it.

2015-04-06  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rewrite umovestr2.test without using grep.
        The regular expression generated by umovestr2.c on systems with large
        page size is too big for GNU grep.  Rewrite the test to use diff
        instead of grep.

        * tests/umovestr2.test: Use match_diff instead of match_grep.
        * tests/umovestr2.c (main): Convert output from regexp to plain text.

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup process_vm_writev syscall decoding.
        * process_vm.c (sys_process_vm_writev): Do not check for syserror,
        it is not applicable on entering syscall.

        umovestr: read chunks of memory up to pagesize at a time.
        * defs.h (get_pagesize): New prototype.
        * mem.c (get_pagesize) Make global.
        * util.c (PAGMASK): Remove.
        (vm_read_mem): New process_vm_readv proxy function.
        (umoven, umovestr): Use it.
        (umovestr): Read chunks up to pagesize at a time.

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        umovestr: fix short read bug.
        * util.c (umovestr): Check the right address.
        * tests/umovestr.c: New file.
        * tests/umovestr2.c: Likewise.
        * tests/umovestr.expected: Likewise.
        * tests/umovestr.test: New test.
        * tests/umovestr2.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add umovestr and umovestr2.
        (TESTS): Add umovestr.test and umovestr2.test.
        (EXTRA_DIST): Add umovestr.expected.
        * tests/.gitignore: Add umovestr and umovestr2.

        Reported-by: Josef T. Burger <bolo@cs.wisc.edu>

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        When process_vm_readv fails with EPERM, try PTRACE_PEEKDATA.
        process_vm_readv() and ptrace(PTRACE_PEEKDATA) have inconsistent access
        control rules wrt traced processes: process_vm_readv() is more likely to
        fail with EPERM than ptrace(PTRACE_PEEKDATA) when tracing a process that
        has execve'd a privileged executable.

        * util.c (umoven, umovestr): If process_vm_readv returned EPERM,
        fall back to ptrace(PTRACE_PEEKDATA).

        Reported-by: Andrew Guertin <lists@dolphinling.net>

2015-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        Use macros for gcc attributes.
        * defs.h (error_msg, perror_msg, error_msg_and_die, perror_msg_and_die,
        die_out_of_memory, printllval, printnum_int, printnum_long, tprintf):
        Use ATTRIBUTE_* macros for gcc attributes.
        * file.c (struct stat64): Likewise.
        * statfs.c (struct compat_statfs64): Likewise.
        * strace.c (die, exec_or_die, init): Likewise.
        * linux/sparc/arch_sigreturn.c: Likewise.
        * linux/ubi-user.h: Likewise.

2015-03-30  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce macros for gcc attributes.
        Define macros for gcc attributes that are already in use
        or going to be used soon.

        * defs.h (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
        ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
        ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): New macros.

2015-03-28  Felix Janda  <felix.janda@posteo.de>

        Include <linux/ioctl.h> for _IOC_* macros.
        Fix a compilation failure with musl libc.

        * evdev.c: Include <linux/ioctl.h>.
        * ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>.
        * ioctlsort.c: Likewise.

        Reported-by: Dima Krasner <dima@dimakrasner.com>
        Acked-by: Mike Frysinger <vapier@gentoo.org>

2015-03-28  Felix Janda  <felix.janda@posteo.de>

        Include <sys/stat.h> for S_I* macros.
        Fix a compilation failure with musl libc.

        * mknod.c: Include <sys/stat.h>.
        * printmode.c: Likewise.

        Reported-by: Dima Krasner <dima@dimakrasner.com>
        Acked-by: Mike Frysinger <vapier@gentoo.org>

2015-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        signal.c: move siginfo_t parsers to a separate file.
        * printsiginfo.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (printsiginfo): Change second argument's type from int to bool.
        * signal.c: Stop defining siginfo_t related constants.
        Move inclusion of xlat/sig*_codes.h files to printsiginfo.c
        (printsigsource, printsigval, printsiginfo_at): Move to printsiginfo.c.
        (printsiginfo): Change second argument's type from int to bool,
        split, and move to printsiginfo.c.

        Update siginfo_t constants.
        * xlat/sigbus_codes.in: Add BUS_MCEERR_AR and BUS_MCEERR_AO,
        add default values.
        * xlat/sigtrap_codes.in: Add TRAP_BRANCH and TRAP_HWBKPT,
        add default values.
        * xlat/sigsegv_codes.in: Add SEGV_BNDERR, add default values.
        * xlat/sigchld_codes.in: Add default values.
        * xlat/sigemt_codes.in: Likewise.
        * xlat/sigfpe_codes.in: Likewise.
        * xlat/sigill_codes.in: Likewise.
        * xlat/siginfo_codes.in: Likewise.
        * xlat/sigpoll_codes.in: Likewise.
        * xlat/sigsys_codes.in: Likewise.

2015-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        signal.c: move sigaltstack parser to a separate file.
        * sigaltstack.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * signal.c (print_stack_t, sys_sigaltstack): Move to sigaltstack.c.
        * xlat/sigaltstack_flags.in: Add default values.

2015-03-25  Denys Vlasenko  <dvlasenk@redhat.com>

        Move sparc64 get_scno() code where it belongs.

        sparc: rename personality 2 files to personality 1.
        Run-tested in qemu 32-bit sparc.

2015-03-25  Denys Vlasenko  <dvlasenk@redhat.com>

        sparc: delete personality 1.
        Personality 1 for sparc and sparc64 appears to be an old attempt
        to support stracing Solaris binaries.

        It stalled after the only syscall, solaris_open, was covered:
        all other solaris_foo's are printargs.

        This change deletes personality 1. Now sparc is an one-personality
        arch, and sparc64 is a two-personality one.

        For clarity, pure renaming of personality 2 files to personality 1 for sparc64
        is performed in the next commit - this prevents a state where syscallent1.h
        seems to indergo a lot of changes, where in fact in is deleted, and then
        replaced by syscallent2.h

        Therefore, tree at this commit will not build.

2015-03-24  Denys Vlasenko  <dvlasenk@redhat.com>

        qemu_multiarch_testing/*: make it easier to do debug in sandboxes.

2015-03-24  Denys Vlasenko  <dvlasenk@redhat.com>

        sparc: fix v4.10-25-g8497b62 fallout.
        Before:

        $ sleep 3 & ./strace -p $!
        Process 8703 attached
        syscall: unknown syscall trap 1a800003 00025d58
        syscall_516(0, 0x40080000, 0, 0xfc000f00, 0x28, 0xefc03b18) = 0
        exit_group(0)                           = ?
        +++ exited with 0 +++

        After:

        $ sleep 3 & ./strace -p $!
        Process 8725 attached
        restart_syscall(<... resuming interrupted nanosleep ...>) = 0
        exit_group(0)                           = ?
        +++ exited with 0 +++

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

        get_scno: add diagnostics for invalid syscall numbers.
        * syscall.c (get_scno): Print a debug level message
        for !SCNO_IS_VALID syscall numbers.

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

        arm: fix v4.10-25-g8497b62 fallout.
        Starting with commit v4.10-25-g8497b62,

        arm$ ./strace true
        pid 1234 stray syscall exit
        Segmentation fault

        Fix this by updating ARM syscall sanity check.
        In particular, get_scno() should not set TCB_INSYSCALL flag because
        other code assumes that s_ent is properly initialized when this flag
        is set.

        * linux/arm/get_scno.c: Check syscall number after fetching.
        Do not apply the check to SCNO_IN_RANGE syscalls.
        Do not set TCB_INSYSCALL flag.
        Extend diagnostics and move it to debug level.

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

        mips: fix pipe syscall decoding.
        * linux/mips/arch_getrval2.c: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * defs.h [MIPS] (HAVE_GETRVAL2): Define.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        sigreturn.c: split arch specific code into separate arch files.
        Split code that use arch-specific registers to separate arch files.

        * sigreturn.c (sys_sigreturn): Move arch-specific code
        to linux/*/arch_sigreturn.c, include "arch_sigreturn.c".
        * linux/arch_sigreturn.c: New file.
        * Makefile.am (EXTRA_DIST): Add linux/arch_sigreturn.c
        and linux/*/arch_sigreturn.c files.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: split arch specific code into separate arch files.
        Split code that use arch-specific registers to separate arch files.

        * syscall.c: Move definitions of variables containing fetched registers
        to linux/*/arch_regs.c files.
        [HAVE_GETRVAL2] (getrval2): Move arch-specific code
        to linux/*/arch_getrval2.c, include "arch_getrval2.c".
        (print_pc): Move arch-specific code to linux/*/print_pc.c files,
        include "print_pc.c".
        [X86_64] (x86_64_getregs_old): Rename to getregs_old, move to
        linux/x86_64/getregs_old.c, include "getregs_old.c".
        [POWERPC] (powerpc_getregs_old): Rename to getregs_old, move to
        linux/powerpc/getregs_old.c, include "getregs_old.c".
        (get_regs) [X86_64, POWERPC]: Update callers.
        (get_scno): Move arch-specific code to linux/*/get_scno.c,
        include "get_scno.c".
        (get_syscall_args): Move arch-specific code
        to linux/*/get_syscall_args.c, include "get_syscall_args.c".
        (get_error): Move arch-specific code to linux/*/get_error.c,
        include "get_error.c".
        (get_syscall_result): Move arch-specific code
        to linux/*/get_syscall_result.c, include "get_syscall_result.c".
        * Makefile.am (EXTRA_DIST): Add new linux/*/*.c files.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: prepare for the split.
        Move functions that use arch-specific registers to the end of file.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        Move get_regs error check from trace_syscall_entering to get_scno.
        Starting with commit v4.10-25-g8497b62, get_scno() can be called outside
        trace_syscall_entering(), so move the get_regs_error check from
        trace_syscall_entering() to get_scno().

        * syscall.c (trace_syscall_entering): Move get_regs_error check ...
        (get_scno): ... here.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

        alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding.
        Fix pipe syscall decoding on alpha.
        Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64.

        * configure.ac (AC_CHECK_FUNCS): Add pipe2.
        * defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2):
        Define.
        * net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros.
        Do not use getrval2 for pipe2 decoding.
        Print address if umove call fails.
        * syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture
        macros.  Implement for [ALPHA].
        * tests/pipe.c: New file.
        * tests/pipe.expected: New file.
        * tests/pipe.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add pipe.
        (TESTS): Add pipe.test.
        (EXTRA_DIST): Add pipe.expected.
        * tests/.gitignore: Add pipe.

2015-03-22  Dmitry V. Levin  <ldv@altlinux.org>

        decode_socket_subcall: fetch all arguments with a single umoven call.
        * syscall.c (decode_socket_subcall): Replace umoven fetch loop
        with a single umoven call.

2015-03-21  Denys Vlasenko  <dvlasenk@redhat.com>

        New test: test/many_looping_threads.c.

        test/.gitignore: add missing test targets.

        Trivial optimization in sys_sigreturn()

        Change last parameter of umoven() from char* to void*
        Saves tons of casts.

        Remove unused struct tcb::inst field.
        It is unused since we dropped support for kernels without PTRACE_SETOPTIONS.

        test/Makefile: add missing test targets.

        Move the comment about termination logic where it belongs.

        startup_tcb() never fails, remove code which checks for failures.

2015-03-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Show the syscall name in "resuming interrupted call" message.
        When signal is received, or if we have attached to a process,
        current syscall (if process is in one) gets restarted.

        Some syscalls are restarted via "restart_syscall()" mechanism.
        On such sycalls, we don't show _which_ syscall gets restarted.

        IOW: users want to see "resuming interrupted nanosleep"
        instead of "resuming interrupted call" when they attach to "sleep 999".

        Kernel does expose this information. The only thing we need is
        to fetch syscall# on attach, and save it.

        This patch does this. It adds tcp->s_prev_ent, which is
        a pointer to struct_sysent of the previous syscall of this tracee.
        It can be NULL.

        sys_restart_syscall() is made to use it when the message is generated.

        To similarly handle restart_syscall() *after signals*, not just
        on attach, on each syscall exit patch saves exited syscall's data
        in the same member (tcp->s_prev_ent).

        Example:

            $ sleep 3 & strace -p $!
            Process 8728 attached
            restart_syscall(<... resuming interrupted nanosleep ...>) = 0
            _exit(0)                                = ?
            +++ exited with 0 +++

2015-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for mmap/mprotect/munmap decoding.
        * tests/mmap.c: New file.
        * tests/mmap64.c: New file.
        * tests/mmap.test: New test.
        * tests/mmap64.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64.
        (mmap64_CFLAGS): Define.
        (TESTS): Add mmap.test and mmap64.test.
        * tests/.gitignore: Add mmap and mmap64.

        sparc, sparc64: fix decoding of mmap2.
        * linux/sparc/syscallent.h (mmap2): Decode with sys_mmap_4koff,
        not sys_mmap.
        * linux/sparc64/syscallent2.h (mmap2): Decode with sys_mmap_pgoff,
        not sys_mmap.

2015-03-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for SECCOMP_MODE_FILTER decoding.
        * tests/seccomp.c: New file.
        * tests/seccomp.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add seccomp.
        (TESTS): Add seccomp.test.
        * tests/.gitignore: Add seccomp.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: factor out common awk code.
        Factor out awk code used in several tests to match.awk.

        * tests/match.awk: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/caps.awk: Use it.
        * tests/getdents.awk: Likewise.
        * tests/getrandom.awk: Likewise.
        * tests/select.awk: Likewise.
        * tests/sigaction.awk: Likewise.
        * tests/init.sh (match_awk): Use gawk not awk.  Define AWKPATH.
        * tests/getdents.test: Likewise.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip netlink based tests when resources are not available.
        * tests/netlink_inet_diag.c (main): Return 77 if socket, bind,
        or listen syscall fail.
        * tests/netlink_unix_diag.c (main): Likewise.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64, arm: decode extra padded compat struct statfs64.
        According to arch/arm/kernel/sys_oabi-compat.c,
        struct statfs64 has extra padding with EABI.

        * statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE):
        Define.
        (do_statfs64_fstatfs64): New function, factored out from sys_statfs64.
        [COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to
        sizeof(struct compat_statfs64).
        (sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64.

        Reported-and-tested-by: Elliott Hughes <enh@google.com>

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: factor out common shell code to functions.
        Factor out shell code used in several tests to common functions.

        * tests/fanotify_mark.expected: New file.
        * tests/ioctl.expected: New file.
        * tests/net-fd.expected: New file.
        * tests/net.expected: New file.
        * tests/statfs.expected: New file.
        * tests/sun_path.expected: New file.
        * tests/uio.expected: New file.
        * tests/ipc.sh: New file.
        * tests/Makefile.am (EXTRA_DIST): Add them.
        * tests/init.sh (dump_log_and_fail_with, run_prog,
        run_prog_skip_if_failed, run_strace, run_strace_merge,
        match_awk, match_diff, match_grep): New functions.
        * tests/*.test: Use them.

2015-03-18  Elliott Hughes  <enh@google.com>

        Show f_flags field in printstatfs.
        printstatfs64 was right, but printstatfs was missing f_flags.
        Noticed on aarch64.

        * statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests/uid*: use fchown* instead of chown*
        Newer architectures have no chown syscall, so use fchown* syscalls
        for testing printuid.

        * tests/uid.test: Use fchown instead of chown.
        * tests/uid.c: Test __NR_fchown instead of __NR_chown.
        (main): Use __NR_fchown instead of __NR_chown.
        * tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32.
        (main): Use __NR_fchown32 instead of __NR_chown32.
        * tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead
        of __NR_chown and __NR_chown32.
        (main): Use __NR_fchown instead of __NR_chown.
        * tests/uid.awk: Update regexp.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        stat64-v.test: add newfstatat syscall support.
        Newer architectures have no stat syscall, so stat() is implemented there
        using newfstatat syscall.

        * tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX.  Update callers.
        [_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support.
        (main) [!NR_stat]: Add newfstatat support.

        Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Andreas Schwab  <schwab@suse.de>

        aarch64: properly decode generic syscalls.
        * linux/aarch64/syscallent1.h: Don't override entries 277 to 1023.

        tests: verify that all patterns match.
        * tests/ipc_msg.test: Count matches to verify that all patterns match.
        * tests/ipc_sem.test: Likewise.
        * tests/ipc_shm.test: Likewise.
        * tests/stat32-v.test: Likewise.
        * tests/stat64-v.test: Likewise.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t.
        STRUCT_STAT.st_[acm]time are declared as unsigned int for some
        personalities, while time_t is signed.

        * printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int,
        explicitly cast them to int.
        * tests/stat64-v.test: Test that negative time_t is decoded properly.

        Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        semctl: fix indirect syscall decoding.
        On architectures where the semctl call is implemented by the ipc syscall
        the 4th argument is passed by reference.

        * ipc.c (sys_semctl): Handle the indirect ipc subcall case.
        * tests/ipc_sem.c (main): Optionally match indirection
        in the 4th argument of semctl calls.

        Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Andreas Schwab  <schwab@suse.de>

        tests/ipc_*: match IPC_64 flag.
        * tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third
        argument of the ipc call.
        * tests/ipc_sem.c (main): Likewise.
        * tests/ipc_shm.c (main): Likewise.

2015-03-16  Andreas Schwab  <schwab@suse.de>

        Fix crash in ipc_sem test.
        Properly use union semun as argument of semctl.

        * tests/ipc_sem.c (main): Properly use union semun as argument of
        semctl.  Don't handle EFAULT specially.
        * tests/ipc_sem.test: Revert last change.

2015-03-16  Andreas Schwab  <schwab@suse.de>

        m68k: fix sigreturn decoding.
        * sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the
        signal mask from the proper place.

        aarch64: fix ioctl decoding.
        * linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h.
        * linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h.
        * linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h.
        * linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h.

2015-03-12  Andreas Schwab  <schwab@suse.de>

        tests/select.test: handle architectures using pselect6 syscall.
        * tests/select.awk (BEGIN): Update regexps to match both select
        and pselect6 syscalls.
        * tests/select.test: Probe for both select and pselect6 syscall.

        Distribute linux/aarch64/arch_regs.h.
        * Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h.

        Fix decoding of mmap2 for arm.
        * syscallent.h (mmap2): Decode with sys_mmap_4koff, not
        sys_mmap_pgoff.

2015-03-12  Andreas Schwab  <schwab@suse.de>

        m68k: define HAVE_SA_RESTORER.
        On m68k the kernel sigaction structure has the sa_restorer member for
        historical reasons.

        * signal.c (HAVE_SA_RESTORER): Define for M68K.

2015-03-11  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: fix rt_sigreturn decoding.
        * sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check.

2015-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        maint: post-release administrivia.
        * NEWS: Add header line for next release.

2015-03-06  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.10 release.
        * NEWS: Update for 4.10 release.
        * debian/changelog: 4.10-1.
        * strace.spec: 4.10-1.

        Move sigreturn/rt_sigreturn parser to a separate file.
        * sigreturn.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (sprintsigmask_n): New prototype.
        (tprintsigmask_addr): New macro.
        * signal.c (sprintsigmask_n): Make global.
        (tprintsigmask_addr): Remove.
        (sys_sigreturn): Move to sigreturn.c.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: use PTRACE_GETREGS to fetch registers.
        * linux/ia64/arch_regs.h: Stop including <asm/rse.h>.
        (ia64_frame_ptr): New declaration.
        * signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr.
        * syscall.c [IA64]: Include <asm/rse.h>.
        [IA64] (ia64_regs, ia64_frame_ptr): New variable.
        [IA64] (ARCH_REGS_FOR_GETREGS): New macro.
        [IA64] (ia64_ia32mode): Convert to macro.
        [IA64] (ia64_r8, ia64_r10): Remove.
        (getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]:
        Use ia64_regs.
        (get_syscall_result) [IA64]: Remove.

        s390, s390x: use PTRACE_GETREGSET to fetch registers.
        * linux/s390/arch_regs.h: New file.
        * linux/s390x/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add them.
        * signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr.
        * syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable.
        [S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro.
        (print_pc) [S390 || S390X]: Use s390_regset.
        (get_scno) [S390 || S390X]: Likewise.
        (get_syscall_args) [S390 || S390X]: Likewise.
        (get_error) [S390 || S390X]: Likewise.
        (get_syscall_result) [S390 || S390X]: Remove.

        qemu_multiarch_testing: update.
        * qemu_multiarch_testing/README: Update statistics.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify unix-yy.test.
        Implement additional synchronization between parent and child processes
        to guarantee that the child starts closing connected socket only after
        exiting of the parent's accept() syscall.
        This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER
        messages from NETLINK_SOCK_DIAG interface.

        * tests/net-accept-connect.c: Implement additional synchronization
        between parent and child processes.
        * tests/unix-yy-connect.awk: Update.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        Use SIGRTMIN from kernel headers.
        * configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>.
        * signal.c: Use ASM_SIGRTMIN instead of constants provided by libc.
        * tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value.
        Use lower RT_* numbers to support pre-3.18 hppa kernels.
        * tests/sigreturn.test: Update regexp.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        ppc64: fix compilation warning.
        Fix compilation warning introduced by commit
        577be2593d4895ef941e1c4e5e1608f7dd13610d

        * signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal
        mask on 32bit personality.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: fix compilation warnings.
        Fix compilation warnings introduced by commit
        5b9b7e1d347eb4556084cdccad75e8247c535ed5:

        signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare]
        syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default]

        * syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast.
        [AARCH64] (arm_sp_ptr): Change pointer type to unsigned.
        * linux/aarch64/arch_regs.h (arm_sp_ptr): Update.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        i386: simplify sigreturn decoding.
        * signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define
        i386_sigcontext_struct and i386_fpstate structures.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for sigreturn/rt_sigreturn decoding.
        Convert test/sigreturn.c into a regular test.

        * test/Makefile (PROGS): Remove sigreturn.
        * test/.gitignore: Likewise.
        * test/sigreturn.c: Rewrite to ...
        * tests/sigreturn.c: ... new file.
        * tests/sigreturn.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sigreturn.
        (TESTS): Add sigreturn.test.
        * tests/.gitignore: Add sigreturn.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        sigreturn: print signal mask as a syscall argument.
        Although sigreturn takes signal mask via frame pointer,
        it's more convenient to display signal mask as a syscall argument
        rather than an outstanding object of unknown nature:

        Before this change:
            sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0

        After this change:
            sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0

        * signal.c (sys_sigreturn): Display signal mask as a syscall argument.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64: implement rt_sigreturn decoding.
        * linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn
        decoding.
        * syscall.c [ARM] (arm_regs): Make static.
        [ARM] (arm_sp_ptr): New variable.
        [AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables.
        * linux/aarch64/arch_regs.h: New file.
        * linux/arm/arch_regs.h (arm_regs): Remove.
        (arm_sp_ptr): New declaration.
        * signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr.
        [AARCH64]: Print signal mask.

        arm: simplify sigreturn decoding.
        * signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext
        structures, fetch signal mask only, use print_sigset_addr_len.

        s390: fix sigreturn decoding.
        * signal.c (sys_sigreturn) [S390]: Fix signal mask decoding.

        mips o32: fix sigreturn decoding.
        * signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask.
        [MIPS] Use print_sigset_addr_len to print signal mask.

        x86_64, x32: implement rt_sigreturn decoding.
        * syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable.
        * linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration.
        * linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn
        decoding.
        * linux/x32/syscallent.h (513): Likewise.
        * signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask
        for non-i386 personalities.

        sparc, sparc64: fix sigreturn decoding.
        * linux/sparc/arch_regs.h (U_REG_FP): New macro.
        * signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding
        of upper 32 bits of the sigmask.

        ppc, ppc64: fix sigreturn decoding.
        * signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits
        of the sigmask.

        sigreturn: issue a less innocuous warning.
        * signal.c (sys_sigreturn): Issue a less innocuous warning on
        architectures for which signal mask decoding is not implemented yet.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        bootstrap: do not link Makefile* files.
        * bootstrap: Do not symlink any Makefile* files, not just Makefile.am
        and Makefile.in.

        Reported-by: Christopher Covington <cov@codeaurora.org>

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: fix sigreturn decoding.
        * signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask.
        Use print_sigset_addr_len to print signal mask.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: use generic signalent.
        This complements commit v4.9-321-gfcf7f8d.

        * linux/ia64/signalent.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.

2015-03-04  Giedrius Statkevičius  <giedrius.statkevicius@gmail.com>

        Document that -k is available only with libunwind.
        Without this users might get confused why `man strace` describes
        an option that doesn't work.

        * strace.1: Note that -k is available only if strace is built
        with libunwind.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        debian: update control file.
        * debian/control (strace, strace-udeb): Add mips64 and mips64el
        to architecture list.
        Patch by James Cowgill <james410@cowgill.org.uk>

        This fixes Debian bug #773375.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        debian: sync with 4.9-2 package.
        * debian/changelog: Sync with 4.9-2.
        * debian/control: Likewise.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        Add arch-specific PTRACE_* constants.
        * xlat/ptrace_cmds.in: Add arch-specific ptrace commands.
        * xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile.
        * xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile.

        This fixes Debian bug #734554.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

        Clarify bootstrap-vs-autoreconf usage.
        * README-hacking: Tell people to run ./bootstrap.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        mips n32: fix preadv/pwritev offset decoding.
        In mips n32 abi, like in most of 32-bit architectures, offset
        is passed to preadv/pwritev syscalls using two syscall arguments.

        * io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

        tests: skip ipc_sem.test on broken kernels.
        Rather than trigger an ERROR which fails `make check`, go with SKIP
        instead.  We don't want the testsuite failing due to kernel bugs.

        * tests/ipc_sem.c (main): Change 99 to 77.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

        tests: skip pc.test on s390.
        The s390 hardware can't support an exact si_addr, and the current kernels
        don't handle text addresses correctly at all.  Until that improves, skip
        the test on s390.

        * tests/pc.c (main): Return 77 on s390 systems.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

        tests: note the kernel configs for -yy options.
        * tests/net-yy.test: Note CONFIG_INET_TCP_DIAG.
        * tests/unix-yy.test: Note CONFIG_UNIX_DIAG.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

        alpha: fix -yy decoding.
        * socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary.

        Reported-and-tested-by: Mike Frysinger <vapier@gentoo.org>

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

        aarch64, x32: fix decoding of compat personality statfs64/fstatfs64.
        * statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same
        attributes as on X86_64.

        mips: fix compilation warning.
        * syscall.c (get_scno) [MIPS]: Fix harmless compilation warning
        about comparison between signed and unsigned integer expressions.

        x32: fix compilation warnings.
        * sysinfo.c (sys_sysinfo): Use ll length format modifier
        instead of l and cast kernel ulong types to unsigned long long.

        aarch64: add -i option support.
        * syscall.c (print_pc): Add aarch64 support.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl: use x32 specific ioctl entries on x32 personality.
        As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h
        (by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32
        specific ioctl entries on x32 personality.

        * linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh.
        * linux/x86_64/ioctlent2.h: Remove.
        * linux/x86_64/ioctls_arch2.h: New file.
        * linux/x86_64/ioctls_inc2.h: New file.
        * Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add
        linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests/uid16: skip if real uid is larger than 16bit.
        * tests/uid16.c (main): Skip if the uid returned by getuid matches
        /proc/sys/kernel/overflowuid.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix uid tests on big endian architectures.
        * tests/uid.c (main): Ignore uids returned by getresuid to avoid
        16bit vs 32bit issues on big endian architectures.
        Change real UID instead of effective UID in setresuid test.
        * tests/uid16.c (main): Likewise.
        * tests/uid32.c (main): Change real UID instead of effective UID
        in setresuid test to match uid.c
        * tests/uid.awk: Update setresuid regexp.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-01  Mike Frysinger  <vapier@gentoo.org>

        tests/getdents: handle older getdents calls.
        If the tools we use call older getdents syscalls where d_type isn't
        passed back, or the arch is old (like Alpha) and can't pass back in
        either version, make sure we don't fail.

        * tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        Fix multiple personalities support in decoding syscall return values.
        * syscall.c (trace_syscall_exiting): When current personality is 32bit,
        print 32bit return code.

        Update generic 64-bit ioctlent from linux v3.19.
        * linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: fix rt_sigaction decoding.
        Fix regression introduced by commit v4.9-9-gc3a5c01.

        * signal.c (HAVE_SA_RESTORER): New macro.
        [HPPA || IA64]: Do not undefine SA_RESTORER.
        (old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER
        instead of SA_RESTORER to check whether to define sa_restorer.
        (decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in
        addition to SA_RESTORER to check whether to use sa_restorer.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        Fix stack buffer overflow when specified command is too long.
        * strace.c (startup_child): Check that the length of the command strace
        is going to execute does not exceed PATH_MAX limit.

        Reported-by: Cheolung Lee <chpie@grayhash.com>

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        build: include ptrace.h after regs.h.
        Restore the order of including <sys/reg.h> and <linux/ptrace.h>
        headers that was inadvertently changed by commit v4.9-280-g5503dd2.

        This should fix build on platforms like m68k where some constants
        are defined simultaneously as enums by <sys/reg.h> and as macros
        by <asm/ptrace.h>.

        * process.c: Include "ptrace.h" after "regs.h".
        * signal.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix decoding of timeval, timespec, and timex structures.
        As time_t is a 64-bit type in x32 personality, it is not correct to
        treat it as a long int type.

        * time.c (current_time_t_is_compat): New macro.
        (sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it.
        (tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t
        when printing tv_sec/tv_usec.
        (tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex
        members of type kernel_long_t.

2015-02-28  Mike Frysinger  <vapier@gentoo.org>

        tests/ipc_sem: detect broken kernels.
        When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc
        logic wrongly returns errors.  Detect that and throw an error.

        * tests/ipc_sem.c: Return 99 when errno is EFAULT.
        * tests/ipc_sem.test: Save output to $OUT and show it when failing.
        Handle exit status 99 to throw an ERROR.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        build: do not link strace with -ldl.
        * configure.ac: Fix dladdr check.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

        Handle broken PTRACE_EVENT_STOP values.
        For a few linux releases (3.1 through 3.3), this define in the exported
        headers were broken.  Redefine if that's the case.

        * ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

        bootstrap: always set up test dirs.
        When files get updated, the bootstrap script should make sure the
        parallel dirs are kept in sync.

        * bootstrap: Always generate the test$m.  Clean up symlinks first.
        Don't link in Makefile.in files.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

        Fix cross-compiling of ioctlsort.
        Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross
        compiling.  This way ioctlsort uses the build tools all the time.

        * configure.ac: Call AX_PROG_CC_FOR_BUILD.
        * Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD.
        (ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD.
        (ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD.
        (ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD.
        (ioctlsort_LD): Delete.
        (ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT).  Use ioctlsort_CFLAGS.
        * m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify pc.test.
        * configure.ac: Check for dladdr in -ldl.
        * tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS).
        * tests/pc.c: Include "config.h" and <dlfcn.h>.
        (main): Use dladdr to find the address to unmap.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        tests: drop support for alternative names of select syscall.
        This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824.

        * tests/select.awk: Drop _newselect support.
        * tests/select.test: Skip if select syscall is not supported.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Rename _newselect to select.
        As an exception to the general rules that syscall names should match
        __NR_* constants defined in kernel headers, show select as "select"
        and old select as "oldselect".

        * linux/arm/syscallent.h (82): Change name to oldselect.
        * linux/hppa/syscallent.h (142): Change name to select.
        * linux/mips/syscallent-n32.h (6022): Likewise.
        * linux/mips/syscallent-n64.h (5022): Likewise.
        * linux/mips/syscallent-o32.h (4142): Likewise.
        * linux/sparc/syscallent.h (230): Likewise.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: sync syscall entries with kernel headers.
        * linux/sparc/syscallent.h: Fix syscall entries for vmsplice,
        inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch,
        ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and
        sched_setaffinity.
        (67, 68, 202, 230): Change syscall names to match __NR_* constants
        defined in arch/sparc/include/uapi/asm/unistd.h.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        s390, s390x: sync syscall entry names with kernel headers.
        * linux/s390/syscallent.h (1, 180, 181): Change syscall names to match
        __NR_* constants defined in arch/s390/include/uapi/asm/unistd.h.
        * linux/s390x/syscallent.h: Likewise.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        xlat: avoid fork bombing the build system.
        When there were fewer xlat headers, this didn't matter as much.
        But now with >200, trying to run them all in parallel can easily
        fork bomb smaller systems.

        * xlat/gen.sh (main): Do not more jobs than # of cpus.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        arm: sync syscall entry names with kernel.
        * linux/arm/syscallent.h (82, 90, 180, 181, 327):
        Change syscall names to match __NR_* constants defined
        in arch/arm/include/uapi/asm/unistd.h.

        arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries
        * linux/arm/syscallent.h (320, 321, 350): Fix names and handlers.

        hppa: sync syscall entry names with kernel.
        * linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280):
        Change syscall names to match __NR_* constants defined in
        arch/parisc/include/uapi/asm/unistd.h.

        subcall.h: add sendmmsg entry.
        * linux/subcall.h: Add sys_sendmmsg entry.
        (SYS_socket_nsubcalls): Update.

        arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition.
        * linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall.

        ia64: parametrize i386 syscallent size check.
        * linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls)
        instead of numeric constant.

        Cleanup linux/subcall.h.
        * linux/subcall.h: Use SYS_ipc_subcall.

        alpha: fix statfs decoding.
        * statfs.c (printstatfs) [ALPHA]: Remove faulty code.

        x32: fix build regression.
        * linux/x32/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        hppa: fix fanotify_mark decoding.
        The parisc kernel has some legacy baggage here and decodes the 64bit
        field in the reverse order.  Handle it in strace too.

        * fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        ia64: fix decoding of getresuid/getresgid/setresgid.
        Looks like the similarity of these names caused confusion when generating
        the syscall table.  getresgid was wired to the wrong output while the other
        two were wired up to printargs instead of the real printer.

        * linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to
        sys_getresgid, and setresgid to sys_setresgid.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        ia64: fix up builds after 16bit uid support.
        The ia64 port pulls in the i386 syscall table so it can decode
        32bit apps, so we need to enable the 16bit uid parsers for it.

        * defs.h (NEED_UID16_PARSERS): Define to 1 for IA64.
        * linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        v4l2: use uintmax_t for times.
        There is no guarantee that the backing value for the various time fields
        are ints or longs which makes printfs annoying.  Lets cast them to the
        uintmax_t type so we can use the j flag and not worry about truncation.

        * v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

        ignore core/compile files.
        Newer autotools includes a compile helper script.

        * .gitignore: Add /compile and core.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        NEWS: Prepare for 4.10 release.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        Remove support for systems without PTRACE_SETOPTIONS.
        Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS
        and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE
        are universally available.

        This change removes all code that implemented post-execve SIGTRAP
        handling and fork/vfork/clone->CLONE_PTRACE substitution.

        * defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros.
        (need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations.
        * strace.c (need_fork_exec_workarounds,
        test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all):
        Remove.
        (syscall_trap_sig): Set to (SIGTRAP | 0x80).
        (ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC).
        (detach): Do not test for TCB_BPTSET.
        (init): Do not call test_ptrace_setoptions_followfork and
        test_ptrace_setoptions_for_all.  Do not test for TCB_BPTSET.
        * syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec,
        syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove.
        (trace_syscall_entering): Do not test for TCB_WAITEXECVE.  Do not call
        syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec.
        (trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and
        syscall_fixup_for_fork_exec.
        [IA64] (ia64_ia32mode): Make static.
        * linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration.
        * util.c: Do not include "syscall.h".
        (arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0,
        restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt):
        Remove.
        * tests/ptrace_setoptions.test: Remove.
        * tests/Makefile.am (TESTS): Remove it.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify pc.test.
        * tests/pc.c (main): Unmap larger memory region.
        Dump process map for debug purposes.
        * tests/pc.test: Update regexps to take CLD_DUMPED child process
        into account.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix "make dist" regression.
        * tests/Makefile.am (EXTRA_DIST): Add getrandom.awk.

        tests: workaround broken awk.
        * tests/getdents.out: New file.
        * tests/Makefile.am (EXTRA_DIST): Add it.
        * tests/getdents.test: Check whether awk is capable of matching long
        regular expressions.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compilation warnings about incompatible print formats.
        On some platforms printing of __s64 types with "%lld" format,
        or __u64 types with "%llu" or "%llx" formats causes a warning
        that __s64/__u64 type is not compatible with long long format.
        From my PoV, this is nonsense, but the workaround costs nothing.

        * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types
        to (unsigned long long).
        * v4l2.c (v4l2_ioctl): Likewise.  Cast __s64 type to (long long).

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc64: fix build regression.
        * linux/powerpc64/arch_regs.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.

        signalent: update from linux v3.19.
        * linux/alpha/signalent.h: Update from linux v3.19 signalent.sh.
        * linux/hppa/signalent.h: Likewise.
        * linux/mips/signalent.h: Likewise.
        * linux/sparc/signalent.h: Likewise.

        Cleanup auxiliary signalent files.
        * linux/aarch64/signalent1.h: Include "signalent.h".
        * linux/powerpc64/signalent1.h: Likewise.
        * linux/sparc64/signalent2.h: Likewise.
        * linux/tile/signalent1.h: Likewise.
        * linux/x32/signalent1.h: Likewise.
        * linux/x86_64/signalent1.h: Likewise.
        * linux/x86_64/signalent2.h: Likewise.
        * linux/sparc64/signalent.h: Include "sparc/signalent.h".
        * linux/sparc64/signalent1.h: Include "sparc/signalent1.h".
        * linux/x32/signalent.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64, x32: fix sys_sigreturn.
        On x86_64/x32, sys_sigreturn is defined only for i386 personality.

        * signal.c (sys_sigreturn): Define for X32.
        (sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, x32: fix build regression.
        * syscall.c (print_pc): Use current_wordsize iff it is defined.

        Change errnoent.h files to use designated initializers.
        * signal.c (printsiginfo): Allow elements of errnoent array to be zero.
        * syscall.c (trace_syscall_exiting): Likewise.
        * errnoent.sh: Output designated initializers.
        * linux/errnoent.h: Regenerated.
        * linux/alpha/errnoent.h: Regenerated.
        * linux/hppa/errnoent.h: Regenerated.
        * linux/mips/errnoent.h: Regenerated.
        * linux/sparc/errnoent.h: Regenerated.
        * linux/sparc/errnoent1.h: Regenerated.
        * linux/powerpc/errnoent.h: New file.
        * linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h".
        * Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h
        and linux/powerpc64/errnoent.h.

        errnoent: update from linux v3.19.
        * linux/errnoent.h: Update from linux v3.19 using errnoent.sh.
        * linux/alpha/errnoent.h: Likewise.
        * linux/hppa/errnoent.h: Likewise.
        * linux/mips/errnoent.h: Likewise.
        * linux/sparc/errnoent.h: Likewise.

        Cleanup auxiliary errnoent files.
        * linux/aarch64/errnoent1.h: Include "errnoent.h".
        * linux/powerpc64/errnoent1.h: Likewise.
        * linux/sparc64/errnoent2.h: Likewise.
        * linux/tile/errnoent1.h: Likewise.
        * linux/x32/errnoent1.h: Likewise.
        * linux/x86_64/errnoent1.h: Likewise.
        * linux/x86_64/errnoent2.h: Likewise.
        * linux/sparc64/errnoent.h: Include "sparc/errnoent.h".
        * linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h".
        * linux/x32/errnoent.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

        evdev: update constants from linux v3.19.
        * xlat/evdev_keycode.in: Update from linux v3.19.
        * xlat/evdev_prop.in: Likewise.

        evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands.
        * evdev.c (keycode_V2_ioctl): Use evdev_keycode to print
        input_keymap_entry.keycode.

        evdev: fix build with old kernel headers.
        * configure.ac: Check whether struct input_absinfo.resolution is defined
        in <linux/input.h>.
        * evdev.c (SYN_MAX): Add fallback definition.
        (abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check.
        (keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks.
        (evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW,
        EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW.
        (evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP,
        EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE.

2015-02-22  Etienne Gemsa  <etienne.gemsa@lse.epita.fr>

        Add decoding for evdev ioctls.
        This patch introduces decoding for evdev ioctls.  For EVIOCSFF the five
        first members are decoded, the union is not.  The code was compiled and
        tested on x86_64 with Linux 3.13.

        * evdev.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (evdev_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands.
        * xlat/evdev_autorepeat.in: New file.
        * xlat/evdev_ff_status.in: New file.
        * xlat/evdev_ff_types.in: New file.
        * xlat/evdev_keycode.in: New file.
        * xlat/evdev_leds.in: New file.
        * xlat/evdev_misc.in: New file.
        * xlat/evdev_mtslots.in: New file.
        * xlat/evdev_prop.in: New file.
        * xlat/evdev_relative_axes.in: New file.
        * xlat/evdev_snd.in: New file.
        * xlat/evdev_switch.in: New file.
        * xlat/evdev_sync.in: New file.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with old kernel headers.
        * strace.c (print_debug_info, maybe_allocate_tcb, print_signalled,
        print_exited): Remove "const" qualifier from status variable to
        workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED
        macros.
        * v4l2.c: Include <linux/types.h>.
        (v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS
        macros are defined.
        * tests/Makefile.am (AM_CPPFLAGS): Define.

        Fix "make dist" regression.
        * Makefile.am (EXTRA_DIST): Remove README-linux.

2015-02-20  Elliott Hughes  <enh@google.com>

        test/sfd.c: add missing includes.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Remove linux/fanotify.h.
        * linux/fanotify.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * fanotify.c: Do not include <linux/fanotify.h>.
        * xlat/fan_classes.in: Add default values.
        * xlat/fan_event_flags.in: Likewise.
        * xlat/fan_init_flags.in: Likewise.
        * xlat/fan_mark_flags.in: Likewise.

        Remove linux/keyctl.h.
        * linux/keyctl.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * keyctl.c: Do not include <linux/keyctl.h>.
        * xlat/key_perms.in: Add default values.
        * xlat/key_reqkeys.in: Likewise.
        * xlat/key_spec.in: Likewise.
        * xlat/keyctl_commands.in: Likewise.

        Remove linux/kexec.h.
        * linux/kexec.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * kexec.c: Do not include <linux/kexec.h>.
        * xlat/kexec_arch_values.in: Add default values.
        * xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default
        values.

        Remove linux/inotify.h.
        * linux/inotify.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * inotify.c: Do not include <linux/inotify.h>.
        * xlat/inotify_flags.in: Add default values.

        Remove linux/reboot.h.
        * linux/reboot.h: Remove.
        * Makefile.am (EXTRA_DIST): Remove it.
        * reboot.c: Do not include <linux/reboot.h>.
        * xlat/bootflags1.in: Add default values.
        * xlat/bootflags2.in: Likewise.
        * xlat/bootflags3.in: Likewise.

        seccomp: fix fallback definitions of some SECCOMP_* constants.
        * seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER,
        SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions.
        * xlat/seccomp_filter_flags.in: Add default value.
        * xlat/seccomp_ops.in: Add default values.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        is_negated_errno: sync MAX_ERRNO with the kernel.
        Linux kernel used to guarantee that the largest errno value will not
        exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit
        v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently
        broke it.  The guarantee is back with kernel commit
        v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d.

        * syscall.c (is_negated_errno): Set maximum errno value to 4095.

2015-02-19  Mike Frysinger  <vapier@gentoo.org>

        README-linux: punt.
        Considering we're requiring linux-2.6 era kernels, the discussion of
        header troubles that plagued 2.2 and 2.4 are no longer relevant.

        * README-linux: Delete.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Improve prctl decoding.
        * configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h.
        * prctl.c (sys_prctl): Implement full decoding of all PR_* constants
        as defined in linux v3.19.
        (sys_arch_prctl): Fix decoding of unknown commands.
        * xlat/cap.in: New file.
        * xlat/pr_mce_kill.in: New file.
        * xlat/pr_mce_kill_policy.in: New file.
        * xlat/pr_set_mm.in: New file.
        * xlat/pr_tsc.in: New file.
        * xlat/pr_unalign_flags.in: New file.
        * xlat/secbits.in: New file.
        * xlat/prctl_options.in: Remove non-linux constants, add fallback
        definitions.
        * xlat/seccomp_mode.in: Add fallback definitions.

        xlat: extend syntax.
        * xlat/gen.sh (gen_header): If the name of constant is specified with a
        value, generate a default definition for the constant using this value.
        * xlat/timerfdflags.in: Use extended syntax.

        Move CAP_* definitions out to header files.
        * Makefile.am (strace_SOURCES): Add caps0.h and caps1.h.
        * caps0.h: New file.
        * caps1.h: New file.
        * capability.c: Remove CAP_* definitions, include "caps0.h"
        and "caps1.h" instead.
        Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h".
        Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h".
        (print_cap_bits): Update callers.
        * xlat/capabilities.in: Rename to xlat/cap_mask0.in.
        * xlat/capabilities1.in: Rename to xlat/cap_mask1.in.

2015-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        Declare all format printers with printf format attribute.
        * defs.h (printllval, printnum_int, printnum_long): Mark with
        format(printf) attribute.
        * sock.c (sock_ioctl): Fix format string.

2015-02-17  Dmitry V. Levin  <ldv@altlinux.org>

        Rename printnum to printnum_long to avoid confusion.
        * defs.h (printnum): Rename to printnum_long.
        * util.c (printnum): Likewise.
        * process.c (sys_ptrace): Likewise.
        * time.c (sys_time): Likewise.

        Use printnum_int consistently.
        * sock.c (sock_ioctl): Use printnum_int instead of printnum to print
        integer type.
        * stream.c (sys_getpmsg): Likewise.

2015-02-16  Dmitry V. Levin  <ldv@altlinux.org>

        print_pc: fix multiple personalities support.
        * syscall.c (print_pc): Choose instruction pointer format depending
        on current_wordsize, not the size of long integer type.
        * tests/pc.c: New file.
        * tests/pc.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add pc.
        (TESTS): Add pc.test.
        * tests/.gitignore: Add pc.

        mips: use PTRACE_GETREGS to fetch all registers.
        * linux/mips/arch_regs.h (struct mips_regs): New structure.
        (mips_REG_*): New macros.
        * signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP.
        * syscall.c [MIPS] (struct mips_regs): New variable.
        [MIPS] (ARCH_REGS_FOR_GETREGS): New macro.
        (mips_a3, mips_r2): Remove.
        (print_pc) [MIPS]: Use mips_REG_EPC.
        (get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3.
        (get_syscall_args) [MIPS]: Use mips_REG_A[0-5].
        (get_syscall_result) [MIPS]: Remove.
        (get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0.

        mips: move ABI check to configure.ac.
        * configure.ac [MIPS]: Check for MIPS ABI.
        * defs.h [MIPS]: Remove MIPS ABI check.
        * ioctlsort.c: Likewise.

        tests: support alternative names of select syscall.
        * tests/select.awk: Recognize "_newselect" as another name of "select".
        * tests/select.test: Try alternative names of select syscall.

2015-02-15  Dmitry V. Levin  <ldv@altlinux.org>

        i386: fix compilation warning.
        Some gcc versions complain about assigning long* to uint32_t* on i386.

        * syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*.
        * linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
        * linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h".
        (i386_esp_ptr): New prototype.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        Do not reset get_regs_error unnecessarily.
        As get_regs() is now guaranteed to set get_regs_error,
        there is no need to reset get_regs_error before get_regs() call.

        * strace.c (trace): Call clear_regs() iff !WIFSTOPPED.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        get_syscall_result: remove redundant ifdefs.
        As get_regs() is now guaranteed to fetch registers when either
        ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can
        safely replace all checks for architectures where these macros are defined
        with a single check for these macros.

        * syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET ||
        ARCH_REGS_FOR_GETREGS].  Remove all checks for architectures where
        nothing has to be done after get_regs().

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        get_regs: define for all architectures.
        * defs.h (get_regs_error): Remove.
        (clear_regs): Update prototype, declare unconditionally.
        (get_regs): Declare unconditionally.
        * syscall.c (clear_regs): New function.
        (get_regs): Define unconditionally.
        (get_regs_error): Define unconditionally, change scope to static.

        get_regs: unify code for architectures that use PTRACE_GETREGS.
        * syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE]
        (ARCH_REGS_FOR_GETREGS): New macro.
        (get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures.

        get_regset: define iff PTRACE_GETREGSET is used.
        * syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET,
        ARCH_IOVEC_FOR_GETREGSET): New macros.
        (get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change
        return type to long, return ptrace() return code instead of assigning it
        to get_regs_error; do not list individual architectures, implement
        constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET.
        (get_regs): Assign get_regset() return code to get_regs_error.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        arm, i386: switch back to use PTRACE_GETREGS.
        PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and
        i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS
        is a bit more costly, so choose the method that costs less.
        This partially reverts commit v4.7-149-gfaa177e.

        * syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove.
        (get_regset) [ARM || I386]: Remove.
        (get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        syscall.c: remove obsolete ifdefs.
        * syscall.c (get_regset, get_regs): Do not check for availability
        of PTRACE_GETREGSET and NT_PRSTATUS macros.

        syscall.c: ensure that NT_PRSTATUS is defined.
        * syscall.c: Do not include <elf.h>.
        (NT_PRSTATUS): New macro.

2015-02-13  Dmitry V. Levin  <ldv@altlinux.org>

        Move regs-related macros and declarations from defs.h to regs.h.
        * regs.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/arch_regs.h: New file.
        * linux/alpha/arch_regs.h: Likewise.
        * linux/arm/arch_regs.h: Likewise.
        * linux/hppa/arch_regs.h: Likewise.
        * linux/i386/arch_regs.h: Likewise.
        * linux/ia64/arch_regs.h: Likewise.
        * linux/mips/arch_regs.h: Likewise.
        * linux/powerpc/arch_regs.h: Likewise.
        * linux/sh64/arch_regs.h: Likewise.
        * linux/sparc/arch_regs.h: Likewise.
        * linux/sparc64/arch_regs.h: Likewise.
        * linux/tile/arch_regs.h: Likewise.
        * linux/x86_64/arch_regs.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add them.
        * defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*,
        and ARM_* macros.
        Remove declarations of struct pt_regs variables.
        [SPARC]: Do not include <asm/psr.h>.
        [SPARC64]: Do not include <asm/psrcompat.h>.
        * bjm.c: Do not include <sys/user.h>.
        * process.c: Include "regs.h".
        Do not include <sys/user.h> and <sys/reg.h>.
        [IA64]: Do not include <asm/ptrace_offsets.h> and <asm/rse.h>.
        * util.c: Likewise.
        * syscall.c: Likewise.
        [AARCH64]: Define struct arm_pt_regs and ARM_* macros.
        [SPARC]: Include <asm/psr.h>.
        [SPARC64]: Include <asm/psrcompat.h>.
        * signal.c: Include "regs.h".
        Do not include <sys/user.h> and <sys/reg.h>.
        [IA64]: Do not include <asm/ptrace_offsets.h>.
        * strace.c [IA64]: Do not include <asm/ptrace_offsets.h>.

        Move all ptrace-related macros and declarations from defs.h to ptrace.h.
        * ptrace.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * configure.ac (AC_CHECK_HEADERS): Remove linux/ptrace.h and sys/ptrace.h.
        * defs.h: Do not include <sys/ptrace.h> and <asm/ptrace.h>.
        Remove definitions of PTRACE_* macros.
        * process.c: Remove <linux/ptrace.h> workarounds, include "ptrace.h".
        * signal.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.
        * strace.c: Include "ptrace.h".
        * wait.c: Likewise.

2015-02-12  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance wait status decoding.
        * xlat/ptrace_events.in: New file.
        * wait.c: Include "xlat/ptrace_events.h".
        (printstatus): In case of WIFSTOPPED, print 0x80 flag separately from
        the stop signal name.
        [WIFCONTINUED]: Add WIFCONTINUED support.
        Decode PTRACE_EVENT_* events.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

        scsi: add bsg support.
        The Linux kernel supports two different versions of the SG_IO API,
        namely v3 and v4. This patch adds support for version 4 of this API.
        At least the sg3_utils package supports version 4 of this API.  Version
        4 of this API is used if /dev/bsg/H:C:I:L is used as device name.

        This patch has been tested by inspecting the output of the following
        commands:

        modprobe scsi_debug dev_size_mb=16 delay=0
        dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p')
        ./strace -eioctl -s256 sg_inq $dev
        echo 'Test XDWRITEREAD(10)'
        bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p')
        dd if=/dev/zero bs=512 count=1 |
          ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00

        * configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h.
        * xlat/bsg_protocol.in: New file.
        * xlat/bsg_subprotocol.in: Likewise.
        * scsi.c: Include them and <linux/bsg.h>.
        (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
        print_sg_io_v4_res): New functions.
        (print_sg_io_req, print_sg_io_res): Use them.
        (scsi_ioctl): Update callers.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

        scsi: Add iovec support.
        * scsi.c (print_sg_io_req, print_sg_io_res): Add support for decoding
        iovecs passed via the SG I/O v3 interface.  Decode the "data in" and
        "data out" buffers in hex instead of in ASCII.

        scsi: on exit, print only initialized part of the buffer.
        * scsi.c (print_sg_io_res): Only print that part of the data in buffer
        that has been initialized by the SCSI LLD driver.

        scsi: make print_sg_io_buffer() print square brackets instead of its callers
        * scsi.c (print_sg_io_buffer): Print square brackets in this function.
        (print_sg_io_req, print_sg_io_res): Update callers.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

        scsi: improve consistency with other decoding functions.
        Pass pointers to tracee's memory as integers instead of pointers.

        * scsi.c (print_sg_io_buffer): Change second argument's type to
        unsigned long.
        (print_sg_io_req, print_sg_io_res): Update callers.

2015-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: extend getdents to support all filesystems regardless of file order
        * tests/getdents.awk: Include all 6 possible permutations of 3
        direntries to regexps.

2015-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        print_setsockopt: fix fall-through bug in SOL_IP switch case.
        This fixes the bug introduced by commit v4.9-250-ga0a4909.

        * net.c (print_setsockopt): Separate SOL_IP case from SOL_PACKET.

        Reported-by: Ben Noordhuis <info@bnoordhuis.nl>

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        Do not watch for post-execve SIGTRAP if PTRACE_O_TRACEEXEC is enabled.
        If PTRACE_O_TRACEEXEC option is enabled, then post-execve SIGTRAPs are
        suppressed and we can safely skip -ENOSYS heuristics.  This partially
        reverts commits v4.9-258-g8e398b6 and v4.9-261-gd70c41d.

        * syscall.c (syscall_fixup_on_sysenter): Skip if PTRACE_O_TRACEEXEC
        flag is set in ptrace_setoptions.  Remove all SECCOMP_RET_ERRNO
        workarounds as they are not needed when PTRACE_O_TRACEEXEC is not
        supported by the kernel.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        When the process stared by strace exits/terminates, forget its pid.
        The process stared by strace can exit/terminate only once.  When this
        happens, forget its pid, so that any other event or action related to a
        process with the same pid as the pid of that first process would not be
        confused with that first process.

        * strace.c (print_signalled, print_exited): Clear strace_child when it
        equals to the given pid.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        -b execve: avoid misleading warning about unknown pid.
        * strace.c (maybe_allocate_tcb): If detach_on_execve is set, do not warn
        about !WIFSTOPPED process with pid == strace_child.
        * tests/bexecve.test: New test.
        * tests/Makefile.am (TESTS): Add it.

        -b execve: do not use struct tcb after detach.
        * strace.c (trace): Do not proceed after detach.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        trace: split into several functions.
        This change moves the main loop back to main() and splits trace()
        into several functions.  There are no algorithmic changes.

        * strace.c (print_debug_info, maybe_allocate_tcb, maybe_switch_tcbs,
        print_signalled, print_exited, print_stopped, startup_tcb): New
        functions.
        (trace) Use them.  Move the main loop ...
        (main): ... here.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        printsiginfo: constify the first argument.
        * signal.c (printsiginfo): Make the first argument a pointer to a const type.
        * defs.h (printsiginfo): Likewise.
        (printsiginfo, printsiginfo_at): Always define these prototypes.
        * configure.ac (AC_CHECK_TYPES): Remove siginfo_t, as HAVE_SIGINFO_T
        is no longer used.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        test: add a manual test for seccomp decoding.
        * test/.gitignore: Add seccomp.
        * test/Makefile (PROGS): Likewise.
        * test/seccomp.c: New file.
        * test/README: Mention ../tests/.

        Implement seccomp decoding.
        * configure.ac (AC_CHECK_HEADERS): Add linux/filter.h
        and linux/seccomp.h.
        * defs.h (print_seccomp_filter): New prototype.
        * linux/dummy.h (sys_seccomp): Remove.
        * linux/syscall.h (sys_seccomp): New prototype.
        * prctl.c: Include <linux/seccomp.h>.
        (sys_prctl): Decode PR_SET_SECCOMP.
        * seccomp.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * xlat/bpf_class.in: New file.
        * xlat/bpf_miscop.in: Likewise.
        * xlat/bpf_mode.in: Likewise.
        * xlat/bpf_op_alu.in: Likewise.
        * xlat/bpf_op_jmp.in: Likewise.
        * xlat/bpf_rval.in: Likewise.
        * xlat/bpf_size.in: Likewise.
        * xlat/bpf_src.in: Likewise.
        * xlat/seccomp_filter_flags.in: Likewise.
        * xlat/seccomp_mode.in: Likewise.
        * xlat/seccomp_ops.in: Likewise.
        * xlat/seccomp_ret_action.in: Likewise.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        is_negated_errno: support large errno values.
        Thanks to SECCOMP_RET_DATA == 0xffff, abnormally large errno
        values could be easily seen when a seccomp filter is used, e.g.
        BPF_STMT(BPF_RET, SECCOMP_RET_ERRNO | SECCOMP_RET_DATA)

        * syscall.c (is_negated_errno): Allow errno values as large as 0xffff.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        x86, x32, x86_64: print SECCOMP_RET_ERRNO filtered syscalls.
        This is required to process SECCOMP_RET_ERRNO filtered syscalls on
        systems where linux kernel does not change the syscall number to -1.

        * syscall.c (is_negated_errno): Move before syscall_fixup_on_sysenter.
        (syscall_fixup_on_sysenter) [I386 || X32 || X86_64] : Use it to check
        AX register.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        is_negated_errno: merge x86_64 and x32 definitions.
        * syscall.c (kernel_long_t, kernel_ulong_t): New types.
        (is_negated_errno): Merge [X32] and [!X32] definitions.
        (get_error): Merge [X86_64] and [X32] code.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        x32: rename is_negated_errno_x32 to is_negated_errno.
        Use the same function name on all architectures.

        * syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno.
        (get_error) [X32]: Update callers.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        x86, x32, x86_64: do not skip syscall number -1.
        Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering.

        * syscall.c (syscall_fixup_on_sysenter) [I386 || X32 || X86_64]:
        Do not skip syscalls that have number -1.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: do not interpet syscall number -1 as a x32 personality syscall.
        Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering.

        * syscall.c (get_scno) [X86_64]: Handle the case of scno == -1.

2015-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        Implement getrandom syscall decoding.
        * getrandom.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/dummy.h (sys_getrandom): Remove.
        * linux/syscall.h (sys_getrandom): New prototype.
        * xlat/getrandom_flags.in: New file.
        * tests/getrandom.c: New file.
        * tests/getrandom.awk: New file.
        * tests/getrandom.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add getrandom.
        (TESTS): Add getrandom.test.
        (EXTRA_DIST): Add getrandom.awk.
        * tests/.gitignore: Add getrandom.

2015-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for select syscall decoding.
        Convert test/select.c into a regular test.

        * test/Makefile (PROGS): Remove select.
        * test/.gitignore: Likewise.
        * test/select.c: Rewrite to ...
        * tests/select.c: ... new file.
        * tests/select.awk: New file.
        * tests/select.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add select.
        (TESTS): Add select.test.
        (EXTRA_DIST): Add select.awk.
        * tests/.gitignore: Add select.

2015-02-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for the latest dumpio fix.
        * tests/dumpio.expected: New file.
        * tests/unix-pair-send-recv.c: New file.
        * tests/dumpio.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add unix-pair-send-recv.
        (TESTS): Add dumpio.test.
        (EXTRA_DIST): Add dumpio.expected.
        * tests/.gitignore: Add unix-pair-send-recv.

2015-02-01  Aurelien Jacobs  <aurel@gnuage.org>

        Fix simultaneous -e read and -e write usage.
        This allows using both -e read=FD and -e write=FD at the same time
        with the same FD.
        Without this patch, the -e write=FD is ignored if -e read=FD is used
        at the same time.

2015-01-31  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: remove unused HAVE_SIN6_SCOPE_ID_LINUX-based code.
        The AC_SIN6_SCOPE_ID autoconf macro that was able to define
        HAVE_SIN6_SCOPE_ID_LINUX was removed by commit v4.4-98-g64f793a.

        * net.c [HAVE_SIN6_SCOPE_ID_LINUX]: Remove.

2015-01-30  Dmitry V. Levin  <ldv@altlinux.org>

        printsock: do not fetch sockaddr.sa_data twice.
        * net.c (printsock): Print addrbuf.sa.sa_data using print_quoted_string.

        setsockopt: add decoding of MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP.
        * net.c (print_group_req): New function.
        (print_setsockopt): Use it.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for sockaddr_un.sun_path decoding.
        * tests/net-accept-connect.c: Allow long socket addresses.
        * tests/sun_path.test: New test.
        * tests/Makefile.am (TESTS): Add it.

        printsock: print the whole sockaddr_un.sun_path.
        * net.c (printsock): If sockaddr_un.sun_path is not NUL-terminated,
        do not omit the last byte of sockaddr_un.sun_path array.

        printsock: do not fetch sockaddr_un.sun_path twice.
        * net.c (printsock): Print addrbuf.sau.sun_path using
        print_quoted_string.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        net: define all SOL_* constants.
        Ensure that all known SOL_* constants are defined.
        Sync the list of known SOL_* constants with linux/socket.h.

        * net.c: Provide definitions for all SOL_* constants.
        Remove all SOL_* preprocessor conditionals.
        (socketlayers): Disconnect from inet_protocols.
        * xlat/socketlayers.in: Remove SOL_ICMP, add SOL_ALG and SOL_NFC.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        setsockopt: decode PACKET_ADD_MEMBERSHIP.
        * xlat/packet_mreq_type.in: New file.
        * net.c: Include "xlat/packet_mreq_type.h".
        (print_packet_mreq): New function.
        (print_setsockopt): Use it.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

        getsockopt, setsockopt: do not decode structures in non-verbose mode.
        Move the code that is common between getsockopt and setsockopt parsers
        to a separate function.
        Move printers specific to getsockopt and setsockopt to separate
        functions, choose appropriate parsers depending on verbose mode.
        Move parsers of specific socket options to separate functions.

        * net.c (printicmpfilter): Rename to print_icmp_filter.
        (printsockopt): Remove.
        (print_sockopt_fd_level_name, print_linger, print_ucred,
        print_tpacket_stats, print_getsockopt, print_tpacket_req,
        print_packet_mreq, print_setsockopt): New functions.
        (sys_getsockopt, sys_setsockopt): Use them.

2015-01-28  Dmitry V. Levin  <ldv@altlinux.org>

        sendmsg: do not decode msghdr in non-verbose mode.
        * net.c (printmsghdr): Do not decode struct msghdr in non-verbose mode.

        decode_select: do not allocate unused memory.
        * desc.c (decode_select): On entering syscall, do not allocate memory
        in non-verbose mode.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

        xattr: quote using print_quoted_string.
        * xattr.c (print_xattr_val): Drop local quoting code, use
        print_quoted_string.

        v4l2: quote pixelformat.
        * v4l2.c (print_pixelformat): Output in quoted v4l2_fourcc() format.

        v4l2: quote strings.
        * v4l2.c (v4l2_ioctl): Print strings using print_quoted_string.

        mips: quote sysmips nodename.
        * sysmips.c (sys_sysmips): Print nodename using print_quoted_string.

        block_ioctl: quote strings.
        * block.c (print_blkpg_req): Print blkpg_partition.devname and
        blkpg_partition.volname using print_quoted_string.
        (block_ioctl): Print blk_user_trace_setup.name using print_quoted_string.

        sys_uname: quote struct utsname members.
        * uname.c (PRINT_UTS_MEMBER): New macro.
        (sys_uname): Use them.

        sock_ioctl: quote network interface names.
        * sock.c (print_ifname): New function.
        (sock_ioctl): Use it to quote ifr_name, ifru_newname, and ifru_slave.

        printsock: quote network interface names.
        * net.c (printsock): Print network interface names returned by
        if_indextoname() using print_quoted_string.

        getdents, getdents64: quote filenames.
        * dirent.c (print_old_dirent): Fix quoting.
        (sys_getdents): Print d_name using print_quoted_string.
        (sys_getdents64): Likewise.
        * tests/getdents.test: Test it.
        * tests/getdents.awk: Update.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

        printfd: quote pathnames.
        Change printfd() behaviour in show_fd_path mode to quote pathnames
        the same way printpathn() does.

        * util.c (printfd): Print non-socket paths using print_quoted_string.
        * tests/scm_rights-fd.test: Test it.
        * tests/scm_rights.c: Update.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

        Rework string_quote API.
        string_quote() has proven to be too hard to use, replace it with
        print_quoted_string() that does memory allocation and prints the result.

        * defs.h (string_quote): Remove.
        (QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES): New macros.
        (print_quoted_string): New prototype.
        * util.c (string_quote): Make static; take "style" flags instead
        of "len", treat QUOTE_0_TERMINATED style flag as former (len == -1);
        add QUOTE_OMIT_LEADING_TRAILING_QUOTES style flag support.
        (ALLOCA_CUTOFF, use_alloca): New macros.
        (print_quoted_string): New function.
        (printpathn, printstr): Update to new API.
        * loop.c (loop_ioctl): Likewise.
        * mtd.c (ubi_ioctl): Likewise.
        * net.c (print_scm_security): Likewise.
        * socketutils.c (unix_parse_response): Likewise.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        avr32: fix typo in sys_timerfd syscall entry.
        * linux/avr32/syscallent.h (timerfd): Change sys_name to "timerfd".

        hppa: fix typos in getresuid and getresgid syscall entries.
        * linux/hppa/syscallent.h (getresuid): Change sys_func to sys_getresuid.
        (getresgid): Change sys_func to sys_getresgid.

2015-01-24  Helge Deller  <deller@gmx.de>

        hppa: fix typo in getpeername syscall entry.
        This fixes an obvious typo which prints "lock" instead of "getpeername"
        for the getpeername syscall.

        * linux/hppa/syscallent.h (getpeername): Change sys_name to "getpeername".

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        Impove struct cmsghdr decoding.
        Print all cmsghdr structures in msg_control array,
        not just the first one.
        Change output format to be consistent with other parts of strace
        where structures and arrays are printed.
        Implement decoder for SCM_SECURITY message type.

        * net.c (print_scm_rights, print_scm_creds, print_scm_security):
        New functions.
        (printcmsghdr): Use them.  Iterate over all members of the array.
        * xlat/scmvals.in: Add SCM_SECURITY.
        * tests/scm_rights.c (main): Pass one more descriptor to the receiver.
        Set SO_PASSCRED on the receiver part.  Reserve enough space to receive
        SCM_CREDENTIALS and SCM_RIGHTS.
        * tests/scm_rights-fd.test: Update.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        Update SO_* constants.
        * xlat/sockoptions.in: Add SO_DOMAIN, SO_MARK, SO_NOFCS, SO_PASSSEC,
        SO_PROTOCOL, SO_RCVBUFFORCE, SO_SNDBUFFORCE, SO_TIMESTAMPING,
        and SO_TIMESTAMPNS.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        tests: run tests for each supported personality.
        When strace supports more than one personality, run test suite
        for each personality supported by the host system.

        * bootstrap: Create tests-m32 and tests-mx32 subtrees from tests.
        * configure.ac: Check for -m32 and -mx32 runtime support.
        (AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile.
        * Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define.
        [HAVE_MX32_RUNTIME] (TESTS_MX32): Define.
        (SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32).
        * .gitignore: Add /tests-m32 and /tests-mx32.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

        Fix ILP32 personality struct cmsghdr decoding on LP64 architectures.
        * net.c (union_cmsghdr): New union.
        [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (cmsghdr32): New structure.
        (printcmsghdr): Properly handle the case of current_wordsize < sizeof(long).

        Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures
        * io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG
        && SUPPORTED_PERSONALITIES > 1]: Properly handle the case of
        current_wordsize < sizeof(long).

2015-01-22  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl: take all 32 bits of ioctl commands into account.
        Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl
        commands were used for decoding, which was the source for numerous
        annoying collisions like this:

                ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
                ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device)

        The solution is to use all 32 bits for decoding, not just "number" and
        "type", but also "size" and "direction".

        As some architectures override defaults that come from asm-generic/ and
        provide alternative definitions for some ioctl commands, we support
        per-architecture ioctl definitions and merge them with common
        definitions at build time.  During the merge, we used to keep both
        generic and architecture-specific definitions, now architecture-specific
        definitions have precedence over generic ones -- ioctlsort omits
        definitions from asm-generic/ for those ioctl names that have different
        definitions in asm/.

        Additional bits of "direction" are architecture specific -- the number
        of bits and their values differ between architectures.  To reduce
        architecture differences in the source code, we keep "direction" in
        symbolic form and compile it in ioctlsort.

        Additional bits of "size" are also architecture specific -- not only the
        number of bits differ between architectures, but sizes of many types
        depend on sizeof(long).  To reduce architecture differences in the
        source code, we keep 32-bit and 64-bit versions of common ioctl
        definitions, and use the appropriate version for each architecture and
        personality.

        To implement this, the tools for generating ioctl definitions from
        kernel headers have been rewritten, and the source format of ioctl
        definitions has been extended.   The final ioctlent*.h files that are
        included by syscall.c are now generated from source ioctls_inc*.h and
        ioctls_arch*.h files at build time with ioctlsort.

        * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code.
        * ioctlsort.c: Rewritten.
        * linux/32/ioctls_inc.h: New file.
        * linux/64/ioctls_inc.h: New file.
        * linux/aarch64/ioctls_arch0.h: New file.
        * linux/aarch64/ioctls_arch1.h: New file.
        * linux/aarch64/ioctls_inc0.h: New file.
        * linux/aarch64/ioctls_inc1.h: New file.
        * linux/alpha/ioctls_arch0.h: New file.
        * linux/alpha/ioctls_inc0.h: New file.
        * linux/arc/ioctls_arch0.h: New file.
        * linux/arc/ioctls_inc0.h: New file.
        * linux/arm/ioctls_arch0.h: New file.
        * linux/arm/ioctls_inc0.h: New file.
        * linux/avr32/ioctls_arch0.h: New file.
        * linux/avr32/ioctls_inc0.h: New file.
        * linux/bfin/ioctls_arch0.h: New file.
        * linux/bfin/ioctls_inc0.h: New file.
        * linux/hppa/ioctls_arch0.h: New file.
        * linux/hppa/ioctls_inc0.h: New file.
        * linux/i386/ioctls_arch0.h: New file.
        * linux/i386/ioctls_inc0.h: New file.
        * linux/ia64/ioctls_arch0.h: New file.
        * linux/ia64/ioctls_inc0.h: New file.
        * linux/m68k/ioctls_arch0.h: New file.
        * linux/m68k/ioctls_inc0.h: New file.
        * linux/metag/ioctls_arch0.h: New file.
        * linux/metag/ioctls_inc0.h: New file.
        * linux/microblaze/ioctls_arch0.h: New file.
        * linux/microblaze/ioctls_inc0.h: New file.
        * linux/mips/ioctls_arch0.h: New file.
        * linux/mips/ioctls_inc0.h: New file.
        * linux/or1k/ioctls_arch0.h: New file.
        * linux/or1k/ioctls_inc0.h: New file.
        * linux/powerpc/ioctls_arch0.h: New file.
        * linux/powerpc/ioctls_inc0.h: New file.
        * linux/powerpc64/ioctls_arch0.h: New file.
        * linux/powerpc64/ioctls_arch1.h: New file.
        * linux/powerpc64/ioctls_inc0.h: New file.
        * linux/powerpc64/ioctls_inc1.h: New file.
        * linux/s390/ioctls_arch0.h: New file.
        * linux/s390/ioctls_inc0.h: New file.
        * linux/s390x/ioctls_arch0.h: New file.
        * linux/s390x/ioctls_inc0.h: New file.
        * linux/sh/ioctls_arch0.h: New file.
        * linux/sh/ioctls_inc0.h: New file.
        * linux/sh64/ioctls_arch0.h: New file.
        * linux/sh64/ioctls_inc0.h: New file.
        * linux/sparc/ioctls_arch0.h: New file.
        * linux/sparc/ioctls_inc0.h: New file.
        * linux/sparc64/ioctls_arch0.h: New file.
        * linux/sparc64/ioctls_arch2.h: New file.
        * linux/sparc64/ioctls_inc0.h: New file.
        * linux/sparc64/ioctls_inc2.h: New file.
        * linux/tile/ioctls_arch0.h: New file.
        * linux/tile/ioctls_arch1.h: New file.
        * linux/tile/ioctls_inc0.h: New file.
        * linux/tile/ioctls_inc1.h: New file.
        * linux/x32/ioctls_arch0.h: New file.
        * linux/x32/ioctls_arch1.h: New file.
        * linux/x32/ioctls_inc0.h: New file.
        * linux/x32/ioctls_inc1.h: New file.
        * linux/x86_64/ioctls_arch0.h: New file.
        * linux/x86_64/ioctls_arch1.h: New file.
        * linux/x86_64/ioctls_inc0.h: New file.
        * linux/x86_64/ioctls_inc1.h: New file.
        * linux/xtensa/ioctls_arch0.h: New file.
        * linux/xtensa/ioctls_inc0.h: New file.
        * linux/aarch64/ioctlent.h.in: Remove.
        * linux/aarch64/ioctlent1.h: Remove.
        * linux/alpha/ioctlent.h.in: Remove.
        * linux/arc/ioctlent.h.in: Remove.
        * linux/arm/ioctlent.h.in: Remove.
        * linux/avr32/ioctlent.h.in: Remove.
        * linux/bfin/ioctlent.h.in: Remove.
        * linux/hppa/ioctlent.h.in: Remove.
        * linux/i386/ioctlent.h.in: Remove.
        * linux/ia64/ioctlent.h.in: Remove.
        * linux/ioctlent.h.in: Remove.
        * linux/ioctlent.sh: Remove.
        * linux/m68k/ioctlent.h.in: Remove.
        * linux/metag/ioctlent.h.in: Remove.
        * linux/microblaze/ioctlent.h.in: Remove.
        * linux/mips/ioctlent.h.in: Remove.
        * linux/mips/ioctlent.sh: Remove.
        * linux/or1k/ioctlent.h.in: Remove.
        * linux/powerpc/ioctlent.h.in: Remove.
        * linux/powerpc64/ioctlent.h: Remove.
        * linux/powerpc64/ioctlent1.h: Remove.
        * linux/s390/ioctlent.h.in: Remove.
        * linux/s390x/ioctlent.h.in: Remove.
        * linux/sh/ioctlent.h.in: Remove.
        * linux/sh64/ioctlent.h.in: Remove.
        * linux/sparc/ioctlent.h.in: Remove.
        * linux/sparc64/ioctlent.h.in: Remove.
        * linux/sparc64/ioctlent2.h: Remove.
        * linux/tile/ioctlent.h.in: Remove.
        * linux/tile/ioctlent1.h: Remove.
        * linux/x32/ioctlent.h.in: Remove.
        * linux/x32/ioctlent1.h: Remove.
        * linux/x86_64/ioctlent.h.in: Remove.
        * linux/x86_64/ioctlent1.h: Remove.
        * linux/xtensa/ioctlent.h.in: Remove.
        * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h.
        * syscall.c (struct_ioctlent ioctlent0): Likewise.
        * Makefile.am: Remove all ioctlent-related definitions.
        Define the list of ioctlent*.h files that have to be generated by
        presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files.
        Add rules for ioctlent*.h files generation.
        (EXTRA_DIST): Update.
        * maint/ioctls_gen.sh: New file.
        * maint/ioctls_hex.sh: New file.
        * maint/ioctls_sym.sh: New file.
        * maint/print_ioctlent.c: New file.
        * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration.
        * .gitignore: Add ioctlent[012].h and ioctls_all[012].h.
        * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h
        and linux/mmtimer.h for tests.
        * tests/ioctl.c: New file.
        * tests/ioctl.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add ioctl.
        (TESTS): Add ioctl.test.
        * tests/.gitignore: Add ioctl.

2015-01-21  Gabriel Laskar  <gabriel@lse.epita.fr>

        ioctl: add decoding for parametrized command names.
        Some ioctl commands from evdev, hiddev, mixer, uinput, spi, and joystick
        are parametrized by a size or a number that are variable.  This change
        implements printing of these parametrized ioctl command names.

        * configure.ac (AC_CHECK_HEADERS): Add linux/input.h.
        * defs.h (ioctl_decode_number): New prototype.
        * io.c (sys_ioctl): Use ioctl_decode_number.
        * ioctl.c (ioctl_decode_number): New function.
        * xlat/evdev_abs.in: New file.
        * xlat/evdev_ev.in: New file.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        Update auxiliary maintainer mode build tools.
        * git-set-file-times: Update from rsync.
        * git-version-gen: Update from gnulib.
        * gitlog-to-changelog: Likewise.

        Update warnings.m4.
        * m4/warnings.m4: Update from gnulib.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        powerpc64: maintain own linux/powerpc64 subdirectory.
        Most architectures supported by strace have their own subdirectory in
        linux directory, but powerpc64 didn't, causing inconveniences.

        * configure.ac (arch): Define to "powerpc64" on powerpc64.
        * linux/powerpc/errnoent1.h: Move to linux/powerpc64/.
        * linux/powerpc/ioctlent1.h: Likewise.
        * linux/powerpc/signalent1.h: Likewise.
        * linux/powerpc/syscallent1.h: Likewise.
        * linux/powerpc64/ioctlent.h: New file.
        * linux/powerpc64/syscallent.h: Likewise.
        * linux/powerpc64/userent.h: Likewise.
        * Makefile.am (EXTRA_DIST): Remove linux/powerpc/ioctlent1.h,
        linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, and
        linux/powerpc/signalent1.h; added linux/powerpc64/errnoent1.h,
        linux/powerpc64/ioctlent.h, linux/powerpc64/ioctlent1.h,
        linux/powerpc64/signalent1.h, linux/powerpc64/syscallent.h,
        linux/powerpc64/syscallent1.h, and linux/powerpc64/userent.h.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

        configure.ac: remove unused AC_INCLUDEDIR.
        * configure.ac (AC_INCLUDEDIR): Remove.
        * m4/includedir.m4: Remove.

        ioctl: print unrecognized ioctl codes in _IOC(dir,type,nr,size) format.
        * defs.h (ioctl_print_code): New prototype.
        * ioctl.c: Include xlat/ioctl_dirs.h.
        (ioctl_print_code): New function.
        * io.c (sys_ioctl): Use it.
        * xlat/ioctl_dirs.in: New file.

2015-01-20  Dmitry V. Levin  <ldv@altlinux.org>

        ioctl: assume that all ioctl commands have unsigned int type.
        In linux, ioctl command number has a 32-bit unsigned integer type:
                fs/ioctl.c:SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
        If the kernel completely ignores other bits on 64-bit architectures,
        why should strace care?
        Let's follow the kernel and treat it as unsigned int.

        * defs.h (struct_ioctlent): Change "code" type to "unsigned int".
        (ioctl_decode, ioctl_lookup, block_ioctl, loop_ioctl, mtd_ioctl,
        ubi_ioctl, ptp_ioctl, scsi_ioctl, sock_ioctl, term_ioctl, rtc_ioctl,
        v4l2_ioctl): Likewise.
        * ioctl.c (ioctl_decode, ioctl_lookup, compare, ioctl_next_match):
        Likewise.
        * block.c (block_ioctl): Likewise.
        * loop.c (loop_ioctl): Likewise.
        * mtd.c (mtd_ioctl, ubi_ioctl): Likewise.
        * ptp.c (ptp_ioctl): Likewise.
        * scsi.c (scsi_ioctl): Likewise.
        * sock.c (sock_ioctl): Likewise.
        * term.c (term_ioctl): Likewise.
        * time.c (rtc_ioctl): Likewise.
        * v4l2.c (v4l2_ioctl): Likewise.
        * ioctlsort.c (struct ioctlent, compare, main): Likewise.

2015-01-16  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlent.sh: cleanup regexps that are used to fetch bases.

        ioctlent.sh: sync lookup regexps that are used in grep and sed.
        ioctlent.sh looks for ioctl command names using grep, and fetches them
        with their definitions using sed.  Historically, lookup regexps used in
        grep and sed are slightly different, which makes the script more
        complicated than necessary.

        qemu_multiarch_testing: update.
        * qemu_multiarch_testing/.gitignore: New file.
        * qemu_multiarch_testing/README: Update statistics.
        * qemu_multiarch_testing/hdc.dir/init2: Run "make check".
        * qemu_multiarch_testing/make-hdc-img.sh: Robustify,
        automatically calculate hdc image size.
        * qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce
        hdb image size.  Report completion of each parallelized task.

2015-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add IPC_STAT to ipc tests, workaround limitiations of old kernels
        * tests/ipc_msg.c: Include <errno.h>.
        (main): Add a test call with IPC_STAT, handle old kernels MSG_STAT behaviour.
        * tests/ipc_sem.c: Include <errno.h>.
        (main): Add a test call with IPC_STAT, handle old kernels SEM_STAT behaviour.
        * tests/ipc_shm.c: Include <errno.h>.
        (main): Add a test call with IPC_STAT, handle old kernels SHM_STAT behaviour.

        Change length type of umoven and umovestr to unsigned.
        * defs.h (umoven, umovestr): Change type of 3rd argument from "int"
        to "unsigned int".
        * util.c (umoven, umovestr): Likewise.  Adjust the code appropriately.

        tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel
        * tests/mmsg.c: #include <errno.h>
        (main): Return 77 if sendmmsg failed with ENOSYS.

        tests: skip ip network tests when the network is not functional.
        * tests/inet-accept-connect-send-recv.c (main): Return 77 if inet stream
        socket cannot be created or it cannot be bound to INADDR_LOOPBACK.
        * tests/net-yy.test: Skip the test if inet-accept-connect-send-recv
        returns 77.

        tests: handle the case when all 64 process capability bits are set.
        * tests/caps.awk: Handle the case when all bits of 64-bit capability
        word are set.

        tests: explicitly request gawk when using gawk features.
        * tests/uid.test: Check for gawk availability and invoke gawk instead of
        plain awk because the test uses gawk's match() feature.

        tests: skip detach tests if kill does not work.
        * tests/detach-running.test: Skip if "kill -0" does not work.
        * tests/detach-sleeping.test: Likewise.
        * tests/detach-stopped.test: Likewise.

        ARM OABI: fix potential compilation warning.
        * syscall.c (get_scno) [!__ARM_EABI__ || ENABLE_ARM_OABI]: Fix
        "comparison between signed and unsigned" warning reported by some
        gcc versions.

        powerpc: fix potential compilation warning.
        * mem.c [POWERPC] (sys_subpage_prot): Fix "comparison between signed
        and unsigned" warning reported by some gcc versions.

2015-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        sparc, sparc64: remove ioctl header file names from solaris ioctl entries
        Starting with commit v4.9-27-g3e252ca, header file names should not be
        part of ioctlent files included by syscall.c

        * linux/sparc/ioctlent1.h: Remove ioctl header file names.
        * linux/sparc64/ioctlent2.h: Remove all entries, include "ioctlent.h".

2015-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        mips: enable indirect ipc subcall support.
        * linux/mips/syscallent-n32.h [LINUX_MIPSN32]: Define SYS_socket_subcall,
        include "subcall.h".
        * linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise.
        * linux/mips/syscallent-o32.h [LINUX_MIPSO32]: Likewise.

        mips: remove stub entries from syscallent files, generate stubs at build time
        * linux/mips/genstub.sh: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * configure.ac [MIPS]: Use it to generate syscallent stubs.
        * linux/mips/.gitignore: Add syscallent stubs.
        * linux/mips/syscallent-n32.h: Remove stub entries, include
        the stub file instead.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.

        build: add $(builddir)/$(OS)/$(ARCH) to the headers search list.
        * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS)/$(ARCH) before
        -I$(srcdir)/$(OS)/$(ARCH).

        build: fix build if siginfo_t lacks si_timerid/si_overrun.
        * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_timerid and
        siginfo_t.si_overrun.
        * signal.c (printsiginfo) [SI_TIMER]: Check HAVE_SIGINFO_T_SI_TIMERID
        and HAVE_SIGINFO_T_SI_OVERRUN.

        configure.ac: remove unused AM_CONDITIONAL expressions.
        * configure.ac (AM_CONDITIONAL): Remove I386, X86_64, X32.

        tests: portability fixes.
        * tests/stat.test: dd obs= is not portable, use bs= instead.
        * tests/stat32-v.test: Likewise.
        * tests/stat64-v.test: Likewise.
        * tests/net.test: Use $* instead of $@ in the quoted string.
        * tests/net-fd.test: Likewise.
        * tests/statfs.test: Quote { and } in regexps.
        * tests/caps.awk: Likewise.
        * tests/getdents.awk: Likewise.
        * tests/net-yy-accept.awk: Likewise.
        * tests/net-yy-connect.awk: Likewise.
        * tests/sigaction.awk: Likewise.
        * tests/unix-yy-accept.awk: Likewise.
        * tests/unix-yy-connect.awk: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Wire up new syscalls.
        * linux/dummy.h (sys_bpf, sys_execveat, sys_getrandom,
        sys_kexec_file_load, sys_memfd_create, sys_seccomp): New stub aliases.
        * linux/32/syscallent.h (seccomp, getrandom, memfd_create, bpf,
        execveat): New entries.
        * linux/64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/ia64/syscallent.h (getrandom, memfd_create, bpf, execveat):
        New entries.
        * linux/m68k/syscallent.h: Likewise.
        * linux/s390/syscallent.h: (seccomp, getrandom, memfd_create, bpf,
        s390_pci_mmio_write, s390_pci_mmio_read, execveat): New entries.
        * linux/s390x/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h (seccomp, getrandom, memfd_create,
        kexec_file_load, bpf, execveat): New entries.
        * linux/x32/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h (seccomp, getrandom, memfd_create):
        New entries.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        s390x: adjust some syscall entries.
        According to linux/arch/s390/include/uapi/asm/unistd.h, readdir is
        defined both on s390 and s390x, while getrlimit, _llseek, sendfile64,
        and fadvise64_64 are defined on s390 only.

        * linux/s390x/syscallent.h (readdir): Add.
        (getrlimit, _llseek, sendfile64, fadvise64_64): Remove.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Change syscallent.h files to use designated initializers.
        Automatically convert all linux syscallent.h files to a form that uses
        designated initializers, with subsequent correction of whitespace
        indentation.

        * linux/alpha/syscallent.h: Use designated initializers.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/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/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Create generic 32-bit syscallent.h.
        Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and
        tile/syscallent1.h share a lot of identical syscall entries described in
        <asm-generic/unistd.h>, move these entries to a new file 32/syscallent.h
        using the following automated conversion with subsequent correction of
        whitespace indentation:

        sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^[[:space:]]*\[[[:space:]]*2\(4[4-9]\|5[0-9]\)/d' linux/arc/syscallent.h

        * linux/32/syscallent.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/arc/syscallent.h: Include "32/syscallent.h",
        remove generic 32-bit syscall entries, use designated initializers.
        * linux/metag/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        tile: fix syscall entries.
        * linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3.
        (pread64, pwrite64): Change nargs to 5.
        (llseek): Change sys_name to _llseek.

        s390: fix fadvise64 and fadvise64_64 syscall entries.
        * linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to
        printargs until special parsers for 31-bit 31 s390 emulation wrappers
        are written.

        alpha: fix fadvise64 syscall entry.
        * linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64.

        tile: fix fadvise64_64 syscall entry.
        * linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func,
        and sys_name.

        Fix getrlimit and ugetrlimit syscall entries.
        * linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/avr32/syscallent.h (getrlimit): Fix sys_name.
        * linux/or1k/syscallent.h: Likewise.
        * linux/s390/syscallent.h (ugetrlimit): Fix sys_name.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.

        Fix umount and umount2 syscall entries.
        * linux/aarch64/syscallent1.h (umount): Change nargs to 1.
        * linux/avr32/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/ia64/syscallent.h (umount2): Change nargs to 2.
        * linux/arm/syscallent.h (umount, umount2): Fix sys_name.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/powerpc/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/metag/syscallent.h: (umount2): Fix sys_name.
        * linux/or1k/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix sendfile64 syscall entries.
        * linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64.
        * linux/metag/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.

        Fix number of arguments in ipc family syscall entries.
        * linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget,
        shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls.
        * linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl,
        shmdt, shmget, semtimedop): Likewise.
        * linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat,
        shmget, shmdt, shmctl): Likewise.
        * linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat,
        * shmctl, shmdt, shmget, semtimedop): Likewise.
        * linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl,
        semtimedop): Likewise.
        * linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl,
        msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise.
        * linux/ia64/syscallent.h (semtimedop): Likewise.
        * linux/mips/syscallent-n32.h (semtimedop): Likewise.
        * linux/mips/syscallent-n64.h (semtimedop): Likewise.
        * linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop,
        semop, shmget, shmctl, shmat, shmdt): Likewise.
        * linux/sh64/syscallent.h (semget, msgget, shmget): Likewise.
        * linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget,
        shmctl, shmat, shmdt): Likewise.
        * linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt,
        msgget, semtimedop): Likewise.
        * linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop,
        shmdt, msgget, semtimedop): Likewise.
        * linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop,
        semget, semop, msgget, msgrcv, msgctl): Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Create generic 64-bit syscallent.h.
        Since aarch64/syscallent1.h and tile/syscallent.h share a lot of
        identical syscall entries described in <asm-generic/unistd.h>, move
        these entries to a new file 64/syscallent.h using the following
        automated conversion with subsequent correction of whitespace
        indentation:

        sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^\[[[:space:]]*2\(4[4-9]\|5[0-9]\)\]/d' linux/tile/syscallent.h

        * linux/64/syscallent.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * linux/aarch64/syscallent1.h: Include "64/syscallent.h",
        remove generic 64-bit syscall entries, use designated initializers.
        * linux/tile/syscallent.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix nfsservctl syscall entries.
        * linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name.
        * linux/metag/syscallent.h: Likewise.

        Add missing syscall entries for sched_[gs]etattr and renameat2.
        * linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2):
        New syscall entries.
        * linux/arc/syscallent.h: Likewise.
        * linux/metag/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Likewise.

        Fix NUMA related syscall entries.
        * linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy):
        Set sys_func.
        * linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy):
        Fix nargs, set sys_func.
        * linux/microblaze/syscallent.h (mbind): Fix nargs.
        * linux/mips/syscallent-n32.h (move_pages): Set sys_func.
        * linux/mips/syscallent-n64.h (move_pages): Likewise.
        * linux/mips/syscallent-o32.h (mbind): Fix nargs.
        * linux/or1k/syscallent.h (migrate_pages): Likewise.
        * linux/powerpc/syscallent.h (migrate_pages): Likewise.
        * linux/sh/syscallent.h (mbind): Likewise.
        * linux/sh64/syscallent.h (mbind): Likewise.

        xtensa: fix syscall entries.
        * linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name.
        (restart_syscall, io_setup, io_destroy, io_submit, io_getevents,
        io_cancel, add_key, request_key, keyctl): Set sys_func.
        (migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages,
        fstatat64): Fix nargs.
        (renameat2): New entry.

        Fix sched_setparam syscall entries.
        * linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2.
        * linux/arm/syscallent.h (sched_setparam): Likewise.
        * linux/avr32/syscallent.h (sched_setparam): Likewise.
        * linux/bfin/syscallent.h (sched_setparam): Likewise.
        * linux/i386/syscallent.h (sched_setparam): Likewise.
        * linux/m68k/syscallent.h (sched_setparam): Likewise.
        * linux/microblaze/syscallent.h (sched_setparam): Likewise.
        * linux/s390/syscallent.h (sched_setparam): Likewise.
        * linux/s390x/syscallent.h (sched_setparam): Likewise.
        * linux/sh/syscallent.h (sched_setparam): Likewise.
        * linux/sh64/syscallent.h (sched_setparam): Likewise.
        * linux/tile/syscallent.h (sched_setparam): Likewise.
        * linux/tile/syscallent1.h (sched_setparam): Likewise.
        * linux/x32/syscallent.h (sched_setparam): Likewise.
        * linux/x86_64/syscallent.h (sched_setparam): Likewise.

        arc: fix fanotify_mark syscall entry.
        * linux/arc/syscallent.h (fanotify_mark): Change nargs to 6.

        ia64: add fallocate syscall entry.
        * linux/ia64/syscallent.h (fallocate): Add syscall entry.

        Fix lookup_dcookie syscall entries.
        * linux/s390/syscallent.h (lookup_dcookie): Add syscall entry.
        * linux/s390x/syscallent.h (lookup_dcookie): Likewise.
        * linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3.
        * linux/x32/syscallent.h (lookup_dcookie): Likewise.

        aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate.
        * linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate):
        Use correct syscall names.

        aarch64: fix mlock syscall entry.
        * linux/aarch64/syscallent1.h (mlock): Change to mlock entry.

        sh, sh64: fix mlock syscall entry.
        * linux/sh/syscallent.h (mlock): Change nargs to 2.
        * linux/sh64/syscallent.h (mlock): Likewise.

        tile: fix swapon syscall entries.
        * linux/tile/syscallent.h (swapon): Change nargs to 2.
        * linux/tile/syscallent1.h (swapon): Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        ARM EABI: reserve some space for new syscalls.
        Reserve the same space for new syscalls on EABI as it is already
        reserved on OABI.

        * linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL):
        Raise to 400.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        arm: rewrite shuffle_scno in a bit more readable way.
        * linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of
        ARM_LAST_ORDINARY_SYSCALL.
        * syscall.c [ARM || AARCH64] (shuffle_scno): Update.

        tests: add tests for ipc syscalls decoding.
        * tests/ipc_msg.c: New file.
        * tests/ipc_sem.c: Likewise.
        * tests/ipc_shm.c: Likewise.
        * tests/ipc_msg.test: New test.
        * tests/ipc_sem.test: Likewise.
        * tests/ipc_shm.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm.
        (TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test.
        * tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Fix indirect ipc subcall handling.
        indirect_ipccall used to guess whether currently decoded ipc syscall is
        an indirect subcall or not based on generic knowledge, while there is a
        robust method to identify indirect ipc subcalls.

        * defs.h (TRACE_INDIRECT_SUBCALL): New flag.
        * ipc.c (indirect_ipccall): Check it.
        * linux/subcall.h: Set it.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        Move socket and ipc subcall entries to subcall.h.
        Syscall entries for socket and ipc subcalls are the same on all
        architectures, or at least they should be the same, so move them
        to the single file.

        * linux/subcall.h: Add syscall entries for socket and ipc subcalls.
        * linux/arm/syscallent.h: Remove entries for socket and ipc subcalls.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/powerpc/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.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

        sh: fix typo introduced by commit v4.9-121-gd535b8b.
        * linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name.

2015-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        Fix fanotify_mark decoding on 32-bit architectures.
        The fanotify_mark syscall takes a 64-bit mask, and on 32-bit
        architectures it is split up into two syscall arguments.

        * configure.ac (AC_CHECK_FUNCS): Add fanotify_mark.
        (AC_CHECK_HEADERS): Add sys/fanotify.h.
        * defs.h (getllval): New prototype.
        * util.c (getllval): New function based on printllval.
        (printllval): Use getllval.
        * fanotify.c (sys_fanotify_mark): Use getllval to properly decode
        64-bit mask and two syscall arguments followed by it.
        * tests/fanotify_mark.c: New file.
        * tests/fanotify_mark.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add fanotify_mark.
        (TESTS): Add fanotify_mark.test.
        * tests/.gitignore: Add fanotify_mark.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        v4l2: fix build on systems with older kernel headers.
        * v4l2.c (print_v4l2_format_fmt): Do not use
        V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined.
        (v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and
        VIDIOC_ENUM_FRAMEINTERVALS unless they are defined.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build with awk that does not support switch-case.
        The switch-case statement is a gawk-specific feature which is not
        necessarily available, let's use traditional if-else statements instead.

        * tests/uid.awk: Rewrite without switch-case statements.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems that lack O_CLOEXEC definition.
        * xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on systems that lack NETLINK_SOCK_DIAG definition.
        NETLINK_INET_DIAG was introduced in linux v2.6.14,
        NETLINK_SOCK_DIAG was added much later in linux v3.3.

        * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]
        (NETLINK_SOCK_DIAG): Define.
        * socketutils.c: Likewise.
        * tests/netlink_unix_diag.c: Likewise.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup local copy of linux/fanotify.h.
        * linux/fanotify.h: Remove macros and structures not used by
        fanotify_init and fanotify_mark parsers.

        Fix "make dist" regression introduced by commit v4.9-125-g120e5db.
        * Makefile.am (EXTRA_DIST): Add linux/unix_diag.h.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix build with fresh glibc.
        * tests/netlink_unix_diag.c: Include <stdint.h>.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlent.sh: handle linux/aufs_type.h properly.
        Before this change, ioctlent.sh could not recognize unusual constants
        defined by linux/aufs_type.h, resulting to ioctls.h with references to
        these constants without appropriate definitions in ioctldefs.h.

        * linux/ioctlent.sh: Update the regexp that is used to lookup constants
        referenced by generated ioctls.h.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix distcheck.
        * tests/stat32-v.test: Remove work files if the test is skipped.

        Fix printing of time_t values set in the distant future.
        * util.c (sprinttime): Increase buffer size.
        * tests/stat64-v.test: Try to set modification time of the sample file
        to a value set in the distant future.

        Use AC_CHECK_TYPES to check for struct statfs64.
        * m4/statfs.m4: Remove.
        * configure.ac (AC_STATFS64): Remove.
        (AC_CHECK_TYPES): Add struct statfs64.
        * statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64.

        Use AC_CHECK_TYPES to check for struct stat64.
        * m4/stat.m4: Remove.
        * configure.ac (AC_STAT64): Remove.
        (AC_CHECK_TYPES): Add struct stat64.
        * file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64.

        file.c: fix 32-bit stat decoding on 64-bit architectures.
        * file.c [SPARC || SPARC64] (struct stat): Remove, use generic
        definition from <asm/stat.h>.
        [SPARC64] (struct stat_sparc64, printstat_sparc64): Remove.
        [AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32,
        STAT32_PERSONALITY): Define.
        [STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32.
        [STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32.
        (printstat) [STAT32_PERSONALITY]: Call printstat32 when
        current_personality == STAT32_PERSONALITY.
        [HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when
        current_personality != STAT32_PERSONALITY.
        [!HAVE_STAT64] (sys_stat64): Fallback to sys_stat.
        [!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat.

        sparc: reuse struct stat parser code for struct solstat decoding.
        * printstat.h: Parametrize major() and minor().
        * file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating
        printstat.h template.
        [SPARC || SPARC64] (printstatsol): Use do_printstat_sol.

        ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding.
        * file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h
        template.
        [POWERPC64] (printstat_powerpc32): Use do_printstat32.

        file.c: group related parsers together.
        * file.c (sys_stat, sys_fstat): Collect in one place right before
        the definition of printstat64.
        (sys_stat64, sys_fstat64): Collect in one place right after the
        definition of printstat64.

        file.c: collect scattered __old_kernel_stat related code.
        * file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat,
        sys_oldstat, sys_oldfstat): Collect functions in one place.

        Use the same source code for struct stat/stat64 decoding.
        * file.c: Define do_printstat64 by instantiating printstat.h template.
        (printstat64): Use do_printstat64.

        x32: use generic printstat/printstat64 parsers.
        * file.c (printstat) [X32]: Define.
        (printstat64) [X32]: Use "struct stat64" instead of "struct stat".
        Use printstat for x32 personality processes.
        (printstat64_x32): Remove.
        (sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of
        printstat64_x32.

        x32: remove redundant definitions.
        * file.c [X32]: Do not define "struct stat" and "struct
        __old_kernel_stat" locally, use definitions provided by <asm/stat.h>.
        Do not define "struct stat64" exclusively, reuse another definition
        added earlier for X86_64.

        Convert do_printstat to a template function.
        * printstat.h: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Include "printstat.h".
        (do_printstat): Move to printstat.h, parametrize its name
        and struct stat.

        file.c: prepare realprintstat for parametrization.
        * file.c (realprintstat): Adjust format strings so that all 64-bit
        integer fields are printed with %llu format, and %u format is used for
        all the rest.  Rename to do_printstat.
        (printstat, printoldstat): Update callers.

        tests: cleanup stat.test.
        * tests/stat.test: Rewrite in a more readable way.

        tests: check verbose decoding of 32-bit and 64-bit struct stat.
        * tests/stat.c: New file.
        * tests/stat32.c: Likewise.
        * tests/stat32-v.test: New file.
        * tests/stat64-v.test: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add stat and stat32.
        (stat_CFLAGS): Define.
        (TESTS): Add stat32-v.test and stat64-v.test.
        * tests/.gitignore: Add stat and stat32.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup struct stat.st_flags decoding.
        There are no symbolic constants defined for struct stat.st_flags,
        so decode this rare field as unsigned int.

        * xlat/fileflags.in: Remove.
        * file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]:
        Decode struct stat.st_flags as unsigned int.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        Drop struct stat.st_aclcnt and stat.st_level support.
        Remove the code that supports struct stat.st_aclcnt and stat.st_level
        decoding -- these fields are not defined in system headers.

        * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and
        struct stat.st_level.
        * file.c (realprintstat, printstat64)
        [HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix race condition in net-accept-connect based tests.
        Change all net-accept-connect based tests to use different unix domain
        socket addresses, so that these tests could be safely run in parallel.

        * tests/net-accept-connect.c: Parametrize unix domain socket address.
        * tests/net-fd.test: Pass socket address to net-accept-connect.
        * tests/net.test: Likewise.
        * tests/unix-yy.test: Likewise.
        * tests/unix-yy-accept.awk: Update regexps.
        * tests/unix-yy-connect.awk: Likewise.

2014-12-31  Mike Frysinger  <vapier@gentoo.org>

        timerfd: update flags decoding.
        The current code only decodes TFD_TIMER_ABSTIME when the kernel has
        a bunch of newer flags.  We have to handle fallbacks for all of them
        since the kernel doesn't currently export things to userspace.

        * time.c: Include fcntl.h for O_* defines.
        (TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in.
        * xlat/timerfdflags.in: Add more definitions.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: fix fxstat decoding.
        * file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor
        using printfd.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: drop _STAT64_VER support.
        Starting with commit v4.6-240-g5afdf12, nobody compiles this
        non-Linux code.

        * file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove
        _STAT64_VER code.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: remove redundant sys_lxstat.
        * file.c [SPARC || SPARC64] (sys_lxstat): Remove.
        * linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat.
        * linux/sparc64/dummy2.h (solaris_lxstat): Likewise.

2014-12-28  Dmitry V. Levin  <ldv@altlinux.org>

        file.c: do not include unused headers.
        * file.c: Do not include <fcntl.h>.

2014-12-27  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup UTIME_NOW/UTIME_OMIT decoding.
        Move the code that's present in two copies from sprinttv()
        to a new helper function.

        * time.c (do_sprinttv): New function.
        (sprinttv): Use it.

2014-12-27  Elliott Hughes  <enh@google.com>

        Fix UTIME_NOW/UTIME_OMIT decoding.
        The kernel doesn't actually care what tv_sec is set to --- it only checks
        tv_nsec when looking for the special values.

2014-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Make -yy output for inet sockets consistent with unix domain sockets.
        Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their
        protocol name obtained using getxattr.

        * socketutils.c (inet_parse_response): Add proto_name argument.
        Print proto_name for connected and unconnected sockets.
        (receive_responses): Add proto_name argument, pass it to the parser.
        (inet_print): Add proto_name argument, pass it to receive_responses.
        (unix_parse_response): Add proto_name argument.
        (print_sockaddr_by_inode): Pass protocol name to inet_print calls.
        * tests/net-yy-accept.awk: Update to match new output format.
        * tests/net-yy-connect.awk: Likewise.

2014-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify unix domain socket decoding test.
        Unix domain socket address family name is not universally decoded as
        AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms.
        Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL.

        Some test regexps have to be properly initialized before they could
        be used, so make sure they are initialized before use.

2014-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix unix domain socket decoding availability test.
        Since inet_diag and unix_diag interfaces are implemented by different
        kernel modules, they have to be tested separately.

        * tests/netlink_unix_diag.c: New file.
        * tests/unix-yy.test: Use it.
        * tests/Makefile.am (check_PROGRAMS): Add it.
        * tests/.gitignore: Likewise.

2014-12-25  Masatake YAMATO  <yamato@redhat.com>

        tests: add a test for decoding unix domain socket addresses.
        * tests/unix-yy-accept.awk: New file.
        * tests/unix-yy-connect.awk: New file.
        * tests/unix-yy.test: New test.
        * tests/Makefile.am (TESTS): Add it.
        (EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk.

2014-12-25  Masatake YAMATO  <yamato@redhat.com>

        Support unix domain sockets in -yy option.
        This change extends -yy option to handle unix domain sockets:
        their peer addresses will be printed, similar to inet sockets.

        For a listening socket, its socket inode and socket path are printed.
        For an accepted socket, its socket inode, the peer inode, and the
        socket path are printed.
        For a client socket, its socket inode and the peer inode are printed.

        An example of a server side communication using netcat:

                $ ./strace -yy -e network nc -l -U /tmp/example.sock
                socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
                setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
                bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
                listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0
                accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]>
                recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6
                INPUT

        An example of a client side communication using netcat:

                $ ./strace -yy -e network nc -U /tmp/example.sock
                socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
                connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
                getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
                INPUT
                ...
                sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6

        * linux/unix_diag.h: New file.
        * socketutils.c (send_query): Rename to inet_send_query.
        (parse_response): Rename to inet_parse_response.
        (unix_print, unix_send_query, unix_parse_response): New functions.
        (receive_responses): Add a new argument named parser: a function for
        handling protocol specific data parts of diag messages.
        (print_sockaddr_by_inode): Call unix_print.
        Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal
        but NETLINK_SOCK_DIAG looks more generic.

2014-12-16  Masatake YAMATO  <yamato@redhat.com>

        Use the protocol name of a socket as a hint for peer address resolution.
        To resolve the peer address of socket, all combinations of families
        (AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried.
        This change utilizes the protocol name obtained via getxattr to specify
        the right combination.

        * socketutils.c (inet_print): New helper function.
        (print_sockaddr_by_inode): Use it.  Utilize the protocol name
        associated with the given inode for resolving the peer socket
        address.  If the protocol name is NULL, resolve the address
        by trying combinations of families and protocols as before.
        * defs.h (print_sockaddr_by_inode): Update prototype.
        * util.c (printfd): Pass the protocol name associated with
        the given path to print_sockaddr_by_inode as the 2nd argument.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls
        Convert parsers of these syscalls to the same scheme as were applied to
        parsers of other uid/gid related syscalls.
        That is, define two sets of parsers on architectures that support
        (either directly or via multiarch) 16-bit and 32-bit gid getgroups
        and setgroups syscalls simultaneously, and reuse essentially the same
        code by parametrizing uid_t and names of parser functions.

        * groups.c: Remove.
        (sys_getgroups, sys_setgroups): Move ...
        * uid.c: ... here and parametrize their names.
        * Makefile.am (strace_SOURCES): Remove groups.c.
        * linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove.
        [NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes.
        * linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16,
        rename sys_[gs]etgroups32 to sys_[gs]etgroups.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * tests/uid.c: Test for getgroups.
        * tests/uid16.c: Likewise.
        * tests/uid32.c: Test for getgroups32.
        * tests/uid.awk: Test for getgroups/getgroups32 decoding.
        * tests/uid.test: Trace getgroups/getgroups32 syscalls.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls.
        Define two sets of parsers on architectures that support (either
        directly or via multiarch) 16-bit and 32-bit uid/gid syscalls
        simultaneously.  Since the code in these two sets is essentially
        the same and the key difference between them is the size of uid_t,
        implement it by parametrizing uid_t and names of parser functions.

        * defs.h (NEED_UID16_PARSERS): New macro.
        * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16,
        sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16,
        sys_setreuid16, sys_setuid16): New prototypes.
        * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16.
        (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16,
        sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding
        sys_*uid16 functions.
        * uid.c: Stop including <asm/posix_types.h>.
        Parametrize uid_t and names of all exported functions.
        (get_print_uid): New function.
        (sys_getresuid): Use it.
        (printuid): Check for (uid_t) -1.
        * uid16.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16,
        sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16,
        sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16,
        sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16,
        and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * tests/uid16.c: New file.
        * tests/uid16.test: New test.
        * tests/Makefile.am (CHECK_PROGRAMS): Add uid16.
        (TESTS): Add uid16.test.
        * tests/.gitignore: Add uid16.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

        sh, sh64: fix uid/gid syscall entries.
        * linux/sh/syscallent.h: Replace printargs with real syscall
        parsers in *chown32 and [gs]et*[gu]id32 syscall entries.
        * linux/sh64/syscallent.h: Likewise.

        s390: fix uid/gid syscall entries.
        * linux/s390/syscallent.h: Add "32" suffix to names of *chown32
        and [gs]et*[gu]id32 syscalls #198..216.

        sparc: fix uid/gid syscall entries.
        * linux/sparc/syscallent.h: Add "32" suffix to names
        of [gs]etres[gu]id32 syscalls #108..112.
        Fix entry for syscall #112 from setresgid32 to setregid32.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        chown.c: split into separate files.
        This will make further uid/gid fixes simpler.

        * fchownat.c: New file.
        * chown.c (sys_fchownat: Move to fchownat.c.
        (sys_chown, sys_fchown): Move to uid.c.
        * Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        util.c: move printuid to uid.c.
        This will make further uid/gid fixes simpler.

        * util.c (printuid): Move
        * uid.c: ... here.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests/uid.awk: rewrite in a more maintainable style.
        Since the test is virtually a FSM, rewrite it as a FSM.

2014-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        printuid: fix uid_t decoding on 64-bit architectures.
        It was not a good idea to treat uid_t as a long int type because
        the latter is twice larger than uid_t on 64-bit architectures.

        * defs.h (printuid): Change uid argument type from "unsigned long"
        to "unsigned int".
        * util.c (printuid): Likewise.  When uid equals to -1, print "-1".
        * tests/uid.awk: New file.
        * tests/uid.c: New file.
        * tests/uid32.c: Likewise.
        * tests/uid.test: New test.
        * tests/uid32.test: Likewise.
        * tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32.
        (TESTS): Add uid.test and uid32.test.
        (EXTRA_DIST): Add uid.awk.
        * tests/.gitignore: Add uid and uid32.

2014-12-13  Dmitry V. Levin  <ldv@altlinux.org>

        Update PTRACE_* constants.
        * xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK,
        and PTRACE_SETSIGMASK.

        Update SWAP_FLAG_* constants.
        * swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and
        SWAP_FLAG_DISCARD_PAGES are defined.
        * xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and
        SWAP_FLAG_DISCARD_PAGES.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        Update SCHED_* constants.
        * xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and
        SCHED_DEADLINE.

        Update prctl PR_* constants.
        * xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE,
        PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        Always compile sys_prctl parser.
        Since sys_prctl is referenced by syscallent files unconditionally,
        conditional compilation of sys_prctl depending on prctl availability is
        pointless.

        * prctl.c (unalignctl_string, sys_prctl): Compile unconditionally.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        process.c: split struct_user_offsets into architecture-specific include files
        * Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h,
        linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h,
        linux/crisv10/userent.h, linux/crisv32/userent.h,
        linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h,
        linux/m68k/userent.h, linux/microblaze/userent.h,
        linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h,
        linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h,
        linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h,
        linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h,
        linux/tile/userent.h, linux/userent.h, linux/userent0.h,
        linux/x32/userent.h, linux/x86_64/userent.h, and
        linux/xtensa/userent.h.
        * process.c (struct_user_offsets): Split into architecture-specific
        include files, inculde userent.h.

        process.c: include less headers.
        * process.c: Do not include <fcntl.h> and <sys/stat.h>.
        Reorder inclusion of xlat header files.

        Unexport struct_user_offsets.
        * defs.h (struct_user_offsets): Remove.
        * process.c (struct_user_offsets): Make static.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        process.c: introduce XLAT_UOFF macro.
        Introduce XLAT_UOFF macro and use it to automatically transform
        struct_user_offsets array into a more readable and compact form.

        for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do
                sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c
        done

        * process.c (XLAT_UOFF): New macro.
        (struct_user_offsets): Use it.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

        process.c: move sethostname and gethostname parsers to a separate file.
        * hostname.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_sethostname, sys_gethostname): Move to hostname.c.

        process.c: move exit parser to a separate file.
        * exit.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_exit): Move to exit.c.

        process.c: move clone, setns, unshare, and fork parsers to a separate file
        * clone.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and
        related code to clone.c.

        process.c: move get*uid and set*uid parsers to a separate file.
        * uid.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid,
        sys_setreuid, sys_setresuid): Move to uid.c.

        process.c: move getgroups* and setgroups* parsers to a separate file.
        * groups.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32,
        sys_getgroups32, and related code to groups.c.

        process.c: move execve and execv parsers to a separate file.
        * execve.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_execve, sys_execv, and related code to execve.c.

        process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file
        * wait.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and
        related code to wait.c.

        process.c: move uname parser to a separate file.
        * uname.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_uname): Move to uname.c.

        process.c: move futex parser to a separate file.
        * futex.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_futex and related code to futex.c.

        process.c: move get_robust_list parser to a separate file.
        * get_robust_list.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_get_robust_list): Move to get_robust_list.c.

        process.c: move sched_* parsers to a separate file.
        * sched.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_sched_getscheduler, sys_sched_setscheduler,
        sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min,
        sys_sched_rr_get_interval, and related code to sched.c.

        process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file
        * affinity.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move
        to affinity.c.

        process.c: move prctl and arch_prctl parsers to a separate file.
        * prctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c.

        process.c: move getcpu parser to a separate file.
        * getcpu.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_getcpu): Move to getcpu.c.

        process.c: move process_vm_readv and process_vm_writev parsers to a separate file
        * process_vm.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * process.c (sys_process_vm_readv, sys_process_vm_writev): Move
        to process_vm.c.

        Implement decoding of fallocate FALLOC_FL_* flags.
        * xlat/falloc_flags.in: New file.
        * configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h.
        * fallocate.c [HAVE_LINUX_FALLOC_H]: Include <linux/falloc.h>.
        Include xlat/falloc_flags.h.
        (sys_fallocate): Decode flags.

        Fix decoding of renameat2 RENAME_* flags.
        * renameat.c: Include <linux/fs.h> where RENAME_NOREPLACE,
        RENAME_EXCHANGE, and RENAME_WHITEOUT are usually defined.

        file.c: move open, openat, and creat parsers to a separate file.
        * open.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_open, sys_openat, sys_creat, and related code
        to open.c.

        file.c: move access and faccessat parsers to a separate file.
        * access.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_access, sys_faccessat and related code to access.c.

        file.c: move umask parser to a separate file.
        * umask.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_umask): Move to umask.c.

        file.c: move lseek and llseek parsers to a separate file.
        * lseek.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_lseek, sys_llseek, and related code to lseek.c.

        file.c: move readahead parser to a separate file.
        * readahead.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_readahead): Move to readahead.c.

        file.c: move truncate, truncate64, ftruncate, and ftruncate64 parsers to a separate file
        * truncate.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_truncate, sys_truncate64, sys_ftruncate, sys_ftruncate64):
        Move to truncate.c.

        file.c: move chdir parser to a separate file.
        * chdir.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_chdir): Move to chdir.c.

        file.c: move link, linkat, unlinkat, and symlinkat parsers to a separate file
        * link.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_link, sys_linkat, sys_unlinkat, sys_symlinkat, and
        related code to link.c.

        file.c: move readlink and readlinkat parsers to a separate file.
        * readlink.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (decode_readlink, sys_readlink, sys_readlinkat): Move
        to readlink.c.

        file.c: move renameat and renameat2 parsers to a separate file.
        * renameat.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_renameat, sys_renameat2, and related code
        to renameat.c.

        file.c: move chown, fchown, and fchownat parsers to a separate file.
        * chown.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c.

        Export at_flags.
        * defs.h (at_flags): New prototype.

        file.c: move chmod, fchmod, and fchmodat parsers to a separate file.
        * chmod.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_chmod, sys_fchmodat, sys_fchmod): Move to chmod.c.

        file.c: move utimes, futimesat, utimensat, and osf_utimes parsers to a separate file
        * utimes.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat,
        sys_osf_utimes): Move to utimes.c.

        file.c: move utime parser to a separate file.
        * utime.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_utime): Move to utime.c.

        Export sprinttime.
        * defs.h (sprinttime): New prototype.
        * file.c (sprinttime): Make global and move to util.c.

        file.c: move mknod, mknodat, and xmknod parsers to a separate file.
        * mknod.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_mknod, sys_mknodat, sys_xmknod, and related code
        to mknod.c.

        file.c: export sprintmode and move it to a separate file.
        * printmode.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h (sprintmode): New prototype.
        * file.c (sprintmode): Make global and move to printmode.c.

        file.c: move getcwd parser to a separate file.
        * getcwd.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_getcwd): Move to getcwd.c.

        file.c: move *xattr parsers to a separate file.
        * xattr.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr,
        sys_listxattr, sys_flistxattr, sys_removexattr, sys_fremovexattr,
        and related code to xattr.c.

        file.c: move fadvise64 and fadvise64_64 parsers to a separate file.
        * fadvise.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_fadvise64, sys_fadvise64_64, and related code
        to fadvise.c.

        file.c: move sync_file_range and sync_file_range2 parsers to a separate file
        * sync_file_range.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_sync_file_range, sys_sync_file_range2, and related
        code to sync_file_range.c.

        file.c: move fallocate parser to a separate file.
        * fallocate.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sys_fallocate): Move to fallocate.c.

        file.c: move swapon parser to a separate file.
        * swapon.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c: Move sys_swapon and related code to swapon.c.

2014-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        Implement full decoding of 64-bit capabilities.
        Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but
        before this change only lower 32 capability bits were decoded for
        v2 and v3.

        * xlat/capabilities1.in: New file.
        * capability.c: Define v2/v3 CAP_* constants.
        Include xlat/capabilities1.h.
        (get_cap_header): New function.
        (print_cap_header): Update to use get_cap_header result.
        (print_cap_data): Decoder higher capability bits for v2 and v3.
        (sys_capget, sys_capset): Use get_cap_header, update print_cap_header
        and print_cap_data calls.
        * tests/caps.c: New file.
        * tests/caps.awk: New file.
        * tests/caps.test: New test.
        * tests/Makefile.am (CHECK_PROGRAMS): Add caps.
        (TESTS): Add caps.test.
        (EXTRA_DIST): Add caps.awk.

2014-12-06  Dmitry V. Levin  <ldv@altlinux.org>

        Make parsers of capget and capset syscalls self-contained.
        Various versions of <linux/capability.h> used to require different
        workarounds to avoid conflicts with types defined by libc headers.
        Define all required types and constants locally to fix this issue.

        * configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h.
        * capability.c: Do not include <linux/capability.h>, remove workarounds
        for problematic versions of <linux/capability.h> file.
        Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums.
        (struct __user_cap_header_struct, struct __user_cap_data_struct): Define.
        * xlat/cap_version.in: Add #unconditional.
        * xlat/capabilities.in: Likewise.

2014-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        Remove system.c.
        All disjoint parts of system.c have been moved to separate files.

        * system.c: Remove.
        * Makefile.am (strace_SOURCES): Remove it.

2014-12-04  Dmitry V. Levin  <ldv@altlinux.org>

        Move mount parser to a separate file.
        * mount.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move sys_mount and related code to mount.c.

        Move umount2 parser to a separate file.
        * umount.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move sys_umount2 and related code to umount.c.

        Move personality parser to a separate file.
        * personality.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move sys_personality and related code to personality.c.

        Move syslog parser to a separate file.
        * syslog.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move sys_syslog and related code to syslog.c.

        Move cacheflush parser to a separate file.
        * cacheflush.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move inclusion of <asm/cachectl.h> to cacheflush.c.
        [M68K, BFIN, SH]: Move to cacheflush.c.

        bfin: move sram_alloc parser to a separate file.
        * sram_alloc.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c [BFIN]: Move sys_sram_alloc and related code to sram_alloc.c.

        Move capget and capset parsers to a separate file.
        * capability.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move inclusion of headers and macro definitions related
        to capget and capset decoding to capability.c.
        (print_cap_header, print_cap_data, sys_capget, sys_capset): Move
        to capability.c.

2014-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        Move sysctl parser to a separate file.
        * sysctl.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Move sys_sysctl and related code to sysctl.c.

        mips: move sysmips parser to a separate file.
        * sysmips.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c: Fix typo in the check for <linux/utsname.h>.
        Move inclusions of <linux/utsname.h> and <asm/sysmips.h> to sysmips.c.
        [MIPS]: Likewise.

        or1k: move or1k_atomic parser to a separate file.
        * or1k_atomic.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * system.c [OR1K]: Move to or1k_atomic.c.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        Alias sys_setdomainname to sys_sethostname.
        Since parsers for setdomainname and sethostname syscalls are identical,
        replace sys_setdomainname with an alias to sys_sethostname.

        * linux/dummy.h (sys_setdomainname): Alias to sys_sethostname.
        * linux/syscall.h (sys_setdomainname): Remove.
        * process.c (sys_setdomainname): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        Alias sys_getpeername to sys_getsockname.
        Since parsers for getpeername and getsockname syscalls are identical,
        replace sys_getpeername with an alias to sys_getsockname.

        * linux/dummy.h (sys_getpeername): Alias to sys_getsockname.
        * linux/syscall.h (sys_getpeername): Remove.
        * net.c (sys_getpeername): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        Alias sys_stime to sys_time.
        Since parsers for stime and time syscalls are identical,
        replace sys_stime with an alias to sys_time.

        * linux/dummy.h (sys_stime): Alias to sys_time.
        * linux/syscall.h (sys_stime): Remove.
        * time.c (sys_stime): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused sys_mctl.
        Starting with commit v4.6-240-g5afdf12, nobody compiles this
        non-Linux code.

        * mem.c [MC_SYNC]: Remove.
        * xlat/mctl_funcs.in: Remove.
        * xlat/mctl_lockas.in: Remove.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        Alias sys_mkdir and sys_mkdirat to sys_chmod and sys_fchmodat.
        Special parsers for mkdir and mkdirat are redundant because
        sys_chmod and sys_fchmodat implement the same decoding.

        * file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove.
        * linux/dummy.h (sys_mkdir): Alias to sys_chmod.
        (sys_mkdirat): Alias to sys_fchmodat.
        * linux/syscall.h (sys_mkdir, sys_mkdirat): Remove.
        * pathtrace.c (pathtrace_match): Do not check for sys_mkdirat.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused <sys/acl.h> based code.
        Starting with commit v4.6-240-g5afdf12, nobody compiles this
        non-Linux code.

        * configure.ac (AC_CHECK_HEADERS): Remove sys/acl.h.
        * file.c [HAVE_SYS_ACL_H]: Remove.
        * xlat/aclcmds.in: Remove.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused <sys/asynch.h> based code.
        Starting with commit v4.6-240-g5afdf12, nobody compiles this
        non-Linux code.

        * configure.ac (AC_CHECK_HEADERS): Remove sys/asynch.h.
        * file.c [HAVE_SYS_ASYNCH_H]: Remove.

2014-11-27  Masatake YAMATO  <yamato@redhat.com>

        Print protocol name of socket descriptors with -yy option.
        For those socket descriptors that have no associated ip:port pairs
        (or when this information is not available), -yy option prints
        the same <socket:[INODE]> information as -y option, e.g.

        $ strace -e sendto -yy ip l > /dev/null
        sendto(3<socket:[23456789]>, ...

        This change makes -yy output more informative: instead of just
        printing "socket", the name of protocol behind the socket descriptor
        will be printed, e.g.

        sendto(3<NETLINK:[23456789]>, ...

        * configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h.
        * tests/net-yy-accept.awk: Update to support protocol names.
        * tests/net-yy-connect.awk: Likewise.
        * util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>.
        (getfdproto): New function.
        (printfd): Use it.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Replace MAXPATHLEN with PATH_MAX.
        MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter.

        * strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX.
        * util.c (printpathn, printpath): Likewise.

2014-11-21  Mike Frysinger  <vapier@gentoo.org>

        Decode FIFREEZE/FITHAW/FITRIM ioctls.
        The freeze/thaw ones are simple, but the trim is an interesting struct.

        * block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM.
        * ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Include <sys/uio.h> unconditionally.
        Since <sys/uio.h> is standardized by POSIX and is present in all
        available versions of glibc, it's safe to assume that any usable
        libc implementation provides this header file.

        * configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h.
        * io.c: Include <sys/uio.h> unconditionally.
        (tprint_iov_upto, tprint_iov, sys_readv, sys_writev,
        print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define
        unconditionally.
        * net.c: Include <sys/uio.h> unconditionally.
        * util.c: Include <sys/uio.h> unconditionally.
        (dumpiov): Define unconditionally.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

        Consistently use C99 designated initializers in the new netlink code.
        * socketutils.c (send_query, receive_responses): Use designated
        initializers for sockaddr_nl, nlmsghdr, and inet_diag_req_v2 structures.
        * tests/netlink_inet_diag.c (send_query, check_responses): Likewise.

2014-11-20  Mike Frysinger  <vapier@gentoo.org>

        Decode open's O_TMPFILE.
        * xlat/open_mode_flags.in: Add O_TMPFILE definition.

2014-11-11  Helge Deller  <deller@gmx.de>

        hppa: update error codes and signal numbers.
        There are two important changes in here:

        1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa
        folks had problems with EWOULDBLOCK != EAGAIN, this was changed in
        kernel 3.14.

        2. Starting with kernel 3.18, hppa folks changed some signal numbers in
        such a way that we end up with SIGRTMIN == 32, which brings hppa in sync
        with other linux ports.

        Both were incompatible changes which basically broke hppa ABI, but since
        they have been merged into the kernel, we have to follow.

2014-11-11  Thomas De Schampheleire  <thomas.de.schampheleire@gmail.com>

        stack trace support: fix check on symbol name presence.
        The output format of the stack trace is supposed to be different
        depending on whether symbol names are available in the build.

        However, the check only verified the validity of the pointer, not of the
        string pointed to (which could be empty).

        This commit fixes the check so that the original output:

        mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
         > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
         > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
         > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
         > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
         > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
         > /bin/busybox(+0x0) [0x62c60]
         > /bin/busybox(+0x0) [0x4940]
         > /bin/busybox(+0x0) [0x499c]
         > /bin/busybox(+0x0) [0x4e08]
         > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
         > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]

        becomes:

        mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
         > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
         > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
         > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
         > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
         > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
         > /bin/busybox() [0x62c60]
         > /bin/busybox() [0x4940]
         > /bin/busybox() [0x499c]
         > /bin/busybox() [0x4e08]
         > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
         > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]

        Acked-by: Masatake YAMATO <yamato@redhat.com>

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

        tests: add a test for decoding and dumping of recvmmsg/sendmmsg.
        * configure (AC_CHECK_FUNCS): Add sendmmsg.
        * tests/mmsg.c: New file.
        * tests/mmsg.expected: New file.
        * tests/mmsg.test: New test.
        * tests/.gitignore: Add mmsg.
        * tests/Makefile.am (CHECK_PROGRAMS): Add mmsg.
        (TESTS): Add mmsg.test.
        (EXTRA_DIST): Add mmsg.expected.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

        Add functions for dumping iovecs in mmsghdr used in sendmmsg and recvmmsg
        This patch is similar to what I did in commit
        02f9f6b386741a52f58e1b31ad4e7fff60781ef8.
        That commit was for sendmsg and recvmsg system calls.
        This one is for sendmmsg and recvmmsg system calls.

        * defs.h (dumpiov_in_mmsghdr): New declaration.
        * net.c (extractmmsghdr): New function derived from printmmsghdr.
        (printmmsghdr): Use it.
        (dumpiov_in_mmsghdr): New function.
        * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr
        for recvmmsg and sendmmsg syscalls.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

        Use the definition of struct mmsghdr if it is defined in build environment
        mmsghrd structure type is defined locally in printmmsghdr function.

        However, more functions will refer the definition in modifications for
        supporting "-e write=set" and "-e read=set" option for sendmmsg and
        recvmmsg system calls.

        After this change, the system definition of struct mmsghdr will be used
        if configure reports it is available, falling back to the old local
        definition.

        * configure.ac (AC_CHECK_TYPES): Add struct mmsghdr.
        * net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define.
        (printmmsghdr): Use previously defined struct mmsghdr.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

        Introduce a separate function to copy from msghdr32 to msghdr.
        This patch is an initial step for supporting "-e write=set" and
        "-e read=set" option for sendmmsg and recvmmsg system calls.

        Coverting a data of msghdr32 to msghdr is needed both for
        {send,recv}msg and {send,recv}mmsg to decode parameters.
        To share the copying code in both decoders, a separate
        function named copy_from_msghdr32 is introduced.

        * net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]
        (copy_from_msghdr32): New function.
        (extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it.

2014-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlsort: rewrite build rules using noinst_PROGRAMS.
        * linux/ioctlsort.c: Rename to ioctlsort.c
        * Makefile.am (EXTRA_DIST): Rename linux/ioctlsort.c to ioctlsort.c.
        [MAINTAINER_MODE] (noinst_PROGRAMS): Add ioctlsort.
        (ioctlsort_SOURCES): Add ioctlsort.c.
        (nodist_ioctlsort_SOURCES): Add ioctls.h and ioctldefs.h.
        (CLEANFILES): Add $(nodist_ioctlsort_SOURCES).
        (ioctlsort.$(OBJEXT)): Likewise.
        (ioctlsort): Remove.

2014-11-11  Lubomir Rintel  <lkundrak@v3.sk>

        Makefile.am: look for ioctl definitions in the kernel build tree by default
        While most of ioctl-related kernel headers are now exported by kernel's
        headers_install, some are still modules_install only.  The kernel's
        headers installed into /usr/include/ are usually headers_install'ed and
        therefore don't contain some internal headers we need.  The solution is
        to look for modules_install'ed headers for the running kernel, and fall
        back to old behavior if they aren't found.

2014-11-04  Lubomir Rintel  <lkundrak@v3.sk>

        Dump details for Bluetooth socket operations.
        * configure.ac (AC_CHECK_HEADERS): Add bluetooth/bluetooth.h.
        * xlat/bt_protocols.in: New file.
        * net.c [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include bluetooth
        headers.
        [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h".
        (printsock) [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Dump details
        for AF_BLUETOOTH sockets.
        (sys_socket) [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Decode
        protocol for PF_BLUETOOTH sockets.

2014-11-04  Philippe De Muyter  <phdm@macqel.be>

        Implement Video4Linux video-input ioctls decoder.
        Introduce v4l2.c, a decoder for the arguments of the video-input subset
        of the v4l2 ioctl's.  This is a combination of
        - previous work by Peter Zotov <whitequark@whitequark.org>, found at
        https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch
        - previous work by William Manley <will@williammanley.net>, found at
        http://marc.info/?l=strace&m=139395588520675
        - forward port, additions and fixes by Philippe De Muyter <phdm@macqel.be>

        As v4l2 is a moving target, I have made v4l2.c compilable with ancient
        linux kernels by testing the availability of some macros.  It has been
        succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and
        succesfully used on linux 3.10 with a camera device.

        * configure.ac: Check for availabilty of V4L2_* enum constants.
        * Makefile.am (strace_SOURCES): Add v4l2.c.
        * defs.h (v4l2_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Use v4l2_ioctl.
        * v4l2.c: New file.
        * xlat/v4l2_*.in: New files.

        Cc: Peter Zotov <whitequark@whitequark.org>
        Cc: William Manley <will@williammanley.net>

2014-11-04  Dmitry V. Levin  <ldv@altlinux.org>

        Update ioctl entries.
        * linux/ioctlent.h.in: Regenerate from v3.17 headers.

        Remove ioctl header file names from the executable.
        * defs.h (struct ioctlent): Remove "doth" field.
        * Makefile.am ($(ioctlent_h)): Remove 1st field.

2014-11-04  Dmitry V. Levin  <ldv@altlinux.org>

        Filter out redundant ioctl entries early.
        For two ioctl entries with the same code, if one's name is a prefix
        to another's name, keep the entry with a shorter name.  Filter out
        redundant ioctl entries at ioctlsort stage so that distributed
        ioctlent.h.in files will be already filtered.

        * linux/ioctlsort.c (is_not_prefix): New function.
        (main): Use it.
        * linux/ioctlent-filter.awk: Remove.
        * Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk.
        ($(ioctlent_h)): Don't use linux/ioctlent-filter.awk.

2014-11-03  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlent.sh: update the list of directories exported by headers_install.
        * linux/ioctlent.sh: Add drm, mtd, rdma, video, and xen directories.

2014-11-01  Masatake YAMATO  <yamato@redhat.com>

        Add a function for dumping iovec in msghdr used in sendmsg and recvmsg.
        Here is an example session:

            $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null
            sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(...
             * 40 bytes in buffer 0
             | 00000  28 00 00 00 10 00 05 00  d0 d9 aa 53 00 00 00 00  (..........S.... |
             | 00010  00 00 00 00 02 00 00 00  00 00 00 00 00 00 00 00  ................ |
             | 00020  08 00 04 00 dd 05 00 00                           ........         |
            ...

            $ ./strace -e read=all ip link show > /dev/null
            recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"...
             * 8192 bytes in buffer 0
             | 00000  34 00 00 00 02 00 00 00  00 00 00 00 ff 23 00 00  4............#.. |
             | 00010  ff ff ff ff 20 00 00 00  10 00 05 00 00 00 00 00  .... ........... |
            ...

        * defs.h (dumpiov_in_msghdr): New prototype.
        * net.c (extractmsghdr): New function derived from printmsghdr.
        (printmsghdr): Use extractmsghdr.
        (dumpiov_in_msghdr): New function.
        * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg
        and sendmsg syscalls.

2014-10-31  Maarten ter Huurne  <maarten@treewalker.org>

        Include <linux/ptrace.h> regardless of <sys/reg.h> existence.
        This fixes compilation with musl libc.
        This approach was already used in process.c, so I assume it is safe.

        * signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check.
        * syscall.c: Likewise.
        * util.c: Likewise.

2014-10-31  Dmitry V. Levin  <ldv@altlinux.org>

        sock: decode SIOCSIFNAME on entering syscall.
        * sock.c (sock_ioctl): Handle SIOCSIFNAME on entering syscall.

2014-10-31  Mike Frysinger  <vapier@gentoo.org>

        sock: fix decoding of SIOCSIFNAME.
        The decoding of SIOCSIFNAME is incorrect.  It does not use
        the ifr_index field to look things up, but ifr_newname.

        * sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and
        display ifr_newname.

2014-10-31  Mike Frysinger  <vapier@gentoo.org>

        sock: fix decoding of struct ifreq.ifr_name.
        The ifr name fields of the ifreq structure might not be NUL terminated.
        If the user makes an ioctl call where they aren't, then strace ends up
        reading random content from its own stack.  Limit the printf lengths.

        * sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs.

2014-10-03  Elliott Hughes  <enh@google.com>

        Don't risk truncating open flags by using mode_t.
        On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short)
        as their mode_t.  The open(2) flags are actually an int, so high ones
        like O_CLOEXEC get truncated if you coerce them to mode_t.

        * defs.h (tprint_open_modes, sprint_open_modes): Change argument type
        from mode_t to int.
        * file.c (tprint_open_modes, sprint_open_modes): Likewise.

2014-09-29  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance sysinfo decoding.
        * configure.ac (AC_CHECK_MEMBERS): Check for struct sysinfo.totalhigh,
        struct sysinfo.freehigh, and struct sysinfo.mem_unit.
        * sysinfo.c (sys_sysinfo): Treat failed umove() call as syserror().
        Print totalhigh, freehigh, and mem_unit members when struct sysinfo
        supports them.

        Move sysinfo parser to a separate file.
        * sysinfo.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * resource.c (sys_sysinfo): Move to sysinfo.c.

2014-09-29  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with musl libc.
        * resource.c: Include <sys/sysinfo.h> for struct sysinfo definition.

        Reported-by: Steven Honeyman <stevenhoneyman@gmail.com>

2014-09-23  Dmitry V. Levin  <ldv@altlinux.org>

        tests: cleanup checks for basic programs.
        * tests/init.sh: Check for cat and rm.
        * tests/getdents.test: Check for awk.
        * tests/ptrace_setoptions.test: Check for grep.
        * tests/net-fd.test: Do not check for rm.
        * tests/net.test: Likewise.
        * tests/scm_rights-fd.test: Likewise.
        * tests/stat.test: Likewise.
        * tests/uio.test: Likewise.

        tests: add a test for -yy option.
        * tests/net-yy.test: New test.
        * tests/inet-accept-connect-send-recv.c: New file.
        * tests/netlink_inet_diag.c: Likewise.
        * tests/net-yy-accept.awk: Likewise.
        * tests/net-yy-connect.awk: Likewise.
        * tests/.gitignore: Add inet-accept-connect-send-recv,
        netlink_inet_diag, *.tmp-*, and *.tmp.*.
        * tests/Makefile.am (check_PROGRAMS): Add inet-accept-connect-send-recv
        and netlink_inet_diag.
        (TESTS): Add net-yy.test.
        (EXTRA_DIST): Add net-yy-accept.awk and net-yy-connect.awk.

2014-09-22  Dmitry V. Levin  <ldv@altlinux.org>

        Move statfs related parsers to a separate file.
        * statfs.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (sprintfstype, printstatfs, sys_statfs, sys_fstatfs): Move
        to statfs.c.
        [HAVE_STATFS64] (printstatfs64, printcompat_statfs64, sys_statfs64,
        sys_fstatfs64): Likewise.
        [ALPHA] (osf_statfs, osf_fstatfs): Likewise.

        fsmagic: sort array by value and use bsearch for faster lookup.
        * defs.h (xlat_search): New prototype.
        * util.c (xlat_bsearch_compare, xlat_search): New functions.
        * file.c (sprintfstype): Use xlat_search for fsmagic lookup.
        * xlat/fsmagic.in: Sort by value and mark as not NULL-terminated.
        * tests/statfs.c: New file.
        * tests/statfs.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add statfs.
        (statfs_CFLAGS): Define.
        (TESTS): Add statfs.test.
        * tests/.gitignore: Add statfs.

2014-09-21  Dmitry V. Levin  <ldv@altlinux.org>

        fsmagic: update from <linux/magic.h>
        * xlat/fsmagic.in: Add new constants from <linux/magic.h>.
        Reported by Elliott Hughes.

2014-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Add -yy option: print ip and port associated with socket descriptors.
        When two ore more -y options are given, print local and remote ip:port
        pairs associated with socket descriptors.  This implementation uses
        NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch
        prepared by Zubin Mithra as a part of his GSoC 2014 strace project.

        * Makefile.am (strace_SOURCES): Add socketutils.c
        (EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h.
        * defs.h (print_sockaddr_by_inode): New prototype.
        * linux/inet_diag.h: New file.
        * linux/sock_diag.h: Likewise.
        * socketutils.c: Likewise.
        * strace.1: Document -yy option.
        * strace.c (usage): Likewise.
        * util.c (printfd): Use print_sockaddr_by_inode.

2014-09-17  Vicente Olivert Riera  <vincent@gentoo.org>

        sigaction: wrap sa_restorer in #ifdef SA_RESTORER consistently.
        Wrap sa_restorer member definitions in #ifdef SA_RESTORER to be
        consistent with their use.
        If an architecture does not provide sa_restorer members but still
        defines SA_RESTORER macro, the latter has to be explicitly undefined.

        This change fixes compilation failures like this one:
        signal.c: In function 'decode_old_sigaction':
        signal.c:631:21: error: 'struct old_sigaction' has no member named 'sa_restorer'
        signal.c: In function 'decode_new_sigaction':
        signal.c:1224:21: error: 'struct new_sigaction' has no member named 'sa_restorer'

        * signal.c (struct old_sigaction, struct old_sigaction32,
        struct new_sigaction, struct new_sigaction32):
        Wrap sa_restorer member in #ifdef SA_RESTORER.
        (decode_old_sigaction, decode_new_sigaction):
        Wrap use of sa32.sa_restorer in #ifdef SA_RESTORER.

2014-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compilation warnings reported by gcc -Wsign-compare.
        * configure.ac (gl_WARN_ADD): Add -Wsign-compare.
        * defs.h (struct tcb): Change 'currpers' type to unsigned.
        (struct xlat): Change 'val' type to unsigned
        (signame): Add 'const' qualifier to its argument.
        (xlookup, printxval): Add 'const' qualifier to the 2nd argument and
        change its type to unsigned.
        (printpathn): Change the 3rd argument type to unsigned.
        (ioctl_lookup): Change 1st argument type to unsigned.
        * count.c (call_summary_pers, call_summary): Change 'i' type to unsigned.
        * file.c (print_xattr_list): Fix comparisons between signed and unsigned
        long values.
        * ioctl.c (compare): Fix cast.
        (ioctl_lookup): Change 1st argument type to to unsigned.
        (ioctl_next_match): Change 'code' type to unsigned.
        * mem.c (sys_move_pages): Change 'i' type to unsigned.
        * mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned.
        Print 'i' using %u format string.
        * process.c (sys_prctl): Change 'i' type to unsigned.
        (printargv): Change 'n' type to unsigned.
        (sys_ptrace): Change 'addr' type to unsigned.
        * scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument
        and change its type to unsigned.  Change 'i' and 'allocated' types
        to unsigned.
        * signal.c (signame): Add 'const' qualifier to its argument.
        Fix comparisons between signed and unsigned values.
        (sprintsigmask_n, printsiginfo): Fix comparisons between signed and
        unsigned values.
        * sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned.
        * strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned.
        (detach): Change 'sig' type to unsigned.
        (startup_attach): Change 'tcbi' type to unsigned.
        (startup_child): Change 'm', 'n', and 'len' types to unsigned.
        (init): Use new variable to iterate 'tcbtab'.
        (pid2tcb): Change 'i' type to unsigned.
        (cleanup): Change 'i' and 'sig' types to unsigned.
        * syscall.c (update_personality): Change 'personality' argument type
        to unsigned.
        (struct qual_options): Change 'bitflag' type to unsigned.
        (reallocate_qual): Add 'const' qualifier to its argument and change its
        type to unsigned.
        (qualify_one): Change 'n' and 'bitflag' arguments types to unsigned.
        Add 'const' qualifier to 'n', 'not', and 'pers' arguments.
        Change 'p' type to signed int.
        (qual_syscall): Change 'bitflag' argument type to unsigned.
        Add 'const' qualifier to 'bitflag' and 'not' arguments.
        Change 'p' type to signed int.
        (qual_signal): Change 'bitflag' argument type to unsigned.
        Add 'const' qualifier to 'bitflag' and 'not' arguments.
        Change 'i' type to unsigned.
        (qual_desc): Change 'bitflag' argument type to unsigned.
        Add 'const' qualifier to 'bitflag' and 'not' arguments.
        (qualify): Change 'i' type to unsigned.
        (get_scno): Change 'currpers' type to unsigned.
        Fix a comparison between signed and unsigned values.
        * system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned.
        Fix comparisons between signed and unsigned values.
        * util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument
        and change its type to unsigned.
        (printuid): Fix a comparison between signed and unsigned values.
        (printpathn): Change 'n' argument type to unsigned.
        (printstr): Change 'size' type to unsigned.
        Fix a comparison between signed and unsigned values.
        (setbpt): Change 'i' type to unsigned.
        * net.c (printsock): Silence a compilation warning.
        * reboot.c (sys_reboot): Likewise.

2014-09-11  Dmitry V. Levin  <ldv@altlinux.org>

        Move dirent related parsers to a separate file.
        * dirent.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * file.c (print_old_dirent, sys_readdir, sys_getdents, sys_getdents64):
        Move to dirent.c.

        getdents, getdents64: fix potential out-of-bounds read issues.
        * file.c (sys_getdents): Check for invalid d_reclen.
        Avoid reading from uninitialized memory.
        (sys_getdents64): Likewise.
        * tests/getdents.awk: New file.
        * tests/getdents.test: New test.
        * tests/Makefile.am (TESTS): Add it.
        (EXTRA_DIST): Add getdents.awk.

2014-09-10  Dmitry V. Levin  <ldv@altlinux.org>

        tprint_sock_type: remove unused parameter.
        * net.c (tprint_sock_type): Remove unused parameter 'tcp'.
        (sys_socket, sys_socketpair): Update callers.

        printsock: fix decoding of unrecognized AF_PACKET packet types.
        * net.c (printsock): Fix fallback string for AF_PACKET packet types.

2014-09-09  Dmitry V. Levin  <ldv@altlinux.org>

        decode_select: fix potential use of an uninitialized variable.
        A pointer to fd_set was used uninitialized when nfds == 0.

        * desc.c (decode_select): Initialize fds.

        Reported-by: Zubin Mithra <zubin.mithra@gmail.com>

2014-09-08  Dmitry V. Levin  <ldv@altlinux.org>

        Use external libaio.h.
        Stop using an outdated partial copy of libaio.h, switch back to external
        libaio.h from libaio.
        This partially reverts commit 2df03c494eb3c36c4178eba35c374831031d1a58.

        * aio.c: Drop a partial copy of libaio.h, include <libaio.h> instead.
        (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS.
        (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and
        HAVE_DECL_IO_CMD_PWRITEV.
        * configure.ac: Check for libaio.h and declaration it provides.

2014-08-19  Dmitry V. Levin  <ldv@altlinux.org>

        maint: post-release administrivia.
        * NEWS: Add header line for next release.

2014-08-15  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.9 release.
        * NEWS: Update for 4.9 release.
        * debian/changelog: 4.9-1.
        * strace.spec: 4.9-1.

        Sync strace.spec and debian/ with packages.
        * debian/changelog: Sync with 4.8-1.1.
        * debian/control: Likewise.
        * debian/rules: Likewise.
        * strace.spec: Sync with 4.8-5.

        NEWS: Update for 4.9 release.

2014-08-15  Mike Frysinger  <vapier@gentoo.org>

        Update syscall tables to the point where they include renameat2.
        * linux/dummy.h: Add printargs aliases for sys_sched_getattr and
        sys_sched_setattr.
        * linux/aarch64/syscallent1.h: Add kcmp/finit_module/sched_setattr/
        sched_getattr/renameat2.
        * linux/alpha/syscallent.h: Add kcmp/finit_module.
        * linux/arm/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
        * linux/hppa/syscallent.h: Add sched_setattr/sched_getattr/utimes/renameat2.
        * linux/i386/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Add getdents64/sched_setattr/sched_getattr/
        renameat2.
        * linux/mips/syscallent-o32.h: Add sched_setattr/sched_getattr/renameat2.
        * linux/powerpc/syscallent.h: Fix finit_module/kcmp order.  Add sched_setattr/
        sched_getattr/renameat2.
        * linux/s390/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Add sched_setattr/sched_getattr.

        renameat2: add decoding support.
        * file.c (decode_renameat, sys_renameat2): New functions.
        (sys_renameat): Use decode_renameat.
        * pathtrace.c (pathtrace_match): Handle sys_renameat2.
        * linux/syscall.h (sys_renameat2): New prototype.
        * xlat/rename_flags.in: New file.

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

        CREDITS: fix generation in out of tree builds.
        The {...} code changes the working dir with `cd`, but the commands outside
        of that block expects to be in the original dir.  Change to a subshell so
        the path outside of this block remains unchanged.

        * Makefile.am ($(srcdir)/CREDITS): Change {...} to (...).

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

        ia64: add missing syscalls.
        When the preadv/pwritev syscalls were added, the ones before it in the
        ia64 list were missed, so all the syscalls there and later were not in
        the right location (causing things to be decoded incorrectly).

        Add the missing syscalls before preadv which also re-aligns all the
        syscalls after that point.  This fixes the uio.test.

        * linux/ia64/syscallent.h: Add syscalls 1310 through 1318.

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

        ia64: fix sigaction decoding.
        Looks like ia64 doesn't have sa_restorer either, yet still defines
        SA_RESTORER.  Deploy the same trick that HPPA is using to make the
        test pass.

        * signal.c (SA_RESTORER): Undefine when IA64 is defined.
        (struct new_sigaction) [IA64]: Disable sa_restorer.

2014-08-12  Dmitry V. Levin  <ldv@altlinux.org>

        tests: skip detach-stopped.test when PTRACE_SEIZE doesn't work.
        detach-stopped.test is known to fail when PTRACE_SEIZE is not available,
        so skip the test in that case.

        * tests/detach-stopped.test: Check for "strace -d" output and skip the
        test when it says that PTRACE_SEIZE doesn't work.

2014-08-11  Erik Johansson  <erik@ejohansson.se>

        sh: fix syscall numbering for recv and sendto.
        * linux/sh/syscallent.h: Swap recv and sendto syscall entries.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

        tests: fix uio building w/out preadv/pwritev.
        The preadv/pwritev symbols weren't added to glibc until the 2.10 release,
        so trying to build the uio test leads to link failures.  Add configure
        tests and update uio.test to handle this.

        * configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev.
        * tests/uio.c: Include config.h.
        (main): Check for HAVE_PREADV and HAVE_PWRITEV.
        * tests/uio.test: Check exit status of uio helper.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

        tests: ignore *.tmp files.
        The tests like to generate random .tmp files, so ignore them.

        * tests/.gitignore: Add *.tmp.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

        tests: fix shell errors in detach tests.
        The current detach test code does:
                set -e
                ...
                cleanup() {
                        set +e
                        kill ...
                        wait ...
                }
                ...
                cleanup
                exit 0

        The problem is that while `set -e` is disabled for the body of the
        cleanup function, it isn't necessarily disabled in the caller scope.
        So if the return value of the cleanup function (`wait` in this case)
        is non-zero, the script ends up failing overall.

        Add an explicit return 0 to the cleanup function so that we don't kill
        the overall test pipeline.

        * tests/detach-running.test (cleanup): Add return 0.
        * tests/detach-sleeping.test (cleanup): Likewise.
        * tests/detach-stopped.test (cleanup): Likewise.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

        set_ptracer_any: add a little documentation.
        This way I don't have to keep reading up on these options and wondering
        why the code isn't aborting when the call fails.

        * tests/set_ptracer_any.c (main): Note prctl failures are ok.

2014-08-10  Mike Frysinger  <vapier@gentoo.org>

        signal: fix thinko in sa_restorer.
        Previous commit here re-added the bugs trying to be fixed due to a
        logic thinko.  The patches were tested in isolation and hand merged
        later.  Oops.

        * signal.c (struct new_sigaction): Change || to &&.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

        sigaction test: support arches w/out SA_RESTORER and swapped args.
        Running Linux 3.15 (sparc64) and glibc 2.17 (sparc32) triggers a
        rt_sigaction call that does not use SA_RESTORER and has an order
        where it inserts a restorer and a size.  The current tests don't
        support that ordering, so add another regex.

        * tests/sigaction.awk: Support no SA_RESTORER and swapped args.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

        alpha/sparc: fix arg count for rt_sigaction.
        Both these arches have a rt_sigaction syscall that takes 5 args, not 4.

        * linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5.
        * linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

        hppa: fix sigaction decoding.
        Since the rt_sigaction syscall on hppa doesn't have a sa_restorer,
        do not include it in the kernel struct.

        We also have to undefine SA_RESTORER so that code doesn't try to
        use it.  The headers will export this, but the syscall doesn't
        actually respect it.

        * signal.c (SA_RESTORER): Undefine when HPPA is defined.
        (struct new_sigaction): Disable sa_restorer on hppa.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

        alpha: fix sigaction decoding.
        Since the rt_sigaction syscall on alpha doesn't have a sa_restorer,
        do not include it in the kernel struct.

        * signal.c (struct new_sigaction): Disable sa_restorer on alpha.

2014-08-08  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for -yy option support.
        * defs.h (show_fd_path): Change type to unsigned int.
        * strace.c (show_fd_path): Likewise.
        (init): Handle repeated -y option.

2014-08-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix preadv/pwritev offset decoding on ILP32 architectures.
        This fixes regression introduced by the previous commit.

        * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]:
        Cast argument to unsigned long before casting it to unsigned long long.

2014-08-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix preadv/pwritev offset decoding on bigendian architectures.
        This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560.

        * util.c (printllval): Remove align argument.
        * defs.h (printllval): Update prototype.
        (printllval_aligned, printllval_unaligned): Remove.
        * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
        sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
        sys_fallocate): Replace printllval_aligned call with printllval.
        * io.c (sys_pread, sys_pwrite): Likewise.
        (print_llu_from_low_high_val): New function.
        (sys_preadv, sys_pwritev): Use it instead of printllval_unaligned.

2014-08-06  Dmitry V. Levin  <ldv@altlinux.org>

        Decode file descriptors returned by accept and accept4 syscalls.
        * net.c (do_accept): Rename to do_sockname.
        (sys_accept, sys_accept4): Update callers, return RVAL_FD.
        (sys_getsockname, sys_getpeername): Call do_sockname directly.
        * tests/net-fd.test: Update.

2014-08-01  Mike Frysinger  <vapier@gentoo.org>

        x32: update io_{setup,submit} syscalls.
        Starting in 3.16, these two syscalls have gotten their own entry
        point for x32.  See linux 7fd44dacdd803c0bbf38bf478d51d280902bb0f1.

        * linux/x32/syscallent.h: Change existing io_{setup,submit} to 64bit,
        and add new entry points for x32 specifically.

2014-06-18  Max Filippov  <jcmvbkbc@gmail.com>

        xtensa: sort values in struct_user_offsets.
        Otherwise ptrace syscall argument decoding is wrong:
          ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0
          ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0
          ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0
        instead of
          ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0
          ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0
          ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0

        * process.c (struct_user_offsets) [XTENSA]: Sort values.

2014-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        Document -k option as experimental.
        strace -k does not produce a reliable output on all supported
        configurations yet, even basic strace-k.test is known to fail
        on some of them.

        * strace.c (usage): Document -k option as experimental.
        * strace.1: Likewise.
        * NEWS: Likewise.

2014-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify -k test.
        Split stack-fcall.c into several compilation units so that intermediate
        function calls would not be optimized out by compiler.

        * tests/stack-fcall.c: Move intermediate functions to ...
        * tests/stack-fcall-*.c: ... new files.
        * tests/Makefile.am (stack_fcall_SOURCES): Add stack-fcall-*.c.

2014-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance -k test.
        Add two more function calls to the stack.  Suggested by Masatake YAMATO.

        * tests/stack-fcall.c (f1): Rename to f3.
        (f1, f2): New functions.
        * tests/strace-k.test: Update.

2014-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: ignore memory mappings that have no PROT_EXEC bit set.
        * unwind.c (build_mmap_cache): For each memory mapping being scanned,
        save its PROT_EXEC bit and skip the mapping if it is not set.

        unwind: cleanup build_mmap_cache.
        * unwind.c (build_mmap_cache): Move local variables to the code branch
        where they are used.  Check return code of sscanf and strdup.  Do not
        treat unusual memory mappings as fatal errors.  Do not skip memory
        mappings with path names starting with "[".

        unwind: remove unused field from mmap_cache_t.
        * unwind.c (mmap_cache_t): Remove "deleted" field.
        (build_mmap_cache): Remove initialization of "deleted" field.

2014-06-12  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: refactor stacktrace_walk.
        * unwind.c (stacktrace_walk): Move stack frame printing code
        to separate function print_stack_frame.

        unwind: constify binary_filename and symbol_name functions arguments.
        * unwind.c (call_action_fn, print_call_cb, sprint_call_or_error,
        queue_put, queue_put_call): Add const qualifier to binary_filename and
        symbol_name arguments.

2014-06-11  Luca Clementi  <luca.clementi@gmail.com>

        unwind: disable stack trace with multiple personalities.
        * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace,
        unwind_capture_stacktrace): Disable stack tracing of non-default
        personality processes.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: rename function_off_set to function_offset.
        * unwind.c (call_action_fn, stacktrace_walk, STACK_ENTRY_SYMBOL_FMT,
        print_call_cb, sprint_call_or_error, queue_put, queue_put_call):
        Rename function_off_set to function_offset.

        unwind: fix a bug in range updating of binary search.
        * unwind.c (print_stacktrace): Fix another off-by-one error in binary search.

        unwind: use fopen64 instead of fopen.
        * unwind.c (fopen_for_input): Define to fopen64 iff
        [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen.
        (build_mmap_cache): Use fopen_for_input instead of fopen.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: fix build on 32-bit architectures.
        Fix compilation warnings in unwind.c on 32-bit architectures.
        On some architectures getuid is actually getuid32, so change the test
        to use getpid instead of getuid.

        * unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set
        to unsigned long.
        (queue_put_error): Change the 3rd argument's type to unsigned long.
        * tests/stack-fcall.c (f1): Use getpid instead of getuid.
        * tests/strace-k.test: Likewise.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify -w option test.
        * tests/count.test: Allow nanosleep to spend a bit less time than 1 second.

2014-06-04  Dmitry V. Levin  <ldv@altlinux.org>

        Fix delete_module decoding.
        * xlat/delete_module_flags.in: New file.
        * file.c (sys_delete_module): Move ...
        * bjm.c (sys_delete_module): ... to here.
        Decode 1st argument using printstr instead of printpath.
        * NEWS: Mention it.

2014-06-04  Zubin Mithra  <zubin.mithra@gmail.com>

        Decode paths associated with file descriptors returned by syscalls.
        * defs.h (RVAL_FD): New macro.
        (RVAL_MASK, RVAL_STR, RVAL_NONE): Update.
        * desc.c (sys_dup, sys_delete_module): New functions.
        (do_dup2, decode_open, sys_creat): Change return value to RVAL_FD.
        * linux/dummy.h (sys_delete_module, sys_dup): Remove.
        * linux/syscall.h (sys_delete_module, sys_dup): New prototypes.
        * syscall.c (trace_syscall_exiting): Handle RVAL_FD.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        NEWS: Prepare for 4.9 release.

        Warn about flags that have no effect with -c.
        * strace.c (init): Issue a warning if -i, -k, -r, -t, -T, or -y is used
        along with -c.
        This fixes Debian bug #443895.

        debian: enable security hardening features.
        * debian/rules: Follow the advice in https://wiki.debian.org/Hardening
        and enable maximum hardening as for programs that handle untrusted data.
        Patch by Markus <waldeck@gmx.de>.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        debian: update control file.
        * debian/control (strace64): Fix a typo in package description.
        Patch by Pascal De Vuyst <pascal.devuyst@gmail.com>.
        (strace, strace-udeb): Add x32 to architecture list.
        Patch by Guillaume Morin <guillaume@morinfr.org>.
        (strace, strace-udeb): Add or1k to architecture list.
        Patch by Christian Svensson <debian@cmd.nu>.
        (strace, strace-udeb): Add arm64 to architecture list,
        and remove defunct arm.
        Patch by Wookey <wookey@debian.org>.

        This fixes Debian bugs: #697625, #727018, #742235, #749956.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        manpage: minor corrections.
        $ groff -ww -mandoc -z strace.1
        strace.1:65: warning: macro `IX' not defined

        * strace.1: define IX macro as empty for groff.
        Change remaining '-' as minus to '\-'.
        Have two word spaces after a full stop as an end of sentence.
        Use extra space ('\,' or '\/') between roman and italic characters.
        Based on patch by Bjarni Ingi Gislason <bjarniig@rhi.hi.is>.
        This fixes Debian bug #725987.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: tests: add a test for -k option.
        * tests/stack-fcall.c: New test target.
        * tests/strace-k.test: New test driver.
        * tests/Makefile.am (check_PROGRAMS): Add stack-fcall.
        (TESTS): Add strace-k.test.
        * tests/.gitignore: Add stack-fcall.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering
        Instead of handling stacktrace capturing and mmap cache invalidating in
        sys_* functions, handle them uniformly in trace_syscall_entering using
        new flags introduced by previous two commits.

        The patch is simpler than its older version(v3).  The value of
        hide_log_until_execve is just ignored.  I found the value is nothing
        to do with this patch.  unwind_cache_invalidate is mentioned only
        once in trace_syscall_exiting.
        Both are suggested by Dmitry Levin.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        unwind: add SE and SI flags to syscall entries for all architectures.
        Add SE flag to execve, exit, and exit_group syscall entries.
        Add SI flag to brk, execve, mmap, mprotect, mremap, munmap,
        remap_file_pages, shmat, and shmdt syscall entries.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: introduce markers specifying the needs of special care in unwinding
        Some system calls require capturing the stack trace before they are
        processed in kernel.  Typical one is execve.  Some system calls require
        invalidating mmap cache after they are processed in kernel.

        In current implementation these requirements are handled directly by
        appropriate syscall handlers.  However, it is difficult to keep the
        source code maintainable using this approach to cover all system calls
        which have such requirements.

        A more generic way to implement this is to flag all syscalls that
        require special processing, and handle these flags right in
        trace_syscall_entering instead of changing syscall handlers.

        This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and
        STACKTRACE_CAPTURE_ON_ENTER.

        The names of macros are suggested by Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: enable dwarf cache of libunwind.
        Here is the benchmark of the dwarf cache.

        Target program:

            #include <sched.h>
            int main(void)
            {
              unsigned int max = 0x6fff, i;
              for (i = 0; i < max; i++)
                sched_yield();
              return 0;
            }

        Command line:

                ./strace -o /dev/null -k a.out

        With the dwarf cache:

            real        0m12.081s
            user        0m3.858s
            sys         0m8.194s

        Without the dwarf cache:

            real        0m22.326s
            user        0m5.218s
            sys         0m16.952s

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: report expected backtracing error.
        When a file mmap'ed to the target process is unlink'ed, backtracing the
        stack would fail.  Current implementation reports it as
        "backtracing_error".  To avoid confusion, the message is changed to
        "expected_backtracing_error".

        Here is the reproducer:

          $ cat ./p-deleted.c
          #include <unistd.h>

          int main(int argc, char **argv) {
            return unlink(argv[0]) < 0;
          }

          $ strace -e unlink -k ./p-deleted
          unlink("./p-deleted")                   = 0
           > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17]
           > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575]
           > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
           > backtracing_error [0x7ffff1365590]
          +++ exited with 0 +++

        p-deleted is deleted therefore backtracing_error is reported.  This
        patch records the deleted marker when making mmap cache and refers the
        recorded information in the case "backtracing_error" to switch the
        message.

        Here is the output of this patch:

          $ strace -e unlink -k ./p-deleted
          unlink("./p-deleted")                   = 0
           > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17]
           > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575]
           > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
           > expected_backtracing_error [0x7ffff1365590]
          +++ exited with 0 +++

        This solution is not perfect: if a file is unlink'ed after making the
        mmap cache and before unwinding, strace cannot have a chance to record
        the deleted marker.

        In this version of patch, hardcoded magic number used in comparing "(delete)"
        string is replaced with strlen as suggested by Dmitry Levin.

        In old version of patch, the deleted entry was thrown away from mmap
        cache to avoid to report "backtracing_error".  In this patch I keep it,
        and just switch the error message.
        Inspired by the review comment from Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: call unwind_tcb_fin before printing detached message.
        captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not
        empty.  This should happen before printing detached message, so
        unwind_tcb_fin is moved to the top of droptcb.

        This is implicitly suggested by Dmitry Levin in patch review process.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: implement automatic mmap cache invalidation.
        A mmap cache belonging to a tcb was updated when a system call which
        changed the memory mapping was called.  This implementation was assumed
        the mapping was changed only by the tcb.  However, this assumption is
        incorrect if the target application is multi-threaded; more than two
        tcbs can shared the same memory mapping and a tcb can modify it without
        being noticed by the others.

        This change introduces a global integer variable mmap_cache_generation,
        and mmap_cache_generation field to struct tcb.  The variable
        is incremented each time a process enters a syscall that can modify its
        memory mapping.  Each tcb records the value of this variable at the
        moment if  building its mmap cache.  Every mmap cache associated with
        the given tcb can be validated by comparing its mmap_cache_generation
        field with the variable mmap_cache_generation.

        This implementation is inefficient.  If strace attaches two processes
        which don't share the memory mapping, rebuilding mmap cache of a tcb
        triggered by another tcb's mmap system call is not necessary.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: introduce queue_t for capturing stacktrace.
        This is the second step for splitting capturing from printing.

        New `queue' field is added to tcb.  Captured stacktrace is stored here.
        The field is initialized/finalized at unwind_tcb_init/unwind_tcb_fin.

        New API function unwind_capture_stacktrace is added.  This function
        captures the currest stack using stracktrace_walker and records it in
        tcb.  It's printing is delayed to the next call of
        unwind_print_stacktrace.

        unwind_print_stacktrace is extended.  Now it checks queue field of
        the given tcb at the start of function.  If the function finds a
        captured stack trace, the latter is printed using stracktrace_walker.

        Currently unwind_capture_stacktrace invocations are added directly to
        handlers of mmap, munmap, mprotect, and execve.

        Here is the difference of output with/without patch:

        (without patch)
          execve("./test-fork", ["./test-fork"], [/* 56 vars */]) = 0
           > /usr/lib64/ld-2.18.so(check_one_fd.part.0+0x82) [0x11f0]

        (with patch)
          execve("./test-fork", ["./test-fork"], [/* 54 vars */]) = 0
           > /usr/lib64/libc-2.18.so(execve+0x7) [0xbcd27]
           > /home/yamato/var/strace/strace(exec_or_die+0x10c) [0x26ac]
           > /home/yamato/var/strace/strace(startup_child+0x346) [0x134f6]
           > /home/yamato/var/strace/strace(init+0x89f) [0x13dff]
           > /home/yamato/var/strace/strace(main+0xa) [0x26ca]
           > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
           > /home/yamato/var/strace/strace(_start+0x29) [0x2799]

        In older version output lines of captured elements were built when
        printing.  In this version they are built when capturing the stack.
        As result, unneeded dynamic memory allocations are avoided.
        Suggested by Luca Clementi.

        In older version the combination of snprintf and realloc were used.
        In this version they are replaced with asprintf.
        Suggested by Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: introduce own debug macro.
        * unwind.c (DPRINTF): New macro, to be utilized in debugging cache
        management code.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: introduce stacktrace_walker.
        In current implementation, the stack trace is captured and printed at
        the same time, in trace_syscall_exiting.  This approach cannot
        provide user expected information when a system call changes the
        memory mapping.  In such cases, the stack trace should be captured on
        entering syscall and printed on exiting.

        As the initial step for splitting capturing from printing, this change
        introduces stacktrace_walker utility function.  It can be used both for
        capturing in trace_syscall_entering and printing in
        trace_syscall_exiting.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: give all exported functions "unwind_" prefix.
        * unwind.c (init_unwind_addr_space): Rename to unwind_init.
        (init_libunwind_ui): Rename to unwind_tcb_init.
        (free_libunwind_ui): Rename to unwind_tcb_fin.
        (delete_mmap_cache): Rename to unwind_cache_invalidate.
        (print_stacktrace): Rename to unwind_print_stacktrace.
        * defs.h: Update prototypes.
        * mem.c: All callers updated.
        * process.c: Likewise.
        * strace.c: Likewise.
        * syscall.c: Likewise.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: delete mmap cache in free_libunwind_ui.
        free_libunwind_ui is expected to release all unwind related resources
        attached to tcp.

        * strace.c (droptcb): Move delete_mmap_cache call ...
        * unwind.c (free_libunwind_ui): ... to here.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

        unwind: make alloc_mmap_cache function local.
        * defs.h (alloc_mmap_cache): Remove.
        * unwind.c (alloc_mmap_cache): Add static qualifier.

        unwind: fix a bug in range updating of binary search.
        * unwind.c (print_stacktrace): Fix off-by-one error in binary search.

2014-05-30  Luca Clementi  <luca.clementi@gmail.com>

        Add -k option to print stack trace after each syscall.
        Print the stack trace of the traced process after each system call when
        -k option is specified.  It is implemented using libunwind to unwind the
        stack and to obtain the function name pointed by the IP.

        Based on the code that was originally taken from strace-plus
        of Philip J. Guo.

        * configure.ac: Add --with-libunwind option.  Check libunwind support.
        * Makefile.am: Add libunwind support.
        * defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields.
        [USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache,
        delete_mmap_cache, print_stacktrace): New prototypes.
        * mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support.
        * process.c (sys_execve): Likewise.
        * strace.c (usage, alloctcb, droptcb, init): Likewise.
        * syscall.c (trace_syscall_exiting): Likewise.
        * unwind.c: New file.
        * strace.1: Document -k option.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        sysctl: update CTL_*, KERN_*, NET_*, and VM_* constants.
        * configure.ac (AC_CHECK_DECLS): Add CTL_*, KERN_*, NET_*, and
        VM_* constants.
        * system.c (CTL_PROC, CTL_CPU): Remove definitions.
        * xlat/sysctl_*.in: Update.

        Check for constants used by waitid function.
        * configure.ac (AC_CHECK_DECLS): Add P_* constants.

        Check for LO_FLAGS_READ_ONLY constant.
        * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_READ_ONLY.

        Compress blank lines.
        Suppress empty lines left after automated xlat conversion.

        xlat: cleanup the aftermath of automatic conversion.

        Generate xlat/*.in files.
        Automatically convert xlat structures from *.c files to xlat/*.in files
        using "./generate_xlat_in.sh *.c" command.

        Rename several xlat structures to avoid collisions.
        * bjm.c (which): Rename to qm_which.
        * ipc.c (msg_flags): Rename to ipc_msg_flags.
        * time.c (which): Rename to itimer_which.

        Enhance xlat generator.
        * xlat/gen.sh: Define all xlat structs not declared in defs.h as static.
        Some symbolic constants are not macros, extend #ifdef check to cover
        symbolic constants checked by AC_CHECK_DECLS.
        Handle complex symbolic constants in SYMBOL|... form.
        Handle symbolic constants in 1<<SYMBOL form.
        Handle numeric constants.
        Implement #unconditional directive that turns off preprocessor checks.
        Implement #unterminated directive that turns off adding XLAT_END.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        Use bootstrap script consistently.
        Now that ./xlat/gen.sh has to be run before autoreconf,
        replace all autoreconf calls with ./bootstrap call.

        * bootstrap: Forward arguments to autoreconf.
        * build_static_example.sh: Replace autoreconf call with bootstrap call.
        * make-dist: Likewise.
        * qemu_multiarch_testing/README: Likewise.

2014-05-30  Mike Frysinger  <vapier@gentoo.org>

        Implement xlat generator.
        * bootstrap: New file.
        * xlat/gen.sh: Likewise.
        * Makefile.am: Include xlat/Makemodule.am
        (EXTRA_DIST): Add $(XLAT_INPUT_FILES), $(XLAT_HEADER_FILES), and
        xlat/gen.sh.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix SCM_RIGHTS test for big-endian systems.
        * tests/scm_rights.c (main): Send zero integer to avoid issues with
        endianness.
        * tests/scm_rights-fd.test: Update grep patterns.

        Decode file descriptors passed via SCM_RIGHTS control messages.
        * net.c (printcmsghdr): Print descriptors from SCM_RIGHTS control
        messages using printfd.
        * tests/scm_rights.c: New file.
        * tests/scm_rights-fd.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add scm_rights.
        (TESTS): Add scm_rights-fd.test.
        * tests/.gitignore: Add scm_rights and uio.

        tests: add a test for -c and -w options.
        * tests/count.test: New test.
        * tests/Makefile.am (TESTS): Add it.

2014-05-29  Mark Hills  <Mark.Hills@framestore.com>

        Optionally produce stats on syscall latency.
        Time spent in system time is not useful where a syscall depends on some
        non-CPU resource, eg. typically open() or stat() to a network drive.

        This patch adds a new flag (-w) to produce a summary of the time
        difference between beginning and end of the system call (ie. latency)

        This functionality has been useful to profile slow processes that
        are not CPU-bound.

2014-05-29  Dmitry V. Levin  <ldv@altlinux.org>

        Constify count_syscall function.
        * count.c (count_syscall): Add const qualifier to timeval argument and
        rename it.  Store the wall clock time spent while in syscall in separate
        timeval variable.
        * defs.h (count_syscall): Update prototype.
        * syscall.c (trace_syscall_exiting): Update count_syscall invocation.

        Constify tv_* functions.
        * defs.h (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): Add
        const qualifier to read only arguments.
        * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div):
        Likewise.

2014-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        Use printstr for sethostname, setdomainname, and gethostname decoding.
        The argument passed to sethostname and setdomainname syscalls, as well
        as the string returned by gethostname syscall, is not a pathname, so
        printpathn is not the right method for its decoding.

        * process.c (sys_sethostname, sys_setdomainname): Decode 1st argument
        using printstr instead of printpathn.
        [ALPHA] (sys_gethostname): Likewise.

2014-05-21  James Hogan  <james.hogan@imgtec.com>

        Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_T.
        When strace is built with large file support definitions in CFLAGS (as
        may be provided by buildroot) the C library headers may expose a 64-bit
        rlim_t even though the struct rlimit fields used by the system call
        interface are only 32-bit.  The SIZEOF_RLIM_T will then be 8 which
        results in bad decoding of the getrlimit and setrlimit syscalls.

        This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with
        checks for current_wordsize.

2014-05-13  Masatake YAMATO  <yamato@redhat.com>

        Enhance setns syscall decoding.
        * process.c (sys_setns): New function.
        Decode the 2nd syscall argument using clone_flags.
        * linux/syscall.h (sys_setns): New prototype.
        * linux/dummy.h (sys_setns): Remove.

2014-05-12  Dmitry V. Levin  <ldv@altlinux.org>

        mips: fix syscall entries that should have TP flag set.

        xtensa: fix unshare syscall entry.

        alpha, hppa, mips n64: fix waitid syscall entry.

        Add TM flag to shmat and shmdt syscall entries.

        Alias sys_vfork to sys_fork.
        * process.c (sys_vfork): Remove.
        * linux/syscall.h (sys_vfork): Likewise.
        * linux/dummy.h (sys_vfork): Alias to sys_fork.
        * linux/alpha/syscallent.h: Fix vfork entry.
        * util.c (setbpt): Do not check for sys_vfork.
        * syscall.c (syscall_fixup_for_fork_exec): Likewise.

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        epoll_ctl: fix EPOLL_CTL_DEL argument decoding.
        * desc.c (sys_epoll_ctl): Do not parse the event structure for
        EPOLL_CTL_DEL operation.

        Reported-by: Марк Коренберг <socketpair@gmail.com>

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update CLOCK_* constants.
        * time.c (clocknames): Add CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM,
        CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE, and CLOCK_TAI.
        Fixes RH#1088455.

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix preadv/pwritev offset decoding.
        * util.c (printllval): Add align argument.
        * defs.h (printllval): Update prototype.
        (printllval_aligned, printllval_unaligned): New macros.
        * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
        sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
        sys_fallocate): Replace printllval call with printllval_aligned.
        * io.c (sys_pread, sys_pwrite): Likewise.
        (sys_preadv, sys_pwritev): Replace printllval call with
        printllval_unaligned.
        * linux/arm/syscallent.h: Set the number of preadv and pwritev
        arguments to 5.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

        Reported-by: Dima Kogan <dima@secretsauce.net>

2014-04-16  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for pread/pwrite and preadv/pwritev offset decoding.
        * tests/uio.c: New file.
        * tests/uio.test: New test.
        * tests/Makefile.am (check_PROGRAMS): Add uio.
        (uio_CFLAGS): Define.
        (TESTS): Add uio.test.

2014-04-10  Dmitry V. Levin  <ldv@altlinux.org>

        Refactor LDT decoding.
        * configure.ac (AC_CHECK_TYPES): Remove struct user_desc.
        * ldt.c: New file.
        * Makefile.am (strace_SOURCES): Add ldt.c.
        * mem.c: Do not include <asm/ldt.h>.
        (print_ldt_entry): Remove.
        (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): Move...
        * ldt.c: ... here.
        * process.c: Do not include <asm/ldt.h>.
        (sys_clone) [I386 || X86_64 || X32]: Use print_user_desc.

2014-04-10  Denys Vlasenko  <dvlasenk@redhat.com>

        Make int3 example in comments more cut-n-pastable.
        I found that I use it quite often. Lets make it so that
        after cut-n-pasting it into a file, there is no need
        to edit the result (e.g. no need to remove C comment
        chars from every line.

2014-04-09  Dmitry V. Levin  <ldv@altlinux.org>

        mips: enable decoding of set_thread_area.
        * linux/dummy.h [MIPS]: Do not redirect sys_set_thread_area to printargs.
        * mem.c [MIPS] (sys_set_thread_area): Define.

        x86_64, x32: enable decoding of modify_ldt, get_thread_area, and set_thread_area
        * linux/dummy.h [X86_64 || X32]: Do not redirect sys_modify_ldt,
        sys_get_thread_area, and sys_set_thread_area to printargs.

        x32: decode clone LDT user_desc entries for x86 processes.
        * mem.c [X32]: Include asm/ldt.h.
        [X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
        sys_get_thread_area): Define.
        * process.c [X32]: Include asm/ldt.h.
        (sys_clone) [X32]: Decode LDT entry if current_personality == 1.

2014-04-09  Elliott Hughes  <enh@google.com>

        x86-64: decode clone LDT user_desc entries for x86 processes.
        * mem.c [X86_64]: Include asm/ldt.h.
        [X86_64] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
        sys_get_thread_area): Define.
        * process.c [X86_64]: Include asm/ldt.h.
        (sys_clone) [X86_64]: Decode LDT entry if current_personality == 1.

2014-04-09  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix clone(2) argument order for x86 processes.
        Apply the same fix that was made for x86_64.

        * process.c [X32] (ARG_CTID, ARG_TLS): Take current
        personality into account.

2014-04-09  Elliott Hughes  <enh@google.com>

        x86-64: fix clone(2) argument order for x86 processes.
        Without this patch, strace claims that parent_tidptr == tls, which is
        clearly wrong.  It is expected that parent_tidptr == child_tidptr.

        * process.c [X86_64] (ARG_CTID, ARG_TLS): Take current
        personality into account.

2014-04-06  Elliott Hughes  <enh@google.com>

        aarch64: Fix decoding of arm struct stat64.
        We need to handle this situation more like x86-64.  32-bit arm and i386
        actually have a common struct stat64, except the arm one must not be
        packed.  Additionally, on aarch64 the 32-bit personality is personality 0.

2014-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        ARM EABI: disable OABI support by default.
        OABI is rarely used in ARM EABI systems nowadays, so disable its support
        by default.  Add --enable-arm-oabi option to enable ARM OABI support.

        * configure.ac: New option --enable-arm-oabi.
        * syscall.c (get_scno) [ARM]: Check ENABLE_ARM_OABI macro defined by
        configure instead of undocumented STRACE_KNOWS_ONLY_EABI macro.

2014-03-12  Elliott Hughes  <enh@google.com>

        Fix stat decoding for LP64 bionic.
        Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with
        HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64.
        The workaround needed to be applied to all LP64 architectures, not
        just aarch64.  This patch fixes that and adds an explanatory comment.

2014-03-11  Masatake YAMATO  <yamato@redhat.com>

        Decode protocol argument for PF_NETLINK sockets.
        * net.c (protocols): Rename to inet_protocols.
        [PF_NETLINK] (netlink_protocols): New xlat structure.
        (sys_socket): Rename protocols to inet_protocols.
        [PF_NETLINK]: Decode protocol argument using netlink_protocols.

        Acked-by: Mike Frysinger <vapier@gentoo.org>

2014-03-11  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup socketpair decoding.
        The only supported domain for socketpair syscall is AF_UNIX, so
        no decoding related to other domains is required for socketpair.

        * net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains,
        print the protocol argument as is.

2014-03-11  Dmitry V. Levin  <ldv@altlinux.org>

        printsiginfo: add SIGSYS decoding.
        * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall.
        * signal.c (SYS_SECCOMP): Define if not yet defined.
        (sigsys_codes): new xlat structure.
        (printsiginfo): Decode SIGSYS.

        Update siginfo codes.
        * signal.c (siginfo_codes): Add SI_DETHREAD.

        Factor out printing of si_pid and si_uid members of siginfo_t.
        * signal.c (printsigsource): New function.
        (printsiginfo): Use it.

2014-03-10  Elliott Hughes  <enh@google.com>

        Improve SI_TIMER decoding.
        Decode siginfo_t more clearly for si_code SI_TIMER.
        The 'pid' is actually a POSIX timer id, and the 'uid' is actually the
        overrun.
        Also factor out the si_value dumping so it's the same for every si_code.

2014-03-03  Elliott Hughes  <enh@google.com>

        aarch64: fix decoding of arm syscall numbers.
        If an aarch64 strace is tracing a process using the arm personality, it
        also needs to call the shuffle_scno function for the ARM-specific
        syscalls.

        * syscall.c (shuffle_scno): Define on AARCH64.
        (get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode.

2014-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        Fix fcntl decoding.
        Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined or
        not defined altogether.
        Do not assume that sizeof(off_t) < sizeof(long long) when F_SETLK64 is
        undefined.

        This change fixes build with musl libc on x86.

        * configure.ac: Define SIZEOF_OFF_T.
        * desc.c (USE_PRINTFLOCK64): New macro.
        (struct flock64, printflock64): Do not define on X32.
        (printflock): Replace X32 specific workaround with SIZEOF_OFF_T check.
        Fix printing off_t members of struct flock.
        (sys_fcntl): Use USE_PRINTFLOCK64.

2014-03-01  Dmitry V. Levin  <ldv@altlinux.org>

        sys_fcntl: remove F_FREESP and F_FREESP64 support.
        F_FREESP and F_FREESP64 fcntl commands are not available in Linux
        and therefore the code implementing their decoding is useless.
        Besides that, F_FREESP64 decoding is too complicated to support.

        * desc.c (fcntlcmds): Remove F_FREESP and F_FREESP64.
        Remove F_FREESP64 from the check whether to define struct flock64.
        (sys_fcntl): Remove F_FREESP and F_FREESP64 support.

2014-02-28  Elliott Hughes  <enh@google.com>

        Add multi-personality support to struct old_sigaction decoding.
        struct sigaction is another structure that contains members
        whose size differs between 32-bit and 64-bit personalities.

        * signal.c [HAVE_SIGACTION] (old_sigaction32): New structure.
        [HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct
        old_sigaction on a 64-bit host.

2014-02-28  Elliott Hughes  <enh@google.com>

        Fix decoding of arm struct stat64 by aarch64 strace.
        aarch64's uapi header files have a struct stat but no struct stat64.
        To correctly decode a 32-bit process' s struct stat64 we need
        HAVE_STAT64, but then the build fails because there is no struct stat64.
        Luckily, the aarch64 struct stat is structurally equivalent to the arm
        struct stat64, so we can just reuse that.

        * file.c [AARCH64] (stat64): Define to stat.

2014-02-28  Dmitry V. Levin  <ldv@altlinux.org>

        Remove obsolete ioctlsort.c.
        The generic version of ioctlsort.c became obsolete after commit
        v4.6-240-g5afdf12 that removed its last non-Linux users.

        * ioctlsort.c: Remove.
        * Makefile.am (EXTRA_DIST): Remove ioctlsort.c.

        Reported-by: Elliott Hughes <enh@google.com>

2014-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Add multi-personality support to stack_t decoding.
        stack_t is one of many structures that contain members
        whose size differs between 32-bit and 64-bit personalities.

        * signal.c (print_stack_t): Decode 32-bit stack_t on a 64-bit host.

        Reported-by: Elliott Hughes <enh@google.com>

2014-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Rewrite signal mask decoding without sigset_t.
        The sigset_t provided by libc is not quite convenient.
        In glibc, sigset_t is an array with space for 1024 bits, which is much
        more than required: all architectures supported by Linux have only 64
        signals except MIPS, which has 128.
        In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than
        necessary.

        With this change, signal mask is decoded without use of intermediate
        sigset_t structure, which saves us some cpu cycles in case of glibc with
        its inflated sigset_t, and enables build with libcs where sigset_t is
        broken.

        Old implementation used to check each signal number in the given signal
        mask twice using sigismember().
        New implementation is based on popcount and next_set_bit() so it's
        noticeably faster.

        * configure.ac: Check for __builtin_popcount.
        * signal.c: Ensure that NSIG >= 32.
        (sprintsigmask, sprintsigmask_long, printsigmask): Remove.
        (popcount32, sprintsigmask_n): New functions.
        (tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros.
        (print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask,
        sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use
        new signal mask decoding interface.
        * tests/sigaction.c (main): Add a test with almost filled signal mask.
        * tests/sigaction.awk: Update.

2014-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with Bionic libc.
        Add generic tests for fopen64 and fputs_unlocked functions to fix build
        with Bionic libc that does not provide them.

        * configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked.
        * strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64
        if !HAVE_FOPEN64.
        Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED.
        * vsprintf.c: Use fputs instead of fputs_unlocked
        if !HAVE_FPUTS_UNLOCKED.

        Reported-by: Elliott Hughes <enh@google.com>

2014-02-25  James Yang  <james.yang@freescale.com>

        powerpc64: fix 64-bit process detection on embedded.
        * syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection
        on embedded powerpc.

2014-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        Do not compile scsi ioctl decoding if <scsi/sg.h> is not available.
        Add a generic test for <scsi/sg.h> availability to fix build with
        Bionic libc that does not provide <scsi/sg.h>.

        * configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h.
        * ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H.
        * scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H.

        Reported-by: Elliott Hughes <enh@google.com>

2014-02-14  Dmitry V. Levin  <ldv@altlinux.org>

        Revert "Add support for Altera's Nios-II softcore architecture"
        The patch originally submitted by Ezequiel García was OK, but I somehow
        managed to mangle it so that most of the patch was not applied.

        According to Ezequiel García, an architecture port based on the generic
        syscall ABI is in progress.

        This reverts commit 61e426e87ac81be4b4ff9de581635b4ea585624f.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: tighten sigaction check.
        * tests/sigaction.awk: Check that input conatins all expected lines.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix sigaction reporting on non-x86 architectures.
        If SA_RESTORER is not defined by libc headers but defined by kernel
        headers, use the definition provided by kernel headers for proper
        sigaction decoding.

        * signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is
        defined, regardless of architecure.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

        Check for SA_RESTORER definition in <asm/signal.h>
        Kernel header <asm/signal.h> cannot be included from regular code
        because it conflicts with libc headers, but SA_RESTORER is needed in
        signal.c, so SA_RESTORER value is forwarded from <asm/signal.h> to
        config.h using a configure check.

        * configure.ac (ASM_SA_RESTORER): Define if SA_RESTORER is defined
        in <asm/signal.h>.

2014-02-07  Dmitry V. Levin  <ldv@altlinux.org>

        arm: fix compilation warning.
        Fix "dereferencing type-punned pointer will break strict-aliasing rules"
        warning introduced by commit v4.8-54-g670b21b.

        * signal.c (sys_sigreturn) [ARM]: Avoid dereferencing type-punned pointers.

2014-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        kexec: fix typo.
        * kexec.c (print_kexec_segments) [SUPPORTED_PERSONALITIES == 1]: Fix typo.

2014-02-06  Ezequiel Garcia  <ezequiel@vanguardiasur.com.ar>

        Add support for Altera's Nios-II softcore architecture.
        This commit adds strace support for Altera's Nios-II official
        kernel port as found in git://git.rocketboards.org/linux-socfpga.git

        Notice that this an out-of-tree kernel architectural port, and uses the
        legacy (non-generic) system call ABI. In particular, the port doesn't
        support PTRACE_GETREGSET, so the implementation is based on PTRACE_GETREGS.

        Given it's mandatory for new architectures to support the generic
        syscall ABI and PTRACE_GETREGSET, if the nios2 architecure is ever
        mainlined, the strace support will have to be re-factored accordingly.

        * linux/nios2/ioctlent.h.in: New file.
        * linux/nios2/syscallent.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add linux/nios2/ioctlent.h.in and
        linux/nios2/syscallent.h.
        * configure.ac: Add NIOS2 to the list of supported architectures.
        * defs.h [NIOS2]: Use register reading system.
        * process.c (struct_user_offsets): Add NIOS2 support.
        * syscall.c (get_regs, get_scno, get_syscall_args,
        get_syscall_result, get_error): Likewise.
        * util.c (change_syscall): Likewise.
        * mem.c (sys_getpagesize): Define on NIOS2.
        * system.c [NIOS2] (sys_cacheflush, sys_nios2cmpxchg): New functions.

        Acked-by: Mike Frysinger <vapier@gentoo.org>

2014-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        Implement add_key, keyctl, and request_key decoding.
        * keyctl.c: New file.
        * linux/keyctl.h: Likewise.
        * Makefile.am (strace_SOURCES): Add keyctl.c.
        (EXTRA_DIST): Add linux/keyctl.h.
        * linux/dummy.h (sys_add_key, sys_keyctl, sys_request_key): Remove.
        * linux/syscall.h (sys_add_key, sys_keyctl, sys_request_key): New
        prototypes.

        Implement ioprio_get and ioprio_set decoding.
        * ioprio.c: New file.
        * Makefile.am (strace_SOURCES): Add ioprio.c.
        * linux/dummy.h (sys_ioprio_get, sys_ioprio_set): Remove.
        * linux/syscall.h (sys_ioprio_get, sys_ioprio_set): New prototypes.

        Implement finit_module decoding.
        * bjm.c (module_init_flags): New xlat structure.
        (sys_finit_module): New function.
        * linux/dummy.h (sys_finit_module): Remove.
        * linux/syscall.h (sys_finit_module): New prototype.

        Cleanup inotify syscalls decoding.
        * linux/inotify.h: New file.
        * file.c (inotify_modes, inotify_init_flags, sys_inotify_add_watch,
        sys_inotify_rm_watch, sys_inotify_init1): Move...
        * inotify.c: ... here.
        (inotify_modes): Rename to inotify_flags, convert to XLAT form.
        (inotify_init_flags): Convert to XLAT form.
        * Makefile.am (strace_SOURCES): Add inotify.c.
        (EXTRA_DIST): Add linux/inotify.h.

        Enhance reboot decoding.
        * linux/reboot.h: New file.
        * system.c (bootflags1, bootflags2, bootflags3, sys_reboot): Move...
        * reboot.c: ... here.
        (bootflags2, bootflags3): Update constants.
        * Makefile.am (strace_SOURCES): Add reboot.c.
        (EXTRA_DIST): Add linux/reboot.h.

        Implement kexec_load decoding.
        * kexec.c: New file.
        * linux/kexec.h: Likewise.
        * Makefile.am (strace_SOURCES): Add kexec.c.
        (EXTRA_DIST): Add linux/kexec.h.
        * linux/dummy.h (sys_kexec_load): Remove.
        * linux/syscall.h (sys_kexec_load): New prototype.

        Use prepared editions of recently imported linux headers.
        * linux/fanotify.h: Replace with edition prepared with headers_install.sh.
        * linux/personality.h: Likewise.

        Implement fanotify_init and fanotify_mark decoding.
        * fanotify.c: New file.
        * linux/fanotify.h: Likewise.
        * Makefile.am (strace_SOURCES): Add fanotify.c.
        (EXTRA_DIST): Add linux/fanotify.h.
        * defs.h (print_dirfd): New prototype.
        * file.c (print_dirfd): Export.
        * linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove.
        * linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New
        prototypes.
        * pathtrace.c (pathtrace_match): Handle sys_fanotify_init and
        sys_fanotify_mark.

        Use XLAT_END macro.
        Automatically update all xlat structures using the following sed regexp:
        s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/

        Itroduce XLAT_END macro to make xlat structures more compact.
        * defs.h (XLAT_END): New macro.

        Convert personality_options to XLAT form.
        * linux/personality.h: New file.
        * Makefile.am (EXTRA_DIST): Add it.
        * system.c: Include <linux/personality.h>.
        (personality_options): Update PER_* constants, convert to XLAT form.

        Convert futexops to XLAT form.
        * process.c: Define FUTEX_*_PRIVATE macros.
        (futexops): Convert to XLAT form.

        Convert sigev_value to XLAT form.
        * time.c (sigev_value): Convert to XLAT form.
        (printsigevent32, printsigevent): Update use of sigev_value.

        Use XLAT macro.
        Automatically convert all xlat structures to XLAT form
        using the following sed regexp:
        s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/

2014-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        Introduce XLAT macro to ease maintenance of xlat structures.
        * defs.h (XLAT): New macro.

        Suggested-by: Mike Frysinger <vapier@gentoo.org>

2014-02-04  Stefan Sørensen  <stefan.sorensen@spectralink.com>

        Decode ptp ioctls.
        * defs.h (ptp_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='.
        * Makefile.am (strace_SOURCES): Add ptp.c.
        (EXTRA_DIST): Add linux/ptp_clock.h.
        * ptp.c: New file.
        * linux/ptp_clock.h: New file.

2014-02-03  Stefan Sørensen  <stefan.sorensen@spectralink.com>

        Decode dynamic posix clocks.
        * time.c (cpuclocknames): New xlat structure.
        (printclockname): New function that decodes posix clock names,
        including dynamic fd encoded clocks.
        (sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep,
        sys_clock_adjtime, sys_timer_create, sys_timerfd, sys_timerfd_create):
        Use it.

        Update ADJ_* constants.
        * time.c (adjtimex_modes): Add ADJ_TAI, ADJ_SETOFFSET, ADJ_MICRO,
        ADJ_NANO, ADJ_OFFSET_SS_READ.

2014-02-02  Philippe Ombredanne  <pombredanne@nexb.com>

        Add decoding of sockets descriptor 'paths' for network calls.
        * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto,
        sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg,
        sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode
        socket descriptor arguments using printfd.
        * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls
        that take socket descriptor arguments.
        * tests/net-fd.test: New test for socket descriptor arguments decoding.
        * tests/Makefile.am (TESTS): Add net-fd.test.
        (net-fd.log): New dependency on net.log.

2014-02-02  Dmitry V. Levin  <ldv@altlinux.org>

        tests: rename all tests so that their names end in .test suffix.
        Due to automake limitations, some features work only for tests
        that end in one of the suffixes listed in TEST_EXTENSIONS.

        * tests/detach-running: Rename to detach-running.test.
        * tests/detach-sleeping: Rename to detach-sleeping.test.
        * tests/detach-stopped: Rename to detach-stopped.test.
        * tests/net: Rename to net.test.
        * tests/ptrace_setoptions: Rename to ptrace_setoptions.test.
        * tests/qual_syscall: Rename to qual_syscall.test.
        * tests/sigaction.sh: Rename to sigaction.test.
        * tests/stat: Rename to stat.test.
        * tests/strace-f: Rename to strace-f.test.
        * tests/Makefile.am (TESTS): Update.
        (LOG_COMPILER): Rename to TEST_LOG_COMPILER.

2014-01-31  Mike Frysinger  <vapier@gentoo.org>

        net: add more sockopt options.
        This syncs with the defines as available in linux-3.13.

        * net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY,
        IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR,
        IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE,
        IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP,
        MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP,
        MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL,
        IP_UNICAST_IF.

2014-01-08  Chris Dearman  <chris.dearman@imgtec.com>

        mips: fix sigaction reporting.
        MIPS userland uses the same sigaction structure with a full signal
        mask for old_sigaction and new_sigaction and does does not have
        an sa_restorer field.

        These changes have been tested on MIPS O32 big/little endian, MIPS N64
        big endian and x86-64.

        * signal.c (old_sigaction) [MIPS]: Add definition for MIPS.
        (decode_old_sigaction) [MIPS]: Print sa_mask according to its definition.
        (new_sigaction) [MIPS]: Add definition for MIPS.

2014-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        Factor out struct sigaction printing code.
        * signal.c [HAVE_SIGACTION] (decode_old_sigaction): New function.
        [HAVE_SIGACTION] (sys_sigaction): Use it.
        (decode_new_sigaction): New function.
        (sys_rt_sigaction): Use it.

2014-01-08  Dmitry V. Levin  <ldv@altlinux.org>

        tests: add a test for rt_sigaction output.
        Since "struct sigaction" varies between architectures, rt_sigaction
        decoding sometimes produces incorrect output.  This test is expected
        to catch basic rt_sigaction decoding bugs.

        Based on a patch proposed by Chris Dearman.

        * tests/sigaction.c: New file.
        * tests/sigaction.awk: Likewise.
        * tests/sigaction.sh: New test.
        * tests/Makefile.am (check_PROGRAMS): Add sigaction.
        (TESTS): Add sigaction.sh.
        (EXTRA_DIST): Add sigaction.awk.
        * tests/.gitignore: Add sigaction.

2014-01-05  Kirill A. Shutemov  <kirill.shutemov@linux.intel.com>

        mem: add missed MAP_HUGETLB mmap flag.
        * mem.c (mmap_flags): Add MAP_HUGETLB mmap flag.

        Acked-by: Mike Frysinger <vapier@gentoo.org>

2013-12-31  Mike Frysinger  <vapier@gentoo.org>

        Delete old PTRACE_{PEEK,POKE}USR logic.
        The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has
        logic in defs.h to make sure it's set sanely.  Delete this old logic as
        the defs.h takes care of it now.

        * process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines.
        * signal.c: Likewise.
        * syscall.c: Delete PTRACE_PEEKUSR define.
        * util.c: Likewise.

2013-12-31  Mike Frysinger  <vapier@gentoo.org>

        Decode the O_PATH flag.
        * file.c (open_mode_flags): Add O_PATH.

2013-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused configure checks.
        * configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist.
        (AC_CHECK_DECLS): Likewise.

2013-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        Assume that <sys/ptrace.h> provides a valid ptrace prototype.
        We used to explicitly list architectures where <sys/ptrace.h> from glibc
        is known to provide a valid prototype for ptrace, and use a homegrown
        replacement for all the rest.  Situation seems to be better nowadays,
        glibc is not the only libc available, so let's use ptrace prototype from
        <sys/ptrace.h> by default, leaving the replacement for rare broken cases
        if any.

        * defs.h: Use ptrace prototype workaround iff
        NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Stop using _LFS64_LARGEFILE.
        There is only one place left in the code where strace guesses whether
        libc provides LFS64 functions and structures.  The most natural thing to
        do there is to check for _LARGEFILE64_SOURCE - the macro provided by
        glibc.  Other libc implementations that provide nondegenerate LFS64
        interfaces are expected to define this macro as well.

        * defs.h (_LFS64_LARGEFILE): Remove.
        * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Define truncate64, ftruncate64, and getdents64 decoders unconditionally.
        These decoders are referenced by most architectures, there were no
        undefined references so far because _LFS64_LARGEFILE appears to be
        always defined by glibc when _GNU_SOURCE is defined.

        * file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define
        unconditionally.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Define printflock64 only if it is referenced by other code.
        * configure.ac (AC_CHECK_TYPES): Add struct flock64.
        * desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros.
        [!HAVE_STRUCT_FLOCK64] (struct flock64): Define.
        (printflock64): Define only if referenced by other code.
        (sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff
        these constants are defined and differ from their non-64bit versions.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific.
        * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and
        PTRACE_POKEUSER.
        * defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if
        they are not provided by <sys/ptrace.h>.

        Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unneeded redefinitions of IPPROTO_* macros.
        IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine
        them.

        * net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP,
        IPPROTO_RAW, IPPROTO_MAX): Remove.

        Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused AC_OFF_T_IS_LONG_LONG configure check.
        * configure.ac: Remove AC_OFF_T_IS_LONG_LONG.
        * m4/long_long.m4: Likewise.

        Remove unused code.
        * configure.ac (AC_CHECK_TYPES): Remove struct opthdr and
        struct t_opthdr.
        * net.c (print_sock_optmgmt): Remove.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Use struct sigcontext instead of struct sigcontext_struct.
        * configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct.
        * signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace
        struct sigcontext_struct with struct sigcontext.

        Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Use standard names of sched_param structure members.
        * process.c (sys_sched_setscheduler, sys_sched_getparam,
        sys_sched_setparam): Use portable struct sched_param member name
        sched_priority instead of glibc specific __sched_priority.

        Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Make SIGEV_THREAD_ID decoding less glibc specific.
        SIGEV_THREAD_ID decoding requires access to an internal member of
        struct sigevent.  There seems to be no portable way to do it besides
        adding a configure check.

        * configure.ac (AC_CHECK_MEMBERS): Check for
        struct sigevent._sigev_un._pad and struct sigevent.__pad.
        * time.c (printsigevent): Use an appropriate struct sigevent member
        to print thread id.

        Reported by John Spencer.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused configure checks.
        * configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr,
        T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        Assume "long long" availability.
        Most of the code already uses long long types unconditionally.

        * configure.ac: Remove the check for long long.
        * file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format
        string unconditionally.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

        Include <sys/poll.h> only if there is no <poll.h>
        * pathtrace.c: Do not include <sys/poll.h> if <poll.h> is available.
        * stream.c: Likewise.

        Move io_* syscalls decoding to a separate file.
        * desc.c (sys_io_setup, sys_io_destroy, sys_io_submit, sys_io_cancel,
        sys_io_getevents, declarations from libaio.h): Move to ...
        * aio.c: new file.
        * Makefile.am (strace_SOURCES): Add aio.c.

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

        Stop using external libaio.h.
        This change incorporates a partial copy instead
        of using external libaio.h.
        Why?
        Because we want to properly decode 32-bit aio calls
        by 64-bit strace. For that, we need more definitions than
        libaio.h provides.
        (These defs are not done yet, but will eventually be done).
        Keeping our local 32-bit compat defs in sync with libaio.h
        _without seeing libaio structs_ is hard/more bug prone.
        A smaller benefit is that we don't need libaio installed.

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

        sys_io_submit: simplify iocb_cmd_lookup() helper.
        This helper returns two values (a string and an enum).
        The caller prints the string. It's simpler to just print
        the string in the caller itself. This eliminates
        "return by reference" and more importantly, an intermediate
        static string buffer for the string result.

        Since function of the helper is different now,
        it is renamed to tprint_lio_opcode().

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

        sys_io_submit: stop traversing iocb vector after first failure.
        The program may use a very large nr but supply either outright
        invalid iocbpp[], or one with far fewer elements than nr.
        We used to try reading iocbpp[i] until i == nr.
        With this change, we stop on the first failure.

2013-11-09  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix pathtrace_match() to match recent fixes to select decoding.

        Fix select decoding on e.g. 32-bit ppc process by 64-bit strace.
        Added next_set_bit() function which finds the next set bit,
        properly taking into account word size of the traced process.
        Use it in decode_select() instead of fd_isset().
        Also, properly round fdsize up to word size of traced process,
        not to strace's word size.

2013-11-06  Denys Vlasenko  <dvlasenk@redhat.com>

        Speed up and explain fd_isset()

2013-11-05  Dr. David Alan Gilbert  <dave@treblig.org>

        Add a test for the latest select decoding fix.
        * test/select.c (main): Add a test for nfds larger than FD_SETSIZE.

2013-11-05  Dmitry V. Levin  <ldv@altlinux.org>

        Fix select decoding for glibc in _FORTIFY_SOURCE mode.
        glibc in _FORTIFY_SOURCE mode raises SIGABRT when descriptor greater
        or equal to FD_SETSIZE is passed to FD_ISSET.  Select family syscalls,
        however, can legitimately accept such descriptors.  To overcome this
        limitation, we have to replace FD_ISSET with an equivalent that imposes
        no such restrictions.

        * desc.c (fd_isset): New function.
        (decode_select): Use it instead of FD_ISSET.

2013-11-05  Dmitry V. Levin  <ldv@altlinux.org>

        More select decoding fixes.
        * desc.c (decode_select): Actually print arg[0] as int on entering
        syscall.  When arg[0] is negative, do not attempt to fetch and decode
        descriptor sets on entering syscall, kernel will reject it anyway.
        On exiting syscall, stop checking descriptor sets as soon as all
        returned descriptors are found.

2013-11-05  Denys Vlasenko  <dvlasenk@redhat.com>

        Truncate arg[0] to int in select decoding.
        This matches kernel's behavior.

        test/select.c: make comment more understandable.

2013-11-05  Dr. David Alan Gilbert  <dave@treblig.org>

        Fix select decoding with bogus (huge or negative) nfds.
        We used to allocate and fetch bit arrays using a sanitized
        length, but then iterate over them with "j < arg[0]" condition,
        where arg[0] is not sanitized. This segfaults if arg[0] is huge
        or negative. This change fixes this.

        Add test/select.c to capture the case.

2013-09-26  Ali Polatel  <alip@exherbo.org>

        Work around conflict between <sys/ptrace.h> and <linux/ptrace.h>
        Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args
        which collides with <linux/ptrace.h>.

        * configure.ac: Check for `struct ptrace_peeksiginfo_args' in
        <sys/ptrace.h>.
        * process.c: Work around potential conflict between <sys/ptrace.h>
        and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args.
        * signal.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.

2013-09-11  Vineet Gupta  <Vineet.Gupta1@synopsys.com>

        Add support for ARC Cores from Synopsys.
        Take #2 on mainlining strace support for ARC (last one was 4.6 based back
        in March 2011), see
        http://sourceforge.net/p/strace/mailman/message/27210168/

        The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls),
        hence very similar to metag port.

        test/* all seem to work well.

        * linux/arc/ioctlent.h.in: New file.
        * linux/arc/syscallent.h: Likewise.
        * Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and
        linux/arc/syscallent.h.
        * configure.ac: Add ARC to the list of supported architectures.
        * defs.h: Add ARC support.
        * process.c (struct_user_offsets): Likewise.
        * signal.c (sys_sigreturn): Likewise.
        * syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args,
        get_syscall_result, get_error): Likewise.
        * util.c (change_syscall): Likewise.

        Acked-by: Mike Frysinger <vapier@gentoo.org>

2013-09-11  William Manley  <william.manley@youview.com>

        Add support for decoding sync_file_range.
        * file.c (sync_file_range_flags): New xlat structure.
        (sys_sync_file_range, sys_sync_file_range2): New functions.
        * linux/syscall.h (sys_sync_file_range, sys_sync_file_range2): New
        prototypes.
        * linux/dummy.h (sys_sync_file_range, sys_sync_file_range2): Remove.
        * linux/mips/syscallent-o32.h: Set the number of sync_file_range
        arguments to 7.

2013-09-11  Mike Frysinger  <vapier@gentoo.org>

        fanotify_mark: fix number of args for 32bit arches.
        The fanotify_mark func takes a 64bit mask, so 32bit arches have to split
        it up into two fields.  When the syscall was added, it was listed as only
        having 5 fields total (since that's correct for 64bit systems).

        * linux/arm/syscallent.h: Set the number of fanotify_mark arguments to 6.
        * linux/bfin/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/metag/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Likewise.

        Acked-by: Chris Metcalf <cmetcalf@tilera.com> [for tile]

2013-09-11  Dmitry V. Levin  <ldv@altlinux.org>

        x86, x86_64: fix compilation warnings.
        Fix "dereferencing type-punned pointer will break strict-aliasing rules"
        warnings introduced by commit v4.8-52-gb51f364.

        * signal.c (sys_sigreturn): Avoid dereferencing type-punned pointers.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove rt parameter from [s]printsigmask()
        In almost all cases, the parameter was 1 ("decode RT sigs too").
        This change hardwires it to be 1.

        The cases where it was 0 are, and why the change to "decode RT sigs too"
        is fine:

        IA64: 64-bit arch, all 64 signals fit in one word in any case.
        S390[x]: sc.oldmask is a sigset_t on kernel side,
                (sigset_t *)&sc.oldmask[0] does contain all 64 signals.
        TILE: uc.uc_sigmask is a sigset_t on kernel side,
                memcpy(&sigm, &uc.uc_sigmask, NSIG / 8) copies all 64 signals.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Convert some uses of long_to_sigmask+printsigmask to sprintsigmask_long.
        This allows to drop long_to_sigmask function,
        and a whole bunch of sigset_t variables.

        Simplify some sigmask manipulations.

        Add compat support for sys_pselect6.

        I386: fix signedness mismatch warning.
        &i386_regs.esp is a pointer to long, not unsigned long.
        It needs a cast.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix sigset printing via print_sigset().
        Replace print_sigset() with print_sigset_addr_len(),
        which takes not only addr, but also len parameter.
        This allows us to drop "do we need to print RT signals?" parameter,
        and this fixes RT signals printing in many syscalls.

        sys_epoll_pwait: print RT signals too, print sigmask size argument.

        sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize),
        no change in functionality.

        sys_sigpending: use print_sigset_addr_len(current_wordsize)
        instead of open-coding it.

        sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it.
        sys_rt_sigpending: ditto.
        sys_rt_sigsuspend: ditto.
        sys_rt_sigtimedwait: ditto.

        do_signalfd: print_sigset -> print_sigset_addr_len. This fixes
        RT signals printing (wasn't showing them before).

        sys_ppoll: ditto.

        copy_sigset_len() is folded into its only user, print_sigset_addr_len(),
        and copy_sigset() is gone.

        While at it, checked kernel sources and noted where kernel enforces
        sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)),
        and where it allows word-sized sigset_size ([rt_]sigpending).

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

        sys_rt_sigaction: fix sigset copying.
        In practice, we always copy as many bytes as syscall param says
        (8, or 16 on mips). However, malicious program can call sigaction
        with wrong sigset size. Such syscall will result in EINVAL,
        but we (strace) end up copying 128 bytes (sizeof(sigset_t)),
        which copyes some garbage from stack after struct sigaction.

        Now we always copy NSIG / 8 bytes (which is 8 bytes, or 16 on mips).

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

        ARM: remove wrong NSIG = 32 define.
        ARM in fact has 64 signals (1..64), and NSIG should be 65
        (as usual, rememebr that NSIG_libc == NSIG_kernel+1).

        I carefully reviewed all usages of NSIG. In syscall.c,
        the only usage is:
                for (i = 0; i <= NSIG; i++)
                        if (strcasecmp(s, signame(i) + 3) == 0)...
        which is safe even if NSIG is way too big - signame(i)
        returns a well-formed string for any i.

        In signal.c, memcpy(&sigset, &sc.sc_mask, NSIG / 8) is used by
        IA64 and TILE code, so ARM change can't affect it. And final
        usage is:
         struct new_sigaction::unsigned long sa_mask[NSIG / sizeof(long)];
        It will grow on ARM (and become correct in the process).
        Its only use is
         memcpy(&sigset, &sa.sa_mask, NSIG / 8);
         printsigmask(&sigset, 1);
        which used to copy garbage in high bits, now it will copy actual data.

2013-07-17  Denys Vlasenko  <dvlasenk@redhat.com>

        ARM: fix sigreturn decoding.
        Decoding of test/sigreturn testcase:
        Was:
        sigreturn() (mask [QUIT TRAP ABRT BUS SEGV USR2 PIPE STKFLT STOP XCPU VTALRM PROF WINCH IO PWR RTMIN]) = 0
        Now:
        sigreturn() (mask [CHLD RT_1 RT_3 RT_31 RT_32]) = 0

2013-07-16  Denys Vlasenko  <dvlasenk@redhat.com>

        Group USE_CUSTOM_PRINTF define with other tweakables.
        No code changes.

2013-07-16  Denys Vlasenko  <dvlasenk@redhat.com>

        Improve sigreturn decoding on x86 to show RT signal bits too.
        This includes decoding of 32-bit sigreturn by 64-bit strace,
        which previously wasn't done.

        Added a test for it.

2013-07-12  Anton Blanchard  <anton@samba.org>

        powerpc: enhance 32/64bit detection.
        We were using uname to determine if userspace was 32 or 64bit.
        This fails when we have a 64bit kernel and a 32bit userspace.

        * configure.ac (powerpc*): Similar to x86, use a runtime test
        to determine if we are 32 or 64bit.

2013-07-12  Anton Blanchard  <anton@samba.org>

        powerpc: fix some compiler warnings.
        Fix a number of differing signedness warnings when building on
        powerpc.

        powerpc: fix iflag build issue (static -> extern)

2013-07-10  Denys Vlasenko  <dvlasenk@redhat.com>

        PTRACE_SEIZE can set ptrace options immediately, use this feature.
        This eliminates some rare bugs, such as post-execve SIGTRAP
        generation when we attach to a process, and it manages to finish
        execve'ing before we set TRACEEXEC option to suppress that.

2013-07-08  Denys Vlasenko  <dvlasenk@redhat.com>

        If -o|logger is in use, exit trace loop if nprocs == 0.

        Exit trace loop if got ECHILD, not if nprocs == 0.
        Comment gives a testcase which wasn't handled correctly
        by the old code.

2013-07-07  Denys Vlasenko  <dvlasenk@redhat.com>

        s390[x]: get rid of syscall_mode, delete code which never triggers.
        Before this change, the logic was as follows:
        syscall entry:
          get_scno:
            syscall_mode = GPR2
            scno = syscall_mode unless syscall_mode == -ENOSYS
            (if -ENOSYS, scn is retrieved by decoding current insn)
          fixup:
            gpr2 = GPR2
            syscall_mode = scno unless syscall_mode == -ENOSYS
            if (gpr2 != syscall_mode) stray_entry
        syscall exit:
          get_res:
            gpr2 = GRP2
          fixup:
            syscall_mode = scno unless syscall_mode == -ENOSYS
            if (WAITEXECVE && gpr2 in (-ENOSYS, scno)) gpr2 = 0;
          get_error:
            gpr2 is retval

        Entry fixup's if() can never trigger:
        regardless whether GPR2 is -ENOSYS or not, syscall_mode is always
        equal to GRP2 value there. So it can be removed.

        On sysexit path, syscall mode is never used.

        Therefore, syscall_mode variable is deleted. grp2 is read from
        GPR2 register in get_scno, redundant read in entry fixup is removed.
        As a result, entry fixup's s390 code block vanishes completely.

        gpr2 variable is renamed s390_gpr2 to match the convention used
        by other arches.

2013-07-04  Denys Vlasenko  <dvlasenk@redhat.com>

        ARM: add STRACE_KNOWS_ONLY_EABI define which can be used to omit OABI support

        Add paranoia check before passing a long to pid2tcb(int pid)

2013-07-02  Denys Vlasenko  <dvlasenk@redhat.com>

        In debug output, show waitpid status with 6 hex digits, not 4.
        This shows event byte values better (without variable offset):

         [wait(0x01057f) = 29491] WIFSTOPPED,sig=SIGTRAP,EVENT_FORK (1)
         [wait(0x80057f) = 29492] WIFSTOPPED,sig=SIGTRAP,EVENT_STOP (128)
                 ^^

2013-07-02  Denys Vlasenko  <dvlasenk@redhat.com>

        Replace suspicious popen_pid assignment with an obviously correct one.
        popen_pid = vfork() does work correctly, but for a subtle reason
        that wrong assignment of 0 happens in the child _first_,
        and _then_ correct value overwrites it in the parent.

        (And in a hyphothetical system where vfork = fork,
        popen_pid wouldn't be shared, so it will also be ok.)

        However, it's not necessary to be difficult.
        This change makes it so that assignment is done only in parent.

2013-07-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Convert trace() from returning int to returning void.
        The cleanup sequence in error cases, and on normal code path
        was nearly the same, no point in duplicating it.

        Remove ia64-specific printing of current address on signal delivery.
        The address is printed anyway by printleader() if -i is active.

        Rename ia32 to ia64_ia32mode, and make it bool, not long.
        Grepping for just ia32 was turning up many false positives.

2013-06-30  Denys Vlasenko  <dvlasenk@redhat.com>

        Fold is_restart_error() into its sole user.

2013-06-29  Denys Vlasenko  <dvlasenk@redhat.com>

        Update qemu_multiarch_testing/README.

2013-06-28  Denys Vlasenko  <dvlasenk@redhat.com>

        sys_clone: add a comment about CLONE_PTRACE and CLONE_UNTRACED.
        No code changes.

        POWERPC: get rid of "static long ppc_result"

        POWERPC: read ppc_regs.nip if -i.

        POWERPC: if GETREGS fails with EIO, don't try it again.

        Get rid of powerpc_getreg(), it's a copy of upeek()

        Change upeek() to take pid, not full tcp.
        This will be used by next change.

2013-06-26  Anton Blanchard  <anton@samba.org>

        powerpc: Provide a fallback for old kernels without PTRACE_GETREGS.
        PTRACE_GETREGS was added to the ppc kernel in 2.6.23. In order to
        provide backward compatibility for very old kernels, add a manual
        fallback.

        * syscall.c (powerpc_getreg, powerpc_getregs_old): New functions.
        (get_regs): Call powerpc_getregs_old if PTRACE_GETREGS is not supported.

2013-06-26  Anton Blanchard  <anton@samba.org>

        powerpc: Use PTRACE_GETREGS to fetch all registers.
        * defs.h: declare ppc_regs and get_regs_error.
        * signal.c (sys_sigreturn): Use ppc_regs instead of upeek.
        * syscall.c: define ppc_regs.
        (printcall): Use ppc_regs instead of upeek.
        (get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call.
        (get_syscall_result): Likewise.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

        Another manpage tweak.

        Manpage update.

        Update build_static_example.sh.
        Now it also contains a tested example of i686 build on 64-bit host.

        In -f mode, do not assume that new pid is stopped - handle exits too.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

        Set strace_child only in the right branch.
        "strace_child = pid" assignment was racing in NOMMU case
        because of vfork (no way to know which process would win).

        After this change, strace_child is set to nonzero only
        in one process after [v]fork.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

        Get rid of TCB_INUSE and TCB_STRACE_CHILD.
        We can use tcb::pid == 0 as an indicator of free tcb,
        and we already have strace_child variable which holds
        pid of our child, if any.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix debug output of wait4 result (was reusing buf[] on unknown events)

        Show PTRACE_EVENT_STOP correctly in debug output.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Panic a bit less when we see an unknown pid.
        I stumbeld over this case when I used "exec stace ...".

        * strace.c (trace): Do not exit if we see an unknown pid in wait4.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        detach(): Reorganize code. Logic is the same.
        * strace.c (detach): Use goto's instead of excessive nesting.
        Drop sigstop_expected and interrupt_done variables.

        Eat pending SIGSTOP _before_ PTRACE_DETACH in detach()
        * strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set,
        di not PTRACE_DETACH - wait for SIGSTOP first.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

        detach(): warn if we see ECHILD from waitpid.
        * strace.c (detach): Warn if we see ECHILD from waitpid.
        Explain in comments that we don't normally expect !WIFSTOPPED
        either, and also that PTRACE_CONT failure isn't expected
        (the "break" there is a "I'm confused, bailing out" code style)..

        Improve error messages in detach()
        * strace.c (detach): Change return type from int to void.
        Improve error meesages: show PID, tell exactly which operation fails.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove workarounds for ancient kernels lacking __WALL.
        __WALL is available and working at least since 2.4 kernels: 10 years ago.

        * strace (detach): Remove workarounds for ancient kernels lacking __WALL.
        Add missing EINTR check.
        (trace): Remove workarounds for ancient kernels lacking __WALL.
        Remove redundant double error printout.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

        USE_SEIZE: fix detaching from stopped processes.
        V3: split SEIZE/!SEIZE code paths to reduce confusion.
        Extensively comment every possible case.
        Verified that all tests/detach* tests work in both SEIZE and !SEIZE
        cases.

        * strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee
        using PTRACE_INTERRUPT instead of sending it a SIGSTOP.
        In a subsequent waitpid loop, correctly wait and suppress SIGSTOP
        on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace
        stop and detach without suppressing signals.

2013-06-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: disable /proc based checks when /proc is not mounted.
        * tests/detach-running: Disable /proc based checks when
        /proc/self/status is not available.
        * tests/detach-sleeping: Likewise.
        * tests/detach-stopped: Likewise.

2013-06-19  Denys Vlasenko  <dvlasenk@redhat.com>

        tests/detach-{running,sleeping,stopped}: check post-detach state.
        Check that traced process still exists and is in a right state
        after strace detached from it.

2013-06-19  Dmitry V. Levin  <ldv@altlinux.org>

        tests: ensure that strace can detach from running processes.
        * tests/detach-running: New test.
        * tests/Makefile.am (TESTS): Add it.

        tests: ensure that strace does not leave sleeping processes stopped.
        * tests/detach-sleeping: Do not send SIGCONT to the sleeping process.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: fix parallel-tests support in detach-* tests.
        * tests/detach-sleeping: Use $LOG file for set_ptracer_any output.
        * tests/detach-stopped: Likewise.

        tests: parametrize "sleep 1"
        * tests/init.sh (SLEEP_A_BIT): New variable.
        * tests/detach-sleeping: Use it.
        * tests/detach-stopped: Likewise.

        tests: ensure that strace can detach from sleeping and stopped processes
        * tests/set_ptracer_any.c: New file.
        * tests/detach-sleeping: New test.
        * tests/detach-stopped: Likewise.
        * tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any.
        (TESTS): Add detach-sleeping and detach-stopped.
        * tests/.gitignore: Add set_ptracer_any.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enhance timeout checks.
        Run each test using a wrapper that does all necessary timeout checks.

        * tests/run.sh: New file.
        * tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it.
        * tests/init.sh (check_strace, check_timeout): Remove.
        * tests/detach-stopped: Update callers.
        * tests/net: Likewise.
        * tests/ptrace_setoptions: Likewise.
        * tests/qual_syscall: Likewise.
        * tests/stat: Likewise.
        * tests/strace-f: Likewise.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

        tests: enable parallel-tests support.
        * configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests.

        tests: prepare for parallel-tests support.
        * tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS.
        * tests/init.sh (LOG): New variable.
        * tests/detach-stopped: Use it.
        * tests/net: Likewise.
        * tests/qual_syscall: Likewise.
        * tests/stat: Likewise.
        * tests/strace-f: Likewise.

2013-06-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Cleanups. No logic changes.
        * defs.h: Define new ptrace constants unconditionally.
        * strace.c (detach): Fix comment.
        (trace): Remove now unnecessary "if USE_SEIZE".

2013-06-05  Dmitry V. Levin  <ldv@altlinux.org>

        maint: post-release administrivia.
        * NEWS: Add header line for next release.

2013-06-03  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlent: add UAPI support.
        * Makefile.am (IOCTLSORT_INCLUDEDIR): Define.
        (ioctlsort): Use it.
        * linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree.
        Strip "uapi/" prefix from output path names.
        * linux/ioctlent.h.in: Regenerate from v3.9 headers.
        * NEWS: Mention it.

        Prepare for 4.8 release.
        * NEWS: Update for 4.8 release.
        * debian/changelog: 4.8-1.
        * strace.spec: 4.8-1.

2013-06-02  Dmitry V. Levin  <ldv@altlinux.org>

        Fix "make dist" on recently added architectures.
        * Makefile.am (EXTRA_DIST): Add linux/aarch64/errnoent1.h,
        linux/aarch64/ioctlent.h.in, linux/aarch64/ioctlent1.h,
        linux/aarch64/signalent1.h, linux/aarch64/syscallent.h,
        linux/aarch64/syscallent1.h, linux/metag/ioctlent.h.in,
        linux/metag/syscallent.h, linux/or1k/ioctlent.h.in,
        linux/or1k/syscallent.h, linux/tile/errnoent1.h, linux/tile/ioctlent1.h,
        linux/tile/signalent1.h, linux/tile/syscallent1.h, linux/ubi-user.h,
        linux/xtensa/ioctlent.h.in, and linux/xtensa/syscallent.h.

        Fix "make dist" regression introduced by commit v4.7-184-gd648f29.
        * Makefile.am (EXTRA_DIST): Add linux/ubi-user.h.

2013-05-28  Dmitry V. Levin  <ldv@altlinux.org>

        Do not suppress signal delivery messages with -qq.
        Current implementation of -qq does not allow suppressing exit status
        messages without suppressing signal delivery messages, which is not
        good.  There is a traditional "-e signal=none" syntax that can be used
        to suppress all signal delivery messages.
        This partially reverts commit v4.7-222-g01997cf.

        * strace.c (trace): Do not suppress signal delivery messages with -qq.
        * strace.1: Update documentation about -qq option.

2013-05-23  Chris Metcalf  <cmetcalf@tilera.com>

        tile: use siginfo_t, not struct siginfo.
        As of glibc 2.16, "struct siginfo" is no longer supported,
        and "siginfo_t" must be used instead.

        tile: remove MAP_CACHE_xxx support in mem.c.
        These flags support functionality in mmap() that has not been
        pushed back to the community, and which may or may not eventually
        end up being the final community model.  In the interim, having
        these flags unconditionally present for "#ifdef TILE" just means
        that the TILE build breaks if using the community versions of
        the kernel and glibc, so just revert the code until such time
        as it may end up in the community.

2013-05-17  Mike Frysinger  <vapier@gentoo.org>

        Rename COPYRIGHT to COPYING.
        The standard name people have adopted is "COPYING" rather than
        "COPYRIGHT".  Use that as a lot of license scanning tools look for it.

        * COPYRIGHT: Rename to ...
        * COPYING: ... this.
        * Makefile.am (EXTRA_DIST): Rename COPYRIGHT to COPYING.
        * README: Likewise.
        * strace.spec (%files): Likewise.

2013-05-17  Dmitry V. Levin  <ldv@altlinux.org>

        Sync strace.spec and debian/ with packages.
        * debian/changelog: Sync with 4.7-1.
        * debian/strace.docs: Likewise.
        * strace.spec: Sync with 4.7-3.

        Update PTRACE_O_* constants.
        * process.c (ptrace_setoptions_flags): Sync with Linux 3.9.

        Update AF_*, PF_*, MSG_*, and TCP_* constants.
        * net.c (domains, addrfams, protocols, socktcpoptions): Sync with
        Linux 3.9.

2013-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        NOMMU: do not hide startup syscalls unless in -D mode.
        On NOMMU systems in "strace PROG" case, we have no way to attach to
        the tracee before it calls execve unless in -D mode.  That is, the
        first execve call is very likely to be missed, and setting
        hide_log_until_execve just results to empty log.

        * strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve
        unless in -D mode.

2013-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        Make -D mode work when the Yama LSM is enabled.
        * strace.c [HAVE_PRCTL]: Include sys/prctl.h.
        (startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]:
        In -D mode, allow tracing the process that is going to become the
        tracee.

        Update PR_* constants.
        * process.c (prctl_options): Add PR_SET_PTRACER.

2013-05-14  Denys Vlasenko  <dvlasenk@redhat.com>

        Hide startup syscalls.
        Tested with "./strace [-D] [-q] [-bexecve] env true",
        all cases seem to work.

        * defs.h: Declare new variable: bool hide_log_until_execve.
        * strace.c: Define hide_log_until_execve.
        Rename skip_startup_execve to skip_one_b_execve.
        (startup_child): Do not set skip_one_b_execve = 1 here.
        (init): If "strace PROG" case (as opposed to "strace -pPID"),
        set skip_one_b_execve and hide_log_until_execve to 1.
        (trace): Don't print signal messages if hide_log_until_execve == 1.
        * syscall.c (trace_syscall_entering):
        Skip syscall printing if hide_log_until_execve == 1.
        Reset hide_log_until_execve if we enter execve syscall.
        (trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1.

2013-05-13  Daniel P. Berrange  <berrange@redhat.com>

        Allow -q to be repeated for very quiet output.
        Even with the -q flag specified, tracing output is still mixed
        with messages about signals and process exit status, which is
        often irrelevant.  Allow the -q option to be repeated to force
        the suppression of signals / exit status info too.

        * defs.h: Change 'qflag' from 'bool' to 'unsigned int'.
        * strace.1: Document ability to repeat '-q' option.
        * strace.c: Allow '-q' to be repeated to quieten process
        exit status and signal messages.

2013-05-11  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: fix syscall table.
        * linux/mips/syscallent-o32.h: Add entries for getpmsg, putpmsg,
        get_mempolicy, set_mempolicy and vserver.  Fix names for umount,
        umount2, mmap, mmap2, pread64, pwrite64, sigaltstack and fstatat64
        syscalls.

2013-05-10  Dmitry V. Levin  <ldv@altlinux.org>

        mips n64: fix syscall table.
        * linux/mips/syscallent-n64.h: Add entries for get_mempolicy,
        set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
        Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack
        and umount2 syscalls.

        mips n32: fix syscall table.
        * linux/mips/syscallent-n32.h: Add entries for mbind, get_mempolicy,
        set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
        Fix handlers for truncate, ftruncate and getdents64 syscalls.
        Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack,
        umount2, and getdents64 syscalls.

2013-05-08  Dmitry V. Levin  <ldv@altlinux.org>

        sync_file_range: fix number of syscall arguments.
        * linux/avr32/syscallent.h: Set the number of sync_file_range arguments
        to 6.
        * 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-o32.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Change sync_file_range to
        sync_file_range2, set the number of sync_file_range2 arguments to 6.
        * linux/tile/syscallent.h: Change sync_file_range to sync_file_range2,
        set the number of sync_file_range2 arguments to 4.
        * linux/tile/syscallent1.h: Change sync_file_range to sync_file_range2.
        update handler.
        * linux/xtensa/syscallent.h: Likewise.

        Add syscall entries for new linux syscalls.
        * linux/dummy.h: Add printargs aliases for sys_finit_module, sys_kcmp
        and sys_sync_file_range2.
        * linux/alpha/syscallent.h: Add entries for process_vm_readv
        and process_vm_writev.
        * linux/bfin/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Add entries for sync_file_range2, kcmp
        and finit_module.
        * linux/hppa/syscallent.h: Add entries for process_vm_readv,
        process_vm_writev, kcmp and finit_module.
        * linux/tile/syscallent.h: Likewise.
        * linux/tile/syscallent1.h: Likewise.
        * linux/ia64/syscallent.h: Add entry for finit_module.
        * linux/i386/syscallent.h: Add entries for kcmp and finit_module.
        * linux/m68k/syscallent.h: Likewise.
        * linux/metag/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/or1k/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Add entries for s390_runtime_instr, kcmp
        and finit_module.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Add entries for kern_features, kcmp
        and finit_module.

        tests/net: fix portability issues.
        * tests/net-accept-connect.c: Fix address length passed to bind()
        and connect().
        * tests/net: Update regexps.

        tests: add a test for basic network syscalls.
        * tests/.gitignore: Add net-accept-connect, *.o and *.log.*.
        * tests/Makefile.am (AM_CFLAGS): New variable.
        (check_PROGRAMS): Add net-accept-connect.
        (TESTS): Add net.
        * tests/net-accept-connect.c: New file.
        * tests/net: New file.

        tests: do not skip tests when timeout utility is not available.
        * tests/init.sh (check_timeout): New function.
        * tests/ptrace_setoptions: Use it.
        * tests/qual_syscall: Likewise.
        * tests/stat: Likewise.
        * tests/strace-f: Likewise.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        Move subcall decoding configuration out of the common code.
        * Makefile.am (EXTRA_DIST): Add linux/subcall.h.
        * linux/syscall.h (SYS_socket_subcall): Remove.
        (SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ...
        * linux/subcall.h: ... new file.
        * linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/powerpc/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.

        Suggested by Mike Frysinger and Chris Metcalf.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: remove some unused declarations and macros.
        * linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys,
        sys_shmsys): Remove declarations.
        [SPARC || SPARC64] (SYS_semsys_subcall, SYS_semsys_nsubcalls,
        SYS_msgsys_subcall, SYS_msgsys_nsubcalls, SYS_shmsys_subcall,
        SYS_shmsys_nsubcalls): Remove macros.

2013-05-07  Mike Frysinger  <vapier@gentoo.org>

        mips: fix build regression.
        The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled
        the mips headers around causing it to check the ABI defines before it
        included the header which set those up.  Now all mips builds fail with:
                In file included from count.c:36:0:
                defs.h:48:4: error: #error Unsupported _MIPS_SIM

        * defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check.

2013-05-07  James Hogan  <james.hogan@imgtec.com>

        metag: rename llseek syscall to _llseek.
        The raw llseek syscall is called _llseek from userland, so fix the
        naming of it for metag to allow the stat test to pass.

        * linux/metag/syscallent.h: Rename llseek syscall to _llseek.

2013-05-07  James Hogan  <james.hogan@imgtec.com>

        metag: disable socket and ipc subcall support.
        The metag architecture also uses dedicated syscalls and doesn't need to
        multiplex ipc and socket subcalls.

        * linux/syscall.h [METAG]: Do not define SYS_socket_subcall and
        SYS_ipc_subcall.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        pread, pwrite: fix number of syscall arguments.
        The number of pread and pwrite arguments depends on architecture and
        personality.  For 64bit and ilp32 it equals to 4, for unaligned
        32bit it equals to 5, and for aligned 32bit it equals to 6.

        * linux/aarch64/syscallent1.h: Change the number of pread and pwrite
        arguments to 4.
        * linux/alpha/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Change the number of pread and pwrite
        arguments to 5.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        preadv, pwritev: fix number of syscall arguments.
        The number of preadv and pwritev arguments depends on architecture and
        personality.  For 64bit and ilp32 it equals to 4, for unaligned 32bit
        it equals to 5, and for aligned 32bit it equals to 6.

        * linux/aarch64/syscallent1.h: Change the number of preadv and pwritev
        arguments to 4.
        * linux/alpha/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Change the number of preadv and pwritev
        arguments to 6.
        * linux/sh/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Likewise.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        ftruncate64, truncate64: fix number of syscall arguments.
        The number of ftruncate64/truncate64 arguments depends on architecture
        and personality.  For 64bit and ilp32 it equals to 2, for unaligned
        32bit it equals to 3, and for aligned 32bit it equals to 4.

        * linux/or1k/syscallent.h: Change the number of ftruncate64 and
        truncate64 arguments to 3.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Change ftruncate64 and truncate64 handlers.
        * linux/sparc/syscallent.h: Change ftruncate64 handler, change the
        number of its arguments to 3.
        * linux/xtensa/syscallent.h: Change the number of ftruncate64 and
        truncate64 arguments to 4.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        fallocate: fix number of syscall arguments.
        The number of fallocate arguments depends on architecture and
        personality.  For 64bit and ilp32 it equals to 4,
        for 32bit it equals to 6.

        * linux/aarch64/syscallent1.h: Change the number of fallocate arguments
        to 4.
        * linux/alpha/syscallent.h: Likewise.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Set fallocate handler and flags.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        fadvise64, fadvise64_64: fix handlers and number of syscall arguments.
        The number of fadvise64 arguments depends on architecture and
        personality.  For 64bit and ilp32 it equals to 4, for unaligned
        32bit it equals to 5, and for aligned 32bit it equals to 6.

        The number of fadvise64_64 arguments is 4 for 64bit and ilp32, for
        unaligned 32bit and most of aligned 32bit it equals to 6, and for
        mips o32 it equals to 7.

        * linux/alpha/syscallent.h: Set fadvise64 handler.
        * linux/s390/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Set fadvise64_64 handler, change the number
        of syscall arguments to 6.
        * linux/ia64/syscallent.h: Change the number of fadvise64 arguments
        to 4.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/tile/syscallent1.h: Change the number of fadvise64 arguments
        to 5.
        * linux/mips/syscallent-o32.h: Change the number of fadvise64_64
        arguments to 7.
        * linux/s390x/syscallent.h: Change fadvise64_64 handler.  Set fadvise64
        handler.  Change numbers of fadvise64 and fadvise64_64 arguments to 4.
        * linux/sh64/syscallent.h: Change fadvise64_64 handler.
        Change numbers of fadvise64 and fadvise64_64 arguments to 4.
        * linux/sparc/syscallent.h: Set fadvise64 and fadvise64_64 handlers,
        change numbers of their arguments to 5 and 6.
        * linux/x86_64/syscallent.h: Change fadvise64 handler.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        mips o32: raise the max number of syscall arguments to 7.
        On mips o32, fadvise64_64 takes 7 arguments.

        * defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        mips: split syscallent.h.
        linux/mips/syscallent.h consisted of several parts that had little in
        common.  Split them into separate files to ease maintenance.

        * linux/mips/syscallent-compat.h: New file.
        * linux/mips/syscallent-n32.h: Likewise.
        * linux/mips/syscallent-n64.h: Likewise.
        * linux/mips/syscallent-o32.h: Likewise.
        * linux/mips/syscallent.h: Include them.
        * Makefile.am (EXTRA_DIST): Add them.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

        readahead: fix number of syscall arguments.
        The number of readahead arguments depends on architecture and
        personality.  For 64bit and ilp32 it equals to 3, for unaligned 32bit it
        equals to 4, and for aligned 32bit it equals to 5.

        * linux/aarch64/syscallent1.h: Set number of readahead arguments to 3.
        * linux/alpha/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/or1k/syscallent.h: Set number of readahead arguments to 4.
        * linux/sh/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.
        * linux/xtensa/syscallent.h: Set number of readahead arguments to 5.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

        linux/syscall.h: make subcall decoding configuration more readable.
        * linux/syscall.h: Inverse and sort the subcall ifdef,
        add a comment why subcall decoding support is not enabled
        on some architectures.

2013-05-06  Chris Zankel  <chris@zankel.net>

        xtensa: disable socket and ipc subcall support.
        The Xtensa architecture also uses dedicated syscalls and doesn't
        need to multiplex ipc and socket subcalls.

        * linux/syscall.h [XTENSA]: Do not define SYS_socket_subcall and
        SYS_ipc_subcall.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

        Fix syscall flags.
        * linux/aarch64/syscallent1.h: Fix syscall flags for send.
        * linux/alpha/syscallent.h: Fix syscall flags for fchdir, getcwd,
        oldumount, sigaltstack, umount, uselib, and utimes.
        * linux/arm/syscallent.h: Fix syscall flags for close, creat, dup, dup2,
        fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, flock,
        fsetxattr, fsync, getdents, getdents64, ioctl, oldfstat, oldselect,
        open, pipe, poll, pread, pwrite, read, readahead, readdir, readv,
        select, socketcall, write, and writev.
        * linux/avr32/syscallent.h: Fix syscall flags for inotify_init and
        unshare.
        * linux/bfin/syscallent.h: Fix syscall flags for pread64 and pwrite64.
        * linux/hppa/syscallent.h: Fix syscall flags for fchdir, flistxattr,
        getcwd, pause, signal, umount2, uselib, utime, and vfork.
        * linux/ia64/syscallent.h: Fix syscall flags for creat, fchdir,
        lstat, umount, uselib, and utimes.  Fix syscall handlers for
        fgetxattr, flistxattr, fremovexattr, and fsetxattr.
        * linux/m68k/syscallent.h: Fix syscall flags for close, creat, dup,
        dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync,
        flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, open, pipe,
        poll, pread64, pwrite64, read, readahead, readdir, readv, select,
        socketcall, write, and writev.
        * linux/metag/syscallent.h: Fix syscall flags for fanotify_init,
        prlimit64, process_vm_readv, process_vm_writev, and quotactl.
        * linux/microblaze/syscallent.h: Fix syscall flags for close, creat,
        dup, dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64,
        fdatasync, flock, fsetxattr, getdents, ioctl, oldfstat, oldselect,
        open, perf_event_open, pipe, poll, pread64, pwrite64, read, readahead,
        readdir, readv, select, socketcall, write, and writev.
        * linux/mips/syscallent.h: Fix syscall flags for close, creat, dup,
        dup2, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, flock,
        fsetxattr, getdents, getdents64, getxattr, ioctl, lgetxattr,
        listxattr, llistxattr, lremovexattr, lsetxattr, oldfstat, open, pipe,
        pivot_root, poll, pread, pwrite, read, readahead, readv, removexattr,
        select, setxattr, socketcall, statfs, write, and writev.
        * linux/or1k/syscallent.h: Fix syscall flags for fchdir and quotactl.
        * linux/powerpc/syscallent.h: Fix syscall flags for fchdir.
        * linux/sh/syscallent.h: Fix syscall flags for getcwd.
        * linux/sparc/syscallent.h: Fix syscall flags for getresgid, getresuid,
        setresgid, setresgid32, and setresuid.
        * linux/xtensa/syscallent.h: Fix syscall flags for close, creat, dup,
        dup2, fallocate, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync,
        flock, fsetxattr, fstatfs, fstatfs64, fsync, getdents, getdents64,
        ioctl, open, pipe, pivot_root, poll, pread64, pwrite64, read,
        readahead, readv, rt_sigreturn, select, setfsgid, setfsuid, setuid,
        swapoff, times, utime, write, and writev.

        tests/stat: enhance regexps.
        * tests/stat: Enhance regexps that check tracing of stat/stat64 and
        fstatat/fstatat64 syscalls.

2013-05-06  Chris Metcalf  <cmetcalf@tilera.com>

        tests/stat: support fstatat syscall for stat()
        Newer Linux architectures don't support the stat/stat64 syscalls.
        Instead they use fstatat() with AT_FDCWD and an extra flags argument.
        Support seeing this output in the 'strace -efile' test.

        As part of this change, use "grep -E -x" syntax consistently for
        all stat tests, since the number of \(foo\)\? expressions was becoming
        pretty unwieldy.

        * tests/stat: Update stat/stat64 check regexp to handle architectures
        that use fstatat instead.  Use "grep -E -x" syntax consistently.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

        ARM OABI: fix 64-bit arguments decoding.
        ARM OABI and ARM EABI have different function parameters passing rules,
        see commit v4.6-11-g7a5b08f for details.

        * util.c (printllval): Do not align argument number in case of ARM OABI.
        * file.c (sys_fadvise64_64): Likewise.

2013-05-06  Mike Frysinger  <vapier@gentoo.org>

        printllval: fix 64bit unpacking on mips/o32 and xtensa.
        The mips/o32 ABI and xtensa arch also do 64bit aligning, so add it to the
        printllval list for this.

        Normally for sys_fadvise64_64 we'd handle the same list of arches, but
        mips/o32 ABI is funky and doesn't shift -- it has 7 args.  So just add
        xtensa to it.

        * file.c (sys_fadvise64_64): Add XTENSA to the shifted list.
        * util.c (printllval): Add LINUX_MIPSO32 and XTENSA to the shifted list.

2013-05-06  Chris Metcalf  <cmetcalf@tilera.com>

        tile: disable socket and ipc subcall support.
        The tile arch just has the dedicated syscalls, so disable
        the logic for parsing subcalls.

        * linux/syscall.h [TILE]: Do not define SYS_socket_subcall and
        SYS_ipc_subcall.

2013-05-06  Mike Frysinger  <vapier@gentoo.org>

        Blackfin: disable socketcall and ipc subcall support.
        The Blackfin arch does not have a socketcall or ipc subcall
        (it has dedicated syscalls broken out), so disable the logic for it.

        * linux/syscall.h [BFIN]: Do not define SYS_socket_subcall and
        SYS_ipc_subcall.

2013-05-05  Mike Frysinger  <vapier@gentoo.org>

        s390: fix # of args truncate64/ftruncate64 takes.
        * linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64.

2013-05-05  Mike Frysinger  <vapier@gentoo.org>

        mtd: clamp ubi name strings.
        Since the length fields with the ubi volnames are signed 16bit values,
        make sure we clamp that number to the size of the buffer we've allocated
        on the stack to prevent buffer overflows.

        * mtd.c (ubi_ioctl): Clamp length to string_quote to 0/UBI_MAX_VOLUME_NAME.
        Check the return of string_quote and tweak the output accordingly.

2013-05-04  Dmitry V. Levin  <ldv@altlinux.org>

        printxval: support more architectures.
        * configure.ac: Define SIZEOF_LONG_LONG.
        * util.c (printllval): Handle all architectures with sizeof(long) > 4
        and sizeof(long) == sizeof(long long).

2013-05-04  Mike Frysinger  <vapier@gentoo.org>

        Fix building for sparc64 targets.
        * util.c (printllval): Handle SPARC64 define.

        Fix building for mips n64 targets.
        * util.c (printllval): Handle LINUX_MIPSN64 define.

2013-05-03  Dmitry V. Levin  <ldv@altlinux.org>

        hppa: fix stat64 and fstat64 decoding.
        * file.c [HPPA]: Do not redefine stat64 to hpux_stat64.

        arm, aarch64, ppc: fix printllval-based decoders.
        * util.c (printllval) [ARM || POWERPC]: Align argument number.
        [AARCH64]: Align argument number in 32bit mode.
        * file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed
        printllval workaround.
        [AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

        Decode mtd/ubi ioctls.
        Been playing with UBI of late and it'd help if I could see what it was
        doing.  Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
        a pointer to a 64bit value, not a strict.

        * util.c (MAX, MIN): Move to ...
        * defs.h (MAX, MIN): ... here.
        (CLAMP): Define.
        (ubi_ioctl): New prototype.
        * ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
        * mtd.c: Include ubi user API header.
        (ubi_volume_types): New enum decode.
        (ubi_volume_props): Likewise.
        (ubi_ioctl): Define.
        * linux/ubi-user.h: Import from linux 3.8.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

        test: add mtd/ubi test helpers.
        I used these to develop the mtd/ubi ioctl decoders.

        * test/.gitignore: Add mtd/ubi.
        * test/Makefile: Declare all tests in a PROGS var.
        Declare build targets .PHONY.
        (all): Depend on $(PROGS) instead of hardcoded list.
        (clean): Remove $(PROGS) instead of hardcoded list.
        * test/mtd.c: New file.
        * test/ubi.c: Likewise.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

        test: include headers for used funcs.
        These funcs use things like wait/write/read/strcmp but sometimes
        don't include the right header for them.

        * test/Makefile: Add -Wall to CFLAGS.
        * test/clone.c: Include unistd.h.
        * test/fork.c: Include sys/wait.h.
        * test/sig.c: Include unistd.h.
        * test/sigkill_rain.c: Include sys/wait.h.
        * test/vfork.c: Include sys/wait.h.
        * test/wait_must_be_interruptible.c: Include string.h

2013-05-02  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1.
        * linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and
        sys_lstat64 before redefining them to printargs.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

        tests: stat: fix clean up of sample file.
        * tests/stat: Also rm the sample file at the end of the test.

        Ignore more files.
        * .gitignore: Add gdb related files.
        * tests/.gitignore: Ignore test logs.

2013-05-02  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix decoding of i386 truncate and ftruncate syscalls.
        * linux/x32/syscallent1.h: Remove sys_*truncate64 redirections.

        x32: fix printllval-based decoders of i386 syscalls.
        * util.c (printllval) [X32]: Handle i386 personality.

        tests: add basic test for ftruncate, lseek and stat family syscalls.
        * tests/stat: New test.
        * tests/Makefile.am (TESTS): Add stat.

2013-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        x32: fix build regressions introduced by commit v4.7-96-g8435d67.
        * desc.c (printflock) [X32]: Add special handling required for
        this architecture with sizeof(long) < sizeof(off_t).
        * file.c [X32] (struct stat64): Add __attribute__((packed)).
        [X32] (HAVE_STAT64): Define.
        (printstat) [X32]: Redirect to printstat64.
        (printstat64) [X32]: Use "struct stat" instead of "struct stat64".
        [X32] (realprintstat64): Rename to printstat64_x32.
        (sys_stat64, sys_fstat64) [X32]: Remove second definitions of these
        functions.  Call printstat64_x32 instead of printstat64
        * linux/x32/syscallent.h: Fix handlers for truncate and ftruncate.

        Alias sys_*lstat* syscall printing functions.
        * file.c (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
        * linux/dummy.h: Move !HAVE_STRUCT___OLD_KERNEL_STAT aliases forward.
        (sys_lstat): Alias to sys_stat.
        (sys_lstat64): Alias to sys_stat64.
        (sys_oldlstat): Alias to sys_oldstat.
        * linux/syscall.h (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
        * linux/x32/syscallent1.h (sys_lstat64): Remove.

        x86_64: decode __old_kernel_stat based syscalls.
        * linux/x86_64/syscallent1.h: Remove sys_old*stat redirections.

        x32: fix decoding of __old_kernel_stat based syscalls.
        * file.c [X32] (struct __old_kernel_stat): Define.
        * linux/x32/syscallent1.h: Remove sys_old*stat redirections.

2013-05-01  James Hogan  <james.hogan@imgtec.com>

        test/threaded_execve: fix on metag.
        The metag ABI has stacks growing upwards so clone expects the stack
        argument to point at the bottom of the stack instead of the top.

        * test/threaded_execve.c [__metag__]: Define clone2 differently
        to avoid a segfault at runtime.

2013-05-01  James Hogan  <james.hogan@imgtec.com>

        test/skodic: make a bit more portable.
        * test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses
        vary between architectures (as far as I can tell the use of MAP_FIXED is
        not relevant to the test).  Also don't assume the file desriptor returned
        by open call is 3 when passing it to mmap.

2013-05-01  Mike Frysinger  <vapier@gentoo.org>

        printllval: handle s390x.
        This is a 64bit arch w/no personalities, so fix printing.
        It can now trace a simple call like readahead:
        $ cat test.c
        main(){readahead(-1, (unsigned long long)1 << 50, 0);}
        $ gcc test.c
        $ ./strace -ereadahead ./a.out
        readahead(-1, 1125899906842624, 0)      = -1 EBADF (Bad file descriptor)

        * util.c (printllval): Handle S390X define.

2013-05-01  Mike Frysinger  <vapier@gentoo.org>

        Stop using old AM_CONFIG_HEADER macro.
        Building with automake-1.13 throws an error:
        configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete.
            You should use the 'AC_CONFIG_HEADERS' macro instead.

        * configure.ac (AM_CONFIG_HEADER): Rename to AC_CONFIG_HEADERS.

2013-04-30  Dmitry V. Levin  <ldv@altlinux.org>

        build: introduce git-version-gen.
        * .gitignore: Add .version.
        * Makefile.am (EXTRA_DIST, BUILT_SOURCES): Add $(srcdir)/.version.
        Add rules to check NEWS, generate $(srcdir)/.version and
        $(distdir)/.tarball-version files.
        Change ChangeLog and CREDITS generation rules to depend on
        $(srcdir)/.version instead of $(srcdir)/.git/refs/heads/*.
        * NEWS: Add dates to recent releases.
        * configure.ac (AC_INIT): Use git-version-gen.
        (AM_INIT_AUTOMAKE): Remove check-news.
        * git-version-gen: Import from gnulib.
        * make-dist: Check NEWS.

        Makefile.am: sort long lists to ease maintenance.
        * Makefile.am (strace_SOURCES, EXTRA_DIST): Sort, place one list element
        per line.

        build: fix "make dist" regression introduced by commit v4.7-105-g7270de5
        * Makefile.am (EXTRA_DIST): Remove linux/arm/syscallent1.h,
        linux/arm/signalent1.h, linux/arm/ioctlent1.h and linux/arm/errnoent1.h.

        build: fix "make dist" regression introduced by commit v4.7-29-g17e3860.
        * Makefile.am (EXTRA_DIST): Add linux/ioctlent-filter.awk.

2013-04-30  Mike Frysinger  <vapier@gentoo.org>

        Blackfin: tweak sram_alloc syscall decode.
        * system.c (sys_sram_alloc): The 2nd argument of sram_alloc syscall
        is a bit field, not a specific value, so decode it as such.

2013-03-31  Zev Weiss  <zev@bewilderbeest.net>

        Print io_submit() offsets in decimal.
        This makes output formatting more consistent with pread()/pwrite(),
        which print their offset parameters in decimal.

        * desc.c (sys_io_submit): Change offset output format from %llx to %lld.

2013-03-30  Andreas Schwab  <schwab@suse.de>

        Fix building outside source directory.
        The file linux/ioctlent.h is generated in the build directory, so
        "../ioctlent.h" won't find it.

        * linux/aarch64/ioctlent1.h: Remove "../" from include file name.
        * linux/powerpc/ioctlent1.h: Likewise.
        * linux/tile/ioctlent1.h: Likewise.
        * linux/x32/ioctlent1.h: Likewise.
        * linux/x86_64/ioctlent1.h: Likewise.
        * linux/x86_64/ioctlent2.h: Likewise.

2013-03-30  Andreas Schwab  <schwab@suse.de>

        AArch64: Fix printing of long long value.
        * util.c (printllval): Fix printing of long long values on
        AArch64.

2013-03-27  Dmitry V. Levin  <ldv@altlinux.org>

        Update PR_* constants.
        * process.c (prctl_options): Add more PR_* constants from linux/prctl.h.

2013-03-25  Chris Zankel  <chris@zankel.net>

        Add support for the XTENSA architecture.
        * configure.ac: Add XTENSA to the list of supported architectures.
        * defs.h: Add XTENSA support.
        * linux/xtensa/syscallent.h: New file.
        * linux/xtensa/ioctlent.h.in: Likewise.
        * process.c (struct_user_offsets): Add XTENSA support.
        * signal.c (sys_sigreturn): Likewise.
        * syscall.c (printcall, get_scno, get_syscall_args,
          get_syscall_result, get_error): Likewise.
        * util.c (change_syscall): Likewise.

2013-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Add example script which builds static (possibly cross-compiled) strace.

2013-03-21  Dmitry V. Levin  <ldv@altlinux.org>

        Use 64-bit versions of stat, readdir and setrlimit functions when available
        strace already has a mechanism to use fopen64 for output when the 64-bit
        version of fopen is available on 32-bit architectures.  Apply this
        mechanism for other three functions to make strace fully adopted for
        64-bit types.

        * strace.c (struct_stat, stat_file, struct_dirent, read_dir,
        struct_rlimit, set_rlimit): New macros.
        (startup_attach): Use read_dir.
        (startup_child): Use struct_stat and stat_file.
        (main): Use struct_rlimit and set_rlimit.

2013-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        Do not use struct dirent in readdir decoding.
        struct dirent from libc should not be used for umove'ing into because it
        contains fixed size d_name.

        * file.c (printdir): Rename to print_old_dirent.
        [SH64]: Decode using struct kernel_dirent.
        [!SH64]: Decode using an open-coded struct with 32-bit d_ino and d_off.
        (sys_readdir): Update.

2013-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        Do not use off_t in sendfile decoding.
        sendfile parser used to decode off_t* parameter as a pointer to host
        off_t type.  With this change, it is decoded as a pointer to target long
        type.

        * io.c (print_off_t): New function.
        (sys_sendfile): Use it.
        * linux/aarch64/syscallent1.h: Use sys_sendfile64 for sendfile decoding.
        * linux/tile/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/hppa/syscallent.h: Use sys_sendfile64 for sendfile64 decoding.
        * linux/metag/syscallent.h: Correct sendfile syscall name.
        * linux/or1k/syscallent.h: Likewise.

2013-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build with older versions of libaio.h.
        * configure.ac: When libaio.h is available, check for
        struct iocb.u.c.flags, IO_CMD_PWRITE and IO_CMD_PWRITEV.
        * desc.c (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS.
        (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and
        HAVE_DECL_IO_CMD_PWRITEV.

        Fix io_submit decoding.
        * desc.c (print_common_flags, sys_io_submit): Add missing ", " to
        SUB_COMMON output, remove extra ", " from SUB_VECTOR output.

2013-03-18  Maxin B. John  <maxin.john@enea.com>

        tests: relax check_prog to allow timeout command provided by busybox.
        Busybox version of timeout doesn't have --version option.
        Relax check_prog to handle those cases.

        * tests/init.sh (check_prog): Use type builtin to check program
        availability.

2013-03-18  Dmitry V. Levin  <ldv@altlinux.org>

        Reorganize get_regs code, hopefully without functional changes.
        * syscall.c [I386 || ARM || OR1K || METAG] (ARCH_REGS_FOR_GETREGSET):
        New macro.
        (get_regset): Implement for AARCH64, METAG, OR1K and X32.
        (get_regs) [AARCH64 || METAG || OR1K || X32]: Use it.

        arm, i386: use PTRACE_GETREGSET if available.
        * syscall.c [ARM || I386 || X86_64] (get_regset): New function.
        (get_regs) [ARM || I386 || X86_64]: Use it.

        Include <sys/uio.h> and <elf.h> on all architectures.
        * syscall.c: Include <sys/uio.h> and <elf.h> on all architectures.

        x86-64: enhance PTRACE_GETREGSET test.
        * syscall.c (get_regs) [X86_64]: Check whether PTRACE_GETREGSET
        works regardless of the kernel version.

        x32: use PTRACE_GETREGSET unconditionally.
        * syscall.c (get_regs) [X32]: Assume that PTRACE_GETREGSET always works
        regardless of the kernel version.

        x86-64, x32: do not include linux/ptrace.h unnecessarily.
        * syscall.c [X86_64 || X32]: Stop including linux/ptrace.h.

        i386, tile, x32: do not redefine ptrace prototype.
        * defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h.

        ptrace: decode note segment descriptor types.
        * configure.ac (AC_CHECK_HEADERS): Add elf.h.
        * process.c: Include elf.h.
        (nt_descriptor_types): New xlat structure.
        (sys_ptrace): Use it.

2013-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update MADV_* constants.
        * mem.c (madvise_cmds): Add more MADV_* constants from
        asm-generic/mman-common.h

        Reported-by: Robin Hack <hack.robin@gmail.com>

2013-03-07  Denys Vlasenko  <vda.linux@googlemail.com>

        Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers()
        count_syscall() was calling setitimer/getitimer once in order to find
        smallest "tick" OS uses in time accounting, in order to use it
        for syscalls which apparently spent less than that time in syscall.
        The code assumed that this "tick" is not zero... but it is zero
        on linux-3.6.11. Which means that this hack doesn't work...

        At least this change prevents this measurement from being done
        _repeatedly_, by initializing one_tick to -1, not 0.

        While at it, added comments in count_syscall() explaining what we are doing.

        Optimized call_summary_pers() a bit, by eliminating redundant tv -> float
        conversions, and prevented 0.0/0.0 which was resulting in "% time"
        being shown as "-nan" if total CPU time spent was 0.000000
        (try "strace -c /bin/true").

        The code seems to seriously underestimate CPU usage:
        "strace -c ls -lR /usr/share >/dev/null" shows total time spent
        in syscalls to be only ~10..20% of what "time ls -lR /usr/share >/dev/null"
        shows.

        It might be useful to have a mode where we show wall clock time
        spent in syscalls, not CPU time. It might also be more accurate.

           text    data     bss     dec     hex filename
         245019     676    5708  251403   3d60b strace_old
         244923     684    5676  251283   3d593 strace

2013-03-06  Denys Vlasenko  <vda.linux@googlemail.com>

        Open-code isprint(c) and isspace(c)
        We don't call setlocale, thus we always use C locale.
        But libc supports various other locales, and therefore
        its ctype interface is general and at times inefficient.
        For example, in glibc these macros result in function call,
        whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e
        suffices.

        By open-coding ctype checks (we have only 4 of them)
        we avoid function calls, we get smaller code:

           text    data     bss     dec     hex filename
         245127     680    5708  251515   3d67b strace_old
         245019     676    5708  251403   3d60b strace

        and we don't link in ctype tables (beneficial for static builds).

2013-03-06  Denys Vlasenko  <vda.linux@googlemail.com>

        Makefile: add commented-out tweak to generate link map.

        Stop using a large static buffer in getfdpath.
           text    data     bss     dec     hex filename
         245075     680    9836  255591   3e667 strace_old
         245143     680    5708  251531   3d68b strace

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix wrongly indented closing curly brace. No code changes.

        strace_vfprintf: if malloc fails, exit gracefully.

2013-03-05  Dmitry V. Levin  <ldv@altlinux.org>

        Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFT.
        PAGE_SHIFT couldn't be reliably obtained at compile time,
        thanks to Chris Metcalf for the hint.

        * mem.c: Do not include <sys/user.h>.
        [SH64] Do not include <asm/page.h>.
        (get_pagesize): New function.
        (sys_mmap_pgoff, sys_old_mmap_pgoff): Use it.

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Emit better message for ERESTARTNOHAND return.

        Disable STREAMS syscalls for non-SPARC.
           text    data     bss     dec     hex filename
           3002       0    1024    4026     fba stream.o.old
           1729       0    1024    2753     ac1 stream.o

        Fix printstrbufarg's address argument to be long, not int.

        Remove variable tracing_paths and check in pathtrace_match.

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Use dynamically-sized selected[] array for -P PATH.
        While at it, added a small optimization of not remembering
        the path twice if it happens to be the same.

           text    data     bss     dec     hex filename
         245111     680   10860  256651   3ea8b strace_old
         245075     680    9804  255559   3e647 strace

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

        metag,or1k: whitesace style fix. no code changes.

        Assorted fixes to syscallent.h.
        or1k was missing TM on many memory-related syscalls
        sys_lookup_dcookie is 3-arg on 64-bit arches, and isn't TF
        sys_recvmsg is 3-arg on all arches
        sys_nfsservctl is 3-arg on all arches
        sys_timerfd_create is 2-arg on all arches
        sys_[f]truncate64 is 4-arg or 3-arg, never 5-arg
        truncate64 is TF
        sys_[l]lseek is TD
        fstat[64] is TD

2013-03-05  James Hogan  <james.hogan@imgtec.com>

        Add support for Imagination Technologies Meta.
        Add support for Imagination Technologies Meta architecture (the
        architecture/ABI is usually referred to as metag in code). The Meta
        Linux kernel port is in the process of being upstreamed for v3.9 so it
        uses generic system call numbers.

        sys_lookup_dcookie writes a filename to buffer argument, so I've set
        TF flag.
        nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h
        so I've left it blank.
        truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit
        args which are packed tightly on metag, so less arguments on metag.
        fchdir/llseek takes a file descriptor so s/TF/TD/
        sync_file_range has 2 64bit args so uses 6 args, so s/4/6/
        timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/
        shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args.
        oldgetrlimit is just getrlimit for metag.
        add TM flag to various memory syscalls.
        metag doesn't directly use sys_mmap_pgoff for mmap2.
        prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag.
        fanotify_init doesn't appear to take a file descriptor so remove TD.
        Add kcmp syscall.

        Cc: Christian Svensson <blue@cmd.nu>

2013-03-01  Denys Vlasenko  <vda.linux@googlemail.com>

        umovestr: speed up check for NUL byte in the fetched word.

2013-03-01  Dmitry V. Levin  <ldv@altlinux.org>

        Fix trace=set regression introduced by commit v4.7-111-g9cbc15b.
        * syscall.c (qual_syscall, qualify): Pass personality down to
        qualify_one.
        * tests/qual_syscall: New test.
        * tests/Makefile.am (TESTS): Add qual_syscall.

2013-03-01  Chris Metcalf  <cmetcalf@tilera.com>

        tile: handle printllval like x86_64 or powerpc64.
        Without this fix the tilegx build fails when it hits the new #error
        about SIZEOF_LONG > 4.

        * util.c (printllval): Fix printing of long long values on TILE.

2013-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Make -b take SYSCALL param, document it in --help and in manpage.
        To not waste an option letter for just one trick,
        extend -b to take a parameter:
        "on which syscalls do you want to detach?".
        Currently supports only execve.

        While at it, fixed (by removing non-Linux and stale info)
        and extended manpage text about -f.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup umoven and umovestr.
        Cleanup sloppy error handling.

        First, EFAULT kind of errors from process_vm_readv by itself is not
        something unusual, so a warning message will not be issued unless a
        short read is detected.

        Second, clients of umoven and umovestr are not prepared to detect and
        handle short reads that can happen in these functions.  The most safe
        way to handle them is to return an error code.

        * util.c (umoven, umovestr): Cleanup handling of errors coming from
        process_vm_readv and PTRACE_PEEKDATA.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        pathtrace: fix umovestr return code check.
        * pathtrace.c (upathmatch): Only NUL-terminated strings can be
        path-matched, so fix the umovestr return code check to filter out
        unsuitable strings.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compilation errors uncovered by -Werror=enum-compare.
        This fixes regression introduced by commit v4.7-111-g9cbc15b.

        * syscall.c: Merge all nsyscalls* enums into single enum.
        Likewise merge nerrnos*, nsignals*, and nioctlents* into single enums.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

        Mass replace error_msg("%s", "literal") -> error_msg("literal")
        There is no need to print literal strings through "%s".
        Only untrusted strings such as filenames need that.

2013-02-26  Ben Noordhuis  <info@bnoordhuis.nl>

        Make umoven report success as 0, not >=0, stop returning success on partial reads
        umoven() uses process_vm_readv() when available but it returns the
        return value of that syscall, which is the number of bytes copied,
        while its callers expect it to simply return zero on success.

        It was causing syscalls that take a user-space argument to print
        the abbreviated version, e.g.:

          epoll_ctl(5, EPOLL_CTL_ADD, 10, {...})

        Instead of:

          epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=10, u64=10}})

        * util.c (umoven): Make umove[n] report success as 0, not >=0,
        stop returning "success" on partial reads.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

        Assorted NOMMU fixes.
        With -D, strdup'ing of pathname is necessary only on NOMMU.

        Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode
        (try "strace [-D] -b env echo HI" to see whether we detach on correct execve).

        Fix test_ptrace_FOO shortcuts on NOMMU to always assume success
        and _properly_ set all variables.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

        Shorten help text - no need to show deprecated option -F.

2013-02-23  Denys Vlasenko  <vda.linux@googlemail.com>

        Merge adjacent tprint's.

        Correct i > MAX_NSYSCALLS commparison: should be i >= MAX_NSYSCALLS.

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix wrong offset display in dumpstr.
        BTW, the new code from prev commit is 5 times faster
        than old one :)

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix a bug in dumpstr (no null termination). Essentially rewrote dumpstr.
        This is a 14 year old bug (!).

        It wasn't biting us merely because outstr[80] was static, thus ended up
        in bss and whatever was after it "accidentally" provided the NUL byte.
        When dumpstr was changed to use on-stack buffer, the bug reared its ugly head.

        This is a rewrite which is smaller and should be significantly faster
        for _long_ strings.

           text    data     bss     dec     hex filename
         244627     680   10860  256167   3e8a7 strace.t9/strace
         244563     680   10860  256103   3e867 strace.ta/strace

        * util.c (dumpstr): Rewrite to be faster and smaller.

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Eliminate MAX_QUALS, make qualifier array dynamic.
        MAX_QUALS was 2048, even though most arches used less than 500 entries
        in it. MAX_QUALS had to be maintained by hand to be higher than syscall
        count. It also limited the highest possible fd to track.

        This change makes qual_flagsN[] arrays start sized to the required minimum
        (number of syscalls) and grow dynamically if user requested
        -e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit
        can be raised with no cost for normal strace invocations.

        qual_flags is now a define to qual_vec[current_personality].

        As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent
        names in one-personality arches to their corresponding <foo>0 arrays,
        removing one indirection level.

          text   data    bss    dec    hex filename
        244471    700  12928 258099  3f033 strace.t7/strace
        244627    680  10860 256167  3e8a7 strace.t8/strace

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Create and use struct_sysent and struct_ioctlent typedefs.
        This is a preparatory mass replace patch with no code changes.

        The future change will need to typedef sysent to sysent0,
        which results in compile failures when "struct sysent" string
        gets mangled into "struct sysent0".

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev()
        We have hundreds of uses of these macros.
        Result is more efficient and 1.1 kbyte shorter code:

          text     data     bss     dec     hex filename
        245579      700   12928  259207   3f487 strace.t5/strace
        244471      700   12928  258099   3f033 strace.t6/strace

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unused QUAL_FAULT code (was used by non-Linux code only).

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Use uint8_t for qual_flags[] instead of ints.
        Resulting bss reduction is ~6kbytes:

           text    data     bss     dec     hex filename
         245703     700   19072  265475   40d03 strace.t4/strace
         245687     700   12928  259315   3f4f3 strace.t5/strace

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Eliminate many SCNO_IS_VALID checks.
        By adding tcp->s_ent pointer tot syscall table entry,
        we can replace sysent[tcp->scno] references by tcp->s_ent.
        More importantly, we may ensure that tcp->s_ent is always valid,
        regardless of tcp->scno value. This allows us to drop
        SCNO_IS_VALID(tcp->scno) checks before we access syscall
        table entry.

        We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks
        with a similar technique.

        Resulting code shrink:
           text    data     bss     dec     hex filename
         245975     700   19072  265747   40e13 strace.t3/strace
         245703     700   19072  265475   40d03 strace.t4/strace

        * count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check.
        * defs.h: Add "int qual_flg" and "const struct sysent *s_ent"
        to struct tcb. Remove "int u_nargs" from it.
        Add UNDEFINED_SCNO constant which will mark undefined scnos
        in tcp->qual_flg.
        * pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check.
        Use tcp->s_ent instead of sysent[tcp->scno].
        * process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs.
        (sys_waitid): Likewise.
        * strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS
        constant is consistent with init code.
        * syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs
        instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent.
        (decode_ipc_subcall): Likewise.
        (printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs.
        (printargs_lu): Likewise.
        (printargs_ld): Likewise.
        (get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check.
        If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values.
        (internal_fork): Use tcp->s_ent instead of sysent[tcp->scno].
        (syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check.
        Use tcp->s_ent instead of sysent[tcp->scno].
        (get_syscall_args): Likewise.
        (get_error): Drop SCNO_IS_VALID check where it is redundant.
        (dumpio): Drop SCNO_IS_VALID check where it is redundant.
        Use tcp->s_ent instead of sysent[tcp->scno].
        (trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead
        of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno].
        Drop SCNO_IS_VALID check where it is redundant.
        Print undefined syscall name with undefined_scno_name(tcp).
        (trace_syscall_exiting): Likewise.
        * util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno].

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

        ARM: make it one-personality arch.
        ARM in fact _is_ one personality.

        We had two personalities for it because it has a handful of
        syscalls with huge scnos (0x000f00xx).

        Extending syscall table to have [0x000f0005] index is of course
        not a good idea.

        Someone decided to handle that by having a separate personality
        just for these syscalls.

        But multi-personality arch does a bit more work in other parts.

        This patch is another alternative: "move" 0x000f00nn syscalls
        down to the entries just above last ordinary syscall,
        by manipulating scno if it falls into the 0x000f00xx range.

        In order to not worsen genuine undefined scnos' printing,
        the code remaps scno back to actual value before printing
        "syscall_NNN" string.

        * defs.h: Remove multi-reprsonality defines from ARM.
        * syscall.c (shuffle_scno): New function.
        (undefined_scno_name): New function.
        (get_scno): [ARM] Replace personality setting with scno shuffling.
        (trace_syscall_entering): Print unknown syscall name using
        undefined_scno_name().
        (trace_syscall_exiting): Likewise.
        * linux/arm/syscallent.h: Add ARM specific syscalls at the end.
        * linux/arm/errnoent1.h: Deleted.
        * linux/arm/ioctlent1.h: Deleted.
        * linux/arm/signalent1.h: Deleted.
        * linux/arm/syscallent1.h: Deleted.

2013-02-20  Denys Vlasenko  <vda.linux@googlemail.com>

        arm: shorten syscall table for EABI - no point in storing NULL entries.
        Also, reformatted ARM code in get_scno(), mostly improved comments,
        without code changes.

        Use the same style of includes in linux/*/* files.
        While at it, fix some comments which say
        "we use i386 syscalls/ioctls/errnos" but in reality
        common ones are used.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix compiler warnings.
        With constant current_wordsize == 4 and 32-bit longs,
        gcc was spooked by "1ul << (8 * current_wordsize)" = "1ul << 32".

        Make such places conditional on SIZEOF_LONG > 4.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Improve comment text. No code changes.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix NOMMU + daemonized tracer SEGV.
        pathname[] was getting destroyed, execve of garbage pathname
        failing, and to top it off, the tracer's stack was also
        smashed and trecer segfaulted.

        * strace.c (exec_or_die): New function.
        (startup_child): Don't use pathname[] contents after vfork,
        make a malloced copy instead. Explain "NOMMU + -D bug"
        and how we work around it.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Make it possible to to do test builds for NOMMU architectures.
        And while using it, I discovered that -D doesn't work too well
        on NOMMU. Added a comment about it.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Clean up mmap decoding.
        Previous code merges too many similar, but different ways
        of decoding mmap. For example, sys_old_mmap is "params in memory"
        API... except SH[64], where it is "params in regs",
        i.e. what sys_mmap ("new mmap") function does on other arches!

        It's much simpler when every mmap handler has same API regardless
        of arch. Where API means whether params are in regs or in memory,
        and whether offset is in bytes, pages, or 4k blocks.

        Then we just insert correct function pointers into
        arch syscall tables.

        It turns out there are four common mmap APIs over
        all architectures which exist in Linux kernel,
        and one outlier for S390.

        A number of mmap decoders were plain wrong in arch tables.
        For example, BFIN has no old_mmap. It returns ENOSYS.
        I checked kernel sources for all arches nad fixed the tables.

        There was dead code for x86_64 for old_mmap:
        x86_64 has no old_mmap.

        * mem.c: Refactor mmap functions so that we have five mmap syscall
        handlers, each with the fixed API (not varying by arch).
        * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks.
        * linux/syscall.h: Declare new mmap syscall handler functions.
        * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff.
        * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff.
        * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff.
        * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff.
        * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff.
        * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff.
        * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff.
        * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff.
        * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff.
        * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff.
        * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff.
        * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff.
        * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg.
        * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent1.h: mmap is TD|TM.
        * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unused function sys_mmap64.
        No wonder that it is unused.
        It's code looked quite questionable.

        * mem.c (sys_mmap64): Remove this function.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove code which supports systems with long long off_t.
        While looking at mmap mess, did experimenting in order
        to figure out what gets used when.

        Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686,
        x86_64 and none of they have long long off_t,
        which isn't suprprising: we aren't using glibc defines
        which enable that.

        Moreover, we SHOULD NOT use off_t in syscall decode!
        Its size depends on libc, not on arch! I.e. it is essentially
        unpredictable and can even in theory vary on the same arch
        with different libc.

        We should use longs or long longs, in a way which matches
        architectural ABI for the given syscall. There are usually
        *at most* two permutations, no need to add yet another variable
        (sizeof(off_t)) to the mix.

        This change removes almost all HAVE_LONG_LONG_OFF_T conditionals,
        which will reveal further possible simplifications.

        * mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T.
        As a result, never remap sys_mmap64 to sys_mmap.
        (print_mmap): Compile unconditionally.
        (sys_old_mmap): Compile unconditionally.
        (sys_mmap): Compile unconditionally.
        * io.c (sys_sendfile): Add a FIXME comment.
        * file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T.
        As a result, never remap sys_*stat64 to sys_*stat etc.
        (sys_truncate): Compile unconditionally.
        (realprintstat): Likewise.
        (sys_stat): Likewise.
        (sys_fstat): Likewise.
        (sys_lstat): Likewise.
        * desc.c (printflock): Likewise.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Fixes in "new" mmap.
        * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5].
        Add page shift of offset for I386.
        Use tcp->ext_arg[5] as offset for X32.
        (sys_old_mmap): [X32] Remove this function, X32 doesn't use is.

        Preliminary simplifications in mmap functions.
        * mem.c: Move "define sys_mmap64 sys_mmap" from the top
        to the only place it affects.
        (print_mmap): Make offset argument unsigned, for safer implicit conversions.
        (sys_old_mmap): [IA64] use unsigned narrow_arg[].
        Cast u_arg[5] (offset param) to unsigned long, to prevent erroneous signed
        expansion.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove broken HAVE_LONG_LONG conditionals.
        We use printllval without HAVE_LONG_LONG guards in many places,
        but define it only if HAVE_LONG_LONG. This means that
        on !HAVE_LONG_LONG systems we won't build for some time now.

        * defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro
        and printllval() function declaration.
        * util.c: Remove HAVE_LONG_LONG guard around printllval()
        function definition.
        (printllval): Add compile-time error check for using wrong
        if branch. Explain places where we deliberately use mismatched
        types for printf formats.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Use explicit long type instead of off_t.
        * file.c (sys_lseek): Use long instead of off_t.

        Merge two identical tables.
        * defs.h: Declare whence_codes[].
        * desc.c: Delete static whence[].
        (printflock[64]): Use whence_codes.
        * file.c: Make whence_codes[] non-static.
        Add SEEK_DATA and SEEK_HOLE to them.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove wrong x32-specific lseek.
        Testing confirmed what I suspected: x32 lseek uses kernel-sized
        (i.e. wide) long for offset parameter.

        * file.c: Delete sys_lseek32.
        * linux/syscall.h: Likewise.
        * linux/x32/syscallent1.h: Likewise.
        * test/x32_lseek.c: New file.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix SEGV in lseek.
        I found hard way why the code was using "_whence" name.

        * file.c: Rename whence[] to whence_codes[].
        (sys_lseek): Fix printxval() to use whence_codes[].
        (sys_lseek32): Likewise.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Comment inner workings of sys_[l]lseek.
        The code doesn't look fully correct to me, but I need to experiment
        on actual x32 machine before I start "fixing" things.
        For now, add comments, and optimize out one tprints() call...

        * file.c (sys_lseek): Rename '_whence' as 'whence'.
        Merge printing of ", " into subsequent tprintf.
        (sys_lseek32): Likewise.
        (sys_llseek): Likewise.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Cosmetic fixes to syscall tables, no code changes.

2013-02-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Make linux/mips/syscallent.h smaller.
        * linux/mips/syscallent.h: Remove trailing empty elements.
        Compactify huge stretches of NULL elements in the middle.

        Simple optimization in get_error.
        * defs.h: Define SCNO_IN_RANGE(scno) macro.
        * syscall.c (get_error): Change return type to void.
        Use SCNO_IN_RANGE instead of SCNO_IS_VALID.
        (trace_syscall_exiting): Stop checking get_error() return value.

        Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALID.

        Finish prefixing regs struct names with arch_
        * defs: Rename regs -> sparc_regs.
        * signal.c (sys_sigreturn): Use new variable name.
        * syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs.
        (getrval2): Use new variable names.
        (printcall): Likewise.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Use the same type for i386_regs on 32-bit and 64-bit x86.
        * defs.h: Stop including <asm/ptrace.h> for x86.
        Change i386_regs from "struct pt_regs" to "struct user_regs_struct".
        * syscall.c: Likewise.

        Fix build error on Tile.
        * syscall.c (get_scno): [TILE] Remove TCB_WAITEXECVE check,
        it is never true on Tile, and stopped compiling when
        TCB_WAITEXECVE define was removed for Tile.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

        x86: zero-extend 32-bit args in syscall entry instead of sign-extension.
        Zero-extension is slightly more common that sign-extension:
        all pointers are zero-extended, and some other params are unsigned.

        Whereas signed ones (fds, pids, etc) are often treated as
        _32-bit ints_ even by kernel, so just unconditionally casting
        such tcp->u_arg[N] to int works.

        * syscall.c (get_syscall_args): [X86] Zero-extend 32-bit args
        instead of sign-extension.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Macroize conditional signed widening operation.
        * defs.h: Define widen_to_long() macro.
        * signal.c (sys_kill): Use it instead of open-coding it.
        (sys_tgkill): Use widen_to_long() on pids.
        * resource.c (decode_rlimit): Formatting fix.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

        A better handling of current_wordsize.
        On x86_64:
          text     data     bss     dec     hex filename
        435661    26628   47424  509713   7c711 strace_old
        435501    26612   47440  509553   7c671 strace_new_clever_wordsize

        On x32 and arm it should be even better, current_wordsize becomes
        a constant there.

        * defs.h: Declare current_wordsize as a variable if needed,
        else declare as a constant define.
        Remove declatation of personality_wordsize[].
        * syscall.c: Make personality_wordsize[] static.
        Declare current_wordsize as a variable if needed.
        (set_personality): Set current_wordsize only if non-constant.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unnecessary "return 0" statements.
        * util.c (change_syscall): Remove dummy "return 0"s.

2013-02-14  Denys Vlasenko  <vda.linux@googlemail.com>

        x86: fix required kernel version for GETREGSET.
        * syscall.c (get_regs): [X86] Use GETREGSET only if kernel >= 2.6.35

        Whitespace fix, no code changes.

2013-02-14  Christian Svensson  <blue@cmd.nu>

        Add support for the OpenRISC 1000 platform.
        * configure.ac: Added or1k architecture..
        * defs.h: Added or1k to use register reading system.
        * linux/or1k/ioctlent.h.in: Use i386 ioctls.
        * linux/or1k/syscallent.h: New file.
        * process.c: Added or1k register defs to struct_user_offsets[].
        * syscall.c: Added or1k_io iovec for or1k GETREGSET,
          regset structure for or1k.
          (printcall): Added handling for or1k.
          (get_regs): Likewise.
          (get_scno): Likewise.
          (get_syscall_args): Likewise.
          (get_syscall_result): Likewise.
          (get_error): Likewise.
        * util.c (change_syscall): Added dummy handling for or1k.
        * system.c (sys_or1k_atomic): New function (or1k specific syscall).

2013-02-14  Denys Vlasenko  <vda.linux@googlemail.com>

        [X86] Use ptrace(PTRACE_GETREGSET, NT_PRSTATUS) to get registers.
        Unlike PTRACE_GETREGS, this new method detects 32-bit processes
        reliably, without checking segment register values which
        are undocumented and aren't part of any sort of API.
        While at it, also fixed x32 detection to use __X32_SYSCALL_BIT,
        as it should have been from the beginning.

        * defs.h: Declare os_release and KERNEL_VERSION.
        * strace.c: Make os_release non-static, remove KERNEL_VERSION define.
        * syscall.c: New struct i386_user_regs_struct,
        static union x86_regs_union and struct iovec x86_io.
        (printcall): Use i386_regs or x86_64_regs depending on x86_io.iov_len.
        (get_regs): On x86 and kernels 2.6.30+, use PTRACE_GETREGSET,
        on earlier kernels fall back to old method.
        (get_scno): [X86] Determine personality based on regset size
        on scno & __X32_SYSCALL_BIT.
        (syscall_fixup_on_sysenter): Use i386_regs or x86_64_regs depending
        on x86_io.iov_len.
        (get_syscall_args): Likewise.
        (get_error): Likewise.

2013-02-13  Denys Vlasenko  <vda.linux@googlemail.com>

        Rename some register statics by prefixing their names with arch.
        This makes it easier to grep for them.

        * syscall.c: Rename variables:
        r0 -> bfin_r0,alpha_r0,sh_r0.
        a3 -> mips_a3.
        r2 -> mips_r2.
        (get_scno): Use new variable names.
        (get_syscall_result): Likewise.
        (get_error): Likewise.

2013-02-13  Denys Vlasenko  <vda.linux@googlemail.com>

        Factor out code to check addr, fetch and print siginfo.
        * defs.h: Declare new function printsiginfo_at(tcp, addr).
        * process.c (sys_waitid): Use printsiginfo_at().
        (sys_ptrace): Likewise.
        * signal.c: (printsiginfo_at): Implement this new function.
        (sys_rt_sigsuspend): Use printsiginfo_at().
        (sys_rt_sigtimedwait): Likewise.

        Decode struct iov in PTRACE_GET/SETREGSET.
        * process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Unify representations of struct user fields for subarchitectures.
        * process.c: Unify MIPS and LINUX_MIPSN32, and SH and SH64 parts of
        struct_user_offsets[].

        Add start_code and start_data members of struct user.
        * process.c: Add start_code and start_data members of struct user
        in struct_user_offsets[], where appropriate.

        Remove hacks for old kernels for architectures which require new kernels
        * util.c (change_syscall): For MICROBLAZE, replace code
        with dummy "return 0" and a comment explaining why that is ok
        for this architecture.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove stray syscall result reading code on syscall entry for s390.
        This is a leftover from sysenter/sysexit split.
        I can't run-test it, but from code inspection it seems to be correct.

        * syscall.c (get_scno): Remove stray syscall result reading for s390[x].

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Deobfuscate definitions of struct user offsets.
        The maze of ifdefs/ifndefs was scaring new contributors.
        Format it so that every arch has its own ifdef block.

        * process.c: Deobfuscate definitions of struct user offsets.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove hacks for old kernels for architectures which require new kernels
        * defs.h: Do not define TCB_WAITEXECVE for AARCH64.
        * util.c (change_syscall): For AARCH64 and X32, replace code
        with dummy "return 0" and a comment explaining why that is ok
        for these architectures.

        Remove old kernel hacks for architectures which require new kernels.
        * defs.h: Do not define TCB_WAITEXECVE for AVR32, BFIN and TILE.
        * util.c (change_syscall): For AVR32, BFIN and TILE, replace code
        with dummy "return 0" and a comment explaining why that is ok
        for these architectures.

        Handle recv[m]msg for non-native 32-bit personality syscalls.
        * net.c (printmsghdr): If current_wordsize is 4 and long is wider than it,
        read 32-bit struct msghdr and expand it into a native one before using it.
        (printmmsghdr): Likewise for struct mmsghdr.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix is_negated_errno() check for X32.
        X32's return value is 64-bit. We were truncating it to 32-bit long
        before checking for -errno.

        * syscall.c (is_negated_errno_x32): New function.
        (get_error): Use is_negated_errno_x32 for X32 architecture.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unused / ambiguously used defines.
        We sometimes use LINUXSPARC and sometimes (more often)
        use "defined(SPARC) || defined(SPARC64)". Better to use
        one construct consistently.
        LINUX_MIPS64 is altogether unused.

        * defs.h: Remove LINUXSPARC and LINUX_MIPS64 defines.
        Move PTRACE_xxx compat defines up, before arch-specific
        machinery. Use defined(SPARC) || defined(SPARC64)
        instead of LINUXSPARC.
        * file.c: Use defined(SPARC) || defined(SPARC64) instead of LINUXSPARC.
        * signal.c: Likewise.

2013-02-11  Denys Vlasenko  <vda.linux@googlemail.com>

        Preparatory patch for "new" x86 personality detection.
        * syscall.c: Move PT_FLAGS_COMPAT define to its only user, get_scno().
        Rename arm_regs_union's fields to names less likely to collide with
        system defines.
        (get_regs): Use sizeof(arm_regs_union) instead of sizeof(aarch64_regs).
        This should be the same, but htis way it's cleaner.
        Remove __X32_SYSCALL_MASK and use __X32_SYSCALL_BIT instead.
        Explain 64-bit check in X32 build better.

2013-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix sigaltstack decoder.
        strace used to hang when decoding sigaltstack called with invalid
        stack_t pointers because of mishandling umove() return code.

        * signal.c (print_stack_t): Handle unfetchable stack_t properly.
        Change return type to void.
        (sys_sigaltstack): Update print_stack_t() usage.

        Reported-by: kawillia@ucalgary.ca

2013-02-09  Mike Frysinger  <vapier@gentoo.org>

        Fix decoding of sysctl() when oldval fields are NULL.
        If you call glibc's syscall wrapper like so:
                static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE };
                int buffer[2] = { 32768, 61000 };
                size_t size = sizeof(buffer);
                sysctl(name, 3, 0, 0, buffer, size);
        (note that oldval/oldlenp are NULL).

        The current strace code complains like so:
        _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, process_vm_readv: Bad address
        (nil), 0, 0x7fffe23c3960, 8}) = -1 EACCES (Permission denied)

        Since passing NULL for the old values is valid, handle that explicitly.
        This also simplifies the code a bit by splitting up the handling of the
        new and old args so that we only handle the new args once.

        Now the output looks like:
        _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, NULL, 0, 0x7fff8c0c91b0, 8) = -1 EACCES (Permission denied)

        * system.c (sys_sysctl): Check if info.oldval is NULL first.  Move the
        processing of oldlen/info.newval/info.newlen out so they always get
        executed.  Fix the format strings so we use %lu for unsigned long rather
        than a mix of %ld and %lu.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

        If we are on a glibc system, assume it's at least glibc 2.1.
        It is not likely anyone uses glibc older that that:
        glibc 2.1.1 was released in 1999

        * net.c: Remove test for glibc >= 2.1.
        * signal.c: Remove code which is compiled only for glibc < 2.1.
        * util.c: Likewise.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

        S390: stop using needlessly static long pc variable.
        * syscall.c: Remove "static long pc" variable.
        (get_scno): Use an automatic long variable instead of a static.

        Dying suddenly with abort() is rude, avoid if possible.
        * file.c (sys_utime): Don't call abort() if wordsize is strange.
        Instead, warn user about it.
        * desc.c (printflock): Use the same message string as in sys_utime.

        Remove vestigial hacks around non-Linux struct sigactions.
        * signal.c: Stop using __sighandler_t glibc'ism. Remove SA_HANDLER macro.
        Explain why we can't use "sa_handler" as a field name.
        (sys_sigaction): Use __sa_handler instead of SA_HANDLER macro.
        (sys_rt_sigaction): Likewise.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

        Optimize AArch64 handling of 32-bit personality.
        By putting aarch64_regs and arm_regs into a union,
        register copying is eliminated.
        No need to check and change personality on syscall exit.

        * defs.h: Remove unused NUM_ARM_REGS define. Fix indentation.
        * syscall.c: Put aarch64_regs and arm_regs into a union.
        (update_personality): Shorten bitness message.
        (printcall): Add commented-out PC printing.
        (get_regs): Remove now-unnecessary 64-to-32 bits register copying.
        (get_syscall_result): Drop personality changing code.

2013-02-07  Denys Vlasenko  <vda.linux@googlemail.com>

        Rename some register statics by prefixing their names with arch.
        This makes it easier to grep for them.

        * syscall.c: Make IA64's r8, r10 global variables static.
        Rename variables:
        r8,r10 -> ia64_r8,ia64_r10.
        d0 -> m68k_d0.
        a3 -> alpha_a3.
        r28 -> hppa_r28.
        r9 -> sh64_r9.
        r10 -> cris_r10.
        r3 -> microblaze_r3.
        (get_scno): Use new variable names.
        (syscall_fixup_on_sysenter): Likewise.
        (get_syscall_result): Likewise.
        (get_error): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

        Rename ARM's regs structure to arm_regs.
        Compile-tested.

        * defs.h: Rename regs structure to arm_regs.
        * syscall.c: Likewise.
        (printcall): Use new name instead of old one.
        (get_regs): Likewise.
        (get_scno): Likewise.
        (get_syscall_args): Likewise.
        (get_error): Likewise.
        * signal.c (sys_sigreturn): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

        Stop needlessly using static variable.
        * syscall.c: Remove static long psr.
        (get_scno): Use local psr variable.
        (get_syscall_result): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

        Shortcut tests for fork/exec syscalls.
        This change should speed up strace by a tiny bit.

        More importantly, it makes it much more clear that
        fork and exec fixups are not necessary for any reasonably
        recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees
        are all dead code.

        * defs.h: Declare new need_fork_exec_workarounds flag variable.
        * strace.c: Define need_fork_exec_workarounds flag variable.
        (test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator.
        (test_ptrace_setoptions_for_all): Likewise.
        (init): Set need_fork_exec_workarounds to TRUE if needed.
        * syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec().
        (trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if
        need_fork_exec_workarounds == TRUE.
        (trace_syscall_exiting): Likewise.

2013-02-05  Ben Noordhuis  <info@bnoordhuis.nl>

        Improve perf_event_open argument decoding.
        * configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h.
        * desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>.
        (perf_event_open_flags): New xlat structure.
        (sys_perf_event_open): New function.
        * linux/dummy.h (sys_perf_event_open): Remove.
        * linux/syscall.h (sys_perf_event_open): New prototype.

2013-02-05  Chris Metcalf  <cmetcalf@tilera.com>

        tile: fix merge skew with new get_regs architecture.
        * defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error.
        * syscall.c (get_regs) [TILE]: Fix merge skew.
        (printcall) [TILE]: fix a compiler warning about pt_reg_t in
        a printf expression.

2013-02-05  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>

        mount: decode MS_NOSEC.
        * system.c (MS_NOSEC): Define.
        (mount_flags): Add MS_NOSEC.

        mmap: decode MAP_UNINITIALIZED.
        * mem.c (mmap_flags): Add MAP_UNINITIALIZED.

2013-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        Print 64-bit instruction pointers zero padded.
        * syscall.c (printcall): Print 64-bit instruction pointers zero padded.

        x86_64: fix compilation warning introduced in previous commit.
        * syscall.c (printcall): Cast x86_64_regs.rip to the type being printed.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Simple bug fix for x86_86.
        * syscall.c (printcall): Use x86_64_regs.rip, not x86_64_regs.ip.

2013-02-05  Chris Metcalf  <cmetcalf@tilera.com>

        Add tilegx support to strace.
        tilegx support has been in the kernel since 3.0.
        In addition, fix some issues with the tilepro support already
        present in strace, primarily the decision to use the
        <asm/unistd.h> numbering space for system calls.

        * defs.h [TILE]: Include <asm/ptrace.h> and provide an extern
        struct pt_regs tile_regs for efficiency.  Provide compat 32-bit
        personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE,
        PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY.
        * linux/tile/errnoent1.h: New file, includes linux/errnoent.h.
        * linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h.
        * linux/tile/signalent1.h: New file, includes linux/signalent.h.
        * linux/tile/syscallent.h: Update with new asm-generic syscalls.
        The version previously committed was the from the first tile patch
        to LKML, which subsequently was changed to use <asm-generic/unistd.h>.
        * linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h.
        * mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable.
        * process.c [TILE]: Choose clone arguments correctly and properly
        suppress all "struct user" related offsets in user_struct_offsets.
        * signal.c [TILE]: Use tile_regs not upeek.
        * syscall.c (update_personality) [TILE]: Print mode.
        (PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers.
        (tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state.
        (get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek.
        (get_scno) [TILE]: Set personality.
        (get_syscall_args) [TILE]: Use tile_regs.
        (get_syscall_result) [TILE]: Update tile_regs.
        (get_error) [TILE]: Use tile_regs.
        (printcall) [TILE]: Print pc.
        (arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]:
        Properly handle tile call semantics and support tilegx.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Small optimization for SPARC[64] get_scno.
        * syscall.c: Remove static unsigned long trap veriable.
        (get_scno): Use local trap variable.

        Do not compile getrval2() if not needed.
        * syscall.c (getrval2): Do not compile it for architetures where
        it isn't ever used.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

        Optimize out PTRACE_PEEKUSER with -i.
        strace -i was fetching PC with a separate PEEKUSER
        despite having GETREGS data:

        ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0
        ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0
        write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
        ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0

        Now it does this:

        ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0
        write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
        ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0

        Analogous improvement in sys_sigreturn() is also implemented.

        * defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM.
        Declare clear_regs(), get_regs() and get_regs_error flag variable.
        * strace.c (trace): Call get_regs(pid) as soon as we know the tcb
        and that it is stopped.
        * syscall.c (get_regs): New function. Used to fetch registers early,
        just after tracee has stopped.
        (printcall): Move it here from util.c. Use global regs.REG data,
        if available on the arch, instead of re-fetching it.
        (get_scno): Use global regs.REG data.
        (get_syscall_result): Likewise.
        * signal.c (sys_sigreturn): Likewise.
        * util.c (printcall): Moved to syscall.c.

2012-12-15  Stanislav Brabec  <sbrabec@suse.cz>

        Fix sys_semtimedop decoding on s390x.
        The s390 and s390x pass semtimedop arguments differently from other
        architectures.  sys_semtimedop parser was fixed for s390 by commit
        v4.6-177-ge0f5fd8, and s390x requires the same fix.

        * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390x.

2012-12-08  Dmitry V. Levin  <ldv@altlinux.org>

        Fix *xattr decoding.
        * file.c (print_xattr_val): Do not attempt to decode a zero sized array.
        Fixes RH#885233.

2012-12-08  Stanislav Brabec  <sbrabec@suse.cz>

        sys_semtimedop: fix timeval argument index in wrapped call.
        Looking at the implementation of wrapped semtimedop() call inside glibc
        and kernel, I started to believe that timeval should be located in
        tcp->u_arg[4] and not tcp->u_arg[5].  Fortunately, tcp->u_arg[5] now
        works correctly as well, due to side effects of decode_ipc_subcall().

        declaration in header:
        int semtimedop(semid, *sops, nsops, *timeout);
                         0      1      2        3

        sys_ipc arguments in glibc on all patforms except s390*:
        semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout
          0            1    2            3                4
        We have to use indexes: 0 3 1 4

        sys_ipc arguments on s390*:
        semid, (int) nsops, timeout, sops
          0            1       2       3
        We have to use indexes: 0 3 1 2

        * ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in
        indirect_ipccall case.

2012-12-06  John Spencer  <maillist-strace@barfooze.de>

        Fix glibc version checks.
        * util.c: Check if __GLIBC__ is defined before using it.
        * signal.c: Likewise.  Fix __GLIBC_MINOR__ checks.

2012-11-29  James Hogan  <james.hogan@imgtec.com>

        Add state argument to change_syscall and fix SPARC.
        Add a state argument to change_syscall() so that SPARC can modify that
        instead of read-modify-writing the whole register set.  This function is
        always called within an arg_setup/arg_finish_change sequence which on
        certain architectures like SPARC will also be doing a read-modify-write.
        This prevents the second write (from arg_finish_change) from undoing the
        effects of the change_syscall call.

        * util.c (change_syscall): Move below definition of arg_setup_state.
        Add state argument.
        [SPARC || SPARC64] Change to set state->u_regs[U_REG_G1] rather than
        read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS.
        (setbpt, clearbpt): Pass state argument to change_syscall.

2012-11-12  Steve McIntyre  <steve.mcintyre@linaro.org>

        Add support for tracing 32-bit ARM EABI binaries on AArch64.
        * defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the
        accessor macros, so it's possible to build on AArch64 without
        ARM system headers.  Set SUPPORTED_PERSONALITIES to 2.
        Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE.
        Set DEFAULT_PERSONALITY to 1.
        * linux/aarch64/errnoent1.h: New file, includes generic errnoent.h.
        * linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h.
        * linux/aarch64/signalent1.h: New file, includes generic signalent.h.
        * linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h.
        * linux/aarch64/syscallent.h: New file, includes arm/syscallent.h.
        * syscall.c [AARCH64]: Define aarch64_regs.
        (update_personality) [AARCH64]: Add debug output.
        (get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by
        checking the size of the returned uio structure from PTRACE_GETREGSET
        and interpret the structure accordingly.
        (get_syscall_result): Likewise.
        (get_syscall_args): Merge the AArch64 and ARM sections so that on
        AArch64 we can fall back to supporting the ARM personality.
        (get_error): Likewise.

2012-11-12  Dmitry V. Levin  <ldv@altlinux.org>

        Move asm-generic ioctl definitions to linux/ioctlent.h.in.
        * linux/ioctlent.h.in: Add asm-generic ioctl entries from all
        linux/*/ioctlent.h.in files.
        * linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries.
        * linux/i386/ioctlent.h.in: Likewise.
        * linux/powerpc/ioctlent.h.in: Likewise.
        * linux/s390/ioctlent.h.in: Likewise.
        * linux/sparc/ioctlent.h.in: Likewise.

2012-10-27  Dmitry V. Levin  <ldv@altlinux.org>

        Filter out redundant "*32" ioctl entries.
        * linux/ioctlent-filter.awk: New file.
        * Makefile.am: Use it.
        * linux/ioctlent.h.in: Removed redundant "*32" entries.

2012-10-26  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance quotactl decoding.
        * quota.c (sys_quotactl): Decode 2nd syscall argument using printpath.
        * pathtrace.c (pathtrace_match): Add quotactl support.
        * linux/*/syscallent.h: Add TF flag to quotactl entry.

2012-10-26  Steve McIntyre  <steve.mcintyre@linaro.org>

        Add AArch64 support to strace.
        AArch64 has been included in linux from 3.7 onwards.
        Add support for AArch64 in strace, tested on linux in a simulator.

        * configure.ac: Support AArch64.
        * defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE.
        * ipc.c (indirect_ipccall): Support AArch64.
        * process.c (struct_user_offsets): Likewise.
        * syscall.c [AARCH64]: Include <asm/ptrace.h>,  <sys/uio.h>, and
        <elf.h>.  Define struct user_pt_regs regs.
        (get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET.
        (get_syscall_args, get_error): Support AArch64.
        * linux/aarch64/ioctlent.h.in: New file.
        * linux/aarch64/syscallent.h: New file, based on linux 3.7 version of
        asm-generic/unistd.h.

2012-10-26  Steve McIntyre  <steve.mcintyre@linaro.org>

        linux: add new errno values for EPROBE_DEFER and EOPENSTALE.
        New definitions match updates in Linux 3.4 and Linux 3.5 respectively.

        * linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER.
        (ERRNO_518): Change to EOPENSTALE.

2012-10-26  Namhyung Kim  <namhyung.kim@lge.com>

        Add -e trace=memory option.
        Add a new 'memory' category for tracing memory mapping related syscalls.

        Affected syscalls are: break, brk, get_mempolicy, madvise, mbind,
        migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect,
        mremap, msync, munlock, munlockall, munmap, remap_file_pages, and
        set_mempolicy.

        * defs.h (TRACE_MEMORY): New macro.
        * syscall.c (lookup_class): Handle trace=memory option.
        * strace.1: Document it.
        * linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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/tile/syscallent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

2012-09-28  Mike Frysinger  <vapier@gentoo.org>

        x32: add 64bit annotation too.
        Since someone can invoke these entry points directly with syscall(),
        at least decode their name and show that they're 64bit versions rather
        than just showing syscall_###.

        * linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64.

2012-09-28  Dmitry V. Levin  <ldv@altlinux.org>

        Ignore fflush(3) return value.
        strace used to honor fflush(3) return value in trace_syscall_entering
        which resulted to tracees not being PTRACE_SYSCALL'ed which in turn
        caused nasty hangups like this one:

        $ strace -o'|:' pwd
        |:: Broken pipe

        There is little strace can do in case of fflush(3) returning EOF, and
        hangup is certainly not the best solution for the issue.

        * syscall.c (trace_syscall_entering): Ignore fflush(3) return value.

2012-09-28  Dmitry V. Levin  <ldv@altlinux.org>

        Use perror_msg instead of perror.
        * signal.c (sys_sigreturn): Use perror_msg instead of perror.
        * strace.c (tprintf, tprints, detach, startup_attach): Likewise.
        * syscall.c (get_scno): Likewise.
        * util.c (umoven, umovestr): Likewise.

2012-09-27  Denys Vlasenko  <vda.linux@googlemail.com>

        process_vm_readv may return ESRCH if tracee was killed, don't complain.
        Discovered by running test/sigkill_rain under strace.

        * util.c (umoven): Do not emit error message if process_vm_readv
        fails with ESRCH.
        (umovestr): LikeWise.

2012-09-13  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial fixes, no code changes.
        * strace.c: Fix compiler warning message about tgkill - we don't use it.
        Fix indentation of preprocessor directives.
        (trace): Remove outdated comment.

2012-08-24  Dmitry V. Levin  <ldv@altlinux.org>

        Always check setreuid return code.
        * strace.c (startup_child): Check setreuid return code.

2012-08-24  Mike Frysinger  <vapier@gentoo.org>

        x32: update {g,s}etsockopt syscall numbers.
        Starting with linux 3.6 (and backported to earlier kernels), these two
        syscalls have changed numbers (moving from native to compat entry points).
        Update the strace syscall list accordingly.

        * linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move
        getsockopt from 55 to 542.

2012-08-16  Dmitry V. Levin  <ldv@altlinux.org>

        Decode file type returned by getdents system call.
        * file.c (sys_getdents): Decode d_type in unabbreviated mode.

2012-07-12  Dmitry V. Levin  <ldv@altlinux.org>

        Close pipe and wait for the pipe process termination.
        In case of normal strace termination, when the trace output is
        redirected to a file or a pipe, close it and wait for the pipe
        process termination.

        * strace.c (main): Before normal exit, close shared_log when it
        differs from stderr, and wait for popen_pid termination.

2012-07-10  Denys Vlasenko  <vda.linux@googlemail.com>

        Enable usage of PTRACE_SEIZE.
        * defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL
        and PTRACE_EVENT_STOP1.
        * strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL
        with 0.
        (trace): Do not check for PTRACE_EVENT_STOP1.

2012-06-05  Mike Frysinger  <vapier@gentoo.org>

        x32: update syscall table.
        This syncs with the syscall table as it is in linux 3.4.

        * linux/x32/syscallent.h (59): Fix comment typo.
        (78): Add missing getdents entry.
        (174): Delete create_module entry (not in the kernel).
        (181, 182, 183, 184, 185): Add missing entries.
        (524, 536, 539, 540): Fix spacing.

2012-05-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Merge adjacent printing operations in a few places.
        * file.c (sys_readahead): Merge tprints() with following printllval().
        (sys_ftruncate64): Likewise.
        (sys_fadvise64): Likewise.
        (sys_fadvise64_64): Likewise.
        (sys_fallocate): Merge tprints() with following tprintf().

2012-05-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Use %d printf format instead of %i everywhere.
        * loop.c (loop_ioctl): Use %d instead of %i.
        * mtd.c (mtd_ioctl): Likewise.

        Fix a few goofs in sys_sysctl()
        * system.c (sys_sysctl): Cast pointer to long, not size_t,
        when we intend to use it as an address. Set oldlen to 0 prior
        to reading into it - we want to have deterministic result
        if read fails.

2012-05-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Stop using non-standard %Zu and %Zd formats for size_t printing.
        The documented formats are %zu and %zd, but since our (normally disabled)
        "fast" printf code doesn't support those too, I convert them to %lu and %ld.

        * bjm.c (sys_query_module): Convert %Zd usages to %lu.
        * system.c (sys_sysctl): Likewise.

2012-05-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove outdated comment about suspending new tracees.
        We no longer track parent/child relationship between tracees.
        Therefore, we no longer suspend new tracee until parent is seen
        exiting form [v]fork/clone. The comment is obsolete.

        * strace.c (trace): Remove outdated comment.

2012-05-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches
        On 64bit systems with a single personality, they used to be sizeof(long),
        which has type "long", not "int", which complicates printf formats.

        * defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int.
        This in turn makes sure current_wordsize is also an int.
        * count.c (call_summary): Revert the change which added cast to int.

2012-05-15  Dmitry V. Levin  <ldv@altlinux.org>

        Add configure --enable-gcc-Werror option.
        * configure.ac: New option --enable-gcc-Werror.

        Make x86-64 build free of artificial warnings.
        * signal.c (sys_sigreturn): Do not issue "no sys_sigreturn" warning
        on X86_64.

2012-05-14  Dmitry V. Levin  <ldv@altlinux.org>

        Fix kernel release string parsing.
        * strace.c (get_os_release): Handle "X.Y-something" utsname.release
        strings properly.

        Reported-by: Bryce Gibson <bryce@gibson-consulting.com.au>

2012-05-14  Denys Vlasenko  <vda.linux@googlemail.com>

        On clearing "breakpopint", restore syscall number too.
        This fixes Fedora bug 659382.
        Low risk: this code is not supposed to be used on any non-acient kernel.

        * util.c (clearbpt): Restore syscall number too.

2012-05-05  Mike Frysinger  <vapier@gentoo.org>

        util: fix building when glibc has a stub process_vm_readv.
        If you have a newer glibc which provides process_vm_readv, but it is built
        against older kernel headers which lack __NR_process_vm_readv, the library
        will contain a stub implementation that just returns ENOSYS.  Autoconf
        checks for this case explicitly and will declare it as unavailable.  So we
        end up in a case where the headers provide the prototype, but autoconf has
        not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:

        util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
        /usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here

        So rename our local function to something unique, and add a define so the
        callers all hit the right place.

        * util.c (strace_process_vm_readv): Rename from process_vm_readv.
        (process_vm_readv): Define to strace_process_vm_readv.

2012-05-03  Dmitry V. Levin  <ldv@altlinux.org>

        doc: describe documentation policy.
        * README-hacking: Describe documentation policy.

2012-05-02  Dmitry V. Levin  <ldv@altlinux.org>

        maint: post-release administrivia.
        * NEWS: Add header line for next release.

        Prepare for 4.7 release.
        * configure.ac: Version 4.7.
        * debian/changelog: 4.7-1.
        * strace.spec: 4.7-1.

        Fix build with <linux/loop.h> from 2.6.18 kernel headers.
        * configure.ac: Check for LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN
        declarations.
        * loop.c (loop_flags_options): Use LO_FLAGS_AUTOCLEAR and
        LO_FLAGS_PARTSCAN only when appropriate declarations are available.
        (loop_ioctl): Use LOOP_SET_CAPACITY only when it is defined.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        * vsprintf.c: Check for USE_CUSTOM_PRINTF earlier.

        Remove duplicate names from CREDITS.
        * .mailmap: Merge email addresses.
        * CREDITS.in: Remove a duplicate name.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        tests: raise strace check timeout to 60 seconds.
        * tests/init.sh (check_timeout): New variable.
        * tests/ptrace_setoptions: Use it.
        * tests/strace-f: Likewise.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        Update STA_* constants.
        * time.c (adjtimex_status): Add STA_NANO, STA_MODE, and STA_CLK.
        * NEWS (Improvements): Mention it.

        NEWS: update for release.
        * NEWS (Improvements): Mention recent recvmsg/recvmmsg decoders
        enhancements.
        (Portability): Add a recommendation for the minimum Linux kernel
        version to use.

        Make printing of utsname.domainname more portable.
        * configure.ac: Check for struct utsname.domainname field.
        * process.c (sys_uname): Print utsname.domainname when the field is
        available.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        Fix recvmmsg decode: do not show more data than actually returned.
        This change complements recent fix for recvmsg decoding.

        * net.c (printmmsghdr): Add msg_len parameter to pass down to do_msghdr.
        When this parameter is zero, pass mmsghdr.msg_len to do_msghdr instead.
        (decode_mmsg): Add msg_len parameter, pass it down to printmmsghdr.
        (sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L.
        (sys_recvmmsg): Call decode_mmsg with msg_len == 0.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

        Remove recently introduced use of ULONG_MAX.
        * io.c: Remove limits.h inclusion.
        (tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX".
        * net.c: Remove limits.h inclusion.
        (printmmsghdr, sys_sendmsg): Use "(unsigned long) -1L" instead of
        "ULONG_MAX".

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Enable printing of uts.domainname in uname syscall.
        * process.c (sys_uname): Enable printing of uts.domainname

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix printstr's len parameter width.
        We often pass syscall params and other long-sized values
        as printstr(len). Truncating them to int may be a bad thing.

        * defs.h: Change len parameter's type from int to long in
        string_quote and printstr function declarations.
        * util.c (string_quote): Special-case only len==-1, not all len<0.
        (printstr): Likewise.

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix recvmsg decode: do not show more data than actually returned.
        I noticed that "hostname -d" talks over netlink and gets 20 bytes
        of response, but we show entire 1024 bytes of iov.
        This changes fixes that.

        * defs.h: New function tprint_iov_upto.
        * io.c (tprint_iov_upto): Definition of this function.
        (tprint_iov): Call tprint_iov_upto.
        * net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto.
        (printmsghdr): Add data_size parameter, pass it down to do_msghdr.
        (printmmsghdr): Call do_msghdr with data_size==ULONG_MAX.
        (sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX.
        (sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval.

2012-04-27  Dmitry V. Levin  <ldv@altlinux.org>

        Package strace-log-merge.
        * strace.spec (%files): Add strace-log-merge.

2012-04-27  Mike Frysinger  <vapier@gentoo.org>

        NEWS: clarify & fix typo.

2012-04-27  Mike Frysinger  <vapier@gentoo.org>

        Cast current_wordsize to an int.
        On 64bit systems with a single personality, we see:
        count.c: In function 'call_summary':
        count.c:223:5: warning: format '%u' expects type 'unsigned int',
                but argument 3 has type 'long unsigned int'

        Since on multi-personality systems this is an array of ints, cast
        the multiplication to an int and update the printf format.

        * count.c (call_summary): Change %u to %d and cast first argument to int.

2012-04-20  Dmitry V. Levin  <ldv@altlinux.org>

        Update NEWS for upcoming 4.7 release.
        * NEWS: Update for 4.7 release.

        Sync strace.spec and debian/ with packages.
        * debian/changelog: Sync with 4.5.20-2.3.
        * debian/control: Likewise.
        * strace.spec: Sync with 4.6-2.

2012-04-18  Mike Frysinger  <vapier@gentoo.org>

        Decode /dev/loop ioctls.
        Needed to debug some losetup failures, and it's easier when you can see
        what the kernel is getting vs what you think you're sending, so add some
        decoders for those ioctls.

        * loop.c: New file.
        * Makefile.am (strace_SOURCES): Add loop.c.
        * defs.h (loop_ioctl): New prototype.
        (string_quote): Likewise.
        * ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'.
        * util.c (string_quote): Remove static keyword.

2012-04-18  H.J. Lu  <hongjiu.lu@intel.com>

        x32: add ia32 support.
        * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h,
        linux/x32/ioctlent1.h, linux/x32/signalent1.h and
        linux/x32/syscallent1.h.
        * configure.ac: Remove AC_GNU_SOURCE, obsoleted by
        AC_USE_SYSTEM_EXTENSIONS.
        * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32.
        (PERSONALITY1_WORDSIZE): Set to 4 for X32.
        * file.c (stat64): New struct for X32.
        (sys_lseek32): New function for X32.
        (stat64): Undef.
        (sys_fstat64): Likewise.
        (sys_stat64): Likewise.
        (realprintstat64): New function for X32.
        (sys_fstat64): Likewise.
        (sys_stat64): Likewise.
        * mem.c (sys_old_mmap): New function for X32.
        * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32.
        * syscall.c (update_personality): Add X32 support.
        (get_scno): Support currpers == 1 for X32.
        * linux/syscall.h (sys_lseek32): New function prototype for X32.
        * linux/x32/errnoent1.h: New file.
        * linux/x32/ioctlent1.h: Likewise.
        * linux/x32/signalent1.h: Likewise.
        * linux/x32/syscallent1.h: Likewise.

2012-04-17  H.J. Lu  <hongjiu.lu@intel.com>

        Cast clock_t type to unsigned long long.
        * resource.c (sys_times): Cast clock_t type to unsigned long long.
        * signal.c (printsiginfo): Likewise.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Add custom (faster) vfprintf implementation (disabled by default)
        * defs.h: Declare strace_vfprintf either as a alias to vfprintf
        or as a bona fide function. USE_CUSTOM_PRINTF define controls whether
        we use strace_vfprintf. By default, we don't.
        * strace.c (tprintf): Call strace_vfprintf instead of vfprintf.
        * vsprintf.c: New file, implements strace_vfprintf.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Stop using %h[h]u format specifiers.
        This is needed for simplified printf, and reduces code size a bit.

        * block.c (block_ioctl): Cast the value to unsinged and use %u
        instead of using %hu.
        * desc.c (sys_io_cancel): Likewise.
        * resource.c (sys_sysinfo): Likewise.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial speed optimization.
        * strace.c (tprints): Use fputs_unlocked instead of fputs.

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

        Fix a problem with sys_lseek on x32.
        * file.c (sys_lseek): Use MIPS-n32 variant also for x32

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

        Add x32 support to strace.
        X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with
        32bit pointers.  At system call level, x32 is also identical to x86-64,
        as shown by many changes like "defined(X86_64) || defined(X32)".  The
        main differerence bewteen x32 and x86-64 is off_t in x32 is long long
        instead of long.

        This patch adds x32 support to strace.  Tested on Linux/x32.

        * configure.ac: Support X32.
        * defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64,
        Set PERSONALITY2_WORDSIZE to 4 for X86_64.
        Add tcb::ext_arg for X32.
        * file.c (stat): New for X32.
        (sys_lseek): Use 64-bit version for X32.
        (printstat64): Check current_personality != 1 for X86_64.
        * ipc.c (indirect_ipccall): Check current_personality == 1
        for X86_64.
        * mem.c (sys_mmap64): Also use tcp->u_arg for X32.  Print NULL
        for zero address.  Call printllval for offset for X32.
        * pathtrace.c (pathtrace_match): Don't check sys_old_mmap for
        X32.
        * process.c (ARG_FLAGS): Defined for X32.
        (ARG_STACK): Likewise.
        (ARG_PTID): Likewise.
        (change_syscall): Handle X32.
        (struct_user_offsets): Support X32.
        (sys_arch_prctl): Likewise.
        * signal.c: Include <asm/sigcontext.h> for X32.
        (SA_RESTORER): Also define for X32.
        * syscall.c (update_personality): Support X32 for X86_64.
        (is_restart_error): Likewise.
        (syscall_fixup_on_sysenter): Likewise.
        (get_syscall_args): Likewise.
        (get_syscall_result): Likewise.
        (get_error): Likewise.
        (__X32_SYSCALL_BIT): Define if not defined.
        (__X32_SYSCALL_MASK): Likewise.
        (get_scno): Check DS register value for X32.  Use
        __X32_SYSCALL_MASK on X32 system calls.
        * util.c (printllval): Use ext_arg for X32.
        (printcall): Support X32.
        (change_syscall): Likewise.
        (arg0_offset): Likewise.
        (arg1_offset): Likewise.
        * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h,
        linux/x32/ioctlent.h.in, linux/x32/signalent.h,
        linux/x32/syscallent.h, linux/x86_64/errnoent2.h,
        linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and
        linux/x86_64/syscallent2.h.
        * linux/x32/errnoent.h: New.
        * linux/x32/ioctlent.h.in: Likewise.
        * linux/x32/signalent.h: Likewise.
        * linux/x32/syscallent.h: Likewise.
        * linux/x86_64/errnoent2.h: Likewise.
        * linux/x86_64/ioctlent2.h: Likewise.
        * linux/x86_64/signalent2.h: Likewise.
        * linux/x86_64/syscallent2.h: Likewise.

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

        Restore tcb::u_lrval; fix lseek on MIPS-n32.
        Linux kernel v3.4 adds x32 support.  Both x32 and n32 use 64bit offset
        for lseek parameter and return value.  We need u_lrval to handle it
        properly.  Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek.
        This patch fixes it properly and prepares lseek for x32.

        * defs.h (tcb): Restore tcb::u_lrval field, RVAL_Lfoo constants.
        Set RVAL_MASK to 7.
        * file.c (sys_lseek): Print 64bit offset and return RVAL_LUDECIMAL
        for n32.
        * syscall.c (get_error): Set u_lrval for MIPS-n32.
        (trace_syscall_exiting): Handle RVAL_Lfoo return value types.

2012-04-06  Mike Frysinger  <vapier@gentoo.org>

        Decode mtd ioctls.
        I got tired of figuring out mtd structures (which show up a lot
        in the embedded space), so add decoders for those ioctls.

        * defs.h (mtd_ioctl): New prototype.
        (print_loff_t): Likewise.
        * io.c (print_loff_t): Delete static keyword
        * ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'.
        * Makefile.am (strace_SOURCES): Add mtd.c.
        (EXTRA_DIST): Add linux/mtd-abi.h.
        * mtd.c: New file.
        * linux/mtd-abi.h: New file.

2012-04-05  Mike Frysinger  <vapier@gentoo.org>

        Fix indefinite hang on no-mmu systems.
        The ptrace setoptions code will fork a child which goes to sleep and
        expects the parent to continue on to do tests.  Unfortunately, this
        does not work on no-mmu systems as fork() is actually vfork() and any
        vforked children will hang the parent until it exits or execs.

        We might be able to make this test work on no-mmu systems with a bit
        of work, but easier to just disable this for the release so it works
        now.

        * strace.c (test_ptrace_setoptions_for_all): Return if strace_vforked.

2012-03-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Makefile.am: whitespace fix.

2012-03-27  Anton Blanchard  <anton@samba.org>

        powerpc: Add syscall entries for direct socket system calls.
        * linux/powerpc/syscallent.h: Add direct socket system calls.

2012-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        qual_syscall: fix potential NULL dereference.
        Fix regression introduced by commit
        c1371ebc400fe9578908beca87f2bf407daf1506

        * syscall.c (qual_syscall): Handle null sys_name.

        Reported-by: Fr. Br. George <george@altlinux.org>

2012-03-26  Dmitry V. Levin  <ldv@altlinux.org>

        strace-log-merge: fix file suffix calculation.
        * strace-log-merge: Quote file prefix to fix file suffix calculation.

        Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
        Suggested-by: Andreas Schwab <schwab@linux-m68k.org>

2012-03-26  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unreachable code.
        * strace.c (process_opt_p_list): Remove unreachable code.

        manpage: remove false info about -p being limited to 32 processes.

        Tweak help text and manpage (added -In to manpage)

2012-03-25  Dmitry V. Levin  <ldv@altlinux.org>

        printstr: check for potential integer overflow.
        * util.c (printstr): Check for potential integer overflow during outstr
        buffer size calculation.

        Robustify parsing of numbers from strings.
        * defs.h (string_to_uint): New prototype.
        * util.c (string_to_uint): New function.
        * strace.c (error_opt_arg): New function.
        (process_opt_p_list): Use string_to_uint instead of atoi.
        Terminate in case of invalid process id.
        (init): Use string_to_uint instead of atoi.
        Use error_opt_arg in case of invalid option argument.
        * syscall.c (qual_syscall, qual_signal, qual_desc): Use string_to_uint
        instead of atoi.

        strace-log-merge: enhance usage error diagnostics.
        * strace-log-merge: Add --help option.  Check number of arguments.
        Issue an error message when no strace output was merged.

        configure.ac: sort lists and use m4_normalize to ease maintenance.
        * configure.ac (AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_CHECK_MEMBERS,
        AC_CHECK_DECLS): Sort lists, use m4_normalize.

2012-03-23  Denys Vlasenko  <vda.linux@googlemail.com>

        Simple optimizations.
        Why open-coding isdigit is a good idea?

        Before: call   __ctype_b_loc
                movzbl (%ebx),%edx
                mov    (%eax),%eax
                testb  $0x8,0x1(%eax,%edx,2)
                je     lbl

        After:  movzbl (%eax),%edx
                sub    $0x30,%edx
                cmp    $0x9,%dl
                ja     lbl

           text    data     bss     dec     hex filename
         236869     704   18944  256517   3ea05 strace.before
         236719     700   18944  256363   3e96b strace

        * defs.h: Alias sigemptyset to __sigemptyset on glibc.
        * syscall.c (qual_syscall): Open-code isdigit.
        (qual_desc): Likewise.
        (qual_signal): Open-code isdigit. Remove string copying
        which was done for no apparent reason.

2012-03-23  Denys Vlasenko  <vda.linux@googlemail.com>

        Reorder declarations in defs.h. No code changes.
        * defs.h: Reorder declarations (such as: keep all printing functions together).

2012-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Simplify current tcp switching and current column handling.
        Instead of using "static FILE *outf and static unsigned int curcol"
        to cache current outfile and its position, we can simply
        remember current tcb and use its ->outf and ->curcol.
        This allows to drop numerous "tcp->curcol = curcol" ops in trace().

        Turns out we can't drop "static FILE *outf", but now its role is
        a bit clearer: it newer changes after init, stays == stderr or
        opened to shared log (which may be the same thing if neither -o
        nor -ff was specified). Let's rename it then.

           text    data     bss     dec     hex filename
         236953     704   18944  256601   3ea59 strace.before.prev.commit
         236905     704   18944  256553   3ea29 strace.before
         236869     704   18944  256517   3ea05 strace

        * strace.c: Replace curcol static variable by struct tcb *current_tcp.
        Rename static FILE *outf to shared_log (since it no longer caches tcp->outf).
        (ptrace_restart): Use current_tcp->curcol instead of curcol.
        (tprintf): Check current_tcp != NULL instead of outf != NULL.
        Use current_tcp->outf instead of outf, current_tcp->curcol instead of curcol.
        (tprints): Likewise.
        (line_ended): Likewise.
        (printleader): Switch current tcb by "current_tcp = tcp" istead of
        assignments to outf and curcol.
        (droptcb): Set current_tcp to NULL if we dropped it.
        (startup_child): Rename outf to shared_log.
        (init): Likewise.
        (cleanup): Likewise.
        (trace): Simplify current tcp switching and current column handling.

2012-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

        Make threaded execve handling code more reabable and somewhat simpler.
        * strace.c (droptcb): Remove outfname check in "outfname && followfork >= 2" -
        with recent changes, followfork >= 2 check guarantees that outfile
        was specified, and _is already opened_.
        (trace): Move tcb existence check before threaded execve handling.
        This allows to remove tcp != NULL checks in threaded execve handling.
        Rewrite threaded execve handling code to be less indented,
        keeping the same logic.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

        simple cleanups in defs.h. No logic changes.
        * defs.h: Move offsetof macro definition into "libc stuff" section.
        Renumber TCB_foo constants (smaller constants -> sometimes smaller code).
        Remove uoff macro.
        * process.c: Move uoff macro here (sole user).

        Show "+++ exited..." with -C.
        * strace.c (trace): Show "+++ exited..." with -C too.
        Save tcp->curcol after PTRACE_LISTEN failure too, just in case.

        Slight tweak to qemu_multiarch_testing scripts.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Replace reprinting decision logic.
        After this change, we no longer need to decide when we need
        to set TCB_REPRINT, and when we don't: it's never needed :)

        Well, almost. That pesky pid-changing execve needs special treatment.
        If not it, it'd be possible to nuke TCB_REPRINT...

        While at it, fix a case of mishandled -C.

        * strace.c (printleader): Do not set TCB_REPRINT.
        (trace): Set TCB_REPRINT only for execve with changing pid.
        Fix mishandling of -C.
        * syscall.c (trace_syscall_entering): Do not clear TCB_REPRINT.
        (trace_syscall_exiting): Replace reprinting decision logic.
        Remove call to printargs(): it is known to just return 0 here.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Report some ptrace failures; nuke tcp->ptrace_errno.
        Report some (not all) ptrace errors, namely,
        errors on ptrace restart operations.

        Before: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...>
        After:  10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process>

        This tells user that strace failed to let sendto syscall
        to be entered - process was dead at that point of time.
        It is (marginally) better than to always say "<unfinished ...>"

        While at it, patch removes tcp->ptrace_errno.
        I added it many months ago, and it looks that after all
        it is not needed for ptrace error detection: I failed to execute
        a single existing code path which is accessible
        through that variable only.

        * defs.h: Remove struct tcp::ptrace_errno field.
        * strace.c (ptrace_restart): Emit message to log on error.
        (printleader): Remove "if (printing_tcp->ptrace_errno)..." code.
        (trace): Remove !tcp->ptrace_errno check, it's always true.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

        Eliminate redundant checks of res variable.
        * syscall.c (trace_syscall_entering): Eliminate redundant checks of res variable.
        (trace_syscall_exiting): Likewise.

        Rename POWERPC-specific static variable result to ppc_result.
        * syscall.c: Rename POWERPC-specific static variable result to ppc_result.

        Remove redundant checks in syscall entry/exit, rename badly named function
        * syscall.c (syscall_enter): Rename to get_syscall_args.
        Document its return values.
        (trace_syscall_entering): Don't check get_syscall_args() return
        value for 0, it never returns that.
        (syscall_fixup_on_sysexit): Make it return void.
        (trace_syscall_exiting): Fix up syscall_fixup_on_sysexit()
        call site accordingly.

        Trivial tweaks. No logic changes.
        * process.c (sys_ptrace): Remove unneeded line wrapping.
        * syscall.c (trace_syscall_entering): Use tprints() instead of tprintf().

        Make ptrace_restart() static. No code changes.
        * defs.h: Remove ptrace_restart() declaration.
        * strace.c (ptrace_restart): Move its definition here.
        * util.c (ptrace_restart): Remove its definition.

2012-03-20  Dmitry V. Levin  <ldv@altlinux.org>

        Do not include limits.h unnecessarily.
        * ioctl.c: Remove limits.h inclusion left after the reverted change.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

        Partially revert last change.
        Thank you Dmitry for spotting it.

        * ioctl.c (compare): Partially revert last change - the new
        comparison logic was buggy.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

        Simplify search in ioctl table.
           text    data     bss     dec     hex filename
         236973     704   18944  256621   3ea6d strace.before
         236929     704   18944  256577   3ea41 strace

        * ioctl.c (compare): Simplify generation of compare result.
        (ioctl_lookup): Pass key directly, not as part of dummy struct.
        (ioctl_next_match): More readable code. No logic changes.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Update qemu build script: now tries to upload result back to host.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Shrink space needed by undefined syscalls in syscall tables.
        Undefined syscall looked like this before this change:
        { 5,    0,      printargs,              "SYS_53"                },
        That is, "SYS_53" string had to be allocated and stored in strace binary.
        Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL
        for valid syscalls, we can replace printargs with NULL in such lines
        and make them "invalid", thus not requiring syscall name string.

        Savings on i386:
           text    data     bss     dec     hex filename
         237389     704   18944  257037   3ec0d strace.before
         236973     704   18944  256621   3ea6d strace
        Savings on mips:
         336551  153692   38320  528563   810b3 strace.before
         275543  153688   38320  467551   7225f strace

        Tested to still decode undefined syscalls correctly (syscall no. 222 on i386).

        * linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with
        'NULL, NULL'.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

        Optimize code if we have only one personality.
        On i386:
           text    data     bss     dec     hex filename
         238025     672   18980  257677   3ee8d strace.before
         237389     704   18944  257037   3ec0d strace

        * defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined.
        Introduce new define, current_wordsize as
        (personality_wordsize[current_personality]).
        Make set_personality() no-op, current_personality constant zero,
        current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality.
        * count.c (call_summary): Use current_wordsize instead of
        personality_wordsize[current_personality].
        * desc.c (printflock): Likewise.
        * file.c (sys_utime): Likewise.
        * io.c (tprint_iov): Likewise.
        * process.c (printargv): Likewise.
        * resource.c (decode_rlimit): Likewise.
        * signal.c (sys_kill): Likewise.
        (sys_rt_sigaction): Likewise.
        * time.c (sprinttv): Likewise.
        (sprint_timespec): Likewise.
        (printitv_bitness): Likewise.
        (tprint_timex): Likewise.
        (printsigevent): Likewise.
        * util.c (dumpiov): Likewise.
        (umoven): Likewise.
        (umovestr): Likewise.
        * syscall.c: Initialize sysent to sysent0 etc.
        Make current_personality, personality_wordsize[], set_personality()
        conditional on SUPPORTED_PERSONALITIES > 1.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix mips64 build failure: sys_pwrite64 doesn't exist.
        sys_pwrite seems to do the same thing as sys_pwrite64
        which we deleted when we removed non-Linux code.

        * linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

        qemu_multiarch_testing/: a directory with scripts for build testing.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Make internal_fork and internal_exec static.
           text    data     bss     dec     hex filename
         237917     672   18980  257569   3ee21 strace
         237845     672   18980  257497   3edd9 strace_new

        * defs.h: Remove declarations of internal_fork and internal_exec.
        * process.c: Remove definitions of internal_fork and internal_exec.
        * syscall.c: Move them here.
        (internal_syscall): Return void instead of int. We were always
        returning zero, and callers weren't checking it anyway.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove code which is not used on Linux.
        Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686,
        mipsel,mips,x86_64

        * syscall.c: Remove code which handles RVAL_Lfoo constants.
        * defs.h: Remove struct tcb::u_lrval member - it is never set.
        Remove RVAL_Lfoo constants which signify return of "long" result -
        they are never used.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unused version of sys_lseek.
        It is buggy: it returns RVAL_LUDECIMAL, which means the return value
        is in tcp->u_lrval. But tcp->u_lrval is never set
        (on Linux - it used to be set on other OSes).

        * file.c (sys_lseek): Remove a version of this function which is
        supposed to be used if off_t is long long. It appears to be buggy
        and unused.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Revert "Remove underscores from a few syscall names which have them"
        This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Simplify sys_lseek64 conditional compilation.
        It looks like sys_lseek64() is never used.
        For one, it is buggy (always shows 0 return value), and no one complains.

        From code inspection: sys_lseek64 name is not used anywhere.
        It is defined to sys_lseek if HAVE_LONG_LONG_OFF_T is true.
        Thus, if !HAVE_LONG_LONG_OFF_T, it is never used.
        Therefore "if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T"
        conditional it sits in can be simplified to
        "if HAVE_LONG_LONG_OFF_T".
        Therefore, we can move it a bit up and merge with
        "if !HAVE_LONG_LONG_OFF_T, use this sys_lseek()" code block,
        by addind an "else" clause to it.
        To simplify it more, drop define and just rename sys_lseek64 ->
        sys_lseek.

        Since the function is buggy, I think it is unused and we can
        just drop it. (I checked: at least I386 never uses it).

        * file.c (sys_lseek64): Rename to sys_lseek; don't compile it
        if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case
        it is never used.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove underscores from a few syscall names which have them.
        Affected names are "_newselect", "_llseek", "_sysctl".
        I see no apparent reason why they have leading underscores.
        Moreover, some arches have underscored names and some have
        non-underscored ones. This is not consistent.

        I verified that every architectire I touched did not have
        a similarly named syscall without underscore, thus this change
        does not introduce new ambiquities.

        I left "_exit" untouched for now, but the same points stand for it too:
        some architectures use "exit" and no one complains. So why many
        arches are using "_exit"?

        * linux/*/syscallent.h: Remove underscores from displayed
        syscall names for _newselect, _llseek, _sysctl.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove unused struct tcb::baddr field.
        * defs.h: Remove unused struct tcb::baddr field.

        Remove unused PTRACE_WRITE{TEXT,DATA} constants (they are from SunOS)
        * util.c: Remove unused PTRACE_WRITE{TEXT,DATA} constants.

        Reindent case labels. No code changes.
        * net.c (printsockopt): Reindent case labels.
        * signal.c (sys_signal): Likewise.

        Remove unused constants. No code changes.
        * syscall.c: Remove unused ENOIOCTLCMD constant. Fix indentation.
        * util.c: Remove unused CLONE_STOPPED constant.

        Move change_syscall() to its only user and make it static.
        * defs.h: Remove declaration of change_syscall().
        * process.c (change_syscall): Remove definition of this function.
        * util.c (change_syscall): Add definition of change_syscall().

        MAP_ANON is the same as MAP_ANONYMOUS, no need to have the former.
        * mem.c: Do not allocate string for MAP_ANON if it is the same as
        MAP_ANONYMOUS.

        Indentation and whitespace fixes. No code changes.

        test/threaded_execve: make it also test a case when leader is not in syscall

2012-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        Implement prlimit64 decoding, rewrite [gs]etrlimit decoding.
        * configure.ac: Remove AC_RLIM_T_IS_LONG_LONG call.
        Define SIZEOF_RLIM_T.
        * m4/long_long.m4 (AC_RLIM_T_IS_LONG_LONG): Remove.
        * linux/dummy.h (sys_prlimit64): Remove.
        * linux/syscall.h (sys_prlimit64): New prototype.
        * resource.c (resources): Reindent, add RLIMIT_RTTIME.
        (sprintrlim, print_rlimit32, sys_getrlimit, sys_setrlimit): Remove.
        [HAVE_LONG_LONG_RLIM_T]: Remove dead code.
        [_LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T]: Likewise.
        (sprint_rlim64, print_rlimit64, decode_rlimit64, sprint_rlim32,
        print_rlimit32, decode_rlimit, sys_getrlimit, sys_setrlimit,
        sys_prlimit64): New functions.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove another "interrupt to quit" message.
        * strace.c (startup_attach): Remove another "interrupt to quit" message.

        Fix "strace -oFILE -ff -p<nonexistant_pid>" behavior.
        * strace.c (newoutf): Set tcp->outf in non-ff mode too.
        (alloctcb): This define is removed.
        (alloc_tcb): Renamed to alloctcb. Does not set tcp->outf anymore.
        Lost 'command_options_parsed' flag parameter.
        (startup_attach): Do not say "interrupt to quit" in attach message -
        ^C does not work in all cases, we mislead users.
        Call newoutf(tcp) after successful attach.
        (startup_child): Call newoutf(tcp) after successful attach.
        (trace): Call newoutf(tcp) when we picked up already attached child.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Make alloc_tcb and droptcb static. No code changes.
        The change is trivial. Diff is large because it is confused
        by function definitions being moved around.

        * defs.h: Remove declarations of alloc_tcb and droptcb.
        * strace.c: Make alloc_tcb and droptcb static.
        Shuffle functions around to make compiler happy.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

        Tidy up includes and copyright notices, fix indentation.
        The files not mentioned in changelog below had only
        copyright notices fixes and indentation fixes.

        * defs.h: Include <stdint.h> and <inttypes.h>.
        * file.c: Do not include <inttypes.h>.
        Move struct kernel_dirent declaration below top include block.
        * block.c: Do not include <stdint.h> and <inttypes.h>.
        * quota.c: Likewise.
        * desc.c: Likewise.
        * signal.c: Likewise.

2012-03-16  Dmitry V. Levin  <ldv@altlinux.org>

        scsi.c: add copyright header.
        * scsi.c: This file was added back in 2007 without a copyright header.
        Add it now.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance capget and capset syscalls decoding.
        * system.c (cap_version): New xlat structure.
        (print_cap_header, print_cap_data): New functions.
        (sys_capget, sys_capset): Use them.

        Remove unused code.
        * syscall.c (subcall_style, decode_subcall): Remove.
        [SYS_socket_subcall] (decode_socket_subcall): New function, based on
        decode_subcall in deref_style.
        [SYS_ipc_subcall] (decode_ipc_subcall): New function, based on
        decode_subcall in shift_style.
        (trace_syscall_entering): Use decode_socket_subcall and
        decode_ipc_subcall instead of decode_subcall.

        Fix IPC decoding on alpha and arm.
        * ipc.c (indirect_ipccall): Return 0 on ALPHA and ARM EABI.
        (sys_shmat): Use indirect_ipccall for proper return value decoding.

        arm: fix compilation warnings.
        * configure.ac: Define SIZEOF_LONG.
        * signal.c (sys_rt_sigaction) [SUPPORTED_PERSONALITIES > 1]: Help
        compiler to optimize out unreachable code that is not expected to work
        on platforms where sizeof(long) <= 4.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        tests: robustify again buggy shells.
        * tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax
        instead of "${parameter-word}".

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

        improve ifdef check with decode_subcall.
        Use the same ifdef logic around the call sites of decode_subcall()
        to protect the definition of the func itself.  This fixes warnings
        for targets like hppa which don't use this func.

        * syscall.c (decode_subcall): Wrap in SYS_socket_subcall and
        SYS_ipc_subcall define checks.

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

        alpha: fix decode of osf_sigprocmask.
        The alpha sigprocmask syscall is special in that it comes from OSF rather
        than the style that everyone else uses.

        Tested with this simple code:
        $ cat test.c
        #include <signal.h>
        main() {
                sigset_t set, oldset;
                sigemptyset(&set);
                sigaddset(&set, SIGINT);
                sigaddset(&set, SIGHUP);
                sigprocmask(SIG_SETMASK, &set, &oldset);
                sigprocmask(SIG_UNBLOCK, &oldset, &set);
                sleep(3);
        }
        $ gcc test.c && ./strace ./a.out
        ...
        osf_sigprocmask(SIG_SETMASK, [HUP INT]) = 0 (old mask [])
        osf_sigprocmask(SIG_UNBLOCK, [])        = 0x3 (old mask [HUP INT])
        osf_sigprocmask(SIG_BLOCK, [CHLD])      = 0x3 (old mask [HUP INT])
        ...

        * linux/alpha/syscallent.h: Call sys_sigprocmask for osf_sigprocmask,
        and change number of arguments to two.
        * signal.c (sys_sigprocmask): Fix decoding of alpha osf sigprocmask.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix array size calculation in previous commit.
        * pathtrace.c (getfdpath): Fix array size calculation.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        pathtrace_select() is never called with NULL, remove dead code.
        pathtrace_select() is only called for -P FILE options,
        and FILE is never a NULL pointer.

           text    data     bss     dec     hex filename
         239453     672   19012  259137   3f441 strace.before
         239329     672   19012  259013   3f3c5 strace

        * pathtrace.c (pathtrace_select): Remove "if (path == NULL)...".
        (pathtrace_select): Remove code which only executes if path == NULL.
        The code was also buggy, it can free non-malloced pointer.
        (getfdpath): Simplify snprintf to sprintf.
        (pathmatch): Use strcmp() == 0 idiom for string equality test.
        (pathtrace_match): Likewise.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        manpage: remove bugs which are fixed.
        "A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x.
        "A traced process which tries to block SIGTRAP will be sent a SIGSTOP
        in an attempt to force continuation of tracing." - not needed
        and no longer done.
        "On Linux, exciting as it would be, tracing the init process is forbidden"
        - not true anymore.
        "When a traced process receives a SIGTRAP signal not
        associated with tracing, strace will not report that signal correctly."
        - not true anymore.

        Simplify SIGCHLD handler setting.
        * strace.c (init): Set SIGCHLD to SIG_DFL earlier.
        (startup_child): Do not bother restoring SIGCHLD handler.

        When reporting signals, use short signal names (SIGfoo) instead of strerror
        * defs.h: Remove strsignal declaration.
        * signal.c: Better check for SI_FROMUSER define.
        * strace.c (strerror): Remove this function.
        (trace): Use short signal names (SIGfoo) instead of strerror.

        Remove TODO file: it's eleven years old and completely outdated.

        Clean up defs.h order. No code changes.
        * defs.h: Group together related declarations. No code changes.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix lame kernel version checking code.
        The code "os_release[0] >= '3'" is not good for any
        finer-grained checks such as "kernel >= 3.2.1".
        Let's proactively fix it.

        * strace.c: Change os_release from string to integer.
        (get_os_release): Parse uname.release to KERNEL_VERSION
        representation.
        (init): Convert kernel version check to KERNEL_VERSION.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Experimental support for "detach on execve" feature.
        * strace.c: Define new detach_on_execve, skip_startup_execve bool variables.
        (init): Set detach_on_execve on -b, set skip_startup_execve if
        "strace PROG" form is used.
        (trace): Detach from process if -b and we see PTRACE_EVENT_EXEC event.

        Simple fixes.
        * strace.c (usage): Document -d; document that -F is deprecated.
        (droptcb): Print "<detached ...>" correctly for non-ff mode too.
        (detach): Suppress a warning.

        Remove an outdated comment.
        * defs.h: Remove an outdated comment.

        Remove extra include directives. No code changes.
        * defs.h: Include <signal.h> unconditionally.
        Other files were doing it unconditionally, so no harm done.
        * bjm.c: Remove system includes which are already included by defs.h.
        * pathtrace.c: Likewise.
        * process.c: Likewise.
        * signal.c: Likewise.
        * strace.c: Likewise.
        * stream.c: Likewise.
        * syscall.c: Likewise.
        * system.c: Likewise.
        * util.c: Likewise.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

        Tidy up order of includes; make bool variables explicit.
        Bool variables are more compact in data and (on x86) on code too:

           text    data     bss     dec     hex filename
         237950     676   19044  257670   3ee86 strace.before
         237838     676   19012  257526   3edf6 strace

        * defs.h: Group library includes at the top of the file.
        Rename dtime to Tflag, debug to debug_flag.
        Change debug_flag,Tflag,qflag,not_failing_only,show_fd_path,tracing_paths
        variable declarations from int to bool.
        * strace.c: Change corresponding definitions. Do the same for static
        variables iflag,rflag,print_pid_pfx.
        Rename dtime to Tflag, debug to debug_flag.
        * syscall.c: Rename dtime to Tflag, debug to debug_flag.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        Fix compiler warnings about breaking strict-aliasing rules.
        * system.c (sys_capget, sys_capset): Use proxy unions to cast long*
        pointers to cap_user_header_t and cap_user_data_t pointers without
        breaking strict-aliasing rules.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

        ppc64: drop unused pid variable.
        * syscall.c (get_scno) [POWERPC64]: Delete unused pid variable.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        ia64: fix compilation warnings.
        * linux/ia64/syscallent.h: Remove improper defines and undefs.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        Ensure that SWAP_FLAG_* constants are defined.
        * file.c: Define those of SWAP_FLAG_* constants which are not yet
        provided by <sys/swap.h>.

        Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance *listxattr syscalls decoding.
        * file.c (print_xattr_list): New function.
        (sys_listxattr, sys_flistxattr): Use it.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix *at syscalls flags decoding.
        Several *at decoders were defining own incomplete *atflags xlat
        structures.  That was error prone, and fchownat decoder actually
        failed to recognize AT_EMPTY_PATH.  Merging these incomplete
        structures into the single at_flags xlat structure will fix
        flags handling in all these decoders altogether.

        * file.c: Define all AT_* constants used by *at decoders.
        (at_flags): New xlat structure, with records for all AT_* constants.
        (fstatatflags, linkat_flags, unlinkatflags): Remove.
        (sys_newfstatat, sys_linkat, sys_unlinkat, sys_fchownat,
        sys_utimensat):  Use at_flags.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        Fix linkat flags decoding.
        * file.c (linkat_flags): New xlat structure.
        (sys_linkat): Decode flags using linkat_flags.

        Implement sys_rt_tgsigqueueinfo syscall decoder.
        * linux/dummy.h (sys_rt_tgsigqueueinfo): Remove.
        * linux/syscall.h (sys_rt_tgsigqueueinfo): New prototype.
        * signal.c (print_sigqueueinfo): New function, based on
        sys_rt_sigqueueinfo.
        (sys_rt_sigqueueinfo): Use print_sigqueueinfo.
        (sys_rt_tgsigqueueinfo): New function.

        Implement syslog syscall decoder.
        * linux/dummy.h (sys_syslog): Remove.
        * linux/syscall.h (sys_syslog): New prototype.
        * system.c (syslog_action_type): New xlat structure.
        (sys_syslog): New function.

2012-03-13  Denys Vlasenko  <vda.linux@googlemail.com>

        Less ugly debug display of ptrace events.
        * strace.c (trace): Less ugly debug display of ptrace events.

        Make manpage mention that -p "`pidof PROG`" works.

2012-03-13  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix logging for "strace -o FILE -ff test/threaded_execve" test case.
        Our logic which was deciding whether to print "<unfinished ...>"
        thingy wasn't working properly for -ff case.

        * defs.h: Group log generation-related declarations together.
        Add a large comment which explains how it works.
        Add declaration of line_ended() function.
        * strace.c (line_ended): New function which sets up internal data
        to indicate that previous line was finished.
        (printleader): Change logic to fix log generation in -ff mode.
        (newoutf): Make check for -ff mode consistent with other places.
        (droptcb): Print "<detached ...>" if last line for this tcp wasn't finished.
        (cleanup): Remove code to print "<unfinished ...>", printleader()
        or detach() will do it instead.
        (trace): Remove code to print "<unfinished ...>".
        Add code which finishes threaded execve's incomplete line
        with " <pid changed to PID ...>" message. Replace printing_tcp = NULL
        followed by fflush() by line_ended() call.
        * process.c (sys_exit): Call line_ended() to indicate that we finished priting.
        * syscall.c (trace_syscall_exiting): Set printing_tcp to current tcp.
        Call line_ended() to indicate that we finished priting.
        Remove call to fflush(), it is done by line_ended() now.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

        net.c: recognize MSG_WAITFORONE.
        * net.c (msg_flags): Add MSG_WAITFORONE.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Treat -ff without -o FILE as single -f.
        * strace.c (init): Treat -ff without -o FILE as single -f.

        Style fix. No code changes.
        * strace.c (process_opt_p_list): Style fix.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Reduce stack usage by ~0.5k.
        main() uses ~0.5k of stack for local variables and such. When we enter
        main tracing loop, most of these variables are no longer used.
        But they still take up stack for the entire life of strace.
        We can avoid this wastage if we move init code into a separate function.
        (Need to be careful and not allow automatic inlining).

        * strace.c (init): New function. Most of pre-existing code of
        main is now living here.
        (main): Call init() to do initialization.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

        Preparatory cosmetic changes for the next commit.
        * strace.c (tprintf): Move function up in the source file. No code changes.
        (tprints): Likewise.
        (printleader): Likewise.
        (tabto): Likewise.

2012-03-11  Dmitry V. Levin  <ldv@altlinux.org>

        Implement sendmmsg syscall decoder.
        * linux/dummy.h (sys_sendmmsg): Remove.
        * linux/syscall.h (sys_sendmmsg): New prototype.
        * net.c (printmmsghdr): Add index argument specifying the element in
        mmsghdr array to print.
        (decode_mmsg): New function, prints the whole mmsghdr array, its length
        and message flags.
        (sys_sendmmsg): New function.
        (sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding.

        Implement sched_rr_get_interval syscall decoder.
        * linux/dummy.h (sys_sched_rr_get_interval): Remove.
        * linux/syscall.h (sys_sched_rr_get_interval): New prototype.
        * process.c (sys_sched_rr_get_interval): New function.

        Implement migrate_pages syscall decoder.
        * linux/dummy.h (sys_migrate_pages): Remove.
        * linux/syscall.h (sys_migrate_pages): New prototype.
        * mem.c (sys_migrate_pages): New function.

        Implement get_robust_list syscall decoder.
        * linux/dummy.h (sys_get_robust_list): Remove.
        * linux/syscall.h (sys_get_robust_list): New prototype.
        * process.c (sys_get_robust_list): New function.

        Define sys_set_robust_list as an alias to sys_munmap.
        * linux/dummy.h (sys_set_robust_list): Redefine to sys_munmap.

        Implement clock_adjtime syscall decoder.
        * linux/dummy.h (sys_clock_adjtime): Remove.
        * linux/syscall.h (sys_clock_adjtime): New prototype.
        * time.c (do_adjtimex): New function, based on sys_adjtimex.
        (sys_adjtimex): Use it.
        (sys_clock_adjtime): New function.

        Define sys_setns as an alias to sys_inotify_rm_watch.
        * linux/dummy.h (sys_setns): Redefine to sys_inotify_rm_watch.

        Sort definitions of dummy parsers.  No code changes.
        * linux/dummy.h: Sort definitions of parsers implemented as aliases.

        Correct inotify_rm_watch decoder.
        * file.c (sys_inotify_rm_watch): Print second argument as int.

        Alias sys_fsync to sys_close.
        * file.c (sys_fsync): Remove.
        * linux/syscall.h (sys_fsync): Likewise.
        * linux/dummy.h (sys_fsync): Alias to sys_close.
        * linux/m68k/syscallent.h: Add TD flag to fsync entry.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.

2012-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        Update ioctl entries.
        * linux/ioctlent.h.in: Regenerate from v3.3 headers.
        * linux/i386/ioctlent.h.in: Likewise.

        strace-log-merge: cleanup.
        * strace-log-merge: Redirect usage to stderr, make the check
        for numeric suffix simpler.

        Add syscall entries for new linux syscalls.
        * linux/i386/syscallent.h: Update process_vm_writev handler.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Add entries for accept4 and sendmmsg.
        * linux/arm/syscallent.h: Add entries for process_vm_readv and
        process_vm_writev.
        * linux/m68k/syscallent.h: Likewise.
        * linux/mips/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/ia64/syscallent.h: Add entries for process_vm_readv,
        process_vm_writev and accept4.
        * linux/microblaze/syscallent.h: Add entries for sendmmsg,
        process_vm_readv and process_vm_writev.

        Implement process_vm_writev decoder.
        * process.c (sys_process_vm_writev): New function.
        * linux/syscall.h (sys_process_vm_writev): New prototype.

        Output iovec length in vmsplice and process_vm_readv decoders.
        * io.c (sys_vmsplice): Output iovec length.
        * process.c (sys_process_vm_readv): Likewise.

2012-03-09  Dmitry V. Levin  <ldv@altlinux.org>

        swapon: decode swap flags.
        * file.c: Include <sys/swap.h>.
        (swap_flags): New xlat structure.
        (sys_swapon): New function.
        * linux/dummy.h (sys_swapon): Remove.
        * linux/syscall.h (sys_swapon): New declaration.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial simplification.
        * strace.c (detach): Use waitpid instead of wait4.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Don't consider PROG to be our child in "strace -D PROG" case.
        TCB_STRACE_CHILD is used for the case when "strace PROG" is ^C-ed
        or something like that. strace should not just exit - it should
        do something with its child (such as signal it too).

        In -D case, PROG is not really a child of _strace_, it is a child
        of strace's parent. It's ok to handle it exactly as an attached process.

        While we are at it, remove nonsensical special-casing of TCB_STRACE_CHILD
        in printing of "<unfinished ...>" message.

        * strace.c (startup_attach): Don't set TCB_STRACE_CHILD if -D.
        (trace): Print "<unfinished ...>" on error regardless of TCB_STRACE_CHILD.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix the case where we try to detach unattached processes.
        Before this change:
        $ strace -D -p1
        strace: -D and -p are mutually exclusive options
        Process 1 detached  <==== WRONG! (and we try to SIGSTOP it!!!)

        * defs.h: Change the meaning of TCB_ATTACHED: now it means "this tracee
        is attached to us". Add TCB_STRACE_CHILD: "this tracee is our child".
        * strace.c (kill_save_errno): Move up. No code changes.
        (process_opt_p_list): Don't set TCB_ATTACHED on new tcb.
        (startup_attach): Change how we work with TCB_ATTACHED.
        Set TCB_STRACE_CHILD on -D.
        (startup_child): Use kill_save_errno instead of kill.
        Set TCB_ATTACHED and TCB_STRACE_CHILD on attached strace child.
        If we are in -D case, don't set TCB_ATTACHED (we aren't attached yet).
        (detach): do not do PTRACE_DETACH if TCB_ATTACHED is not set.
        (cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED.
        (trace): Likewise.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Call PTRACE_CONT with addr=0.
        * strace.c (trace): Call PTRACE_CONT with addr=0.

        install strace-log-merge by "make install"

        strace_log_merge: new file. Helper to merge timestamped strace -ff logs.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case.
        In this case we were printing PIDs to LOG.* files
        even though it is not necessary.

        The fix is in the addition of "&& followfork < 2" condition.

        * strace.c: Remove pflag_seen variable, add print_pid_pfx one.
        (process_opt_p_list): Do not pflag_seen++.
        (main): Use "nprocs != 0" condition instead of "pflag_seen != 0".
        Set print_pid_pfx before entering main tracing loop.
        (printleader): Use print_pid_pfx to decide whether to print pid prefix.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

        Allow -p PID to take comma or whitespace-separated list of PIDs.
        * defs.h: Clarify meaning of TCB_ATTACHED. No code changes.
        * strace.c (process_opt_p_list): New function.
        (main): Call process_opt_p_list to process -p PIDs argument.

2012-03-08  Denys Vlasenko  <vda.linux@googlemail.com>

        Pass addr=0 instead of 1 into restarting ptrace calls.
        While we are at it, fold do_ptrace into its lone caller.
        We no longer set tcp->ptrace_errno = ESRCH on ESRC error in upeek.
        Other code paths where ptrace fails wern't doing it, and the code which
        checks tcp->ptrace_errno even assumes it is never set to ESRCH.
        (It was me who added this code sometime ago, so it was my fault
        that it was a bit messy)

        I ran sigkill_rain test and verified that unfinished syscalls are
        still handled correctly.

        * util.c (ptrace_restart): Do not pass addr=1 to ptrace(), pass 0 instead.
        I have no idea why we were passing 1. Ptrace documentation says
        that addr parameter is ignored.
        (do_ptrace): Remove this function.
        (upeek): Use ptrace() instead of do_ptrace().
        * defs.h: Remove do_ptrace() declaration.

2012-03-08  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial tweaks to error messages.
        * strace.c (test_ptrace_setoptions_followfork): Use kill_save_errno
        instead of kill.
        (trace): Use perror_msg instead of perror.
        * count.c (set_sortby): Use error_msg_and_die instead of fprintf.
        * syscall.c (qualify): Likewise.
        * util.c (ptrace_restart): Expand error message.
        (umoven): Likewise.
        (umovestr): Likewise.
        (upeek): Use perror_msg instead of sprintf + perror.

2012-02-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove stray sys_swapon() declaration.
        * linux/syscall.h: Remove stray sys_swapon() declaration.
        * linux/mips/syscallent.h: Include dummy.h with correct relative path.
        * linux/dummy.h: Tweak one place where spaces are used instead of tabs.
        * linux/dummy_check.sh: New script. It helps in finding stray syscall
        handler declarations.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Correct syscall entries for t[g]kill.
        * linux/hppa/syscallent.h: Make tgkill use sys_tgkill, not printargs.
        * linux/sh/syscallent.h: Change tkill type TD -> TS.
        * linux/sh64/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Change tkill type 0 -> TS.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Assorted trivial optimizations.
           text    data     bss     dec     hex filename
         236448     672   19044  256164   3e8a4 strace.before
         236360     672   19044  256076   3e84c strace

        * file.c (sprintmode): Use smaller static buffer, eliminate strlen call.
        (sprinttime): Use smaller static buffer.
        (printstat_sparc64): Coalesce two printing calls into one.
        (printstat_powerpc32): Likewise.
        (printcompat_statfs6): Likewise.
        (sys_utime): Do not fetch personality_wordsize[current_personality]
        repeatedly - cache it in local variable instead.
        * process.c (printargv): Likewise.
        * resource.c (sprintrlim): Return const char*, not char*. This allows
        to eliminate sprintf(buf, "RLIM_INFINITY"). Use smaller static buffer.
        (sprintrlim64): Likewise.
        * strace.c (strerror): Use smaller static buffer.
        (strsignal): Likewise.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Alias a few more syscall printing functions.
           text    data     bss     dec     hex filename
         237384     672   19044  257100   3ec4c strace.before
         236448     672   19044  256164   3e8a4 strace

        * defs.h: Declare new functions printargs_lu(), printargs_ld()
        which simply print syscall all args as unsigned or signed longs.
        * desc.c (sys_epoll_create): Call printargs_ld() instead of open-coding it.
        * linux/syscall.h: Remove declarations of the following functions:
        sys_alarm, sys_getresgid, sys_getsid, sys_nice, sys_setgid, sys_setpgid,
        sys_setpgrp, sys_setregid, sys_setresgid.
        * process.c (sys_setgid): Delete this function: now aliased to sys_setuid().
        (sys_getresgid): Delete this function: now aliased to sys_getresuid().
        (sys_setregid): Delete this function: now aliased to sys_setreuid().
        (sys_setresgid): Delete this function: now aliased to sys_setresuid().
        (sys_setpgrp): Delete this function: now aliased to printargs_lu().
        (sys_getsid): Likewise.
        (sys_setpgid): Likewise.
        (sys_alarm): Likewise.
        (sys_getpgrp): Delete this function: was unused - was already shadowed
        by a define in linux/dummy.h.
        (sys_setsid): Likewise.
        (sys_getpgid): Likewise.
        * resource.c (sys_nice): Delete this function: now aliased to printargs_ld().
        * linux/dummy.h: Define new aliases (see above for the list).
        * syscall.c (printargs_lu): New function.
        (printargs_ld): New function.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Style fixes, no code changes.
        * desc.c (sys_io_getevents): Indentation fix.
        * file.c (sys_xstat): Remove space after function name.
        (decode_mknod): Indentation fix.
        * net.c (printsockopt): Indentation fix.
        * process.c (unalignctl_string): Indentation fix.
        (sys_sched_getscheduler): Remove space after ! operator.

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        Compress blank lines.
        Suppress repeated empty lines left after automated code removal.
        This change was made by filtering every source code file through
        "cat -s".

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        Remove parts of automake machinery which are not needed on Linux.
        This change is a verbatim part of Dmitry's changes to remove support
        for non-Linux architectures.

        * Makefile.am: Don't install PORTING file. Install README-linux-ptrace file.
        Set OS variable to linux unconditionally.
        * configure.ac: Remove code to set opsys variable, and its usage.
        Remove checks for headers which are never present on Linux.
        * m4/stat.m4: Remove 'ifdef LINUX' check.
        * m4/statfs.m4: Likewise.

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        Remove and update documentation.
        This change is a verbatim part of Dmitry's changes to remove support
        for non-Linux architectures.

        * PORTING: Deleted.
        * INSTALL: Modified.
        * README: Modified.
        * strace.1: Modified: bugs should be reported to mailing list, not Debian.
        * strace.spec: do not install PORTING file.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

        Remove a few more code parts which are unused on Linux.
        This change is abapted from Dmitry's changes to remove support for
        non-Linux architectures.

        * Makefile.am: Remove if LINUX/endif pairs.
        * defs.h: Remove stream_ioctl() declaration.
        * ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block.
        * resource.c: Use 'defined(FOO)' instead of 'defined FOO' form.
        * util.c: Likewise.
        * signal.c: Remove conditional includes which are never used on Linux.
        * stream.c: Likewise.
        * file.c: Remove excessive empty lines.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

        Build fixes after non-Linux code removal.
        * configure.ac: Remove calls to proc-based ptrace checks.
        * proc.c: Remove, it's empty now.
        * Makefile.am: Remove reference to proc.c.
        * net.c: Remove trailing newlines.
        * quota.c: Likewise
        * resource.c: Likewise
        * strace.c: Likewise
        * stream.c: Likewise
        * time.c: Likewise

        Fix defined(FOO) style.
        * file.c: Consistently use defined(FOO) instead of defined (FOO).
        * mem.c: Likewise.
        * net.c: Likewise.
        * signal.c: Likewise.
        * sock.c: Likewise.
        * linux/mips/syscallent.h: Likewise.

        Reindent preprocessor directives in util.c; fix style.
        * util.c: Fix indentation of preprocessor directives broken by
        automatic removal of non-Linux code. Fix style to use consistent
        defined(FOO) instead of defined (FOO).

        Reindent preprocessor directives in syscall.c; fix style.
        * syscall.c: Fix indentation of preprocessor directives broken by
        automatic removal of non-Linux code. Fix style to use consistent
        defined(FOO) instead of defined (FOO).

        Reindent defs.h preprocessor directives.
        * defs.h: Fix indentation of preprocessor directives broken by
        automatic removal of non-Linux code.

        Cleanup after non-Linux code removal.
        Conditions such as defined(LINUX) are always true now,
        defined(FREEBSD) etc are always false.
        When if directive has them as subexpressions, it can be simplified.
        Another trivial changes here are fixes for directive indentation.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

        Manual removal of non-Linux source, documentation, etc.
        Remove non-Linux source directories: freebsd/, svr4/, sunos4/, svr4/.
        Remove README-freebsd, README-sunos4, README-svr4, m4/procfs.m4.

        linux/sparc/{errnoent1,ioctlent1,signalent1}.h used to point to svr4/ files -
        replace their contents with copies of used (and now deleted) files.
        Make linux/sparc64/{errnoent1,ioctlent1,signalent1}.h include these files
        instead of svr4/* ones.

        Makefile.am: remove references to deleted files.
        configure.ac: Remove a few tests which make no sense on Linux.
        Man page: remove non-Linux quirks information.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

        Automated removal of non-Linux code.
        This change is generated by running every source through the following command:

        unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD
        -USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS
        -UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c

2012-02-24  Denys Vlasenko  <vda.linux@googlemail.com>

        When accessing data blocks, truncate addr to wordsize.
        * util.c (umoven): Truncate addr to wordsize before use.

2012-02-22  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix a typo.
        * strace.1: Fix a typo in example description.
        This fixes Debian bug #653309.

        Fix sockaddr_un.sun_path name in decoded output.
        * net.c (printsock): Show sockaddr_un.sun_path as "sun_path".
        This fixes Debian bug #554946.

        Avoid potential core file clobbering on exit.
        * strace.c (main): Set RLIMIT_CORE to zero before terminating itself
        with a deadly signal.
        This fixes Debian bug #656398.

2012-02-20  Dmitry V. Levin  <ldv@altlinux.org>

        Eliminate native_scno and known_scno.
        * defs.h (known_scno): Remove.
        (sysent): Remove native_scno field.
        * process.c [IA64]: Replace known_scno(tcp) with tcp->scno.
        (internal_fork) [USE_PROCFS || !LINUX]: Likewise.
        * syscall.c: Do not define NR_SYSCALL_BASE.
        (known_scno): Remove.
        (syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp)
        with tcp->scno.
        (trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise.
        (syscall_fixup_on_sysexit) [SUNOS4]: Likewise.

        Remove initialization of native_scno field.
        * linux/i386/syscallent.h: Remove native_scno initialization for clone,
        fork and vfork.
        * linux/ia64/syscallent.h (sys_fork, sys_vfork): Remove redirections
        to printargs.
        * linux/syscall.h [IA64]: Do not define SYS_fork and SYS_vfork.
        * util.c (printcall) [IA64]: Likewise.
        (setbpt): Use sys_func to check for clone, fork and vfork syscalls.

        Do not use SYS_ipc and SYS_socketcall.
        * linux/dummy.h (sys_ipc, sys_socketcall): Remove redirections to
        printargs.
        * linux/ia64/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Remove native_scno initialization for "ipc"
        and "socketcall".
        * linux/syscall.h (sys_ipc, sys_socketcall): New prototypes.
        (SYS_ipc, SYS_socketcall): Remove no longer used constants.
        [IA64]: Remove undefining of ipc and socket SYS_* constants.
        [SPARC || SPARC64]: Remove unused ipc SYS_* constants.
        * ipc.c (sys_ipc): New function.
        * sock.c (sys_socketcall): Likewise.
        * syscall.c (trace_syscall_entering): Use sys_func to check for ipc and
        socket subcalls.

2012-02-20  Dmitry V. Levin  <ldv@altlinux.org>

        Remove initialization of native_scno field for most of syscalls.
        The native_scno field is not so much used in the code than before.
        In many cases sys_func is checked instead, and for most of syscall
        entries there is no need to initialize native_scno.

        * linux/i386/syscallent.h: Remove native_scno initialization for
        _exit, read, write, waitpid, execve, wait4, sysfs, readv, writev,
        pread64, pwrite64, exit_group, waitid, send, recv, sendto and
        recvfrom syscall entries.
        * linux/syscall.h: Do not define no longer used SYS_waitid and
        SYS_sub_* constants.
        [IA64]: Do not define SYS_waitpid and SYS32_* constants.
        * defs.h: Do not define no longer used  __NR_exit_group constant.
        * strace.c [USE_PROCFS] (proc_open): Use sys_func to check for execve.

2012-02-14  Mike Frysinger  <vapier@gentoo.org>

        util: check for process_vm_readv in C library.
        glibc-2.15 provides process_vm_readv, so trying to provide it ourselves
        with that version fails.

        * configure.ac (AC_CHECK_FUNCS): Add process_vm_readv.
        * util.c: Handle HAVE_PROCESS_VM_READV.

2012-02-09  Denys Vlasenko  <vda.linux@googlemail.com>

        README-linux-ptrace: correct the description of suppressed signals.

2012-02-06  Dmitry V. Levin  <ldv@altlinux.org>

        strace -P: fix handling of invalid syscalls.
        * pathtrace.c (pathtrace_match): Check the given syscall number using
        SCNO_IN_RANGE.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Skip the syscall entry if the sys_func field is NULL.
        Avoid NULL dereference when there are holes in sysent tables.
        It can happen with syscall (number, ...) and number is in those holes.
        There are no targets with holey systent tables so far, but at least
        one such a target, x32, is already on the horizon.

        * defs.h (SCNO_IN_RANGE): Also check the sys_func field.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Define RLIM64_INFINITY only if not defined.
        * resource.c (RLIM64_INFINITY): Define only if it isn't defined.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Cast to long for %l in printf.
        Cast a value to long for %l in printf to avoid compiler warning
        on systems where it may be long long.

        * count.c (call_summary_pers): Cast to long.
        * ipc.c (sys_mq_open, printmqattr): Likewise.
        * quota.c (decode_cmd_data): Likewise.
        * resource.c (sys_sysinfo): Likewise.
        * time.c (tprint_timex): Likewise.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Check HAVE_LONG_LONG_OFF_T when printing offset.
        When HAVE_LONG_LONG_OFF_T is defined, we need to use %llu to print
        offset.

        * io.c (sys_sendfile): Check HAVE_LONG_LONG_OFF_T when printing
        offset.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Define old stat functions only if needed.
        When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't
        used and strace won't link since they use realprintstat which isn't
        defined when HAVE_LONG_LONG_OFF_T is defined.

        * file.c (convertoldstat, sys_oldstat, sys_oldfstat, sys_oldlstat):
        Define only if HAVE_LONG_LONG_OFF_T isn't defined.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Print NULL for zero address in sys_mmap64.
        * mem.c (sys_mmap64): Print NULL for zero address so that it is
        consistent with sys_mmap.

2012-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unused sys_pread64 and sys_pwrite64 parsers on Linux.
        * io.c [HAVE_LONG_LONG_OFF_T]: Remove sys_pread64 and sys_pwrite64
        aliases.
        (sys_pread64, sys_pwrite64): Define these functions only on
        [SVR4 && _LFS64_LARGEFILE] platform.
        * linux/mips/syscallent.h: Use sys_pread and sys_pwrite to handle
        appropriate syscalls.
        * linux/syscall.h (sys_pread64, sys_pwrite64): Remove.
        * syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only on
        [SVR4 && _LFS64_LARGEFILE] platform.

2012-02-03  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial changes to help text. No code changes.
        * strace.c (usage): Tweak help text: remove unpaired closing brackets,
        make -V and -h sit on separate lines (hard to see them otherwise).

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Simple optimizations.
           text    data     bss     dec     hex filename
         239474     672   20484  260630   3fa16 strace.before
         239234     668   19044  258946   3f382 strace

        * file.c (sprint_open_modes): Reduce static buffer size.
        Simplify separator printing.
        * signal.c (sprintsigmask): Reduce static buffer size.
        Simplify separator printing and printing of almost full masks.
        Use stpcpy instead of sprintf and strcpy+strlen.
        * strace.c (startup_child): Don't strchr() for ':' twice in a row.
        * util.c (sprintflags): Exit loop early if possible.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial optimization.
        * strace.c (cleanup): Read 'interrupted' volatile variable only once.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Make interactive-ness directly controllable via command line option.
        Defaults are often ok, but when they are not, people get confused.
        "Why can't I kill strace?" and "Why strace dies on ^C when I want
        to _tracee_ to die instead?" are typical complaints.

        * strace.c: Replace 'interactive' variable with 'opt_intr' variable.
        Define INTR_foo constants for its possible values.
        Define 'interactive' as a macro.
        (usage): Document -I n option.
        (main): Parse -I n option, modify signal handling to accomidate new
        -I 1 and -I 4 modes.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Suppress compiler warning.
        * strace.c (trace): Frame potentially unused label with ifdef/endif.

        On Ctrl-C induced detach, send SIGINT to child tracee, not SIGTERM.
        * strace.c (interrupt): Remember signal number.
        (cleanup): If we exiting due to signal, send that signal to child tracee.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

        Add experimental code to use PTRACE_SEIZE, disabled by default.
        All new code is predicated on "ifdef USE_SEIZE". If it is not defined,
        behavior is not changed.

        If USE_SEIZE is enabled and run-time check shows that PTRACE_SEIZE works, then:
        - All attaching is done with PTRACE_SEIZE + PTRACE_INTERRUPT.
          This means that we no longer generate (and possibly race with) SIGSTOP.
        - PTRACE_EVENT_STOP will be generated if tracee is group-stopped.
          When we detect it, we issue PTRACE_LISTEN instead of PTRACE_SYSCALL.
          This leaves tracee stopped. This fixes the inability to SIGSTOP or ^Z
          a straced process.

        * defs.h: Add commented-out "define USE_SEIZE 1" and define PTRACE_SEIZE
        and related constants.
        * strace.c: New variable post_attach_sigstop shows whether we age going
        to expect SIGSTOP on attach (IOW: are we going to use PTRACE_SEIZE).
        (ptrace_attach_or_seize): New function. Uses PTRACE_ATTACH or
        PTRACE_SEIZE + PTRACE_INTERRUPT to attach to given pid.
        (startup_attach): Use ptrace_attach_or_seize() instead of ptrace(PTRACE_ATTACH).
        (startup_child): Conditionally use alternative attach method using PTRACE_SEIZE.
        (test_ptrace_setoptions_followfork): More robust parameters to PTRACE_TRACEME.
        (test_ptrace_seize): New function to test whether PTRACE_SEIZE works.
        (main): Call test_ptrace_seize() while initializing.
        (trace): If PTRACE_EVENT_STOP is seen, restart using PTRACE_LISTEN in order
        to not let tracee run.
        * process.c: Decode PTRACE_SEIZE, PTRACE_INTERRUPT, PTRACE_LISTEN.
        * util.c (ptrace_restart): Add "LISTEN" to a possible error message.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

        process_vm_readv gets EINVAL if process is gone (SIGKILLed). Don't complain.
        * util.c (umoven): Don't complain on EINVAL from process_vm_readv.
        (umovestr): Likewise.

        Revert last change. Add a comment to prevent further misunderstanding.
        * time.c (sys_nanosleep): Display remaining time only on interrupt.

        Fix nanosleep decoding: second argument was not shown after success.
        * time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check.
        * syscall.c (is_restart_error): Remove redundant check.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks.
        Currently, we use PTRACE_PEEKDATA to read things like filenames and
        data passed by I/O syscalls.
        PTRACE_PEEKDATA gets one word per syscall. This is VERY expensive.
        For example, in order to print fstat syscall, we need to perform
        more than twenty trips into kernel to fetch one struct stat!

        Kernel 3.2 got a new syscall, process_vm_readv(), which can be used to
        copy data blocks out of process' address space.

        This change uses it in umoven() and umovestr() functions if possible,
        with fallback to old method if process_vm_readv() fails.
        If it returns ENOSYS, we don't try to use it anymore, eliminating
        overhead of trying it on older kernels.

        Result of "time strace -oLOG ls -l /usr/lib >/dev/null":
        before patch: 0.372s
        After patch:  0.262s

        * util.c (process_vm_readv): Wrapper to call process_vm_readv syscall.
        (umoven): Use process_vm_readv for block reads of tracee memory.
        (umovestr): Likewise.
        * linux/syscall.h: Declare new function sys_process_vm_readv.
        * process.c (sys_process_vm_readv): Decoder for new syscall.
        * linux/i386/syscallent.h: Add process_vm_readv, process_vm_writev syscalls.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix a case of broken output if last seen syscall was exit.
        * defs.h: Rename tcp_last to printing_tcp. Explain what it means.
        Remove printtrailer() function.
        * process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL".
        * strace.c: Add new variable printing_tcp.
        (cleanup): Convert printtrailer() call to "printing_tcp = NULL".
        (trace): Likewise.
        (trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit.
        (printleader): Set printing_tcp.
        (printtrailer): Remove this function.
        * syscall.c: Remove tcp_last variable.
        (trace_syscall_entering): Don't set printing_tcp, printleader call now does it.
        (trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL".

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix handling of test/threaded_execve.c testcase.
        Since 3.0, Linux has a way to identify which thread execve'ed.
        This patch makes use of it in order to properly dispose
        of disappeared ("superseded") thread leader,
        and replace it with execve'ed thread.

        Before this patch, strace was "leaking" thread which exec'ed.
        It was thinking that it still runs. It would look like this:

        18460 pause( <unfinished ...>     <=== thread leader
        18466 execve("/proc/self/exe", ["exe", "exe"], [/* 47 vars */] <unfinished ...>
        18465 +++ exited with 0 +++       <=== exits from other threads
        18460 <... pause resumed> )             = 0

        The last line is wrong: it's not pause resumed, it's execve resumed.
        If thread leader would do exit instead of pause, it is much worse:
        strace panics because it thinks it sees return from exit syscall!

        And strace isn't aware 18466 (exec'ed thread) is gone.
        It still thinks it's executes execve syscall.

        * strace.c: New variable "static char *os_release".
        (get_os_release): New static function.
        (main): Call get_os_release to retrieve Linux version.
        (trace): If we see PTRACE_EVENT_EXEC, retrieve old pid, and if it
        differs from new one, free one of tcbs and print correct messages.

2012-01-27  Denys Vlasenko  <vda.linux@googlemail.com>

        Fix readlink result display - was printing bogus "..." semi-randomly.
        * file.c (decode_readlink): Use printstr() instead of printpathn().

        Add new test program: test/threaded_execve.c.

        Make pid2tcb static.
        * defs.h: Remove pid2tcb declaration.
        * strace.c (pid2tcb): Make this function static.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

        Per Dmitry's request, remove paranoid check in verror_msg()
        * strace.c (verror_msg): Remove redundant check for msg != NULL.

        More robust error check for vasprintf.
        * strace.c (verror_msg): More robust error check for vasprintf.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

        Slightly more compact handling of argv[]
           text    data     bss     dec     hex filename
         238274     672   20484  259430   3f566 strace.before
         238226     672   20484  259382   3f536 strace

        * strace.c (main): Slightly more compact handling of argv[]

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

        Trivial optimization.
        * strace.c: Set default interactive = 1 statically instead
        of doing it in main().

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

        Allocate -o OUTFILE buffer only if needed.
           text    data     bss     dec     hex filename
         238258     668   28676  267602   41552 strace.before
         238274     668   20484  259426   3f562 strace

        * strace.c (main): Allocate -o OUTFILE buffer only if needed:
        unused buffer in bss is not entirely free.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

        Use single fprintf in verror_msg()
        This change partially reverts commit 44d0532.

        In code before commit 44d0532, single fprintf was used on purpose:
        we want to send entire message as one write() call. Since stderr
        is unbuffered, separate fprintf's to it always result in separate
        writes, they are not coalesced. If we aren't the only program
        which writes to this particular stderr, this may result
        in interleaved messages.

        Since this function is not performance critical, I guess
        it's ok to make it less efficient.

        * strace.c (verror_msg): Attempt to print the message in single
        write operation. Use separate fprintfs as a fallback if malloc fails.

2012-01-21  Denys Vlasenko  <vda.linux@googlemail.com>

        Improve code readability (logic is unchanged)
        * util.c (umoven): Move assignment out of function call. Make assignment
        to a flag variable later, closer to the place where it will be used.
        (umovestr): Likewise.
        (uload): Likewise.

2012-01-20  Denys Vlasenko  <vda.linux@googlemail.com>

        Change umovestr API: return > 0 instead of 0 if NUL was seen.
        * pathtrace.c (upathmatch): Adjust umovestr return value check for new API.
        * util.c (printpathn): Use umovestr() > 0 return value for more efficient
        (and robust - we don't depend on "no overwrote past NUL" behavior anymore)
        handling of terminating NUL.
        (printstr): Remove useless NUL placement before umovestr() call.
        Allocate 1 byte more to outstr[] array - for NUL.
        (umovestr): Change to return 1 if NUL was seen.

        umovestr result may have no NUL, use "%.*s" instead of "%s" to print it.
        * system.c (sys_mount): Be careful when printing umovestr result,
        it may have no terminating NUL.
        (sys_sysmips): Likewise.

2012-01-20  Denys Vlasenko  <vda.linux@googlemail.com>

        Eliminate code duplication in time printing, reduce a few static buffers
           text    data     bss     dec     hex filename
         238454     664   28772  267890   41672 strace.before
         238106     664   28676  267446   414b6 strace

        * defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines.
        Add 'int special' parameter to sprinttv().
        * time.c (sprinttv): Add 'int special' parameter, and use it
        similarly to 'int special' parameter of printtv_bitness().
        (printtv_bitness): Use sprinttv() instead of duplicating its code.
        (print_timespec): Use sprint_timespec() instead of duplicating
        its code.
        * desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128
        when checking remaining buffer size.
        * net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128
        for static buffer size.
        * stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128
        when checking remaining buffer size.

2012-01-19  Denys Vlasenko  <dvlasenk@redhat.com>

        Reduce bss usage and speed up string printing.
           text    data     bss     dec     hex filename
         237913     660   49284  287857   46471 strace.before
         237973     660   28772  267405   4148d strace

        This reduces L1 D-cache pressure a bit: instead of dirtying
        20k of bss, we will reuse already dirty stack area.

        * util.c (printpathn): Use on-stack buffers instead of static ones.
        Saves 5*MAXPATHLEN in bss.
        (printstr): Use tprints() instead of tprintf("%s") when printing
        formatted string. May be a bit faster, depending on libc.

2012-01-18  Andreas Schwab  <schwab@linux-m68k.org>

        Add support for compat_statfs64.
        * file.c (struct compat_statfs64, printcompat_statfs64): Define.
        (sys_statfs64, sys_fstatfs64): Use it.

        Add support for statfs64.f_flags.
        * file.c (printstatfs64): Print f_flags if available.

        Fix missing parens.
        * signal.c (sys_sigreturn): Add missing parens.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Get rid of TCB_SIGTRAPPED.
        On attempts to block or set SIGTRAP handler,
        for example, using sigaction syscall, we generate
        an additional SIGSTOP.

        This change gets rid of this SIGSTOP sending/ignoring.
        It appears to work just fine.

        It also works if I force strace to not use PTRACE_O_TRACESYSGOOD,
        which means strace stops will be marked with SIGTRAP,
        not (SIGTRAP | 0x80) - I wondered maybe that's when
        this hack is needed.

        So, why we even have TCB_SIGTRAPPED? No one knows. It predates
        version control: this code was present in the initial commit,
        in 1999. No adequate comments, either.

        Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction
        and sys_sigprocmask syscalls - the ones which are most usually
        used to implement signal blocking, it is only set in obsolete
        sys_signal, sys_sigaction, sys_sigsetmask, and in some dead
        non-Linux code.

        I think whatever bug it was fixing is gone long ago -
        at least as long as sys_rt_sigaction is used by glibc.
        Again, since glibc (and uclibc) uses sys_rt_sigaction
        and sys_sigprocmask, modified code paths are not used
        by most programs anyway.

        * defs.h: Remove definition of TCB_SIGTRAPPED.
        * signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP.
        (sys_sigsetmask): Likewise.
        (sys_sigaction): Likewise.
        (sys_signal): Likewise.
        * strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

        When we write log, flush output buffers in a few more cases.
        I observed a case when signal delivery message was buffered
        by stdio until it was flushed along with the next syscall
        entry message.

        * strace.c (trace): Flush output buffers in a few more cases.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix old sigaction display.
        * signal.c (sys_sigaction): Fix display of sigaction with
        SIG_DFL/SIG_IGN handlers.

        Change x86_64_regs struct type from pt_regs to user_regs_struct.
        * syscall.c: Change x86_64_regs struct type from
        pt_regs to user_regs_struct, and explain the change in comment.

2012-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix struct pt_regs declaration on i386 and x86-64.
        * defs.h [I386] (i386_regs): Replace definition with declaration.
        [X86_64] (x86_64_regs): Remove.
        * syscall.c [X86_64] (x86_64_regs): Make static.

2012-01-12  Denys Vlasenko  <dvlasenk@redhat.com>

        Make ERESTARTxyz messages more descriptive.
        There is widespread confusion about exact meaning
        of ERESTARTxyz codes. Before this change, we were showing
        all four of them the same: as "(To be restarted)".

        This change prints better explanations for these codes,
        and contains verbose comments which explain *why* we display
        codes that way - or else someone confused
        is bound to come later and mangle them again.
        New messages are:

        ERESTARTSYS (To be restarted if SA_RESTART is set)
        ERESTARTNOINTR (To be restarted)
        ERESTARTNOHAND (Interrupted by signal)
        ERESTART_RESTARTBLOCK (Interrupted by signal)

        * syscall.c (trace_syscall_exiting): Make ERESTARTxyz messages
        more descriptive.

2012-01-10  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix sigreturn arg count from 1 to 0 on all architectures.
        * linux/alpha/syscallent.h: Change [rt_]sigreturn's arg count to 0.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.

2012-01-10  Denys Vlasenko  <dvlasenk@redhat.com>

        Display mask on enter to sigreturn, not on exit.
        sys_sigreturn() performs ugly manipulations in order to show
        signal mask which is restored by this syscall: on syscall entry,
        fetches it from the stack, saves it in tcp->u_arg[]
        (where it used to overflow this array - fixed sometime ago),
        then retrieves the mask and displays it on syscall exit.

        Apparently, the motivation is to make it slightly more obvious
        to user that signal mask is restored only when this syscall returns.
        IMO, this hardly justifies the necessary hacks. It is much easier
        to display the mask at the point when we fetch it - on syscall entry.

        While at it, I made it so that we do display returned value/errno.
        I see no point in hiding it and showing uninformative "= ?" instead.

        Example of pause() being interrupted by ALRM which has installed handler
        which re-arms ALRM:

        Before the patch:

        rt_sigsuspend([INT])                    = ? ERESTARTNOHAND (To be restarted)
        --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
        alarm(1)                                = 0
        sigreturn()                             = ? (mask now [INT])

        After:

        rt_sigsuspend([INT])                    = ? ERESTARTNOHAND (To be restarted)
        --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
        alarm(1)                                = 0
        sigreturn() (mask [INT])                = -1 EINTR (Interrupted system call)

        * defs.h: Declare struct pt_regs i386_regs and struct pt_regs x86_64_regs.
        * syscall.c: Remove "static" keywork from these structures' definitions.
        * signal.c (sys_sigreturn): Display mask on enter, not on exit.

2012-01-04  Denys Vlasenko  <dvlasenk@redhat.com>

        Do not detach from tracee which experienced ptrace error.
        Before this patch, if a thread got nuked by exit in another thread
        and we happened to poke it at the same time, we print "????(" thingy
        and detach the thread. Since we removed "detach before death" logic,
        this no longer matches the behavior of other threads.
        Before patch:
        [pid  1780] exit_group(1)               = ?
        [pid  1778] ????( <unfinished ...>
        Process 1778 detached
        [pid  5860] +++ exited with 1 +++
        After:
        [pid 17765] exit_group(1)               = ?
        [pid 21680] ????( <unfinished ...>
        [pid 17791] +++ exited with 1 +++
        [pid 21680] +++ exited with 1 +++

        * strace (trace): Do not detach from tracee which experienced ptrace error.

2012-01-04  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove sig parameter from detach()
        * strace.c (detach): Drop sig parameter - it is zero in all calls.
        (cleanup): Don't pass sig = 0 to detach() call.
        (detach): Ditto.

2011-12-26  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance decoding for personalities with small wordsize.
        * util.c (umoven, umovestr) [SUPPORTED_PERSONALITIES > 1]: If current
        personality's wordsize is less than sizeof(long), use only significant
        bits of the given address.

2011-12-23  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance personality switching.
        On syscall entry, save current personality in the tcb structure
        along with scno.
        On syscall exit, restore current personality from the tcb structure.
        * defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers
        field.
        * strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize
        tcp->currpers.
        * syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New
        function.
        (get_scno, trace_syscall_exiting): Use it.

        Reported-by: Michael A Fetterman <mafetter@nvidia.com>

2011-12-01  Dmitry V. Levin  <ldv@altlinux.org>

        * net.c (socktcpoptions): Add more TCP_* constants from linux/tcp.h.
        Reported-by: Rick Jones <rick.jones2@hp.com>

2011-12-01  Heiko Carstens  <heiko.carstens@de.ibm.com>

        Fix sys_ipc/sys_semtimedop decoding on s390.
        The s390 kernel sys_ipc system call only takes five arguments instead of
        six arguments which the common code sys_ipc implementation takes.
        One of the arguments of the sys_semtimedop subcall is therefore passed in
        a different register than in the common code implementation.
        This leads to broken decoding of the timespec argument:

        semtimedop(0, 0x3ffffb43832, 1, {...})  = -1 EAGAIN

        Fixed it looks like this:

        semtimedop(0, 0x3ffffc2c842, 1, {0, 10000000}) = -1 EINTR

        * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390.

2011-11-29  Dmitry V. Levin  <ldv@altlinux.org>

        strace.c (trace): Fix compilation warning.

2011-11-28  Dmitry V. Levin  <ldv@altlinux.org>

        linux/syscall.h: Remove redundant function declarations.
        Remove 51 function declarations aliased to other declarations in
        linux/dummy.h file.

        linux/syscall.h: Sort function declarations.

        linux/syscall.h: Place one function declaration per line.

        Remove redundant parsers.
        * desc.c (sys_dup): Remove.
        * file.c (sys_pivotroot, sys_rmdir, sys_fchdir, sys_chroot, sys_fchroot,
        sys_unlink, sys_symlink, sys_rename): Remove.
        * linux/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_pivotroot,
        sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.
        * linux/dummy.h: Add aliases for sys_chroot, sys_dup, sys_pivotroot,
        sys_rename, sys_rmdir, sys_symlink, sys_unlink.
        * pathtrace.c (pathtrace_match): Update.
        * sunos4/dummy.h: Add aliases for sys_chroot, sys_dup, sys_fchdir,
        sys_fchroot, sys_rename, sys_rmdir, sys_symlink, sys_unlink.
        * svr4/dummy.h: Likewise.
        * sunos4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot,
        sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.
        * svr4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot,
        sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.

        Reflect the fact that nfsservctl syscall was removed from linux kernels.
        linux/dummy.h: Move nfsservctl to "unimplemented" section.

2011-11-27  Dmitry V. Levin  <ldv@altlinux.org>

        x86_64: add getcpu syscall entry.
        * linux/x86_64/syscallent.h: Add syscall entry for getcpu.

2011-11-26  Dmitry V. Levin  <ldv@altlinux.org>

        Add syscall entries for new linux syscalls.
        * linux/dummy.h: Add printargs parsers for new syscalls.
        * linux/arm/syscallent.h: Add entries for sys_clock_adjtime,
        sys_name_to_handle_at, sys_open_by_handle_at, sys_sendmmsg, sys_setns
        and sys_syncfs.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Add entries for sys_clock_adjtime,
        sys_name_to_handle_at, sys_open_by_handle_at, sys_setns and sys_syncfs.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/s390/syscallent.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Add entry for sys_setns.
        * linux/bfin/syscallent.h: Add entries for sys_sendmmsg and sys_setns.
        * linux/hppa/syscallent.h: Add entries for sys_clock_adjtime,
        fanotify_init, fanotify_mark, sys_name_to_handle_at,
        sys_open_by_handle_at, sys_sendmmsg, sys_setns and sys_syncfs.

        Fix prctl syscall entries.
        * linux/mips/syscallent.h: Fix prctl handler.
        * linux/tile/syscallent.h: Likewise.

        arm: fix io_* syscall entries.
        * linux/arm/syscallent.h: Fix handlers for io_setup, io_destroy,
        io_getevents, io_submit and io_cancel.

        Fix mincore syscall entries.
        * linux/arm/syscallent.h: Fix mincore handler.
        * linux/avr32/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.

2011-11-25  Dmitry V. Levin  <ldv@altlinux.org>

        Fix sendmsg syscall entries.
        * linux/arm/syscallent.h: Fix number of sendmsg arguments.
        * 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/powerpc/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/tile/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix epoll_wait syscall entries.
        * linux/arm/syscallent.h: Fix epoll_wait flags and handler.
        * linux/m68k/syscallent.h: Fix epoll_wait flags.
        * linux/microblaze/syscallent.h: Fix number of epoll_wait arguments.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix epoll_ctl syscall entries.
        * linux/arm/syscallent.h: Fix epoll_ctl flags and handler.
        * linux/m68k/syscallent.h: Fix epoll_ctl flags.
        * linux/x86_64/syscallent.h: Fix number of epoll_ctl arguments.

        arm: fix epoll_create syscall entry.
        * linux/arm/syscallent.h: Fix epoll_create handler.

        Fix mlockall syscall entries.
        * linux/arm/syscallent.h: Fix number of mlockall arguments.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/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/tile/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix epoll_pwait syscall entries.
        * linux/alpha/syscallent.h: Fix number of epoll_pwait arguments.
        * linux/arm/syscallent.h: Likewise.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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/tile/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix reboot syscall entries.
        * linux/alpha/syscallent.h: Fix number of reboot arguments.
        * 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/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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/tile/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

        Fix swapon syscall entries.
        * linux/arm/syscallent.h: Fix number of swapon arguments.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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/tile/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.
        * linux/alpha/syscallent.h: Fix number of swapon arguments, add TF flag.
        * linux/hppa/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.

        Fix sgetmask and ssetmask syscall entries.
        * linux/hppa/syscallent.h: Fix sgetmask and ssetmask entries.
        * linux/powerpc/syscallent.h: Likewise.
        * linux/sparc/syscallent.h: Likewise.
        * linux/tile/syscallent.h: Likewise.

        Rename siggetmask to sgetmask and sigsetmask to ssetmask.
        * linux/arm/syscallent.h: Rename siggetmask to sgetmask and
        sigsetmask to ssetmask.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Likewise.
        * linux/sh64/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Rename sys_sgetmask to sys_siggetmask,
        sys_ssetmask to sys_sigsetmask.

        Add TRACE_IPC flag to sys_ipc syscall entries.
        * linux/arm/syscallent.h: Add TI flag to sys_ipc entry.
        * linux/avr32/syscallent.h: Likewise.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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.

2011-11-05  Dmitry V. Levin  <ldv@altlinux.org>

        gitlog-to-changelog: update from gnulib.
        * gitlog-to-changelog: Update from gnulib.
        * Makefile.am: Add --append-dot to gitlog-to-changelog invocation.

2011-10-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Decode TIOCSCTTY's third parameter.
        * term.c (term_ioctl): Decode TIOCSCTTY's third parameter.

2011-10-14  Dmitry V. Levin  <ldv@altlinux.org>

        Remove useless and obsolete "#if DONE" sections.  No code changes.
        * linux/dummy.h: Remove "#if DONE" section.
        * linux/sparc/dummy2.h: Likewise.
        * linux/sparc64/dummy2.h: Likewise.
        * sunos4/dummy.h: Likewise.
        * svr4/dummy.h: Likewise.

        Add names for dummy parsers.  No code changes.
        * linux/dummy.h: Add aliases to printargs() for those of dummy parsers
        that had no own names before.
        * linux/*/syscallent.h: Use these new names instead of printargs.

        Sort definitions of dummy parsers.  No code changes.
        * linux/dummy.h: Sort definitions of parsers implemented as aliases
        to printargs().

2011-10-14  Mike Frysinger  <vapier@gentoo.org>

        sys_epoll_create1: decode flag arguments correctly.
        * desc.c (epollflags): Define.
        (sys_epoll_create1): Use epollflags to printflags. Change "O" to "EPOLL".

        Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

        Implement decoding of splice, tee and vmsplice(2) syscalls.
        * io.c (print_loff_t): New function.
        (sys_sendfile64): Use it.
        (splice_flags): New xlat structure.
        (sys_tee, sys_splice, sys_vmsplice): New functions.
        * linux/syscall.h (sys_tee, sys_splice, sys_vmsplice): Declare them.
        * linux/*/syscallent.h: Use them.

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

        Fix epoll_wait and epoll_pwait decoding.
        * desc.c (epoll_wait_common): Print "maxevents" and "timeout" arguments
        as integers.

        Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

        Decode EPOLLRDHUP.
        * desc.c (epollevents): Add EPOLLRDHUP.

        Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

        Remove unreachable code in umoven() and umovestr().
        * util.c (umoven, umovestr): Remove unreachable code.

        Reported-by: Weichuan Yan <wchyan@marvell.com>

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

        Do post-attach initialization earlier; fix "we ignore SIGSTOP on NOMMU" bug
        We set ptrace options when we see post-attach SIGSTOP.
        This is wrong: it's better to set them right away on the very first
        stop (whichever it will be). It also will make adding SEIZE support easier,
        since SEIZE has no post-attach SIGSTOP.

        We do it by adding a new bit, TCB_IGNORE_ONE_SIGSTOP, and treating
        TCB_STARTUP and TCB_IGNORE_ONE_SIGSTOP as two slightly different things.

        * defs.h: Add a new flag bit, TCB_IGNORE_ONE_SIGSTOP.
        * process.c (internal_fork): Set TCB_IGNORE_ONE_SIGSTOP on a newly added child.
        * strace.c (startup_attach): Set TCB_IGNORE_ONE_SIGSTOP after attach.
        Fix a case when "strace -p PID" found PID dead but sone other of its threads
        still alive.
        (startup_child): Set TCB_IGNORE_ONE_SIGSTOP after attach, _if needed_.
        This fixes a bogus case where we can ignore a _real_ SIGSTOP on NOMMU.
        (detach): Perform anti-SIGSTOP dance only if TCB_IGNORE_ONE_SIGSTOP is set,
        not if TCB_STARTUP is set.
        (trace): Set TCB_IGNORE_ONE_SIGSTOP after attach.
        Clear TCB_STARTUP and initialize tracee on the very first tracee stop.
        Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen.

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

        Get rid of TCB_ATTACH_DONE.
        * defs.h: Remove TCB_ATTACH_DONE constant.
        * strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE
        to distinquish attached from not-yet-attached threads.

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

        Set TCB_STARTUP only _after_ we attached.
        This fixes logic in detach() which thinks that TCB_STARTUP
        means that we are already attached, but did not see SIGSTOP yet.
        This also allows to get rid of TCB_ATTACH_DONE flag.

        * process.c (internal_fork): Set TCB_STARTUP after attach.
        * strace.c (startup_attach): Likewise.
        (startup_child): Likewise.
        (alloc_tcb): Do not set TCB_STARTUP on tcb allocation - we are
        not attached yet.
        (trace): Set TCB_STARTUP when we detech an auto-attached child.

2011-09-02  Denys Vlasenko  <dvlasenk@redhat.com>

        Simple optimizations in trace()
        * strace.c (trace): Calculate WSTOPSIG(status) once,
        unify code paths to ptrace(PTRACE_SYSCALL).

        Trivial fixes on error paths.
        * strace.c (startup_attach): Emit message on fork() failure.
        (startup_child): Remove non-informative comment.
        * util.c (ptrace_restart): use perror_msg() on error instead of fprintf().

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix compile failure introduced by last commit.
        * desc.c (decode_select): Fix double definition of nfds.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Roll back "die on malloc failure" behaviour a bit.
        After recent change, select(2^31-1, NULL, NULL, NULL)
        would make strace exit. This change caps fdsize so that
        it is always in [0, 1025*1024], IOW: we will try to allocate at most
        1 megabyte, which in practice will almost always work,
        unlike malloc(2Gig).

        * desc.c (decode_select): Cap fdsize to 1024*1024.
        * pathtrace.c (pathtrace_match): Cap fdsize to 1024*1024.
        * file.c (sys_getdents): Cap len to 1024*1024.
        (sys_getdents64): Cap len to 1024*1024.
        * util.c (dumpiov): Refuse to process iov with more than 1024*1024
        elements. Don't die on malloc failure.
        (dumpstr): Don't die on malloc failure.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Add stpcpy to autoconf machinery.
        * configure.ac: Add stpcpy to AC_CHECK_FUNCS.
        * defs.h: Frame stpcpy with "if !defined HAVE_STPCPY".
        * util.c: Likewise.

        Simplify sprinttv()
        * time.c (sprinttv): Trivial simplifications.

        * desc.c (decode_select): Set tcp->auxstr as late as possible.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Reformat setuid-ing code in startup_child()
        New code does the same as old one, but is more readable (I hope).

        * strace.c (startup_child): Reformat setuid-ing code.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

        Minor tweaks in startup_child(). Logic isn't changed (but code is)
        * strace.c (startup_attach): Tweak comment.
        (startup_child): Move common code out of ifdef.
        Indent nested ifdefs. Tweak comments. Remove two
        unnecessary calls to getpid().

        Use tprints with literal strings, it may be faster than tprintf.
        * bjm.c: Replace tprintf("str") with tprints("str").
        * block.c: Likewise.
        * desc.c: Likewise.
        * file.c: Likewise.
        * io.c: Likewise.
        * ipc.c: Likewise.
        * mem.c: Likewise.
        * net.c: Likewise.
        * proc.c: Likewise.
        * process.c: Likewise.
        * quota.c: Likewise.
        * resource.c: Likewise.
        * scsi.c: Likewise.
        * signal.c: Likewise.
        * sock.c: Likewise.
        * strace.c: Likewise.
        * stream.c: Likewise.
        * syscall.c: Likewise.
        * system.c: Likewise.
        * term.c: Likewise.
        * time.c: Likewise.
        * util.c: Likewise.

        Fix "format not a string literal" warning caused by tprintf(str)
        * defs.h: Declare tprints().
        * strace.c: Define tprints().
        (tabto): Use tprints(str), since tprintf(str) was throwing a warning.
        * desc.c: Use tprints(str) instead of tprintf("%s", str).
        * file.c: Likewise.
        * io.c: Likewise.
        * net.c: Likewise.
        * process.c: Likewise.
        * signal.c: Likewise.
        * syscall.c: Likewise.
        * util.c: Likewise.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

        Add README-linux-ptrace file.
        I tried to push this doc to Michael Kerrisk <mtk.manpages@gmail.com>,
        but got no reply. To avoid losing the document, let it live
        in strace tree for now.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

        Make out-of-memory handling more uniform.
        This fixes one real bug in dumpstr().

        * defs.h: Declare die_out_of_memory().
        * strace.c (die_out_of_memory): New function.
        (strace_popen): If allocation fails, call die_out_of_memory().
        (main): Likewise.
        (expand_tcbtab): Likewise.
        (rebuild_pollv): Likewise.
        * count.c (count_syscall): Likewise.
        (call_summary_pers): Likewise.
        * desc.c (decode_select): Likewise.
        * file.c (sys_getdents): Likewise.
        (sys_getdents64): Likewise.
        (sys_getdirentries): Likewise.
        * pathtrace.c (pathtrace_match): Likewise.
        * syscall.c (qualify): Likewise.
        * util.c (printstr): Likewise.
        (dumpiov): Likewise.
        (dumpstr): Likewise.
        (fixvfork): Likewise.
        * mem.c (sys_mincore): Don't check free() parameter for NULL.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

        Optimization: eliminate all remaining usages of strcat()
        After this change, we don't use strcat() anywhere.

        * defs.h: Change sprinttv() return type to char *.
        * time.c (sprinttv): Return pointer past last stored char.
        * desc.c (decode_select): Change printing logic in order to eliminate
        usage of strcat() - use stpcpy(), *outptr++ = ch, sprintf() instead.
        Also reduce usage of strlen().
        * stream.c (decode_poll): Likewise.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

        Optimize string_quote() for speed.
        * util.c (string_quote): Speed up check for terminating NUL.
        Replace strintf() with open-coded binary to hex/oct conversions -
        we potentially do them for every single byte, need to be fast.

        Optimization: eliminate some usages of strcat()
        * defs.h: Declare stpcpy().
        * util.c: Define stpcpy().
        * file.c: Remove static str_append().
        (sprint_open_modes): Use stpcpy() instead of str_append().
        (sprintflags): Use stpcpy() instead of strcat().
        (printpathn): Eliminate usage of strcat().
        (printstr): Eliminate usage of strcat().

2011-08-30  Denys Vlasenko  <dvlasenk@redhat.com>

        Small optimization on AVR32.
        * syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting
        from regs.FOO for AVR32.

2011-08-30  Denys Vlasenko  <dvlasenk@redhat.com>

        On X86_64 and I386, use PTRACE_GETREGS to fetch all registers.
        Before this change, registers were read with PTRACE_PEEKUSER
        ptrace operation, one per register. This is slower than
        fetching them all in one ptrace operation.

        * defs.h: include asm/ptrace.h on X86_64 and I386.
        * syscall.c: New static variables i386_regs and x86_64_regs.
        Remove static eax/rax variables.
        (get_scno): Fetch all registers with single PTRACE_GETREGS operation.
        (get_syscall_result): Likewise.
        (syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs.
        (syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results.
        (get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results.

2011-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Do not include <limits.h>
        * strace.c: Do not include <limits.h> explicitly, it is already included
        implicitly by <sys/param.h>.

2011-08-30  Dmitry V. Levin  <ldv@altlinux.org>

        Include <sys/param.h> to get PATH_MAX definition.
        * pathtrace.c: Include <sys/param.h> instead of <limits.h> to get
        PATH_MAX definition.

        Reported-by: Steve Bennett <steveb@workware.net.au>

2011-08-26  Denys Vlasenko  <dvlasenk@redhat.com>

        Indent a large set of nested ifdefs/endifs. No code changes.
        * defs.h: Indent a large set of nested ifdefs/endifs

        Rename syscall_fixup to syscall_fixup_on_sysenter.
        * defs.h: Tweak comment.
        * syscall.c: Rename syscall_fixup to syscall_fixup_on_sysenter.
        (trace_syscall_entering): Use new finction name.

        Make syscall result reading more consistent among different arches.
        * syscall.c: Eliminate static flags variable for POWERPC.
        (syscall_fixup): Don't fetch syscall results. Affected arches:
        POWERPC, BFIN, HPPA.
        (syscall_fixup_on_sysexit): Move syscall results fetching code
        for this function to get_syscall_result. Affected arches:
        S390X, POWERPC, BFIN, M68K, HPPA, CRIS, MICROBLAZE.
        (get_syscall_result): Add syscall results fetching.

2011-08-25  Denys Vlasenko  <dvlasenk@redhat.com>

        Simplify syscall_fixup[_on_sysexit]
        * syscall.c (syscall_fixup): Remove checks for entering(tcp).
        Remove code which executes if exiting(tcp).
        (syscall_fixup_on_sysexit): Remove code which executes
        if entering(tcp). Remove checks for exiting(tcp).

        Split syscall_fixup into enter/exit pair of functions.
        * syscall.c: Create syscall_fixup_on_sysexit() which is a copy of
        syscall_fixup().
        (trace_syscall_exiting): Call syscall_fixup_on_sysexit() instead of
        syscall_fixup().

        Remove stray commas in struct initializers. No code changes.
        * process.c: Remove stray commas in struct initializers.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Optimize tabto()
        tabto is used in many lines of strace output.
        On glibc, tprintf("%*s", col - curcol, "") is noticeably slow
        compared to tprintf("                 "). Use the latter.
        Observed ~15% reduction of time spent in userspace.

        * defs.h: Drop extern declaration of acolumn. Make tabto()
        take no parameters.
        * process.c (sys_exit): Call tabto() with no parameters.
        * syscall.c (trace_syscall_exiting): Call tabto() with no parameters.
        * strace.c: Make acolumn static, add static char *acolumn_spaces.
        (main): Allocate acolumn_spaces as a string of spaces.
        (printleader): Call tabto() with no parameters.
        (tabto): Use simpler method to print lots of spaces.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        * syscall.c (sys_indir): Use %ld for printing long, not %u.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Opotimize "scno >= 0 && scno < nsyscalls" check.
        gcc can't figure out on its own that this check can be done with
        single compare, and does two compares. We can help it by casting
        scno to unsigned long: ((unsigned long)(scno) < nsyscalls)

        * defs.h: New macro SCNO_IN_RANGE(long_var).
        * count.c (count_syscall): Use SCNO_IN_RANGE() instead of open-coded check.
        * syscall.c (getrval2): Use SCNO_IN_RANGE() instead of open-coded check.
        This fixes a bug: missing check for scno < 0 and scno > nsyscalls
        instead of scno >= nsyscalls.
        (get_scno): Use SCNO_IN_RANGE() instead of open-coded check.
        This fixes a bug: scno > nsyscalls instead of scno >= nsyscalls.
        (known_scno): Use SCNO_IN_RANGE() instead of open-coded check.
        (internal_syscall): Likewise.
        (syscall_enter): Likewise.
        (trace_syscall_entering): Likewise.
        (get_error): Likewise.
        (trace_syscall_exiting): Likewise.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove scno_good logic in syscall exit.
        * syscall.c (trace_syscall_exiting): Remove scno_good logic,
        it can't trigger in syscall exit.

        Remove redundant assignments.
        * syscall.c (get_error): Remove redundant "u_error = 0" and redundant
        and unclear comments.

        Group int-sized fields together in struct tcb.
        * defs.h: Group int-sized fields together in struct tcb.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Reorder functions in syscall.c. No code changes.
        Old order (basically "in no particular order"):
            dumpio
            decode_subcall
            internal_syscall
            get_scno
            get_syscall_result
            known_scno
            syscall_fixup
            is_negated_errno
            get_error
            syscall_enter
            trace_syscall_entering
            trace_syscall_exiting
            trace_syscall
            printargs
            getrval2
            sys_indir
            is_restart_error

        New order:
        various utility functions:
            decode_subcall
            printargs
            getrval2
            sys_indir
            is_restart_error
        syscall enter handling functions:
            get_scno
            known_scno
            syscall_fixup (also used in syscall exit code)
            internal_syscall (also used in syscall exit code)
            syscall_enter
            trace_syscall_entering
        syscall exit handling functions:
            get_syscall_result
            is_negated_errno
            get_error
            dumpio
            trace_syscall_exiting
        main syscall enter/exit function:
            trace_syscall

        * syscall.c: Reorder functions so that related ones are closer
        in the source.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Rename some functions, delete unused one. No code changes.
        * defs.h: Rename get_scno_on_sysenter() to get_scno();
        delete force_result() declaration.
        * strace.c (proc_open): Rename get_scno_on_sysenter() to get_scno().
        * syscall.c: Rename get_scno_on_sysenter() to get_scno().
        Rename get_scno_on_sysexit() to get_syscall_result().
        Delete unused force_result().

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Unify per-architecture post-execve SIGTRAP check.
        Move post-execve SIGTRAP check from get_scno_on_sysenter
        (multitude of places on many architectures) to a single location
        in trace_syscall_entering. This loosens the logic for some arches,
        since many of them had additional checks such as scno == 0.
        However, on non-ancient Linux kernels we should never have post-execve
        SIGTRAP in the first place, by virtue of using PTRACE_O_TRACEEXEC.

        * syscall.c (get_scno_on_sysenter): Remove tcp->flags & TCB_WAITEXECVE checks.
        (trace_syscall_entering): Do tcp->flags & TCB_WAITEXECVE check here.
        (get_scno_on_sysexit): Tweak comment.
        (syscall_fixup): Likewise.
        (trace_syscall_exiting): Likewise.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Speed up x86 by avoiding EAX read on syscall entry.
        on x86, EAX read on syscall entry is not necessary if we know
        that post-execve SIGTRAP is disabled by PTRACE_O_TRACEEXEC ptrace option.
        This patch (a) moves EAX retrieval from syscall_fixup
        to get_scno_on_sysexit, and (b) perform EAX retrieval in syscall_fixup
        only if we are in syscall entry and PTRACE_O_TRACEEXEC option is not on.

        * syscall.c (get_scno_on_sysexit): On I386 and X86_64, read eax/rax
        which contain syscall return value.
        (syscall_fixup): On I386 and X86_64, read eax/rax only on syscall enter
        and only if PTRACE_O_TRACEEXEC is not in effect.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Do not read syscall no in get_scno_on_sysexit.
        * syscall.c (get_scno_on_sysexit): Remove scno retrieval code, since
        we don't save it anyway. This is the first real logic change
        which should make strace faster: for example, on x64 ORIG_EAX
        is no longer read in each syscall exit.

        Simplify get_scno_on_sysenter/sysexit.
        * syscall.c (get_scno_on_sysenter): Remove "if (exiting(tcp))" code,
        make "if (entering(tcp))" code unconditional.
        (get_scno_on_sysexit): Remove "if (entering(tcp))" code,
        make "if (exiting(tcp))" code unconditional.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

        get_scno is an unholy mess, make it less horrible.
        Currently, get_scno does *much* more than "get syscall no".
        It checks for post-execve SIGTRAP. It checks for changes
        in personality. It retrieves params on entry and registers on exit.
        Worse still, it is different in different architectures: for example,
        for AVR32 regs are fetched in get_scno(), while for e.g. I386
        it is done in syscall_enter().

        Another problem is that get_scno() is called on both syscall entry and
        syscall exit, which is stupid: we don't need to know scno on syscall
        exit, it is already known from last syscall entry and stored in
        tcp->scno! In essence, get_scno() does two completely different things
        on syscall entry and on exit, they are just mixed into one bottle, like
        shampoo and conditioner.

        The following patches will try to improve this situation.

        This change duplicates get_scno into identical get_scno_on_sysenter,
        get_scno_on_sysexit functions. Call them in syscall enter and syscall
        exit, correspondingly.

        * defs.h: Rename get_scno to get_scno_on_sysenter; declare it only
        if USE_PROCFS.
        * strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno.
        * syscall.c (get_scno): Split into two (so far identical) functions
        get_scno_on_sysenter and get_scno_on_sysexit.
        (trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno.
        (trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno.

2011-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        Reduce code redundancy in syscall_enter()
        * syscall.c [LINUX] (syscall_enter): Move tcp->u_nargs initialization
        from arch-specific ifdefs to common code.  Always cache tcp->u_nargs in
        a local variable and use it in for() loops.
        [IA64, AVR32] Rewrite tcp->u_arg[] initialization using a loop.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Define MAX_ARGS to 6 for all Linux arches.
        * defs.h: Define MAX_ARGS to 6 for all Linux arches.
        * linux/ia64/syscallent.h: Change all 8-argument printargs
        to MA (MAX_ARGS).
        linux/mips/syscallent.h: Change all two 7-argument printargs
        to MA (MAX_ARGS).

        Fix argument printing in sys_mmap64.
        * mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i]
        instead of argument values copied from memory.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Cache tcp->u_nargs in a local variable for for() loops.
        Loops of the form "for (i = 0; i < tcp->u_nargs; i++) ..."
        need to fetch tcp->u_nargs from memory on every iteration
        if "..." part has a function call (gcc doesn't know that
        tcp->u_nargs won't change). This can be sped up
        by putting tcp->u_nargs in a local variable, which might
        go into a CPU register.

        * syscall.c (decode_subcall): Cache tcp->u_nargs in a local variable
        as for() loop limit value.
        (syscall_enter): Likewise.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Drop checks for sysent[i].nargs == -1.
        * defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
        * syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
        (decode_subcall): Drop checks for sysent[i].nargs == -1.
        (syscall_enter): Likewise.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Stop using nargs == -1 in syscallent tables.
        Usage -1 as argument count in syscallent tables
        necessitates the check for it, a-la:
        if (sysent[tcp->scno].nargs != -1)
            tcp->u_nargs = sysent[tcp->scno].nargs;
        else
            tcp->u_nargs = MAX_ARGS;
        which is stupid: we waste cycles checking something which
        is constant and known at compile time.

        * defs.h: Make struct sysent::nargs unsigned.
        * freebsd/i386/syscallent.h: Replace nargs of -1 with MA.
        * linux/s390/syscallent.h: Likewise.
        * linux/s390x/syscallent.h: Likewise.
        * svr4/syscallent.h: Likewise.
        * freebsd/syscalls.pl: Likewise in generator script.
        * syscallent.sh: Likewise in generator script.
        * syscall.c: Add define MA MAX_ARGS / undef MA around includes
        of syscallent[N].h.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Move trace_syscall_exiting below trace_syscall_entering. No code changes.
        Syscall enter happens before syscall exit. Having functions
        in opposite order in the source is confusing.

        * syscall.c: Move trace_syscall_exiting below trace_syscall_entering.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix -z display.
        Before this patch, the following:
            open("qwerty", O_RDONLY)    = -1 ENOENT
            write(2, "wc: qwerty: No such file or dire"..., 38) = 38
        was shown totally wrongly with -z:
            open("qwerty", O_RDONLY)    = 38
        (yes, that's right, write syscall is lost!)
        Now it is shown "less wrongly" as:
            open("qwerty", O_RDONLY <unfinished ...>
            write(2, "wc: qwerty: No such file or dire"..., 38) = 38

        * syscall.c (trace_syscall_exiting): Use common TCB_INSYSCALL clearing
        via "goto ret". This fixes totally broken display of -z, but even now
        it is not working as intended. Add a comment about that.
        (trace_syscall_entering): Use common TCB_INSYSCALL setting
        via "goto ret".

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Straighten up confused comments/messages about post-execve SIGTRAP handling
        * defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail.
        * strace.c (choose_pfd): Use entering/exiting macros instead of direct check
        for TCB_INSYSCALL.
        * syscall.c (get_scno): Use entering/exiting macros instead of direct check
        for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP.
        (syscall_fixup): Use entering/exiting instead of direct check
        for TCB_INSYSCALL. Add a comment what "not a syscall entry" message
        usually means. Change wrong "stray syscall exit" messages into
        "not a syscall entry" ones.

        count_syscall() always returns 0, optimize it.
        * defs.h (count_syscall): Change return type from int to void.
        * count.c (count_syscall): Change return type from int to void.
        * syscall.c (trace_syscall_exiting): Change code around call
        to count_syscall accordingly.

        Optimize out dummy PC printing on signal delivery.
        * strace.c (trace): Optimize out dummy PC printing on signal delivery.
        While at it, tweak comments.

        Conditionally optimize out unused code.
        * syscall.c (internal_syscall): Call internal_exec only if
        SUNOS4 || (LINUX && TCB_WAITEXECVE).
        * process.c (internal_exec): Define this function only if
        SUNOS4 || (LINUX && TCB_WAITEXECVE).
        (printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1.
        * signal.c (sys_kill): Likewise.
        * syscall.c (is_negated_errno): Likewise.
        (trace_syscall_exiting): Fold a tprintf into tprintfs which follow it.

        Cosmetic improvement in ifdefs. No code changes.
        * strace.c (proc_open): Change ifdefs so that braces are properly paired.

        Exclude tcp->pfd from non-procfs systems.
        * defs.h: Make struct tcb::pfd fields conditional on USE_PROCFS.
        * strace.c (alloc_tcb): Use tcp->pfd only if USE_PROCFS.
        (droptcb): Likewise.

        Small optimizations related to memory allocation.
        * strace (expand_tcbtab): Shorten "out of memory" message.
        (rebuild_pollv): Remove unnecessary NULL check before free().
        * util.c (dumpstr): Add a comment about likely bug.

        Improve code readability by avoiding assignments inside if()
        * desc.c (decode_select): Move assignment out of if() condition.
        * file.c (sprinttime): Likewise.
        (sys_getdirentries): Likewise.
        * io.c (sys_ioctl): Likewise.
        * strace.c (test_ptrace_setoptions_followfork): Likewise.
        (main): Likewise.
        (proc_open): Likewise.
        (detach): Likewise.
        (proc_poll): Likewise.
        (trace): Likewise.
        * syscall.c (qualify): Likewise.
        (sys_indir): Likewise.
        * test/procpollable.c (main): Likewise.
        * test/sfd.c (main): Likewise.
        * time.c (printtv_bitness): Likewise.
        (sprinttv): Likewise.
        (print_timespec): Likewise.
        (void sprint_timespec): Likewise.
        (printitv_bitness): Likewise.
        * util.c (dumpstr): Likewise.
        (umovestr): Likewise.
        (fixvfork): Likewise.

        Convert ioctl_next_match() to new-style C function definition.
        * ioctl.c (ioctl_next_match): Convert to new-style C function definition.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Small optimization in signal and ioctl tables.
        Trivial shuffling of data tables puts them all in one file,
        allowing gcc to see their sizes and eliminate variables
        which store these sizes.

        Surprisingly, in C mode gcc does not optimize out static const int
        variables. Help it by using enums instead.

        * defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2},
        signalent{0,1,2}, nsignals{0,1,2}.
        * ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}.
        * signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}.
        * syscall.c: Move above definitions to this file. Make them static const
        or enums if suitable.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Don't return int from set_personality(), no one checks it.
        * defs.h (set_personality): Change return type to void.
        * syscall.c (set_personality): Change return type to void.

        Remove unused declaration.
        * defs.h: Remove unused declaration of handle_new_child().

        Use natural-sized integer field for tcb::flags.
        * defs: Change struct tcb::flags type from short to int.
        This results in smaller code at least on x86.

        Make needlessly static data local.
        * syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers
        is declared static. But its old data is never used. Convert it
        to ordinary local variable.

        Optimize get_scno function.
        * syscall.c (get_scno): Make gpr_offset[] array static const.

        Optimize iocb_cmd_lookup.
        * desc.c (iocb_cmd_lookup): Make command table constant.
        Reduce size of static char buffer.

        Correct sys_sendfile[64] type and nargs.
        * freebsd/i386/syscallent.h: Correct sys_sendfile nargs 7->8
        * linux/mips/syscallent.h: Correct sys_sendfile64 nargs 5->4
        * linux/sh/syscallent.h: Correct sys_sendfile64 nargs 5->4
        * linux/sh64/syscallent.h: Correct sys_sendfile64 nargs 5->4
        * linux/m68k/syscallent.h: Correct sys_sendfile64 type TF->TD|TN
        * linux/microblaze/syscallent.h: Correct sys_sendfile64 type TF->TD|TN
        * linux/tile/syscallent.h: Correct sys_sendfile and sys_sendfile64 type TD->TD|TN

        Make addflags return void.
        * defs.h (addflags): Change return type from int to void.
        * util.c (addflags): Change return type from int to void.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Set saner MAX_ARGS (6 or 8) for X86_64 and I386.
        I noticed that tcp->u_args[MAX_ARGS] array is way larger than
        I'd expect: for all arches except HPPA it has 32 (!) elements.

        I looked at the code and so far I spotted only one abuser of
        this fact: sys_sigreturn. On several arches, it saves sigset_t
        into tcp->u_args[1...N] on entry and prints it on exit, a-la

        memcpy(&tcp->u_arg[1], &sc.oldmask[0], sizeof(sigset_t))

        The problem here is that in glibc sigset_t is insanely large:
        128 bytes, and using sizeof(sigset_t) in memcpy will overrun
        &tcp->u_args[1] even with MAX_ARGS == 32:
        On 32 bits, sizeof(tcp->u_args) == 32*4 == 128 bytes!
        We may already have a bug there!

        This commit changes the code to save NSIG / 8 bytes only.
        NSIG can't ever be > 256, and in practice is <= 129,
        thus NSIG / 8 is <= 16 bytes == 4 32-bit words,
        and even MAX_ARGS == 5 should be enough for saving signal masks.

        * defs.h: Reduce MAX_ARGS for X86_64 and I386 from 32 to 8
        for FreeBSD and to 6 for everyone else. Add comment about current
        state of needed MAX_ARGS.
        * signal.c: Add comment about size of sigset_t.
        (sprintsigmask): Reduce static string buffer from 8k to 2k.
        (sys_sigreturn): Fix sigset saving to save only NSIG / 8 bytes,
        not sizeof(sigset_t) bytes.
        * linux/mips/syscallent.h: Reduce nargs of printargs-type syscall to 7.
        * linux/arm/syscallent.h: Reduce nargs of printargs-type syscall to 6.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/powerpc/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.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Optimize sys_old_mmap.
        * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64,
        copy narrow parameters from userspace by single umove, not by six
        separate ones; then assign them to long u_arg[i]. For SH[64],
        avoid copying of tcp->u_arg.
        (sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled
        differently for no apparent reason.
        * test/mmap_offset_decode.c: New test program, illustrates FIXME.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Untangle ifdef forest in sys_mmap64. No code changes.
        After careful analysis, it looks like !LINUX and ALPHA
        pass all seven parameters in registers; and in all other cases
        parameters are on stack (pointed to by tcp->u_arg[0]).
        In light of this, reorganize ifdefs, making them simpler,
        without changing any logic.
        After this, it's apparent we use tcp->u_arg[4,5,6] and possibly
        [7] without checking that it's valid to do so.
        So far, just add a comment about this.

        * mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way.
        Add comments about apparent bugs.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Style and comment fixes, no code changes.
        * mem.c: Indent includes to show nesting better.
          (addtileflags): Fix style of this function definition;
          correct wrong endif comment, add another endif comment.

        Use simpler rounding up to next multiple of 2.
        * util.c (printllval): simpler rounding up to next multiple of 2.

        Cosmetic fixes, no code changes.
        * defs.h: Add/reformat comments.
        * signal.c: Remove wrong comment. Add warning directive
        when we detect that NSIG is undefined. Add comment about
        NSIG on ARM. Fix typo in comment.
        (signame): Reformat code a bit without changes to logic.
        Shorten static buffer.
        (sys_rt_sigprocmask): Remove stray empty line.
        * syscall.c: Add warning directive when we detect that
        NSIG is undefined. Add comment about NSIG on ARM.

2011-08-23  Dmitry V. Levin  <ldv@altlinux.org>

        Fix PTRACE_SETOPTIONS tests.
        * strace.c [LINUX] (kill_save_errno): New function.
        (test_ptrace_setoptions_followfork): Change return type to void.
        Fix and harden error handling.  Use kill_save_errno() to avoid errno
        clobbering.  Treat EIO from ptrace() the same way as EINVAL.
        (test_ptrace_setoptions_for_all): Use kill_save_errno() to avoid errno
        clobbering.  Treat EIO from ptrace() the same way as EINVAL.
        (main): Update use of test_ptrace_setoptions_followfork().

        Fix compilation on linux 2.4.x.
        * configure.ac: Check for BLKGETSIZE64.
        * block.c (block_ioctl): Check for HAVE_BLKGETSIZE64.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove tcp->parent and TCB_CLONE_THREAD.
        tcp->parent is used for only two things:
        (1) to send signal on detach via tgkill (need to know tgid).
        Solution: use tkill, it needs only tid.
        (2) to optimize out ptrace options setting for new tracees.
        Not a big deal if we drop this optimization: "set options" op is fast,
        doing it just one extra time once per each tracee is hardly measurable.

        TCB_CLONE_THREAD is a misnomer. It used only to flag sibling we attached to
        in startup_attach. This is used to prevent infinite recursive rescanning
        of /proc/PID/task.
        Despite the name, there is no guarantee it is set only on non-leader:
        if one would run "strace -f -p THREAD_ID" and THREAD_ID is *not*
        a thread leader, strace will happily attach to it and all siblings
        and will think that THREAD_ID is the leader! Which is a bug, but
        since we no longer detach when we think tracee is going to die,
        this bug no longer matters, because we do not use the knowledge
        about thread group leaders for anything. (We used it to delay
        leader's exit).

        IOW: after this patch strace has no need to know about threads, parents
        and children, and so on. Therefore it does not track that information.
        It treats all tracees as independent entities. Overall,
        this simplifies code a lot.

        * defs.h: Add TCB_ATTACH_DONE flag, remove TCB_CLONE_THREAD flag
        and struct tcb::parent field.
        * process.c (internal_fork): Don't set tcpchild->parent.
        * strace.c (startup_attach): Use TCB_ATTACH_DONE flag instead of
        TCB_CLONE_THREAD to avoid attach attempts on already-attached threads.
        Unlike TCB_CLONE_THREAD, TCB_ATTACH_DONE bit is used only temporarily,
        and only in this function. We clear it on every tcb before we return.
        (detach): Use tkill instead of tgkill.
        (trace): Set ptrace options on new tracees unconditionally,
        not only when tcp->parent == NULL.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove TCB_SUSPENDED constant and related code.
        Since we no longer suspend waitpid'ing tracees, we have only one case when
        we suspend tracee: when we pick up a new tracee created by clone/fork/vfork.

        Background: on some other OSes, attach to child is done this way:
        get fork's result (pid), loop ptrace(PTRACE_ATTACH) until you hook up
        new process/thread. This is ugly and not safe, but what matters for us
        is that it doesn't require suspending. Suspending is required
        on Linux only, because on Linux attach to child is done differently.

        On Linux, we use two methods of catching new tracee:
        adding CLONE_THREAD bit to syscall (if needed, we change
        [v]fork into clone before that), or using ptrace options.
        In both cases, it may be so that new tracee appears before one which
        created it returns from syscall. In this case, current code
        suspends new tracee until its creator returns. Only then
        strace can determine who is its parent (it needs child's pid for this,
        which is visible in parent's [v]fork/clone result).
        This is inherently racy. For example, what if SIGKILL kills
        creator after it succeeded creating child, but before it returns?
        Looks like we will have child suspended forever.

        But after previous commit, we DO NOT NEED parent<->child link for anything.
        Therefore we do not need suspending too. Bingo!

        This patch removes suspending code. Now new tracees will be continued
        right away. Next patch will remove tcp->parent member.

        * defs.h: Remove TCB_SUSPENDED constant
        * process.c (handle_new_child): Delete this function.
          (internal_fork): Do not call handle_new_child on syscall exit.
        * strace.c (handle_ptrace_event): Delete this function.
          (trace): Do not suspend new child; remove all handling
          of now impossible TCB_SUSPENDED condition.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

        Do not detach when we think tracee is going to die.
        Current code plays some ungodly tricks, trying to not detach
        thread group leader until all threads exit.

        Also, it detaches from a tracee when signal delivery is detected
        which will cause tracee to exit.
        This operation is racy (not to mention the determination
        whether signal is set to SIG_DFL is a horrible hack):
        after we determined that this signal is indeed fatal
        but before we detach and let process die,
        *other thread* may set a handler to this signal, and
        we will leak the process, falsely displaying it as killed!

        I need to look in the past to figure out why we even do it.
        First guess is that it's a workaround for old kernel bugs:
        kernel used to deliver exit notifications to the tracer,
        not to real parent. These workarounds are ancient
        (internal_exit is from 1995).

        The patch deletes the hacks. We no longer need tcp->nclone_threads,
        TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather
        ugly functions.

        I also added a new message: "+++ exited with EXITCODE +++"
        which shows exact moment strace got exit notification.
        It is analogous to existing "+++ killed by SIG +++" message.

        * defs.h: Delete struct tcb::nclone_threads field,
          TCB_EXITING and TCB_GROUP_EXITING constants,
          declarations of sigishandled() and internal_exit().
        * process.c (internal_exit): Delete this function.
          (handle_new_child): Don't ++tcp->nclone_threads.
        * signal.c (parse_sigset_t): Delete this function.
          (sigishandled): Delete this function.
        * strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++.
          (droptcb): Don't delay dropping if tcp->nclone_threads > 0,
          don't drop parent if its nclone_threads reached 0:
          just drop (only) this tcb unconditionally.
          (detach): don't drop parent.
          (handle_group_exit): Delete this function.
          (handle_ptrace_event): Instead of handle_group_exit, just drop tcb;
          do not panic if we see WIFEXITED from an attached pid;
          print "+++ exited with EXITCODE +++" for every WIFEXITED pid.
        * syscall.c (internal_syscall): Do not treat sys_exit specially -
          don't call internal_exit on it.

2011-08-16  Sergei Trofimovich  <slyfox@gentoo.org>

        Declare printrusage32() on Alpha.
        * defs.h [ALPHA] (printrusage32): New declaration.

2011-08-15  Denys Vlasenko  <dvlasenk@redhat.com>

        Slight optimization and cleanup in trace()
        * strace.c (trace): Do not recalculate "cflag ? &ru : NULL"
        again and again. Do not clear errno unnecessarily.
        Consistently check wait errors as pid < 0, not pid == -1.
        Indent ifdefs for better readability.
        Remove comments after endif if ifdef/endif block is really tiny.

        Fix compilation on 2.4.20 kernel based system.
        * block.c (block_ioctl): add ifdef/endif around BLKGETSIZE64 usage
        * strace.c (trace): add ifdef/endif around WIFCONTINUED usage

2011-07-19  Dmitry V. Levin  <ldv@altlinux.org>

        Check for additional PTRACE_* constants.
        * configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD,
        PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC,
        PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT.
        * defs.h [LINUX]: Define these PTRACE_* constants when they are not
        provided by <sys/ptrace.h>.

        Reported-by: Douglas Mencken <dougmencken@gmail.com>
        Reported-by: Steve Bennett <steveb@workware.net.au>

2011-07-19  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove superfluous backslash-continuation in configure.ac.
        * configure.ac: remove superfluous backslash continuation
        in AC_CHECK_DECLS

2011-06-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Make IOCTL_WSTOP more readable.
        * defs.h: Make IOCTL_WSTOP more readable

        Trivial cleanups.
        * strace.c (trace): Change ifdef LINUX to make a bit more sense,
          remove wrong comment at its endif. Slightly optimize
          "+++ killed by SIG +++" message for systems without WCOREDUMP macro.

        Remove redundant include <stdarg.h>
        * strace.c: Remove redundant include <stdarg.h>

        Clean up two old comments.
        * strace.c (startup_attach): Remove misplaced comment.
          (trace) Remove incomplete part of a comment.

        Make a few variables static.
        * defs.h: Remove tcbtab declaration.
        * strace.c: Make run_uid, run_gid, outf, tcbtab, progname
          global variables static

        Add debug output in initial attachment code.
        * strace.c (startup_attach): If -d, report pid and success/failure
          of every attach attempt.

        Better debug logging of allocations and waitpit results.
        * strace.c (alloc_tcb): Print number of allocated tcb's if -d.
          (droptcb): Likewise.
          (handle_ptrace_event): Remove PTRACE_EVENT_EXEC debug message.
          (trace): Improve logging of waitpid: show WIFxxx, exitcode/signal,
          ptrace event name, WCOREDUMP - all on one line.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Optimize arrays of register indexes in syscall_enter.
        * syscall.c (syscall_enter) [BFIN]: Make register no array "static const".
          [SH]: Make register no array "const", pre-multiply it by 4.
          [SH64]: Make register no array "const".
          [X86_64]: Make register no array "const", pre-multiply it by 8.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Deindent syscall_enter by removing unnecessary braces. No code changes.
        syscall_enter has many long (>80 columns) lines.
        It is aggravated by the fact that it has a lot of {} blocks
        which are not necessary (the code is the same without them).
        This patch removes {}s and deindents affected lines.
        While at it, it indents ifdefs so that nesting is easier to track,
        and adds a few spaces in the expressions, such as
        "tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...".
        There is no actual changes to the code here.

        * syscall.c (syscall_enter): Remove unnecessary {} blocks.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove dead "ifndef CLONE_PTRACE" branch.
        process.c defines CLONE_PTRACE for Linux, so it can't be undefined.
        Therefore ifndef CLONE_PTRACE code is dead (since at least 2004).
        This patch removes it.

        * process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not
          the code inside) and entire ifndef CLONE_PTRACE/endif block.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Add a comment about setbpt. No code changes.
        * defs.h: Add a comment about setbpt().

        Untangle a particularly badly obfuscated bit of code. No logic changes.
        * util.c (setbpt): Calculate new arg0 in more readable way.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove TCB_FOLLOWFORK.
        TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow
        all [v]forks/clones or don't follow any, therefore global variable
        followfork is an already existing indicator of what we want to do.
        This patch drops all setting/clearing of TCB_FOLLOWFORK bit,
        and replaces checks for this bit by checks of followfork value.
        In internal_fork, check is moved to in front of if(), since
        the check is needed on both "entering" and "exiting" branch.

        * defs.h: Remove TCB_FOLLOWFORK define.
        * process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK,
          test followfork instead of tcp->flags & TCB_FOLLOWFORK.
          (handle_new_child): Likewise.
        * strace.c (startup_attach): Likewise.

2011-06-23  Dmitry V. Levin  <ldv@altlinux.org>

        * system.c (sys_capget, sys_capset): Fix pointer arithmetics.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Make initial tcb allocation more readable. No logic changes.
        * strace.c (main): Make initial tcb allocation more readable.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Do not allocate tiny cap_user_header/data structures, place them on stack.
        This allows us to avoid having code to malloc them, and code to check
        for malloc failure. Resulting code decrease:
           text    data     bss     dec     hex filename
          10175       0      16   10191    27cf system.o.old
           9797       0       0    9797    2645 system.o

        * system.c (sys_capget): Put cap_user_header_t and cap_user_data_t
          on stack, rather than allocating them in heap. These structures
          are very small (a few integer fields), stack is a better place
          for them.
          (sys_capset): Likewise.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Use [p]error_msg[_and_die] where appropriate. No logic changes.
        Resulting size changes:
           text    data     bss     dec     hex filename
          17445      16    8572   26033    65b1 strace.o.old
          16850      16    8572   25438    635e strace.o

        * strace.c: Replace fprintf[+cleanup]+exit with [p]error_msg_and_die,
          fprintf("progname: ...") with [p]error_msg where appropriate.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Whitespace cleanups. No code changes.
        * count.c: Place opening curly brace after if (),
          not on the next line. Almost all strace code alredy
          uses this style.
        * desc.c: Likewise.
        * file.c: Likewise.
        * net.c: Likewise.
        * pathtrace.c: Likewise.
        * process.c: Likewise.
        * quota.c: Likewise.
        * signal.c: Likewise.
        * strace.c: Likewise.
        * syscall.c: Likewise.
        * time.c: Likewise.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Make strace_fopen abort on error.
        Error from strace_fopen in main results in call to exit(1).
        Error from strace_fopen in newoutf is propagated to newoutf
        callers: startup_attach (where it results in exit(1))
        and alloc_tcb (where error is ignored). In second case,
        the behavior doesn't seem to be right: it means with -ff
        on open error for new LOGFILE.PID the output will continue
        to go into *the same file as the previous process* - which
        would be confusing. Moreover, on droptcb outf may be closed
        and the output of other, still running process outputting
        to the same outf will be lost. I don't think this is sane.
        IOW: in all cases, error in strace_fopen should be fatal.

        * strace.c (strace_fopen): Abort on error instead of returning NULL.
          (newoutf): Change return type to void.
          (startup_attach): Remove error check on newoutf return value.
          (main): Remove error check on strace_fopen return value.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Make set_cloexec_flag abort on error.
        set_cloexec_flag() may fail only if we pass it a bad fd,
        such as -1 or non-opened one. If we do, we have a bug
        in the caller. It makes no sense to try to continue
        running when we detect such a blatant bug in our own code.

        * strace (set_cloexec_flag): Abort instead of returning error
          indicator. Change function to return void.
          (strace_fopen): Remove error check on set_cloexec_flag return value.
          (proc_open): Likewise.
          (proc_poll_open): Likewise.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Make strace_popen abort on error.
        It makes no sense to postpone abort on strace_popen error
        unti it returns. Moreover, out-of-memory error was exiting
        without any message.
        While at it, use 0 as "none" for popen_pid, as optimization.

        * strace: Initialize popen_pid to 0 - this puts it in bss.
          (trace): Reset popen_pid to 0 instead of -1.
          (strace_popen): Never return NULL as error indicator,
          abort with good error message instead.
          (main): Remove NULL check of strace_popen result.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Delete fork_tcb()
        Get rid of fork_tcb() function. It used to do what the comment
        above it says, but now it doesn't do much:
        it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls
        expand_tcbtab(). The second operation is not necessary, since
        alloc_tcp() will do it itself when needed.
        This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK
        where it was formerly called. It also makes nprocs, tcbtabsize and
        expand_tcbtab() static. (While at it, I nuked redundant
        extern char **environ declaration: strace.c had *two* of them...)

        * defs.h: Remove declarations of nprocs, tcbtabsize and
          expand_tcbtab.
        * process.c (fork_tcb): Remove this function.
          (internal_fork): Open-code fork_tcb.
          (handle_new_child): Likewise.
        * strace.c: Remove redundant "extern char **environ". Declare
          nprocs and tcbtabsize static.
          (expand_tcbtab): Make it static.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

        Simplify expand_tcbtab and alloc_tcb.
        Get rid of a few intermediate variables, simplifies a few expressions,
        and uses error_msg_and_die instead of more verbose
        fprintf+cleanup+exit sequence.
        In alloc_tcp, I use memset to clear entire new tcp.
        This not only saves a few bytes of code, but lowers the chances
        of future bugs where some data "leaks out" into new tcb's
        from old ones because we forgot to re-initialize it.

        * strace.c (expand_tcbtab): Simplify this function. No logic changes.
          (alloc_tcb): Likewise.

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Trivial fixes.
        * process.c (internal_fork): Remove conditionals which make no difference
          (we return 0 on both branches of these ifs).
        * util.c: Fix indentation of an ifdef.

2011-06-21  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build when libaio-devel is not available.
        * desc.c: Do not compile code that uses struct iocb unless
        HAVE_LIBAIO_H is set.

        Reported-by: Denys Vlasenko <dvlasenk@redhat.com>

2011-06-21  Dmitry V. Levin  <ldv@altlinux.org>

        tests: finish ptrace_setoptions_* merge.
        * tests/Makefile.am (TESTS): Merge ptrace_setoptions_*.
        * tests/ptrace_setoptions: Check for Linux kernel > 2.6.

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Remove write-only nchildren member from struct tcb.
        * defs.h: Remove nchildren member from struct tcb.
        * process.c (handle_new_child): Remove inc/decrements of tcp->nchildren.
          (internal_fork): Likewise.
        * strace.c (startup_attach): Likewise.
          (droptcb): Likewise.
          (alloc_tcb): Remove initialization of tcp->nchildren.

        Fix tests/ptrace_setoptions_* to match last fix in ptrace options code.

        Remove write-only nzombies member from struct tcb.
        * defs.h: Remove nzombies member from struct tcb.
        * strace.c (droptcb): Remove "tcp->parent->nzombies++".
          (alloc_tcb): Remove "tcp->nzombies = 0".

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix regression introduced by "Properly handle real SIGTRAPs" change.
        Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54
        introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set.
        The check (tcp->parent == NULL) in old code was meant to check
        "if we are not a child created by auto-attach" - in this case,
        options need to be set on the child; otherwise they are inherited
        and do not need to be set.
        I misunderstood the check and if tcp->parent is not NULL, I was
        setting only ptrace_setoptions_for_all bits.
        This change fixes the problem. Since the fixed logic makes it
        unnecessary to keep two sets of options in separate variables,
        I merge them back into one variable, ptrace_setoptions.

        * defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all
          into one variable, ptrace_setoptions.
        * strace.c: Likewise.
          (test_ptrace_setoptions_followfork): Use ptrace_setoptions variable.
          (test_ptrace_setoptions_for_all): Likewise.
          (main): Likewise.
        * process.c (internal_fork): Likewise.
          (internal_exec): Likewise.
        * strace.c (trace): Fix the bug where different options were set
          depending on "tcp->parent == NULL" condition. Add a comment
          which makes it more clear why this condition is checked.

2011-06-18  Denys Vlasenko  <dvlasenk@redhat.com>

        Do not suspend waitpid.
        strace used to suspend waitpid until there is a child
        for waitpid'ing process to collect status from.
        Apparently, it was done because in some very old kernels
        (circa 2002 or even earlier) there were ptrace bugs which
        were making waitpid in real parent to not see children.
        This kernel bug is fixed long ago. This change removes the workaround.
        test/wait_must_be_interruptible.c is a test program which
        illustrates why without this change strace changes
        programs's behavior.

        * defs.h: Delete waitpid and nclone_waiting members from from struct tcb.
          Remove declaration of internal_wait().
        * process.c (internal_wait): Remove this function.
        * strace.c (alloc_tcb): Do not set tcp->nclone_waiting.
          (resume): Remove this function.
          (resume_from_tcp): Remove this function.
          (detach): Do not call resume_from_tcp().
          (handle_group_exit): Do not call resume_from_tcp().
        * syscall.c (internal_syscall): Do not call internal_wait().

2011-06-13  Andi Kleen  <ak@linux.intel.com>

        Enhance io_submit() decoding.
        strace didn't decode important fields in the iocb passed to io_submit.
        This patch changes the code to dump them all.  Also it prefixes the fields
        with names to make it easier to read.

        * desc.c (iocb_cmd_lookup, print_common_flags): New functions.
        (sys_io_submit): New iocb decoder.

2011-06-13  Dmitry V. Levin  <ldv@altlinux.org>

        Add argument to tprint_iov() specifying whether to decode each iovec.
        * defs.h (tprint_iov): Add decode_iov argument.
        * io.c (tprint_iov): Implement new decode_iov argument.
        (sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update
        tprint_iov calls.
        * net.c (do_msghdr): Likewise.

        Introduce ARRAY_SIZE() macro.
        * defs.h (ARRAY_SIZE): New macro.
        * ioctl.c: Use it.
        * pathtrace.c (pathmatch, storepath): Likewise.
        * process.c (printpriv): Likewise.
        * signal.c: Likewise.
        * syscall.c: Likewise.

2011-06-13  Andi Kleen  <ak@linux.intel.com>

        Fix decoding of timer id returned by timer_create.
        * time.c (sys_timer_create): The kernel returns a integer, not a
        pointer for the timer id in the memory pointed to by timer_id.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

        Add test for PTRACE_O_TRACESYSGOOD.
        * tests/ptrace_setoptions_for_all: New file.
        * tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all.

        tests: update test for linux kernel version.
        * tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

        Update ptrace_setoptions test.
        The test have to be adjusted after commit v4.6-5-g3454e4b.

        * ptrace_setoptions: Update grep pattern, rename to
        ptrace_setoptions_followfork.
        * tests/Makefile.am (TESTS): Rename ptrace_setoptions to
        ptrace_setoptions_followfork.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

        * strace.c (verror_msg): Rewrite without use of heap memory allocation.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix MIPS syscall entries.
        * linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337,
        and 4338 syscall numbers.

        Reported-by: Denys Vlasenko <dvlasenk@redhat.com>

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

        Don't display bogus parameter for sigreturn syscall.
        * linux/*/syscallent.h: For those arches which use sys_sigreturn,
        not printargs, to show [rt_]sigreturn syscall, change number of arguments
        from 1 to 0: sys_sigreturn function doesn't use syscall parameters.
        (I guess kernel doesn't actually _have_ any parameters for this syscall,
        at least on these architectures). Do the same change for I386 and x86-64
        even though they use printargs: I looked at kernel code and syscall
        definitely doesn't have any parameters on these arches.
        (I hesitate to change 1 to 0 params for arches I don't know -
        it is remotely possible some of them do have a parameter for this syscall).

        Optimize sigreturn handling.
        * signal.c (sys_sigreturn): move stack pointer variables,
        and for SPARC and MIPS, stack pointer and sigmask reading code
        into "if (entering) ..." block, because it is only needed
        in this branch; load tcp->u_arg[1] into sigmask for display
        _after_ we know for sure u_arg[1] does contain valid sigmask
        (IOW: perform operation only when we know we will need the result)

        Do not call umoven to fetch parameters if we have zero params.
        * syscall.c [I386] (syscall_enter): Do not call umoven
        to fetch zero bytes. This is just an optimization.

        "Modernize" four old-style function parameter declarations.
        * signal.c (signame, long_to_sigset, printsigmask, printsignal):
        Convert old-style C function definitions to a "modern" form.
        This does not change any actual code.

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

        Fix sigreturn decoding on MIPS.
        The "return 0" line was accidentally deleted circa 2007,
        which made sigreturn on MIPS always display "= 0" return
        instead of more informative " = ? (mask now [MASK])".

        * strace.c (sys_sigreturn): Add wrongly deleted "return 0" line

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

        Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed
        We already do it in the normal case, but in rare code path where
        tracee is gone (SIGKILLed?) sometimes we were printing this:
        "SYSCALL(ARGS <unavailable>)= ? <unavailable>" - note jammed together ")=".
        test/sigkill_rain.c can be used to verify the fix.

        * strace.c (printleader): add a space after ")" in " <unavailable>)"

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

        Add fflush after printf in test/sigkill_rain.c.

        Update test/* directory, it seem to be a bit bit-rotted.
        Added README; modified sigkill_rain.c to be more understandable,
        made clone.c compile; added wait_must_be_interruptible.c test;
        updated Makefile and .gitignore.

2011-06-07  Denys Vlasenko  <dvlasenk@redhat.com>

        Whitespace cleanups. no code changes.
        * bjm.c: Fix tabulation (such as extra spaces before tabs),
        convert punctuation where it deviates from prevalent form
        elsewhere in strace code, convert sizeof and offsetof where
        it deviates from from prevalent form, remove space between
        function/macro/array names and (parameters) or [index],
        add space between "if" and (condition), correct non-standard
        or wrong indentaion.
        * defs.h: Likewise
        * desc.c: Likewise
        * file.c: Likewise
        * ipc.c: Likewise
        * linux/arm/syscallent.h: Likewise
        * linux/avr32/syscallent.h: Likewise
        * linux/hppa/syscallent.h: Likewise
        * linux/i386/syscallent.h: Likewise
        * linux/ioctlsort.c: Likewise
        * linux/m68k/syscallent.h: Likewise
        * linux/microblaze/syscallent.h: Likewise
        * linux/powerpc/syscallent.h: Likewise
        * linux/s390/syscallent.h: Likewise
        * linux/s390x/syscallent.h: Likewise
        * linux/sh/syscallent.h: Likewise
        * linux/sh64/syscallent.h: Likewise
        * linux/tile/syscallent.h: Likewise
        * linux/x86_64/syscallent.h: Likewise
        * mem.c: Likewise
        * net.c: Likewise
        * pathtrace.c: Likewise
        * process.c: Likewise
        * signal.c: Likewise
        * sock.c: Likewise
        * strace.c: Likewise
        * stream.c: Likewise
        * sunos4/syscall.h: Likewise
        * sunos4/syscallent.h: Likewise
        * svr4/syscall.h: Likewise
        * svr4/syscallent.h: Likewise
        * syscall.c: Likewise
        * system.c: Likewise
        * test/childthread.c: Likewise
        * test/leaderkill.c: Likewise
        * test/skodic.c: Likewise
        * time.c: Likewise
        * util.c: Likewise

2011-05-30  Dmitry V. Levin  <ldv@altlinux.org>

        ARM EABI: fix 64-bit syscall's arguments decoding.
        ARM OABI and ARM EABI have different function parameters passing rules.
        With EABI, 64-bit function parameters passed in registers are aligned to
        an even-numbered register instead of using the next available pair, see
        http://lkml.org/lkml/2006/1/12/175
        This rule also applies to syscall's arguments.

        * linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64,
        readahead, preadv, pwritev): Fix number of arguments.
        * util.c (printllval): Align 64bit argument to 64bit boundary on
        __ARM_EABI__.

        Reported-by: Damir Shayhutdinov <damir@altlinux.org>

2011-05-30  Damir Shayhutdinov  <damir@altlinux.ru>

        Linux: implement decoding of preadv and pwritev syscalls.
        * io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions.
        * linux/syscall.h (sys_preadv, sys_pwritev): Declare them.
        * linux/*/syscallent.h: Use them.

2011-05-30  Denys Vlasenko  <dvlasenk@redhat.com>

        "Modernize" all old-style function parameter declarations.
        * bjm.c: Convert all remaining old-style C function definitions
        to a "modern" form. This does not change any actual code.
        * io.c: Likewise
        * ioctl.c: Likewise
        * net.c: Likewise
        * proc.c: Likewise
        * process.c: Likewise
        * signal.c: Likewise
        * sock.c: Likewise
        * strace.c: Likewise
        * stream.c: Likewise
        * syscall.c: Likewise
        * system.c: Likewise
        * time.c: Likewise
        * util.c: Likewise

2011-05-27  Denys Vlasenko  <dvlasenk@redhat.com>

        Cleanups on top of "handle SIGTRAP properly" change, based on Dmitry's comments.
        * defs.h ([p]error_msg[_and_die]): Declare new functions.
        * strace.c (SYSCALLTRAP): Rename to syscall_trap_sig.
        ([p]error_msg[_and_die]): Define new functions.
        (strace_tracer_pid): New variable, it controls which pid will
        do cleanup on exit via [p]error_msg_and_die.
        (main): Set strace_tracer_pid to our initial pid.
        (startup_attach): Change strace_tracer_pid if we are in -D mode.
        (test_ptrace_setoptions_for_all): Minor changes to logic,
        such as better diagnostic messages.

2011-05-25  Denys Vlasenko  <dvlasenk@redhat.com>

        Identifier "errno" may be a macro, it's unsafe to use it.
        * strace.c (strerror): Rename parameter errno to err_no

2011-05-24  Denys Vlasenko  <dvlasenk@redhat.com>

        Don't perform TCB_WAITEXECVE wait if not needed.
        * defs.h (ptrace_setoptions_for_all): Expose this variable.
        * strace.c (ptrace_setoptions_for_all): Remove "static".
        * process.c (internal_exec): Don't set TCB_WAITEXECVE bit
        if we know that post-execve SIGTRAP is not going to happen.

2011-05-23  Denys Vlasenko  <dvlasenk@redhat.com>

        Properly handle real SIGTRAPs.
        * defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork.
        * process.c (internal_fork): Ditto.
        * strace.c (ptrace_setoptions_for_all): New variable.
        (SYSCALLTRAP): New variable.
        (error_msg_and_die): New function.
        (test_ptrace_setoptions_for_all): New function.
        (main): Call test_ptrace_setoptions_for_all() at init.
        (handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it).
        (trace): Check events and set ptrace options without -f too.
        Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP.

2011-04-24  Mike Frysinger  <vapier@gentoo.org>

        Blackfin: update syscall list.

        * linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at,
        clock_adjtime, and syncfs syscalls.

2011-04-24  Mike Frysinger  <vapier@gentoo.org>

        linux: add new EHWPOISON errno.

        * linux/errnoent.h: Change ERRNO_133 to EHWPOISON.

2011-04-08  Grant Edwards  <grant.b.edwards@gmail.com>

        Add ability to print file descriptor paths and filter by those paths.
        * pathtrace.c: New file, implements matching syscall arguments to
        user-specified file paths.
        * Makefile.am (strace_SOURCES): Add pathtrace.c.
        * defs.h (TCB_FILTERED, filtered): New defines.
        (getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
        tracing_paths): New declarations.
        * strace.c (show_fd_path, tracing_paths): New global variables.
        (usage, main): Implement handling of -y and -P options.
        * strace.1: Add descriptions of -y and -P options.
        * syscall.c (trace_syscall_entering): Add path matching logic to the
        print/noprint decision and set the TCB_FILTERED bit appropriately.
        (trace_syscall_exiting): Use filtered() macro that checks the
        TCB_FILTERED bit to determine print/noprint status.
        * util.c (printfd): Use getfdpath().

2011-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix BLKTRACESTOP definition.
        * block.c: Fix typo in the check for BLKTRACESTOP.
        Reported by Gabor Z. Papp.

2011-03-15  Dmitry V. Levin  <ldv@altlinux.org>

        Ensure that PTRACE_GETSIGINFO et al are always defined on Linux.
        * configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants.
        * defs.h [LINUX]: Define those PTRACE_* constants that are not provided
        by <sys/ptrace.h>.

        * CREDITS.in: Fix typo.

2011-03-14  Dmitry V. Levin  <ldv@altlinux.org>

        Update PTRACE_* constants.
        * process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET.

        Prepare for 4.6 release.
        * NEWS: Update for 4.6 release.
        * configure.ac: Version 4.6.
        * debian/changelog: 4.6-1.
        * strace.spec: 4.6-1.

2011-03-14  Mike Frysinger  <vapier@gentoo.org>

        linux/ioctlent: unify them all.
        This unifies all the ioctlent.h's in the linux subdir while still
        allowing each arch to maintain its own minor list.

        The basic method is:
        - each arch has linux/<arch>/ioctlent.h.in which defines only the
        arch-specific ioctls;
        - linux/ioctlent.h.in which defines only the common ioctls;
        - at build time, these two headers are combined and sorted to produce
        the linux/ioctlent.h file.

        This also requires a little tweaking of the include files since the
        common ioctlent.h is a built file.

        * linux/ioctlent.h: Split into linux/ioctlent.h.in and
        linux/i386/ioctlent.h.in, remove asm entries from the former, remove
        non-asm entries from the latter.
        * linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove
        non-asm entries.
        * linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove
        non-asm entries.
        * linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove
        non-asm entries.
        * linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove
        non-asm entries.
        * linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove
        non-asm entries.
        * linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in,
        remove non-asm entries.
        * linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove
        non-asm entries.
        * linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove
        non-asm entries.
        * linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove
        non-asm entries.
        * linux/arm/ioctlent.h.in: New file.
        * linux/avr32/ioctlent.h.in: Likewise.
        * linux/i386/ioctlent.h.in: Likewise.
        * linux/m68k/ioctlent.h.in: Likewise.
        * linux/microblaze/ioctlent.h.in: Likewise.
        * linux/tile/ioctlent.h.in: Likewise.
        * linux/x86_64/ioctlent.h.in: Likewise.
        * linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of
        ioctlent.h.
        * linux/sh64/ioctlent.h.in: Likewise.
        * linux/sparc64/ioctlent.h.in: Likewise.
        * linux/arm/ioctlent1.h: Update ioctlent.h include.
        * linux/powerpc/ioctlent1.h: Likewise.
        * linux/sparc/ioctlent1.h: Likewise.
        * linux/sparc64/ioctlent1.h: Likewise.
        * linux/x86_64/ioctlent1.h: Likewise.
        * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS).
        (EXTRA_DIST): Update.
        [MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in.
        [LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules.
        * .gitignore: Add linux/ioctlent.h.

2011-03-10  Dmitry V. Levin  <ldv@altlinux.org>

        Show more details about signals received by traced processess.
        * strace.c [!USE_PROCFS] (trace): Differentiate output format depending
        on PTRACE_GETSIGINFO success or failure.  In the former case, use
        printsiginfo() to show more details about received signal.

        Get rid of PT_GETSIGINFO.
        * strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is
        available.  Replace PT_GETSIGINFO with PTRACE_GETSIGINFO.  Use
        PTRACE_GETSIGINFO for all signals.

        Enhance decoding of kernel-generated signals.
        * signal.c (printsiginfo) [LINUX]: Do not print uninteresting
        zero-initialized fields.

        Fix decoding of user-generated signals.
        * signal.c [LINUX] (SI_FROMUSER): Define.
        [LINUX || SVR4] (printsiginfo) [SI_FROMUSER]: Enhance decoding.

        Recognize SI_KERNEL and SI_ASYNCNL.
        * signal.c [LINUX] (SI_KERNEL, SI_ASYNCNL): Define.
        [LINUX || SVR4] (siginfo_codes): Add entries for SI_KERNEL and
        SI_ASYNCNL, reorder entries.

2011-03-05  Sebastian Pipping  <sebastian@pipping.org>

        Take all git branches into account for generation of CREDITS file.
        * Makefile.am: Make CREDITS target depend on all git branches.

2011-03-04  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of file descriptors.
        * defs.h (printfd): New function prototype.
        * util.c (printfd): New function.
        * file.c (print_dirfd): Update prototype to use printfd().
        (sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat,
        sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat,
        sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd().
        (sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64,
        sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64,
        sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync,
        sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr,
        sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64,
        sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch,
        sys_fallocate): Use printfd() for decoding of file descriptors.
        * desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2,
        decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for
        decoding of file descriptors.
        * io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread,
        sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64,
        sys_ioctl): Likewise.
        * mem.c (print_mmap, sys_mmap64): Likewise.
        * signal.c (do_signalfd): Likewise.
        * stream.c (decode_poll): Likewise.
        * time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise.
        Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.

2011-03-03  Sebastian Pipping  <sebastian@pipping.org>

        Print shutdown(2) modes as SHUT_* constants.
        * net.c (shutdown_modes): New xlat structure.
        (sys_shutdown): Use shutdown_modes to decode 2nd syscall argument.

        Fix decoding of inotify_init1() flags.
        * file.c (inotify_init_flags): New xlat structure.
        (sys_inotify_init1): Use it instead of open_mode_flags.

2011-03-03  Dmitry V. Levin  <ldv@altlinux.org>

        Fix struct xlat initialization bugs.
        * file.c (inotify_modes): Terminate with NULL entry.
        * net.c (sock_type_flags): Make this array static.
        (socketlayers): Add a comment that this array should remain not
        NULL-terminated.

        tests: avoid SIGPIPE.
        * tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null".
        The former may result to strace being killed by SIGPIPE, which in
        certain configuratons may lead to generation of a core file.
        Suggested by Mike Frysinger.

2011-03-01  Mike Frysinger  <vapier@gentoo.org>

        tests: do not make missing /usr/bin/time a failure.
        * tests/init.sh (framework_skip_): New function.
        (check_prog): Use it instead of framework_failure_.

2011-02-27  Dmitry V. Levin  <ldv@altlinux.org>

        Generate an xz tar archive of the distribution.
        * configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with dist-xz.
        * Makefile.am: Update srpm target.
        * make-dist: Update for dist-xz.
        * strace.spec: Update Source tag.
        * debian/watch: Update regexp.
        * .gitignore: Add strace-*.tar.xz.

        Use "make check" in debian/rules and strace.spec.
        * debian/control: Update Build-Depends.
        * debian/rules: Run "make check".
        * strace.spec: Update BuildRequires. Run "make check" in %check section.

        Implement two basic "strace -f" tests.
        * Makefile.am (SUBDIRS): Add tests.
        * configure.ac (AC_CONFIG_FILES): Add tests/Makefile.
        * tests/.gitignore: New file.
        * tests/Makefile.am: Likewise.
        * tests/init.sh: Likewise.
        * tests/ptrace_setoptions: Likewise.
        * tests/strace-f: Likewise.

2011-02-26  Dmitry V. Levin  <ldv@altlinux.org>

        ppc, s390, sparc: regenerate ioctlent.h files.
        * linux/powerpc/ioctlent.h: Regenerated using Fedora 15 kernel headers.
        * linux/s390/ioctlent.h: Likewise.
        * linux/sparc/ioctlent.h: Likewise.

        Remove redundant ioctlent.h files.
        * linux/s390x/ioctlent.h: Replace old contents with include of
        s390/ioctlent.h file.
        * linux/sparc64/ioctlent.h: Replace old contents with include of
        sparc/ioctlent.h file.

2011-02-25  Dmitry V. Levin  <ldv@altlinux.org>

        ioctlsort: sync with ioctl_lookup()
        * linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with
        ioctl_lookup() which looks at these bits only.

        Remove obsolete .cvsignore files.
        * test/.cvsignore: Rename to test/.gitignore.
        * */.cvsignore, */*/.cvsignore: Removed.

        Ignore generated intermediate header files.
        * .gitignore: Add ioctls.h and ioctldefs.h.

2011-02-24  Dmitry V. Levin  <ldv@altlinux.org>

        Generate much of the CREDITS file from git log.
        * CREDITS.in: New file, derived from CREDITS, without names of
        those who are listed as git log 'Author:'s.
        * CREDITS: Remove file.
        * Makefile.am [MAINTAINER_MODE] (CREDITS): New rule.
        * .gitignore: Add CREDITS.
        * .mailmap: New file, required to map git author names and email
        addresses to canonical/preferred form.

2011-02-23  Dmitry V. Levin  <ldv@altlinux.org>

        sparc: fix compilation warning.
        * file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size
        to unsigned long.

        Update the list of files that must be distributed.
        * Makefile.am (EXTRA_DIST): Add debian/source/format, debian/watch,
        linux/ia64/signalent.h, linux/powerpc/ioctlent1.h,
        linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h,
        linux/powerpc/signalent1.h.

        Fix compilation warning reported by gcc -Wunused-but-set-variable.
        * process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable.

2011-02-22  Mike Frysinger  <vapier@gentoo.org>

        ioctlsort: zero pad ioctl codes to 4 places.
        Zero padding the ioctl number will allow simple sorting via shell scripts.

        * linux/ioctlsort.c (main): Output ioctl codes zero padded.
        * linux/ioctlent.h: Regenerated.

2011-02-22  Mike Frysinger  <vapier@gentoo.org>

        Update mount flags to latest linux.
        * system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
        MS_STRICTATIME, MS_BORN): Define.
        (mount_flags): Add MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
        MS_STRICTATIME, MS_BORN.

2011-02-22  Dmitry V. Levin  <ldv@altlinux.org>

        Sync debian/changelog and strace.spec with packages.
        * debian/changelog: Sync with 4.5.20-2.
        * strace.spec: Likewise.

2011-02-20  Dmitry V. Levin  <ldv@altlinux.org>

        Add TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries.
        * linux/*/syscallent.h: Add TD flag to fanotify_init.  Add TD|TF flags
        to fanotify_mark.

        Fix flags of fallocate sysentries.
        * linux/*/syscallent.h: Fix sys_fallocate flags.

        Add TRACE_DESC flag to epoll_create* sysentries.
        * linux/*/syscallent.h: Add TD flag to sys_epoll_create and
        sys_epoll_create1.

        Add TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries
        * linux/*/syscallent.h: Add TD flag to sys_fgetxattr, sys_flistxattr,
        and fremovexattr.

        Add TRACE_FILE flag to swapoff sysentries.
        * linux/*/syscallent.h: Add TF flag to sys_swapoff.

        Add TRACE_DESC flag to fadvise64* sysentries.
        * linux/*/syscallent.h: Add TD flag to sys_fadvise64 and
        sys_fadvise64_64.

        Add TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries.
        * linux/*/syscallent.h: Add TD flag to sys_mmap and sys_old_mmap.

        Do not initialize native_scno on platforms with only one personality.
        * linux/bfin/syscallent.h: Remove redundant native_scno initialization.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.

        Add LOOP_* ioctls defined in linux/loop.h.
        * linux/ioctlent.sh: Add LOOP_* ioctls (0x4C..) defined in linux/loop.h
        header file.
        * linux/ioctlent.h: Regenerated.
        Reported by Mike Frysinger.

2011-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions()
        * strace.c (handle_ptrace_event): Fix PTRACE_GETEVENTMSG usage.
        (test_ptrace_setoptions): Test that PTRACE_GETEVENTMSG works properly.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

        linux/sparc: move to common syscall.h.
        Rather than constantly deal with the sparc/syscall.h going stale, merge
        the few sparc-specific pieces into the linux/syscall.h header.

        * linux/syscall.h: Add sparc-specific pieces from sparc/syscall.h.
        * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h and
        linux/sparc64/syscall.h.
        * linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

        sparc: add new funcs to syscall.h.
        Sync missing defs from the common syscall.h here.

        * linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and
        sys_pwrite64 prototypes.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

        sparc: punt unused syscall.h.2.
        I can't find any mention of this header actually being used.
        Seems to be a really old copy of the common syscall.h.

        * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h.2.
        * linux/sparc/syscall.h.2: Deleted.

2011-02-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix raw exit_group(2) decoding.
        * syscall.c (trace_syscall_entering): Check for sys_exit instead of
        SYS_exit to handle exit_group(2) as well as _exit(2).

2011-02-18  Dmitry V. Levin  <ldv@altlinux.org>

        Optimize known_scno()
        * syscall.c (known_scno): Do not check for native_scno field on
        platforms that support only one personality.

        * process.c (internal_exit) [IA64]: Remove redundant check.

2011-02-09  Dmitry V. Levin  <ldv@altlinux.org>

        Fix biarch support in IO dumping.
        * syscall.c (dumpio): Switch on tcp->sys_func instead of tcp->scno
        for more reliable results.

        Simplify tprintf() declaration.
        * defs.h (tprintf): Simplify declaration.

2011-02-05  Dmitry V. Levin  <ldv@altlinux.org>

        * defs.h (SYSCALL_NEVER_FAILS): Fix typo.

2011-01-19  Dmitry V. Levin  <ldv@altlinux.org>

        Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values.
        * defs.h (SYSCALL_NEVER_FAILS): New syscall flag.
        * linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id
        and setfs[ug]id.
        * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id,
        gete[ug]id and setfs[ug]id syscalls.
        * process.c [LINUX] (sys_getuid, sys_setfsuid): New functions.
        * syscall.c (NF): New shorthand macro for use in syscallent.h files.
        (get_error): Check SYSCALL_NEVER_FAILS flag.
        Reported by Марк Коренберг <socketpair@gmail.com>.

        * linux/*/syscallent.h: Fix typo in sys_newfstatat syscall flags.

2011-01-18  Mike Frysinger  <vapier@gentoo.org>

        Blackfin: update ioctl list.
        * linux/bfin/ioctlent.h: Sync with latest kernel sources.

2011-01-17  Dmitry V. Levin  <ldv@altlinux.org>

        Fix stat64 decoding on mips.
        * linux/mips/syscallent.h: Use sys_stat64() to decode stat64 syscall.
        This fixes Debian bug #599028.

        Update linux/*/syscallent.h files to match Linux kernel v2.6.37.
        * linux/alpha/syscallent.h: Add hooks for fanotify_init, fanotify_mark,
        and prlimit64.
        * linux/i386/syscallent.h: Likewise.
        * linux/ia64/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/microblaze/syscallent.h: Likewise.
        * linux/mips/syscallent.h: Likewise.
        * linux/powerpc/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/x86_64/syscallent.h: Likewise.
        * linux/arm/syscallent.h: Add hooks for accept4, fanotify_init,
        fanotify_mark, and prlimit64.
        * linux/hppa/syscallent.h: Add hook for prlimit64.

2011-01-16  Dmitry V. Levin  <ldv@altlinux.org>

        block.c: cleanup.
        * block.c: Include <inttypes.h>.
        (print_blkpg_req): Always decode struct blkpg_ioctl_arg.
        Robustify decoding of strings.
        (block_ioctl): Do not decode return values passed by pointers on exit
        from failed syscalls.
        Use format macros from inttypes.h to print values of type uint64_t.

2011-01-15  Dmitry V. Levin  <ldv@altlinux.org>

        Add block ioctl support.
        * block.c: New file.
        * Makefile.am (strace_SOURCES): Add it.
        * defs.h [LINUX] (block_ioctl): New function.
        * ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK*
        ioctls.
        Patch by Jeff Mahoney <jeffm@suse.com>

2011-01-14  Holger Hans Peter Freyther  <zecke@selfish.org>

        Parse SOL_SCTP socket options.
        * configure.ac (AC_CHECK_HEADERS): Add netinet/sctp.h.
        * net.c [HAVE_NETINET_SCTP_H]: Include <netinet/sctp.h>.
        [SOL_SCTP] (socksctpoptions): New xlat structure.
        (sys_getsockopt, printsockopt): Parse SOL_SCTP options.

        * net.c (socketlayers): Add more SOL_* constants from linux/socket.h.

2011-01-14  Dmitry V. Levin  <ldv@altlinux.org>

        strace.1: fix misleading italics.
        * strace.1: Use bold instead of italics for "-e trace=" keywords.
        This fixes Debian bug #589323.

        Update linux/ioctlent.h.
        * linux/ioctlent.h: Regenerate using linux v2.6.37 headers.

        Add HDIO_* ioctls defined in linux/hdreg.h.
        * linux/ioctlent.sh: Add HDIO_* ioctls (0x03..) defined in
        linux/hdreg.h header file.
        This fixes Debian bug #450953.

2011-01-13  Dmitry V. Levin  <ldv@altlinux.org>

        Test PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK along with PTRACE_O_TRACEFORK
        * strace.c (test_ptrace_setoptions): Add PTRACE_O_TRACECLONE and
        PTRACE_O_TRACEVFORK to PTRACE_SETOPTIONS call, to test exactly
        the same set of options that is going to be used later in trace().

2011-01-10  Dmitry V. Levin  <ldv@altlinux.org>

        * net.c (protocols): Add more IPPROTO_* constants defined in netinet/in.h

2011-01-10  Holger Hans Peter Freyther  <holger@freyther.de>

        * net.c (protocols): Add IPPROTO_GRE, IPPROTO_SCTP and IPPROTO_UDPLITE.

2011-01-10  Carmelo AMOROSO  <carmelo.amoroso@st.com>

        sh: Add entry for not-multiplexed accept4.
        * linux/sh/syscallent.h: Add specific entry for not-multiplexed accept4
        available in kernel mainline since v2.6.37-rc6, see
        http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21b6e4c7106b2d68a6710506d8706608272fd78b

2010-12-14  Carmelo AMOROSO  <carmelo.amoroso@st.com>

        sh: Add entries for not-multiplexed socket calls.
        * linux/sh/syscallent.h: Add specific entries for not-multiplexed
        socket calls (available in kernel mainline since v2.6.37-rc1)

        sh: Fix compilation warning in do_pipe due to missing prototype.
        * defs.h [SH]: Make getrval2 prototype visible to do_pipe
        and fix the following compiler warning:
        .../net.c: In function 'do_pipe':
        .../net.c:1632: warning: implicit declaration of function 'getrval2'
        .../net.c:1632: warning: format '%lu' expects type 'long unsigned int',
        but argument 3 has type 'int'

2010-12-14  Dmitry V. Levin  <ldv@altlinux.org>

        Fix build on uClibc.
        * defs.h [LINUX]: Define PTRACE_GETEVENTMSG macro.
        Patch by Douglas Mencken <dougmencken@gmail.com>.

2010-12-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix strace -f -o '|command' hangup.
        * strace.c (main): Call test_ptrace_setoptions() before parsing
        -o option, otherwise a forked command will cause a hangup inside
        test_ptrace_setoptions().

2010-12-03  Dmitry V. Levin  <ldv@altlinux.org>

        Output diagnostics to stderr.
        * syscall.c (get_scno): Output information about changes in
        personality mode to stderr.  Reported by Pádraig Brady.

        Recognize more clone flags.
        * process.c (CLONE_*): Define more flags from linux v2.6.25.
        (clone_flags): Add entries for them.
        Proposed by <zhangyanfei@cn.fujitsu.com>.

        Decode struct ucred for getsockopt SO_PEERCRED.
        * net.c (sys_getsockopt): Decode SO_PEERCRED.
        Proposed by Arkadiusz Miśkiewicz <arekm@maven.pl>.

2010-12-03  Carmelo AMOROSO  <carmelo.amoroso@st.com>

        sh: Add support for tracing sys_cacheflush system call.
        * linux/sh/syscallent.h: Update sys_cacheflush entry.
        * linux/syscall.h [SH] (sys_cacheflush): New function declaration.
        * system.c [SH] (cacheflush_flags): New xlat structure.
        [SH] (sys_cacheflush): New function.

        Reviewed-by: Angelo Castello <angelo.castello@st.com>

2010-11-30  Dmitry V. Levin  <ldv@altlinux.org>

        Cleanup test_ptrace_setoptions()
        * strace.c (test_ptrace_setoptions): Cleanup.
        (main): Fix test_ptrace_setoptions() error diagnostics message.
        Print ptrace_setoptions value in debug mode.

2010-11-30  Wang Chao  <wang.chao@cn.fujitsu.com>

        Handle followfork using ptrace_setoptions if available.
        If PTRACE_O_TRACECLONE et al options are supported by kernel,
        use them to do followfork rather than the original setbpt
        method that changes registers ourselves.

        * defs.h [LINUX] (handle_new_child): New function prototype.
        * process.c [LINUX] (handle_new_child): New function based on the
        code from internal_fork(), with a trivial change: do reparent only
        for sys_clone.
        [LINUX] (internal_fork): Use handle_new_child().  Do nothing if
        ptrace_setoptions is in effect.
        * strace.c [LINUX] (handle_ptrace_event): New function.
        [LINUX] (trace): If ptrace_setoptions is in effect, then
        call the new function to handle PTRACE_EVENT_* status, and
        set PTRACE_SETOPTIONS when we see the initial stop of tracee.

2010-11-30  Wang Chao  <wang.chao@cn.fujitsu.com>

        Test how PTRACE_SETOPTIONS support works.
        Currently test fork related options only.  Fork a child that uses
        PTRACE_TRACEME at startup and then does a fork so strace can test
        how the PTRACE_SETOPTIONS support works before it handles any real
        tracee.  Since PTRACE_O_TRACECLONE/*FORK were introduced to kernel
        at the same time, this test seems to be enough for these 3 options.

        * defs.h [LINUX]: Define PTRACE_O_TRACECLONE et al macros here.
        (ptrace_setoptions): New variable declaration.
        * strace.c [LINUX] (test_ptrace_setoptions): New function, tests
        whether kernel supports PTRACE_O_CLONE/*FORK, the result is stored
        in the new variable ptrace_setoptions for later use.
        (main): Call test_ptrace_setoptions() if followfork option is set.

2010-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Enable support for less verbose build rules.
        * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules.

2010-09-17  Wang Chao  <wang.chao@cn.fujitsu.com>

        Do not trace children cloned with CLONE_UNTRACED flag.
        If clone is called with flag CLONE_UNTRACED, to be consistent with
        option PTRACE_O_TRACECLONE, we should not set CLONE_PTRACE flag on
        its arguments.

        * process.c [LINUX] (internal_fork): Check the syscall and arguments.

2010-09-17  Dmitry V. Levin  <ldv@altlinux.org>

        Update the list of CLOCK_* constants to match Linux kernel v2.6.32+
        * time.c (struct xlat clocknames[]): Add more RT clock IDs.
        Reported by Tommi Rantala.

2010-09-16  Dmitry V. Levin  <ldv@altlinux.org>

        Update linux/hppa/syscallent.h to match Linux kernel v2.6.35.
        * linux/hppa/syscallent.h: Add hooks for recvmmsg and accept4.

2010-09-15  Dmitry V. Levin  <ldv@altlinux.org>

        Pass less information to qualify_one and qual_*
        * syscall.c (qualify_one, qual_syscall, qual_signal, qual_fault,
        qual_desc): Take just a bitflag argument instead of pointer to the whole
        qual_options structure.
        (struct qual_options): Update prototype of "qualify" field.
        (qualify): Update use of qualify_one and qual_options->qualify.

2010-09-15  Wang Chao  <wang.chao@cn.fujitsu.com>

        Fix -e option with only one value in qualifier statement.
        Fix regression introduced by commit v4.5.20-19-g30145dd:
        if -e option is used with only one value in qualifier statement,
        e.g. 'strace -e trace=open ls', syscall information would not be
        printed properly.

        * syscall.c (qualify): Remove faulty optimization.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

        Fix off_t/rlim_t size checks when cross-compiling.
        The current off_t/rlim_t size checks (wrt size of long long) use AC_RUN
        which obviously doesn't work when cross-compiling.  While we don't hit
        any configure errors, the fall back code is pretty dumb (which is to say
        there isn't any).  Considering the code in question though, we can use
        some fun compiler tricks with sizeof and array lengths to turn it into
        a pure build test and avoid the RUN issue completely.

        * m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG):
        Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

        Fix long long little endian detection when cross-compiling.
        The long long endian detection code does an AC_TRY_RUN() and since that
        doesn't work when cross-compiling, it sets a fallback value.  However,
        rather than do any sort of default endian detection, the code simply
        sets it to "no".  This probably breaks most little endian systems out
        there when cross-compiling for them.  It certainly breaks Blackfin
        systems.  So use the common endian detection code provided by autoconf
        and key off of that when cross-compiling.

        * configure.ac: Call AC_C_BIGENDIAN.
        * m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling
        logic based on ac_cv_c_bigendian.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

        Blackfin: decode new syscalls.
        * linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls.
        * linux/syscall.h: Add sys_cacheflush() decl.
        * system.c: Decode Blackfin's cacheflush syscall.

        * linux/ioctlent.sh: Search a few non-exported paths.

2010-09-15  Roland McGrath  <roland@redhat.com>

        Clean up pid2tcb usage.
        * strace.c (pid2tcb): Always match pid.  Fail for argument <= 0.
        [USE_PROCFS] (first_used_tcb): New function.
        [USE_PROCFS] (trace): Use that instead of pid2tcb(0).

2010-09-09  Dmitry V. Levin  <ldv@altlinux.org>

        Turn on more compiler warnings.
        * configure.ac: Enable gcc -Wwrite-strings.

        Import warnings.m4 from gnulib.
        * m4/warnings.m4: Replace with warnings.m4 from gnulib.
        * configure.ac: Use gl_WARN_ADD from new warnings.m4.
        * Makefile.am (AM_CFLAGS): Update for new warnings.m4.

        Split acinclude.m4.
        * Makefile.am (ACLOCAL_AMFLAGS): Add "-I m4".
        * acinclude.m4: Remove.
        * m4/includedir.m4: New file, with definition of AC_INCLUDEDIR from
        acinclude.m4.
        * m4/long_long.m4: New file, with definitions of AC_OFF_T_IS_LONG_LONG,
        AC_RLIM_T_IS_LONG_LONG and AC_LITTLE_ENDIAN_LONG_LONG from acinclude.m4.
        * m4/procfs.m4: New file, with definitions of AC_MP_PROCFS,
        AC_POLLABLE_PROCFS and AC_STRUCT_PR_SYSCALL from acinclude.m4.
        * m4/stat.m4: New file, with definition of AC_STAT64 from acinclude.m4.
        * m4/statfs.m4: New file, with definition of AC_STATFS64 from
        acinclude.m4.
        * m4/warnings.m4: New file, with definition of AC_WARNFLAGS from
        acinclude.m4.

        * process.c (sys_waitid): Remove unused variable.

2010-09-07  Dmitry V. Levin  <ldv@altlinux.org>

        Fix const-correctness issues uncovered by gcc -Wwrite-strings.
        * defs.h (struct xlat): Add const qualifier to the field of
        type "char *".
        (set_sortby, qualify, printnum, printnum_int): Add const qualifier to
        arguments of type "char *".
        * count.c (set_sortby): Add const qualifier to the argument and
        automatic variable of type "char *".
        * desc.c (decode_select): Add const qualifier to automatic variables of
        type "char *".
        * ioctlsort.c (struct ioctlent): Add const qualifier to fields of
        type "char *".
        (main):  Add const qualifier to argv.
        * process.c (printargv): Add const qualifier to the argument and
        automatic variable of type "char *".
        (printargc) Add const qualifier to argument of type "char *".
        * signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to
        arguments of type "char *".
        * strace.c (progname): Add const qualifier.
        (detach): Add const qualifier to automatic variable of type "char *".
        * stream.c (struct strbuf): Add const qualifier to the field of
        type "char *".
        * syscall.c (struct qual_options): Add const qualifier to fields of
        type "char *".
        (qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier
        to arguments of type "char *".
        (qual_signal): Add const qualifier to the argument of type "char *",
        avoid modification of constant argument.
        (qualify): Likewise.
        * util.c (printflags): Add const qualifier to automatic variable of
        type "char *".
        (printnum, printnum_int): Add const qualifier to arguments of
        type "char *".

2010-09-04  Wang Chao  <wang.chao@cn.fujitsu.com>

        Fix printing clone flags.
        When we trace clone() syscall with only exit signal as clone
        flags, strace would print an unnecessary OR operator.

        * process.c (sys_clone): Fix this.

2010-08-28  Wang Chao  <wang.chao@cn.fujitsu.com>

        Drop nclone_detached and related flags.
        Remove nclone_detached since CLONE_DETACHED flag was no-op for a very
        long time in kernel.

        * defs.h (struct tcb): Remove nclone_detached field.
        Remove TCB_CLONE_DETACHED flag.
        * process.c: Remove CLONE_DETACHED flag.
        (clone_flags): Remove CLONE_DETACHED entry.
        (internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED
        flag and nclone_detached.
        * strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit):
        Likewise.

2010-08-09  Neil Campbell  <lists@thebatcave.org.uk>

        Correct get/set_robust_list syscall numbers for powerpc.
        * linux/powerpc/syscallent.h: Swap positions of get_ and set_robust_list.

2010-08-09  Wang Chao  <wang.chao@cn.fujitsu.com>

        Handle CLONE_PARENT flag.
        * process.c (internal_fork): The parent of new cloned process is the
        same of the calling process when CLONE_PARENT is set.

        Fix error when judging if process has children.
        * process.c (internal_wait): Processes counted in tcp->nclone_threads
        are tcp's threads, rather than tcp's children.

2010-08-09  Wang Chao  <wang.chao@cn.fujitsu.com>

        Forbid using mutually exclusive options -D and -p together.
        If we use -D and -p option together to trace a multi-thread program, in
        addition to the main thread, other threads could not be traced even if we
        present -f option. Moreover, when executing 'strace -D -p <non-exist pid>',
        strace could not terminate normally.

        * strace.c (main): Check it.

2010-08-05  David Daney  <ddaney@caviumnetworks.com>

        Update Linux MIPS syscalls to match 2.6.35-rc6+
        * linux/mips/syscallent.h: Add and update 405 hooks.

2010-08-05  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

        Add support for the MicroBlaze architecture.
        * configure.ac: Recognize MicroBlaze.
        * linux/microblaze/syscallent.h: New file.
        * Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h
        * process.c (change_syscall, struct_user_offsets): Add MicroBlaze
        support.
        * signal.c (sys_sigreturn): Likewise.
        * syscall.c (internal_syscall, get_scno, syscall_fixup, get_error,
        syscall_enter): Likewise.

2010-08-05  Frederik Schüler  <fs@debian.org>

        linux/sparc: add missing syscall declarations.
        * linux/sparc/syscall.h: Sync with linux/syscall.h

2010-07-17  Andreas Schwab  <schwab@linux-m68k.org>

        Handle biarch get/setrlimit.
        * resource.c (print_rlimit32) [POWERPC64 || X86_64]: Define.
        (sys_getrlimit, sys_setrlimit) [POWERPC64 || X86_64]: Use it.

2010-07-13  Andreas Schwab  <schwab@linux-m68k.org>

        Add biarch support for powerpc64.
        * acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of
        long.
        * configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if
        $host_cpu = powerpc64.
        * defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE)
        (PERSONALITY1_WORDSIZE) [POWERPC64]: Define.
        * file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]:
        Define.
        (printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in
        32-bit personality.
        (sys_newfstatat) [POWERPC64]: Handle personalities.
        * signal.c (sys_sigreturn) [POWERPC64]: Likewise.
        * util.c (printllval) [POWERPC64]: Likewise.
        (printcall) [POWERPC64]: Use wider format for IP prefix.
        * syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode.
        * linux/powerpc/errnoent1.h: New file.
        * linux/powerpc/ioctlent1.h: New file.
        * linux/powerpc/signalent1.h: New file.
        * linux/powerpc/syscallent1.h: New file.

2010-07-09  Andreas Schwab  <schwab@redhat.com>

        Balance braces.
        * strace.c (proc_open): Avoid unbalanced braces.
        (trace): Likewise.

2010-07-06  Andreas Schwab  <schwab@linux-m68k.org>

        Remove extern declaration at file scope.
        * defs.h (force_result): Declare.
        * process.c (internal_wait): Don't declare force_result.

2010-06-24  Andreas Schwab  <schwab@redhat.com>

        Document -C/-D.
        * strace.c (usage): Document -C.
        * strace.1: Document -D.

2010-06-13  Roland McGrath  <roland@redhat.com>

        Fix sourceforge download URL.

2010-06-05  Andreas Schwab  <schwab@linux-m68k.org>

        M68K: Fix fetching syscall arguments.
        * syscall.c (syscall_enter) [M68K]: Properly handle more than five
        syscall arguments.

2010-05-28  Andreas Schwab  <schwab@linux-m68k.org>

        Decode TLS syscalls on m68k.
        * linux/m68k/syscallent.h: Add entries for get_thread_area,
        set_thread_area, atomic_comxchg_32, atomic_barrier.
        * linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]:
        Don't redefine.
        * mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New.

        Fix warning when compiling for m68k.
        * syscall.c (d0): Define as long.

2010-04-13  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.5.20 release.
        * NEWS: Update for 4.5.20 release.
        * configure.ac: Version 4.5.20.
        * debian/changelog: 4.5.20-1.
        * strace.spec: 4.5.20-1.

2010-04-13  Frederik Schüler  <fs@debian.org>

        Update debian/* files for the upcoming release.
        * debian/control: update standards-version to 3.8.4.
        * debian/rules: allow parallel building.
        * debian/rules: comment out verbose build, only needed for debugging.
        * debian/rules: clean up clean: target, dh_clean does most of the work
          already.
        * debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy
          up for us.

2010-04-13  Heiko Carstens  <heiko.carstens@de.ibm.com>

        Fix s390 system call table list.
        * linux/s390/syscallent.h: Add the missing entries for preadv and
        pwritev to the system call table list.
        * linux/s390x/syscallent.h: Likewise.

2010-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        Update linux/ioctlent.h.
        * linux/ioctlent.sh: Search in asm-generic directory as well.
        * linux/ioctlent.h: Regenerated.

        Update linux/*/syscallent.h files to match Linux kernel v2.6.33.
        * linux/alpha/syscallent.h: Add 47 hooks.
        * linux/arm/syscallent.h: Update hooks for pselect6, ppoll,
        epoll_pwait.  Add 11 hooks.
        * linux/bfin/syscallent.h: Update hooks for prctl, fallocate,
        signalfd4, eventfd2, epoll_create1, dup3, pipe2, perf_event_open.
        Hook up recvmmsg.
        * linux/hppa/syscallent.h: Update hooks for signalfd4, eventfd2,
        epoll_create1, dup3, pipe2, perf_event_open.
        * linux/i386/syscallent.h: Fix syscall name for the kexec_load hook.
        Add 5 hooks.
        * linux/ia64/syscallent.h: Fix syscall name for the kexec_load hook.
        Add 4 hooks.
        * linux/m68k/syscallent.h: Add 50 hooks.
        * linux/powerpc/syscallent.h: Fix hook for timerfd_create.  Fix
        6 syscall names to match the kernel.  Use sys_semop to parse semop.
        Add 14 hooks.
        * linux/s390/syscallent.h: Fix syscall name for the kexec_load hook.
        Add 14 hooks.
        * linux/s390x/syscallent.h: Likewise.
        * linux/sh/syscallent.h: Add 13 hooks.
        * linux/sh64/syscallent.h: Add 15 hooks.
        * linux/sparc/syscallent.h: Add 22 hooks.
        * linux/x86_64/syscallent.h: Add 5 hooks.

        Enhance recvmmsg parser.
        * net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the
        syscall.  Decode timespec structure both on entrance and on exit.

2010-04-07  Andreas Schwab  <schwab@linux-m68k.org>

        Decode recvmmsg syscall.
        * net.c (do_msghr): New function to print struct msghdr.
        (printmsghdr): Use it.
        (printmmsghdr, sys_recvmmsg): New.
        * linux/syscall.h: Declare sys_recvmmsg.
        (SYS_sub_recvmmsg): Define.
        (SYS_socket_nsubcalls): Bump.
        * linux/sparc/syscall.h: Likewise.
        * linux/arm/syscallent.h: Add sys_recvmmsg.
        * linux/bfin/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/m68k/syscallent.h: Likewise.
        * linux/powerpc/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/ia64/syscallent.h: Adjust.

2010-04-07  Dmitry V. Levin  <ldv@altlinux.org>

        * strace.1: Fix quoting of hyphens and formatting of strace options.

        Split trace_syscall() for better readability.
        * syscall.c (trace_syscall): Split into trace_syscall_exiting() and
        trace_syscall_entering().

        Implement -C option to combine regular and -c output.
        * defs.h (cflag_t): New enum.
        * strace.1: Document -C option.
        * strace.c (cflag): Update type.
        (main): Handle -C option.
        (trace): Update use of cflag.
        * count.c (count_syscall): Move clearing of TCB_INSYSCALL to ...
        * syscall.c (trace_syscall): ... here.  Update use of cflag.
        Based on patch by Adrien Kunysz.

        Fix "make dist" regression introduced by commit v4.5.19-12-g5078770.
        * Makefile.am (EXTRA_DIST): Rename linux/syscallent.h to linux/i386/syscallent.h

        * desc.c (sys_epoll_pwait): Fix output formatting bug.

        * desc.c (decode_select): Fix potential stack buffer overflow.

2010-03-31  Dmitry V. Levin  <ldv@altlinux.org>

        Fix msgsnd indirect ipccall decoding.
        This regression was introduced by commit v4.5.18-136-g783f5bc.
        * ipc.c (tprint_msgsnd): Add and use "flags" argument.
        (sys_msgsnd): Pass "flags" argument to tprint_msgsnd().
        Patch by Anton Blanchard.

2010-03-23  Mark Wielaard  <mjw@redhat.com>

        Hook up inotify_init1 open mode flags printer.
        * file.c [LINUX] (sys_inotify_init1): New function.
        * linux/syscall.h: Declare new sys_inotify_init1 handler.
        * linux/bfin/syscallent.h: Hook up new handler.
        * linux/hppa/syscallent.h: Likewise.
        * linux/i386/syscallent.h: Likewise.
        * linux/x86_64/syscallent.h: Likewise.

2010-03-09  Andreas Schwab  <schwab@redhat.com>

        Avoid spurious error when checking for linux/netlink.h.
        * configure.ac: Include <asm/types.h> when checking for
        linux/netlink.h.

2010-02-23  Andreas Schwab  <schwab@linux-m68k.org>

        Fix reporting signal mask by sigreturn on powerpc.
        * signal.c (sys_sigreturn) [POWERPC]: Skip dummy stack frame when
        locating signal context.

2010-02-09  David Daney  <ddaney@caviumnetworks.com>

        Fix MIPS N32/N64 compile error.
        * syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass
        tcp->pid to ptrace().

2010-02-05  Chris Metcalf  <cmetcalf@tilera.com>

        Add support for the TILE architecture.
        * configure.ac: Add TILE to the list of supported architectures.
        * defs.h: Define TCB_WAITEXECVE for TILE.
        * linux/tile/syscallent.h: New file.
        * Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h
        * process.c (change_syscall, struct_user_offsets): Add TILE support.
        * syscall.c (get_scno, get_error, syscall_enter): Likewise.
        * mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions
        support.
        * signal.c (sigact_flags): Add SA_NOPTRACE.
        (sys_sigreturn): Add TILE support.

2010-02-04  Dmitry V. Levin  <ldv@altlinux.org>

        Remove dead code.
        * defs.h (tv_tv): Remove.
        * net.c (sys_xsetsockaddr): Remove commented out dead code.
        * process.c (setarg, sys_execv, sys_execve, struct_user_offsets):
        Likewise.
        * signal.c (sys_sigsuspend): Likewise.
        * strace.c (reaper, trace): Likewise.
        * stream.c (internal_stream_ioctl): Likewise.
        * syscall.c (trace_syscall): Likewise.
        * term.c (term_ioctl): Likewise.
        * util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt):
        Likewise.

        Merge Linux internal_clone() into internal_fork()
        * defs.h (internal_clone): Remove.
        * process.c (internal_clone): Merge into internal_fork().
        (internal_fork) [!LINUX]: Remove dead code.
        * syscall.c (internal_syscall): Replace internal_clone() with
        internal_fork().

        * Makefile.am (INCLUDES): Remove redundant search directories.

2010-02-04  Frederik Schüler  <fs@debian.org>

        Update debian/* files.
        * debian/control: add sparc64 to the architectures list.
        This closes Debian bug #560062
        * Backport commit f0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 to fix FTBFS.
        This closes Debian bug #560516
        * debian/control: Update standards-version to 3.8.3.
        * debian/control: Lower package priority to optional, matching
        the archive override.
        * debian/control: add ${misc:Depends} to Depends: lines where
        appropriate.
        * debian/watch: new file, allows automatic tracking of new
        upstream versions.
        * debian/source/format: new file, adapt to debian source format "quilt"
        * debian/rules: indentation cleanups; use dh_testroot and dh_prep
        in clean target.

2010-01-25  Andreas Schwab  <schwab@redhat.com>

        Fix spurious failure of AC_STAT64 test.
        * acinclude.m4 (AC_STAT64): Include <sys/types.h> first.

2010-01-12  Andreas Schwab  <schwab@redhat.com>

        Don't kill the process when detaching.
        * strace.c (detach): Call clearbpt when TCB_BPTSET is set.

2009-12-25  Dmitry V. Levin  <ldv@altlinux.org>

        Decode fifth argument of mremap syscall.
        * mem.c (sys_mremap): Decode fifth argument.
        * linux/*/syscallent.h: Update the number of mremap syscall arguments.

2009-12-24  Chris Metcalf  <cmetcalf@tilera.com>

        * mem.c (sys_mbind): Display first argument in hex.

        * mem.c (mremap_flags): Add MREMAP_FIXED.

2009-11-16  Mike Frysinger  <vapier@gentoo.org>

        Move i386-specific files out of common linux dir.
        * linux/syscallent.h: Moved to ...
        * linux/i386/syscallent.h: ... here.
        * linux/ia64/syscallent.h: Update i386 syscallent.h include.
        * linux/sparc/gen.pl: Likewise.
        * linux/x86_64/syscallent1.h: Likewise.

2009-11-16  Andreas Schwab  <schwab@redhat.com>

        Remove support for pre-C89.
        * defs.h: Remove references to __STDC__ and P macros.
        * strace.c: Likewise.

2009-11-13  Dmitry V. Levin  <ldv@altlinux.org>

        Decode more SOL_PACKET socket options.
        * net.c (sockpacketoptions): Add more PACKET_* entries.
        (sys_getsockopt): Decode PACKET_STATISTICS.
        (printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING.
        Patch by Gabor Gombas.

2009-11-11  Andreas Schwab  <schwab@redhat.com>

        Ignore errors if a thread is killed.
        * util.c (clearbpt): Ignore ESRCH error.

2009-11-06  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>

        Fix handling of Linux systems without struct statfs64.
        * acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64.
        * configure.ac: Call AC_STATFS64.
        * file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only
          if struct statfs64 is available.

2009-11-06  Dmitry V. Levin  <ldv@altlinux.org>

        Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int)
        * net.c (sys_getsockopt): Optimize output a bit.
        Decode integer argument using printnum_int(), patch by Gabor Gombas.

        Check umove() return code.
        * bjm.c (sys_query_module): Print input parameters when entering
        syscall.  Fix handling of syscall error.  Handle unlikely umove()
        failures.
        * ipc.c (tprint_msgrcv): New function.  Move part of msgrcv parser code
        here, add check umove() return code.
        (sys_msgsnd): Print msqid parameter as int instead of long.
        (sys_msgrcv): Likewise.  Use tprint_msgrcv().
        * process.c (print_affinitylist): Check umove() return code.
        * sock.c (sock_ioctl): Handle unlikely umove() failure in the
        SIOCGIFCONF parser.

        Fix check for linux/netlink.h on Linux 2.6.32-rc5+
        * configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include
        sys/socket.h instead of linux/socket.h beforehand.

2009-11-04  Andreas Schwab  <schwab@redhat.com>

        Decode fallocate on PowerPC.
        * linux/powerpc/syscallent.h: Decode fallocate.

        Factor out printing of 64bit syscall argument.
        * defs.h (ALIGN64): Remove.
        (printllval): Declare.
        * util.c (printllval): Define.
        * file.c (sys_readahead): Use printllval.
        (sys_lseek64): Likewise.
        (sys_truncate64): Likewise.
        (sys_ftruncate64): Likewise.
        (sys_fadvise64): Likewise.
        (sys_fadvise64_64): Likewise.
        (sys_fallocate): Likewise.
        * io.c (sys_pread): Likewise.
        (sys_pwrite): Likewise.
        (sys_pread64): Likewise.
        (sys_pwrite64): Likewise.
        * mem.c (sys_mmap64): Likewise.

2009-11-03  Andreas Schwab  <schwab@redhat.com>

        Correct decoding of readahead and fadvice64(_64) on PowerPC.
        * file.c (sys_readahead): Align 64bit argument.  Handle PowerPC64
        like other 64bit architectures.
        (sys_fadvise64): Likewise.
        (sys_fadvise64_64): Handle PowerPC like ARM.
        * linux/powerpc/syscallent.h (sys_readahead): Account for 64bit
        argument alignment on PowerPC32.

2009-10-27  Andreas Schwab  <schwab@redhat.com>

        Maintain separate print column for each process.
        * defs.h (struct tcp): Add curcol.
        * strace.c: (alloc_tcb): Initialize it.
        (trace): Use curcol from current process and save it before
        continuing.
        (tprintf): Don't modify curcol on output error.

2009-10-21  Roland McGrath  <roland@redhat.com>

        * strace.spec: 4.5.19-1 release.

2009-10-21  Dmitry V. Levin  <ldv@altlinux.org>

        * file.c (printstat64): Cleanup trailing whitespace.

2009-10-16  Andreas Schwab  <schwab@redhat.com>

        Fix decoding of newfstatat syscall on x86-64.
        * file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit
        process redirect to printstat.
        Fixes RH#529316 "Field values shown for "newfstatat" system
        call are incorrect"

2009-10-12  Dmitry V. Levin  <ldv@altlinux.org>

        * configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h.

2009-10-12  Mike Frysinger  <vapier@gentoo.org>

        sparc/linux: Rewrite to use asm/ptrace.h.
        The current sparc/linux code uses asm/reg.h, but recent Linux kernels
        dropped that header completely.  So switch over to the ptrace headers
        as those should stick around indefinitely as part of the ABI.

        * defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define.
        * process.c: Drop asm/regs.h include.
        [SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs.
        * signal.c: Drop asm/regs.h include.
        (m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS].
        [SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs.
        * syscall.c: Drop asm/regs.h include.
        [SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result,
        syscall_enter): Change struct regs to struct pt_regs.
        * util.c: Drop asm/regs.h include.
        (_hack_syscall5, _ptrace): Delete.
        [SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change
        struct regs to struct pt_regs.

2009-10-11  Roland McGrath  <roland@redhat.com>

        * make-dist: Clean up.

        * configure.ac: Use AC_CONFIG_AUX_DIR([.]).

2009-10-09  Dmitry V. Levin  <ldv@altlinux.org>

        * make-dist: New script for preparing release tarballs.

        * git-set-file-times: Import from rsync.

        * Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS.

2009-10-08  Dmitry V. Levin  <ldv@altlinux.org>

        Enhance msgsnd() parser.
        * ipc.c (tprint_msgsnd): New function.  Move msgsnd parser code here,
        add check for umove() return code.
        (sys_msgsnd): Use tprint_msgsnd().

        * NEWS: Update for 4.5.19 release.

        Enhance semop()/semtimedop() sembuf parser.
        * ipc.c (tprint_sembuf): New function. Move sembuf parser code here,
        add abbrev() support.
        (sys_semop, sys_semtimedop): Use tprint_sembuf().

2009-10-08  Jakub Bogusz  <qboosh@pld-linux.org>

        Add pretty printing of sembuf argument to semop() and semtimedop()
        * ipc.c (semop_flags): New xlat structure.
        (sys_semop, sys_semtimedop): Add pretty printing of sembuf argument.

2009-10-08  Mike Frysinger  <vapier@gentoo.org>

        Add support for Linux/no-mmu with vfork.
        * configure.ac (AC_CHECK_FUNCS): Add fork.
        * strace.c (strace_vforked): Define.
        (startup_child): Do not raise SIGSTOP if vforked.
        (trace): Skip first exec when starting up after vforked.
        * syscall.c [BFIN] (get_scno): Drop waitexec checks.

        Avoid malloc(0) in getdents parsers.
        On end of directory, getdents returns 0.  This return value is used to
        then try and do malloc(0), but on some systems this will always return
        NULL.  Since the code won't read the pointer in question if len is 0,
        then don't bother calling malloc(0) and set the pointer to NULL ourself.
        * file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call.

2009-10-07  Mike Frysinger  <vapier@gentoo.org>

        Add sys_nanosleep() prototype for sparc.
        * linux/sparc/syscall.h (sys_nanosleep): New prototype.
        Reported by Frederik Schüler.

        Silence compiler warnings about implicit cast from pointer to integer.
        * util.c (do_ptrace): Cast ptrace() 4th arg to long.
        (ptrace_restart): Drop void* cast on ptrace() 4th arg.

        Ignore .gdb files from FLAT toolchains.
        * .gitignore: Add /*.gdb.

        * configure.ac (AC_CHECK_FUNCS): Sort and expand.

        Blackfin: Update ioctl/syscall lists.
        * linux/bfin/ioctlent.h: Sync list with latest kernel sources.
        * linux/bfin/syscallent.h: Likewise.

        ioctlsort: Check ppc hosts too.
        * linux/ioctlsort.c: Check for __powerpc__.

2009-10-07  Andreas Schwab  <schwab@redhat.com>

        Fix build on ia64.
        * linux/ia64/syscallent.h: Update for addition of accept4 syscall
        in ../syscallent.h.

2009-10-07  Roland McGrath  <roland@redhat.com>

        * strace.spec (%doc): Add ChangeLog-CVS.

        * Makefile.am (srpm): New phony target.

        * Makefile.am (EXTRA_DIST): Add ChangeLog.
        ($(srcdir)/ChangeLog): New target, replaces gen-changelog phony target.
        Put it inside [MAINTAINER_MODE].

2009-10-06  Dmitry V. Levin  <ldv@altlinux.org>

        * NEWS: Update for 4.5.19 release.

2009-10-05  Frederik Schüler  <fs@debian.org>

        Prepare debian/* files for release.
        * debian/rules: Do not ship ChangeLog anymore.
        * debian/control: Update to Debian standards version 3.8.1, and remove
        Roland from the Maintainers list.  This closes Debian bug #521458.
        * debian/changelog: Document changes and prepare for release.

2009-10-05  Dmitry V. Levin  <ldv@altlinux.org>

        * defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.

        * ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer.
        Based on patch from Carlos O'Donell.

2009-10-05  Carlos O'Donell  <carlos@systemhalted.org>

        * linux/hppa/syscallent.h: Update syscalls.
        Based on work by Kyle McMartin and Helge Deller.

        Fix SA_HANDLER function pointer comparisons for hppa.
        * signal.c (sys_sigaction): Cast SA_HANDLER function pointers to long.
        (sys_rt_sigaction): Likewise.

2009-10-05  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

        CRIS: Correct first argument to upeek()
        This complements commit ea0e6e80260d2b1b7ad40282012b0e47869bcddf.
        * syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass
        tcp pointer instead of pid to upeek().
        * util.c [CRISV10 || CRISV32] (printcall): Likewise.

2009-10-05  Dmitry V. Levin  <ldv@altlinux.org>

        * signal.c (do_signalfd): Fix typo in output format.

2009-09-21  Dmitry V. Levin  <ldv@altlinux.org>

        * Makefile.am (gen_changelog_start_date): Fix date.

2009-09-19  Dmitry V. Levin  <ldv@altlinux.org>

        Prepare for 4.5.19 release.
        * NEWS: Update for 4.5.19 release.
        * configure.ac: Version 4.5.19.
        * debian/changelog: 4.5.19-1.
        * strace.spec: 4.5.19-1.

        Update debian/* to 4.5.18-1.
        * debian/changelog: Update to 4.5.18-1.
        * debian/compat: Set compatibility level to 7.
        * debian/control (Build-Depends): Update debhelper requirement.
        (strace, strace64): Add Section and Priority tags.

2009-09-19  Kirill A. Shutemov  <kirill@shutemov.name>

        Fix fadvise64 decoding on ARM.
        * file.c (sys_fadvise64_64) [ARM]: Fix argument ordering.

2009-09-18  Dmitry V. Levin  <ldv@altlinux.org>

        Fix follow fork/vfork on Linux ARM OABI.
        __NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI.
        * process (change_syscall) [LINUX && ARM]: Mask off the high order bits
        when changing syscall.

        Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>

2009-09-18  Mike Frysinger  <vapier@gentoo.org>

        Mark shell scripts as executable.

        Ignore ioctlsort helper program.
        * .gitignore: Add ioctlsort.

        linux/errno: Add ERFKILL.
        * linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132
        definition introduced in Linux 2.6.31.

2009-09-01  Paolo Bonzini  <pbonzini@redhat.com>

        Add accept4 socketcall.
        This second patch in the series adds support for accept4 as a socketcall
        sub-call.  Besides the need to renumber all system calls, this poses
        no problem.
        Tested on i686.

        * linux/arm/syscallent.h: Add accept4 socketcall.
        * linux/m68k/syscallent.h: Likewise.
        * linux/powerpc/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/syscallent.h: Likewise.

        * linux/sparc/syscall.h (SYS_sub_accept4): Declare.
        (SYS_socket_nsubcalls): Update.
        * linux/syscall.h: Likewise.

2009-09-01  Paolo Bonzini  <pbonzini@redhat.com>

        Replace x86-64 paccept with accept4.
        This patch changes the paccept syscall to accept4 for x86-64, since
        the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826.
        At the same time, it adds support for pretty printing its arguments.

        * linux/x86_64/syscallent.h: Replace paccept with accept4,
        hook in sys_accept4.
        * net.c (sys_accept): Leave a small stub calling the new...
        (do_accept): ... function, which also adds a flags_arg argument.
        (sys_accept4): New.

2009-08-28  Andreas Schwab  <schwab@redhat.com>

        Zero-extend 32-bit addresses when printing argv array.
        (printargv): Zero-extend 32-bit addresses.
        Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit
        process".

2009-08-12  Andreas Schwab  <schwab@redhat.com>

        Add more futex decoding.
        * process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI)
        (FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define.
        (futexops): Add entries for them.
        (sys_futex): Decode FUTEX_CMP_REQUEUE_PI and
        FUTEX_WAIT_REQUEUE_PI.

2009-07-08  Dmitry V. Levin  <ldv@altlinux.org>

        Generate ChangeLog from git log.
        * .gitignore: Add ChangeLog
        * ChangeLog: Rename to ChangeLog-CVS.
        * Makefile.am (gen-changelog): New rule.
        (dist-hook): Depend on it.
        (EXTRA_DIST): Add ChangeLog-CVS.
        * README-hacking: Describe changes.
        * gitlog-to-changelog: Import from gnulib.


See ChangeLog-CVS for older changes.

Generated by dwww version 1.15 on Sun Jun 23 21:33:13 CEST 2024.