Compare commits

...

218 Commits

Author SHA1 Message Date
2c8b6de913 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 02:27:18 +00:00
Baruch Siach
f414d9e3ba 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 02:27:18 +00:00
Baruch Siach
04512207ac 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 02:27:18 +00:00
Shankara Pailoor
3798b04eab 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-08 02:27:18 +00:00
b9a262af78 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-07 23:30:52 +00:00
bc87159e49 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.
2019-01-05 21:14:42 +00:00
77265f5d49 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.
2019-01-05 21:14:42 +00:00
88d842435e 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.
2019-01-05 21:14:42 +00:00
9c529cda68 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.
2019-01-05 21:14:42 +00:00
3ef1efa2d1 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.
2019-01-05 21:14:42 +00:00
17a1b88f8e 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.
2019-01-05 21:14:42 +00:00
be27e07c97 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.
2019-01-05 21:14:42 +00:00
48f74df7d3 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.
2019-01-05 21:14:42 +00:00
63de2e2055 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.
2019-01-05 21:14:42 +00:00
2b31eeb6c1 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.
2019-01-05 21:14:42 +00:00
4ba813df47 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.
2019-01-05 21:14:42 +00:00
d0d79b4b7e 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.
2019-01-05 21:14:42 +00:00
536d2af968 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.
2019-01-05 21:14:42 +00:00
bfff2ebaa6 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.
2019-01-05 21:14:42 +00:00
25a73fb12f 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.
2019-01-05 21:14:42 +00:00
cf36cc7c78 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 21:14:42 +00:00
Martin Lau
91cdd32f65 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 21:14:42 +00:00
3e93457d5f 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-05 21:14:42 +00:00
cd5b418320 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-02 00:29:09 +00:00
cab745b842 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.
2019-01-01 21:36:08 +00:00
d6c71dd061 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 15:35:21 +00:00
51bd6db1ef 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-30 15:35:21 +00:00
27739ebccc Prepare for 4.26 release
* NEWS: Update for 4.26 release.
2018-12-26 18:25:10 +00:00
2087d82fc7 strace.spec.in: add a comment about the license 2018-12-26 18:25:10 +00:00
Gleb Fotengauer-Malinovskiy
2ecf1d5c2b 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.
2018-12-26 18:25:10 +00:00
Gleb Fotengauer-Malinovskiy
721476cb78 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 18:25:10 +00:00
333079522a 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 01:59:38 +00:00
Eugene Syromyatnikov
38ea49ad11 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 01:59:38 +00:00
Eugene Syromyatnikov
c065838680 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 01:59:38 +00:00
Eugene Syromyatnikov
0954bf0ec8 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 01:59:38 +00:00
Eugene Syromyatnikov
3adbab7c2b 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 01:59:38 +00:00
Eugene Syromyatnikov
a55f5485c6 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 01:59:38 +00:00
Eugene Syromyatnikov
95e1e717ac 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 01:59:38 +00:00
Eugene Syromyatnikov
e3d913d5fb 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 01:59:38 +00:00
Eugene Syromyatnikov
e850f7f95c 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 01:59:38 +00:00
Eugene Syromyatnikov
2a750e9a9f 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 01:59:38 +00:00
Eugene Syromyatnikov
6b662a84b4 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 01:59:38 +00:00
Eugene Syromyatnikov
665dd0ece8 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 01:59:38 +00:00
Eugene Syromyatnikov
cd933c16c9 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.
2018-12-26 01:59:38 +00:00
Eugene Syromyatnikov
6c9cfeaaa4 xlat: add fallback definitions to setsock_ipv6_options
* xlat/setsock_ipv6_options.in: Add fallback definitions.
2018-12-26 01:59:38 +00:00
Eugene Syromyatnikov
88863bf3ed 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 01:59:38 +00:00
Eugene Syromyatnikov
5be335ceaa 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 01:59:38 +00:00
Eugene Syromyatnikov
7e15b04b20 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 01:59:38 +00:00
Eugene Syromyatnikov
40771886ec 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 01:59:38 +00:00
Eugene Syromyatnikov
09d91633d1 syslog: move constant definitions to xlat
* syslog.c (enum): Remove.
* xlat/syslog_action_type.in: Add fallback definitions.
2018-12-26 01:59:38 +00:00
92e347b556 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.
2018-12-24 23:46:43 +00:00
73fa3d6822 Update copyright headers 2018-12-24 23:46:43 +00:00
62b47db1ac Update NEWS 2018-12-24 20:11:43 +00:00
Eugene Syromyatnikov
e95c9ec4d1 strace.1.in: consistently use CTRL-combinations 2018-12-24 20:11:43 +00:00
Eugene Syromyatnikov
2479d313e7 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 20:11:43 +00:00
00d0c29d14 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 20:00:11 +00:00
Shankara Pailoor
1448070a00 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 10:19:24 +00:00
b967e34d70 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-24 10:19:24 +00:00
d0ae0b3dca 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 22:12:36 +00:00
476b03b33a 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 22:12:36 +00:00
73f565d1b8 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 22:12:36 +00:00
986a55423e 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 22:12:36 +00:00
b2c63fa897 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 22:12:36 +00:00
Eugene Syromiatnikov
8a5feb1cb3 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-23 22:12:36 +00:00
f6869581d4 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-22 22:16:03 +00:00
Shankara Pailoor
fa35f3e87d 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 19:19:23 +00:00
Eugene Syromyatnikov
2b84c24551 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 19:19:23 +00:00
4964cf3765 filter_qualify: prepare for the change of signame semantics
* filter_qualify.c (sigstr_to_uint): Check signame return value.
2018-12-17 19:19:23 +00:00
Eugene Syromyatnikov
63144af13f 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 19:19:23 +00:00
Eugene Syromyatnikov
b3f92b39f1 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 19:19:23 +00:00
Eugene Syromyatnikov
8c3b410bac signal: make printisgnal honor xlat style
* signal.c (printsignal): Respect current xlat style.
2018-12-17 19:19:23 +00:00
Eugene Syromyatnikov
d1a0f700f1 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 19:19:23 +00:00
Masatake YAMATO
692dbd2c3d 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.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2018-12-17 19:19:23 +00:00
004e6b5b7a 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 17:30:24 +00:00
bc04bb238c 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-17 13:45:05 +00:00
7273c6fb3c 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 22:07:26 +00:00
e3b80cb65f 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 22:07:26 +00:00
7488ce9e23 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 22:07:26 +00:00
86d073674e 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-13 22:07:26 +00:00
b93d52fe3d 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 00:00:00 +00:00
c6782f144a 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 00:00:00 +00:00
Shankara Pailoor
bf195a8455 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 23:45:11 +00:00
Shankara Pailoor
e1f15583e0 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-10 23:45:11 +00:00
c40270dd87 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 18:37:34 +00:00
5be511bf86 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 18:37:34 +00:00
1f84eefc40 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 18:37:34 +00:00
217eccfba5 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 16:10:05 +00:00
51d89ef0a0 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 16:10:05 +00:00
917c2ccf3a 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 16:10:05 +00:00
bcd5cdddec 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 16:10:05 +00:00
afc80cdb3f ppc64: remove redundant redefinition
* linux/powerpc64/arch_regs.c (ARCH_PC_REG): Remove.
2018-12-05 16:10:05 +00:00
Shankara Pailoor
26e1435f91 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 16:10:05 +00:00
Janosch Frank
f476724ea1 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.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
2018-12-05 16:10:05 +00:00
1dc2a5313c 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-27 01:13:40 +00:00
114249603e 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 20:49:05 +00:00
a4fb2fbdde 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 02:04:04 +00:00
Shankara Pailoor
0933b30869 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 02:04:04 +00:00
956dc3ed36 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 02:04:04 +00:00
Shankara Pailoor
f11fb909d7 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-26 02:04:04 +00:00
6f9cf06b99 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 23:56:38 +00:00
c4c993b642 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 01:22:13 +00:00
Eugene Syromyatnikov
97c3deca54 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 01:22:13 +00:00
Eugene Syromyatnikov
384e286e5d 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 01:22:13 +00:00
Eugene Syromyatnikov
ab30fe571d 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 01:22:13 +00:00
Eugene Syromyatnikov
ca2121efef arm: add a comment that __ARM_NR_cmpxchg was removed in 4.4
* linux/arm/syscallent.h: Add a comment about __ARM_NR_cmpxchg.
2018-11-24 01:22:13 +00:00
Eugene Syromyatnikov
2482e7caba 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.
2018-11-24 01:22:13 +00:00
Eugene Syromyatnikov
f9163e811b linux/dummy.h: remove unused sys_phys definition
* linux/dummy.h (sys_phys): Remove.
2018-11-24 01:22:13 +00:00
Eugene Syromyatnikov
98306f2c05 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.
2018-11-24 01:22:13 +00:00
Eugene Syromyatnikov
d30aacd4ec 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 01:22:13 +00:00
Eugene Syromyatnikov
b4b01268bb 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-24 01:22:13 +00:00
341eb0859d 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 22:51:49 +00:00
eca7e95886 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-21 17:32:51 +00:00
422ecbe675 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 04:56:30 +00:00
7a4c6b715d 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-20 04:56:30 +00:00
62267a93f4 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-12 13:42:11 +00:00
f9e5f12b7c 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 17:40:36 +00:00
Rasmus Villemoes
2649c8c8b6 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.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2018-11-05 17:40:36 +00:00
Eugene Syromyatnikov
e2d2dc699f 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 13:00:37 +00:00
Eugene Syromyatnikov
846e277d0f 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 13:00:37 +00:00
Eugene Syromyatnikov
e471c53d1d 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 13:00:37 +00:00
Eugene Syromyatnikov
5f7f0b6c85 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-11-01 13:00:37 +00:00
4c9516cc9b 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.
2018-10-30 10:43:31 +00:00
c12d2de112 Prepare for 4.25 release
* NEWS: Update for 4.25 release.
2018-10-30 08:09:10 +00:00
5c62e29237 Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-10-30 08:09:10 +00:00
6726f218f7 Update NEWS 2018-10-25 20:50:32 +00:00
Elvira Khabirova
7a7f6c6a7c 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 20:50:32 +00:00
6d6d5bc480 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-25 13:36:54 +00:00
4370024753 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 09:05:38 +00:00
Gleb Fotengauer-Malinovskiy
3960969554 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.
2018-10-24 07:48:56 +00:00
Gleb Fotengauer-Malinovskiy
be3ba52a4d maint: update for linux 4.19-rc8
* maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE.
2018-10-24 07:48:56 +00:00
5993d50813 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-10-24 07:48:56 +00:00
f5b9ee4945 xtensa: fix typo in pkey_alloc syscall number
* linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349.
2018-09-27 19:46:36 +00:00
e78becf8b9 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-23 09:54:55 +00:00
9eeab98448 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-18 21:54:17 +00:00
96df4b36f6 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 21:32:37 +00:00
f708bcfa45 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.
2018-09-16 16:45:24 +00:00
305e47a9ae 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 11:44:01 +00:00
762d8e06bf 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 11:44:01 +00:00
af39dee46c 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 11:44:01 +00:00
d7cbc89824 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-16 09:48:16 +00:00
Eugene Syromyatnikov
5aba529854 process: honor xlat style in print_user_offset_addr
* process.c (print_user_offset_addr): Print in accordance with xlat
verbosity setting.
2018-09-04 11:13:52 +00:00
Eugene Syromyatnikov
92b04d4a22 time: add xlat styles support to printclockname
* time.c (printclockname): Respectl xlat_verbosity.
2018-09-04 11:13:52 +00:00
Eugene Syromyatnikov
4b0130a7d0 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-04 11:13:52 +00:00
Eugene Syromyatnikov
750cdcba9c 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 12:05:48 +00:00
Eugene Syromyatnikov
302cf02757 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 12:05:48 +00:00
Eugene Syromyatnikov
a5918bf7e6 xlat: provide fallback definitions for open_access_modes constants
* xlat/open_access_modes.in: Add fallback values.
2018-09-03 10:16:50 +00:00
Eugene Syromyatnikov
4499e109ec xlat: update resources
* xlat/resources.in: Declare as #value indexed, provide fallback values.
(RLIMIT_VMEM): Remove.
2018-09-03 10:16:50 +00:00
Eugene Syromyatnikov
201e01dbac 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-03 10:16:50 +00:00
Eugene Syromyatnikov
ac2f6695cd 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.
2018-09-02 22:38:21 +00:00
Eugene Syromyatnikov
da048e91a1 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.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
cfb86ab4e9 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.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
92d020787f 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.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
cbbf708b4d macros: add ROUNDUP macro
* macros.h (ROUNDUP): New macro.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
c3ac40611c 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 17:44:26 +00:00
Eugene Syromyatnikov
8a56b8a1b7 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.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
38e0f55602 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 17:44:26 +00:00
Eugene Syromyatnikov
9a969eb670 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 17:44:26 +00:00
Eugene Syromyatnikov
ef859a2702 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 17:44:26 +00:00
Eugene Syromyatnikov
54fc755c56 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 17:44:26 +00:00
Eugene Syromyatnikov
7c08fe37a1 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 17:44:26 +00:00
Eugene Syromyatnikov
a302982576 sockaddr: whitespace cleanup, fix typo in comment
* sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess
indentation from the switch statement.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
f561173367 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.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
9f4b5992fe 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 17:44:26 +00:00
Eugene Syromyatnikov
79878e783c 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 17:44:26 +00:00
Eugene Syromyatnikov
298f29a15b 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.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
6177e74134 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).
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
b05d2667e9 xlat: provide fallback definitions to pollflags
* xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
fdfc68a984 xlat: provide fallback values for socktypes
* xlat/socktypes.in: Provide fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
3f10639284 xlat: provide fallback values to route_nexthop_flags
* xlat/route_nexthop_flags.in: Add fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
618d4ed497 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 14:38:12 +00:00
Eugene Syromyatnikov
9b5d56054c 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 14:38:12 +00:00
Eugene Syromyatnikov
f3b38739d5 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 13:13:09 +00:00
Eugene Syromyatnikov
288b872266 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-09-01 13:02:04 +00:00
Eugene Syromyatnikov
1d7b8edda9 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
45afd0c7a3 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
dac524ad98 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
587d1d5663 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
00bfa52a81 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 23:41:41 +00:00
Eugene Syromyatnikov
5d18b8cdef 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 23:41:41 +00:00
Eugene Syromyatnikov
25a4cafa90 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 23:41:41 +00:00
Eugene Syromyatnikov
6e7da52286 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
930864b083 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
3926f4a07d 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 23:41:41 +00:00
Eugene Syromyatnikov
24535be245 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 23:41:41 +00:00
Eugene Syromyatnikov
4fa680e63f 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 23:41:41 +00:00
Eugene Syromyatnikov
fb7c51690e 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 23:41:41 +00:00
Eugene Syromyatnikov
df7dd5aa66 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 23:41:41 +00:00
Eugene Syromyatnikov
e8d95392ad 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 23:41:41 +00:00
Eugene Syromyatnikov
fe8861f6b4 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 23:41:41 +00:00
Eugene Syromyatnikov
f7d175b562 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 23:41:41 +00:00
Eugene Syromyatnikov
701fd04d8a 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 23:41:41 +00:00
Eugene Syromyatnikov
cde23ff80c 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
6b141f643a 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
d029a5efd1 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 23:41:41 +00:00
Eugene Syromyatnikov
eded21f5c0 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 23:41:41 +00:00
Eugene Syromyatnikov
9624d9f09d 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
db5235d0e9 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 23:41:41 +00:00
Eugene Syromyatnikov
cf174ac87a 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 23:41:41 +00:00
Eugene Syromyatnikov
f9578731fc 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.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
9aa1efde58 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-27 23:41:41 +00:00
44e21ae30d tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
* tests/nsyscalls.c (test_syscall): Do not assume that unimplemented
syscalls always fail with ENOSYS.
2018-08-22 20:38:27 +00:00
ccee090b78 tests: workaround systemd-nspawn habit of disabling mlockall syscall
* tests/mmap.c (main): Do not assume that mlockall syscall always
succeeds.
2018-08-22 20:38:27 +00:00
1df0986c75 tests: workaround systemd-nspawn habit of disabling munlockall syscall
* tests/munlockall.c (main): Do not assume that munlockall syscall
always succeeds.
2018-08-22 20:38:27 +00:00
Eugene Syromyatnikov
9d2848e517 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-21 11:28:14 +00:00
14ae61f37b 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 10:26:18 +00:00
Eugene Syromyatnikov
2d88ec9e39 xlat: fix typo in smc_protocols.in
* xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/.
2018-08-19 10:26:18 +00:00
538cf68f12 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.
2018-08-19 10:26:18 +00:00
9725de9c22 ci: update gitlab ubuntu image
* .gitlab-ci.yml (image): Replace "ubuntu:17.10" with "ubuntu:18.04".
2018-08-19 10:26:18 +00:00
7b0d371b3f 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.
2018-08-19 10:26:18 +00:00
f0ec4e696c ci: fix kernel headers version diagnostics
* ci/run-build-and-tests.sh: Honor $CPPFLAGS when printing
kernel headers version.
2018-08-19 10:26:18 +00:00
Zhibin Li
ed29ac33bb tests: enhance test coverage of evdev ioctl
* tests/ioctl_evdev.c (main): Test EVIOCGMTSLOTS(8) command.
2018-08-19 10:26:18 +00:00
Zhibin Li
e286b9cbc0 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 10:26:18 +00:00
Zhibin Li
5ee385e2eb 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 10:26:18 +00:00
Zhibin Li
99300f217b 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 10:26:18 +00:00
Pierre Marsais
e38143b00e 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.

Signed-off-by: Pierre Marsais <pierre.marsais@lse.epita.fr>
2018-08-19 10:26:18 +00:00
0f09267db0 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 10:26:18 +00:00
b89a69dec2 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-19 10:26:18 +00:00
a264eb3b65 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.
2018-08-14 10:11:12 +00:00
1574 changed files with 14104 additions and 21095 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
/* export-ignore
/README-github_gitlab-autogenerated-archives.txt -export-ignore

5
.gitignore vendored
View File

@ -12,6 +12,8 @@
/.version
/CREDITS
/ChangeLog
/INSTALL
/README
/aclocal.m4
/autom4te.cache
/bpf_attr_check.c
@ -53,15 +55,14 @@
/native_printer_decls.h
/native_printer_defs.h
/printers.h
/README
/scno.h
/sen.h
/stamp-h1
/strace
/strace-*.tar.gz
/strace-*.tar.xz
/strace.1
/strace-log-merge.1
/strace.1
/strace.dsc
/strace.spec
/sys_func.h

View File

@ -1,4 +1,4 @@
image: "ubuntu:17.10"
image: "ubuntu:18.04"
before_script:
- ci/install-dependencies.sh
@ -8,6 +8,15 @@ variables:
SLEEP_A_BIT: "sleep 0.2"
VERBOSE: "1"
gcc-x86_64-libdw-mainline:
stage: test
script: ci/run-build-and-tests.sh
variables:
CC: "gcc"
TARGET: "x86_64"
STACKTRACE: "libdw"
KHEADERS: "torvalds/linux"
gcc-x86_64-libdw:
stage: test
script: ci/run-build-and-tests.sh

View File

@ -24,6 +24,11 @@ matrix:
- STACKTRACE=libunwind
- CHECK=coverage
- KHEADERS=torvalds/linux
- compiler: gcc-8
env:
- TARGET=x86_64
- STACKTRACE=libunwind
- KHEADERS=torvalds/linux
- compiler: gcc
env:
- TARGET=x86_64

30
COPYING
View File

@ -7,24 +7,14 @@ Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
Copyright (c) 2001-2018 The strace developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
strace is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
strace is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details.
strace test suite is provided under the terms of the GNU General Public License
version 2 or later, see tests/COPYING for more details.

View File

@ -5,5 +5,5 @@ that are needed to build strace. Some of these files are generated by tools
from the GNU Autoconf and GNU Automake packages.
Note: rather than running `autoreconf` directly, please invoke `./bootstrap`
script and follow the instructions given in [INSTALL](INSTALL) file for further
script and follow the instructions given in [INSTALL](README-configure) file for further
building and installation.

501
LGPL-2.1-or-later Normal file
View File

@ -0,0 +1,501 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom
to share and change it. By contrast, the GNU General Public Licenses are
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software
Foundation and other authors who decide to use it. You can use it too,
but we suggest you first think carefully about whether this license or
the ordinary General Public License is the better strategy to use in
any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get it
if you want it; that you can change the software and use pieces of it in
new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide complete
object files to the recipients, so that they can relink them with the
library after making changes to the library and recompiling it. And you
must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there
is no warranty for the free library. Also, if the library is modified
by someone else and passed on, the recipients should know that what they
have is not the original version, so that the original author's reputation
will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot effectively
restrict the users of a free program by obtaining a restrictive license
from a patent holder. Therefore, we insist that any patent license
obtained for a version of the library must be consistent with the full
freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License. This license, the GNU Lesser General
Public License, applies to certain designated libraries, and is quite
different from the ordinary General Public License. We use this license
for certain libraries in order to permit linking those libraries into
non-free programs.
When a program is linked with a library, whether statically or using a
shared library, the combination of the two is legally speaking a combined
work, a derivative of the original library. The ordinary General Public
License therefore permits such linking only if the entire combination
fits its criteria of freedom. The Lesser General Public License permits
more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to encourage
the widest possible use of a certain library, so that it becomes a
de-facto standard. To achieve this, non-free programs must be allowed
to use the library. A more frequent case is that a free library does
the same job as widely used non-free libraries. In this case, there
is little to gain by limiting the free library to free software only,
so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of free
software. For example, permission to use the GNU C Library in non-free
programs enables many more people to use the whole GNU operating system,
as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is linked
with the Library has the freedom and the wherewithal to run that program
using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License"). Each
licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on
the Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code
means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running
a program using the Library is not restricted, and output from such
a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided
that you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of
it, thus forming a work based on the Library, and copy and distribute
such modifications or work under the terms of Section 1 above,
provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge
to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or table,
the facility still operates, and performs whatever part of its
purpose remains meaningful.
(For example, a function in a library to compute square roots
has a purpose that is entirely well-defined independent of
the application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square root
function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work
based on the Library, the distribution of the whole must be on the
terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of
who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is
to exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume
of a storage or distribution medium does not bring the other work
under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To
do this, you must alter all the notices that refer to this License,
so that they refer to the ordinary GNU General Public License,
version 2, instead of to this License. (If a newer version than
version 2 of the ordinary GNU General Public License has appeared,
then you can specify that version instead if you wish.) Do not make
any other change in these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the
Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative
of it, under Section 2) in object code or executable form under the
terms of Sections 1 and 2 above provided that you accompany it with
the complete corresponding machine-readable source code, which must
be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange.
If distribution of object code is made by offering access to copy from
a designated place, then offering equivalent access to copy the source
code from the same place satisfies the requirement to distribute the
source code, even though third parties are not compelled to copy the
source along with the object code.
5. A program that contains no derivative of any portion of the Library,
but is designed to work with the Library by being compiled or linked
with it, is called a "work that uses the Library". Such a work, in
isolation, is not a derivative work of the Library, and therefore
falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License. Section
6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header
file that is part of the Library, the object code for the work may
be a derivative work of the Library even though the source code is
not. Whether this is true is especially significant if the work can
be linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure
layouts and accessors, and small macros and small inline functions
(ten lines or less in length), then the use of the object file
is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section
6. Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link
a "work that uses the Library" with the Library to produce a work
containing portions of the Library, and distribute that work under
terms of your choice, provided that the terms permit modification
of the work for the customer's own use and reverse engineering for
debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered
by this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do
one of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and
(2) will operate properly with a modified version of the library,
if the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three
years, to give the same user the materials specified in Subsection
6a, above, for a charge no more than the cost of performing this
distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you
cannot use both them and the Library together in an executable that
you distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise permitted,
and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities. This
must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the
Library except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, link with, or distribute the
Library is void, and will automatically terminate your rights under
this License. However, parties who have received copies, or rights,
from you under this License will not have their licenses terminated
so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify
or distribute the Library or its derivative works. These actions
are prohibited by law if you do not accept this License. Therefore,
by modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on
the Library), the recipient automatically receives a license from
the original licensor to copy, distribute, link with or modify the
Library subject to these terms and conditions. You may not impose
any further restrictions on the recipients' exercise of the rights
granted herein. You are not responsible for enforcing compliance by
third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement
or otherwise) that contradict the conditions of this License, they
do not excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence
you may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you,
then the only way you could satisfy both it and this License would
be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended
to apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of
any such claims; this section has the sole purpose of protecting
the integrity of the free software distribution system which
is implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed
to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time. Such
new versions will be similar in spirit to the present version, but
may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published
by the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free Software
Foundation; we sometimes make exceptions for this. Our decision will
be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and
reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO
IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR
A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of
the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and an idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -7,27 +7,7 @@
# Copyright (c) 2002-2018 The strace developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# SPDX-License-Identifier: LGPL-2.1-or-later
if HAVE_M32_RUNTIME
TESTS_M32 = tests-m32
@ -147,13 +127,15 @@ strace_SOURCES = \
fetch_struct_xfs_quotastat.c \
file_handle.c \
file_ioctl.c \
filter_qualify.c \
filter.h \
filter_qualify.c \
flock.c \
flock.h \
fs_x_ioctl.c \
futex.c \
gcc_compat.h \
get_personality.c \
get_personality.h \
get_robust_list.c \
getcpu.c \
getcwd.c \
@ -178,6 +160,7 @@ strace_SOURCES = \
kexec.c \
keyctl.c \
keyctl_kdf_params.h \
kill_save_errno.h \
kvm.c \
largefile_wrappers.h \
ldt.c \
@ -204,15 +187,15 @@ strace_SOURCES = \
msghdr.h \
mtd.c \
native_defs.h \
nbd_ioctl.c \
negated_errno.h \
net.c \
netlink.c \
netlink.h \
netlink_crypto.c \
netlink_inet_diag.c \
netlink_kobject_uevent.c \
netlink_kobject_uevent.h \
netlink_sock_diag.h \
netlink_inet_diag.c \
netlink_netfilter.c \
netlink_netlink_diag.c \
netlink_packet_diag.c \
@ -221,6 +204,7 @@ strace_SOURCES = \
netlink_selinux.c \
netlink_smc_diag.c \
netlink_sock_diag.c \
netlink_sock_diag.h \
netlink_unix_diag.c \
nlattr.c \
nlattr.h \
@ -243,9 +227,11 @@ strace_SOURCES = \
prctl.c \
print_aio_sigset.c \
print_dev_t.c \
print_group_req.c \
print_fields.h \
print_group_req.c \
print_ifindex.c \
print_instruction_pointer.c \
print_kernel_version.c \
print_mac.c \
print_mq_attr.c \
print_msgbuf.c \
@ -265,7 +251,10 @@ strace_SOURCES = \
process_vm.c \
ptp.c \
ptrace.h \
ptrace_syscall_info.c \
ptrace_syscall_info.h \
quota.c \
random_ioctl.c \
readahead.c \
readlink.c \
reboot.c \
@ -318,8 +307,8 @@ strace_SOURCES = \
statx.c \
statx.h \
strace.c \
string_to_uint.h \
string_to_uint.c \
string_to_uint.h \
swapon.c \
syscall.c \
sysctl.c \
@ -348,6 +337,7 @@ strace_SOURCES = \
utimes.c \
v4l2.c \
wait.c \
wait.h \
xattr.c \
xfs_quota_stat.h \
xlat.c \
@ -401,6 +391,8 @@ EXTRA_DIST = \
CREDITS \
ChangeLog \
ChangeLog-CVS \
LGPL-2.1-or-later \
README-configure \
README-linux-ptrace \
debian/changelog \
debian/compat \
@ -428,9 +420,8 @@ EXTRA_DIST = \
linux/64/ioctls_inc.h \
linux/64/syscallent.h \
linux/aarch64/arch_defs_.h \
linux/aarch64/arch_get_personality.c \
linux/aarch64/arch_regs.c \
linux/aarch64/arch_regs.h \
linux/aarch64/arch_rt_sigframe.c \
linux/aarch64/arch_sigreturn.c \
linux/aarch64/get_error.c \
linux/aarch64/get_scno.c \
@ -449,8 +440,6 @@ EXTRA_DIST = \
linux/alpha/arch_defs_.h \
linux/alpha/arch_getrval2.c \
linux/alpha/arch_regs.c \
linux/alpha/arch_regs.h \
linux/alpha/arch_rt_sigframe.c \
linux/alpha/arch_sigreturn.c \
linux/alpha/errnoent.h \
linux/alpha/get_error.c \
@ -466,8 +455,6 @@ EXTRA_DIST = \
linux/alpha/syscallent.h \
linux/alpha/userent.h \
linux/arc/arch_regs.c \
linux/arc/arch_regs.h \
linux/arc/arch_rt_sigframe.c \
linux/arc/get_error.c \
linux/arc/get_scno.c \
linux/arc/get_syscall_args.c \
@ -480,11 +467,10 @@ EXTRA_DIST = \
linux/arch_defs_.h \
linux/arch_kvm.c \
linux/arch_regs.h \
linux/arch_rt_sigframe.c \
linux/arch_sigreturn.c \
linux/arm/arch_defs_.h \
linux/arm/arch_regs.c \
linux/arm/arch_regs.h \
linux/arm/arch_rt_sigframe.c \
linux/arm/arch_sigreturn.c \
linux/arm/get_error.c \
linux/arm/get_scno.c \
@ -499,8 +485,6 @@ EXTRA_DIST = \
linux/arm/syscallent.h \
linux/arm/userent.h \
linux/avr32/arch_regs.c \
linux/avr32/arch_regs.h \
linux/avr32/arch_rt_sigframe.c \
linux/avr32/get_error.c \
linux/avr32/get_scno.c \
linux/avr32/get_syscall_args.c \
@ -513,7 +497,6 @@ EXTRA_DIST = \
linux/avr32/userent.h \
linux/bfin/arch_defs_.h \
linux/bfin/arch_regs.c \
linux/bfin/arch_rt_sigframe.c \
linux/bfin/get_error.c \
linux/bfin/get_scno.c \
linux/bfin/get_syscall_args.c \
@ -526,12 +509,12 @@ EXTRA_DIST = \
linux/bfin/set_scno.c \
linux/bfin/syscallent.h \
linux/bfin/userent.h \
linux/check_scno.c \
linux/dummy.h \
linux/errnoent.h \
linux/getregs_old.h \
linux/hppa/arch_defs_.h \
linux/hppa/arch_regs.c \
linux/hppa/arch_regs.h \
linux/hppa/arch_rt_sigframe.c \
linux/hppa/errnoent.h \
linux/hppa/get_error.c \
@ -546,10 +529,9 @@ EXTRA_DIST = \
linux/hppa/set_scno.c \
linux/hppa/signalent.h \
linux/hppa/syscallent.h \
linux/i386/arch_kvm.c \
linux/i386/arch_defs_.h \
linux/i386/arch_kvm.c \
linux/i386/arch_regs.c \
linux/i386/arch_regs.h \
linux/i386/arch_rt_sigframe.c \
linux/i386/arch_sigreturn.c \
linux/i386/get_error.c \
@ -583,7 +565,6 @@ EXTRA_DIST = \
linux/inet_diag.h \
linux/m68k/arch_defs_.h \
linux/m68k/arch_regs.c \
linux/m68k/arch_regs.h \
linux/m68k/arch_rt_sigframe.c \
linux/m68k/arch_sigreturn.c \
linux/m68k/get_error.c \
@ -598,7 +579,6 @@ EXTRA_DIST = \
linux/m68k/syscallent.h \
linux/m68k/userent.h \
linux/metag/arch_regs.c \
linux/metag/arch_regs.h \
linux/metag/arch_rt_sigframe.c \
linux/metag/get_error.c \
linux/metag/get_scno.c \
@ -611,7 +591,6 @@ EXTRA_DIST = \
linux/metag/syscallent.h \
linux/microblaze/arch_defs_.h \
linux/microblaze/arch_regs.c \
linux/microblaze/arch_rt_sigframe.c \
linux/microblaze/arch_sigreturn.c \
linux/microblaze/get_error.c \
linux/microblaze/get_scno.c \
@ -627,8 +606,6 @@ EXTRA_DIST = \
linux/mips/arch_defs_.h \
linux/mips/arch_getrval2.c \
linux/mips/arch_regs.c \
linux/mips/arch_regs.h \
linux/mips/arch_rt_sigframe.c \
linux/mips/arch_sigreturn.c \
linux/mips/errnoent.h \
linux/mips/genstub.sh \
@ -651,8 +628,6 @@ EXTRA_DIST = \
linux/netlink_diag.h \
linux/nios2/arch_defs_.h \
linux/nios2/arch_regs.c \
linux/nios2/arch_regs.h \
linux/nios2/arch_rt_sigframe.c \
linux/nios2/get_error.c \
linux/nios2/get_scno.c \
linux/nios2/get_syscall_args.c \
@ -664,8 +639,6 @@ EXTRA_DIST = \
linux/nios2/syscallent.h \
linux/nr_prefix.c \
linux/or1k/arch_regs.c \
linux/or1k/arch_regs.h \
linux/or1k/arch_rt_sigframe.c \
linux/or1k/get_error.c \
linux/or1k/get_scno.c \
linux/or1k/get_syscall_args.c \
@ -679,7 +652,6 @@ EXTRA_DIST = \
linux/packet_diag.h \
linux/powerpc/arch_defs_.h \
linux/powerpc/arch_regs.c \
linux/powerpc/arch_regs.h \
linux/powerpc/arch_rt_sigframe.c \
linux/powerpc/arch_sigreturn.c \
linux/powerpc/errnoent.h \
@ -696,8 +668,8 @@ EXTRA_DIST = \
linux/powerpc/syscallent.h \
linux/powerpc/userent.h \
linux/powerpc64/arch_defs_.h \
linux/powerpc64/arch_get_personality.c \
linux/powerpc64/arch_regs.c \
linux/powerpc64/arch_regs.h \
linux/powerpc64/arch_rt_sigframe.c \
linux/powerpc64/arch_sigreturn.c \
linux/powerpc64/errnoent.h \
@ -717,11 +689,11 @@ EXTRA_DIST = \
linux/powerpc64/syscallent.h \
linux/powerpc64/syscallent1.h \
linux/powerpc64/userent.h \
linux/ptrace_pokeuser.c \
linux/raw_syscall.h \
linux/riscv/arch_defs_.h \
linux/riscv/arch_get_personality.c \
linux/riscv/arch_regs.c \
linux/riscv/arch_regs.h \
linux/riscv/arch_rt_sigframe.c \
linux/riscv/get_error.c \
linux/riscv/get_scno.c \
linux/riscv/get_syscall_args.c \
@ -737,8 +709,6 @@ EXTRA_DIST = \
linux/rt_sigframe.h \
linux/s390/arch_defs_.h \
linux/s390/arch_regs.c \
linux/s390/arch_regs.h \
linux/s390/arch_rt_sigframe.c \
linux/s390/arch_sigreturn.c \
linux/s390/get_error.c \
linux/s390/get_scno.c \
@ -754,9 +724,8 @@ EXTRA_DIST = \
linux/s390/userent0.h \
linux/s390/userent1.h \
linux/s390x/arch_defs_.h \
linux/s390x/arch_get_personality.c \
linux/s390x/arch_regs.c \
linux/s390x/arch_regs.h \
linux/s390x/arch_rt_sigframe.c \
linux/s390x/arch_sigreturn.c \
linux/s390x/get_error.c \
linux/s390x/get_scno.c \
@ -775,7 +744,6 @@ EXTRA_DIST = \
linux/sh/arch_defs_.h \
linux/sh/arch_getrval2.c \
linux/sh/arch_regs.c \
linux/sh/arch_rt_sigframe.c \
linux/sh/get_error.c \
linux/sh/get_scno.c \
linux/sh/get_syscall_args.c \
@ -791,7 +759,6 @@ EXTRA_DIST = \
linux/sh64/arch_defs_.h \
linux/sh64/arch_regs.c \
linux/sh64/arch_regs.h \
linux/sh64/arch_rt_sigframe.c \
linux/sh64/get_error.c \
linux/sh64/get_scno.c \
linux/sh64/get_syscall_args.c \
@ -812,8 +779,6 @@ EXTRA_DIST = \
linux/sparc/arch_defs_.h \
linux/sparc/arch_getrval2.c \
linux/sparc/arch_regs.c \
linux/sparc/arch_regs.h \
linux/sparc/arch_rt_sigframe.c \
linux/sparc/arch_sigreturn.c \
linux/sparc/errnoent.h \
linux/sparc/get_error.c \
@ -829,9 +794,9 @@ EXTRA_DIST = \
linux/sparc/syscallent.h \
linux/sparc/userent.h \
linux/sparc64/arch_defs_.h \
linux/sparc64/arch_get_personality.c \
linux/sparc64/arch_getrval2.c \
linux/sparc64/arch_regs.c \
linux/sparc64/arch_regs.h \
linux/sparc64/arch_rt_sigframe.c \
linux/sparc64/arch_sigreturn.c \
linux/sparc64/errnoent.h \
@ -853,9 +818,8 @@ EXTRA_DIST = \
linux/subcall.h \
linux/syscall.h \
linux/tile/arch_defs_.h \
linux/tile/arch_get_personality.c \
linux/tile/arch_regs.c \
linux/tile/arch_regs.h \
linux/tile/arch_rt_sigframe.c \
linux/tile/arch_sigreturn.c \
linux/tile/get_error.c \
linux/tile/get_scno.c \
@ -875,11 +839,13 @@ EXTRA_DIST = \
linux/userent.h \
linux/userent0.h \
linux/x32/arch_defs_.h \
linux/x32/arch_get_personality.c \
linux/x32/arch_kvm.c \
linux/x32/arch_regs.c \
linux/x32/arch_regs.h \
linux/x32/arch_rt_sigframe.c \
linux/x32/arch_sigreturn.c \
linux/x32/check_scno.c \
linux/x32/get_error.c \
linux/x32/get_scno.c \
linux/x32/get_syscall_args.c \
@ -887,6 +853,7 @@ EXTRA_DIST = \
linux/x32/ioctls_arch1.h \
linux/x32/ioctls_inc0.h \
linux/x32/ioctls_inc1.h \
linux/x32/ptrace_pokeuser.c \
linux/x32/raw_syscall.h \
linux/x32/rt_sigframe.h \
linux/x32/set_error.c \
@ -896,6 +863,7 @@ EXTRA_DIST = \
linux/x32/syscallent1.h \
linux/x32/userent.h \
linux/x86_64/arch_defs_.h \
linux/x86_64/arch_get_personality.c \
linux/x86_64/arch_kvm.c \
linux/x86_64/arch_regs.c \
linux/x86_64/arch_regs.h \
@ -922,7 +890,6 @@ EXTRA_DIST = \
linux/x86_64/syscallent2.h \
linux/x86_64/userent.h \
linux/xtensa/arch_regs.c \
linux/xtensa/arch_rt_sigframe.c \
linux/xtensa/get_error.c \
linux/xtensa/get_scno.c \
linux/xtensa/get_syscall_args.c \

72
NEWS
View File

@ -1,3 +1,75 @@
Noteworthy changes in release ?.?? (????-??-??)
===============================================
* Improvements
* Enhanced xlat styles support configured by -X option.
* Updated lists of BPF_*, BTRFS_*, FAN_*, IFLA_*, KERN_*, KVM_CAP_*, NDA_*,
NETNSA_*, NT_*, PR_*, REL_*, SECCOMP_*, SCTP_*, UDP_*, V4L2_*, and *_MAGIC
constants.
* Bug fixes
* Fixed strace-k test on alpha.
* Fixed build on mips o32.
* Fixed build on NOMMU architectures.
Noteworthy changes in release 4.26 (2018-12-26)
===============================================
* License
* The test suite is now provided under the terms of
the GNU General Public License version 2 or later.
* All the rest of strace is now provided under the terms of
the GNU Lesser General Public License version 2.1 or later.
* Changes in behavior
* If strace is interrupted by a signal it handles (currently
one of HUP, INT, QUIT, PIPE, or TERM), strace terminates
itself with this signal.
* Improvements
* Implemented obtainment of system call information using
PTRACE_GET_SYSCALL_INFO ptrace API.
* Implemented decoding of PTRACE_GET_SYSCALL_INFO ptrace request.
* Implemented decoding of BLKGETZONESZ, BLKGETNRZONES, and RND* ioctl
commands.
* Enhanced xlat styles support configured by -X option.
* Enhanced internet address formatting in structureless contexts.
* Enhanced decoding of getsockopt SO_ERROR option.
* Enhanced error diagnostics when the first exec fails.
* Added %net as a short form of %network in syscall specifications.
* Updated lists of ABS_*, BPF_*, FAN_*, IFA_*, IFLA_*, KVM_CAP_*, NETLINK_*,
NTF_*, PR_SPEC_*, REL_*, SOL_*, TCA_*, and V4L2_* constants.
* Updated lists of ioctl commands from Linux 4.20.
* Enhanced manual page.
* Bug fixes
* Fixed "xlat_idx: Unexpected xlat value 0" warnings.
* Fixed sthyi output format on s390.
* Documented -X option in strace -h output.
Noteworthy changes in release 4.25 (2018-10-30)
===============================================
* Improvements
* Implemented decoding of KVM_CHECK_EXTENSION and NBD_* ioctl commands.
* Implemented decoding of SOL_XDP socket option names.
* Implemented decoding of AF_PACKET protocols in socket syscall.
* Implemented decoding of AF_AX25 and AF_X25 addresses, protocols,
and options.
* Implemented stack trace printing on receiving signals.
* Enhanced xlat styles support configured by -X option.
* Enhanced decoding of IFLA_*, NETCONFA_*, and SMC_DIAG_* netlink attributes.
* Wired up io_pgetevents syscall on arm, sparc, and sparc64.
* Updated lists of AF_*, AUDIT_*, BPF_*, IFLA_*, IN_*, IPSTATS_*,
IPV4_DEVCONF_*, NT_*, SCTP_*, SO_*, SOCK_*, SOL_*, and V4L2_* constants.
* Updated lists of ioctl commands from Linux 4.19.
* Bug fixes
* Fixed decoding of bit sets in evdev ioctl commands.
* Fixed decoding of EVIOCGBIT(0, ...) ioctl commands.
* Fixed test suite for the case when mlockall and unimplemented syscalls
are explicitly disabled by a seccomp filter.
Noteworthy changes in release 4.24 (2018-08-14)
===============================================

View File

@ -15,10 +15,10 @@ Basic Installation
Briefly, the shell command './configure && make && make install' should
configure, build, and install this package. The following more-detailed
instructions are generic; see the 'README' file for instructions
specific to this package. Some packages provide this 'INSTALL' file but
do not implement all of the features documented below. The lack of an
optional feature in a given package is not necessarily a bug. More
recommendations for GNU packages can be found in *note Makefile
specific to this package. Some packages provide this 'README-configure'
file but do not implement all of the features documented below. The
lack of an optional feature in a given package is not necessarily a bug.
More recommendations for GNU packages can be found in *note Makefile
Conventions: (standards)Makefile Conventions.
The 'configure' shell script attempts to guess correct values for

View File

@ -0,0 +1,11 @@
github/gitlab autogenerated archives are not supported
======================================================
This information applies to bundles automatically generated
by github and gitlab.
strace's program version is maintained using git-version-gen script, therefore,
building strace depends on "git describe" (a full git clone is needed for this)
or, alternatively, a .tarball-version file. Neither github nor gitlab can
provide the latter, they also do not allow to inject a .tarball-version file
during export archiving.

View File

@ -3,12 +3,15 @@ strace - the linux syscall tracer
This is [strace](https://strace.io) -- a diagnostic, debugging and instructional userspace utility with a traditional command-line interface for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as [ptrace](http://man7.org/linux/man-pages/man2/ptrace.2.html).
strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file [COPYING](COPYING) for details.
strace is released under the terms of [the GNU Lesser General Public License version 2.1 or later](LGPL-2.1-or-later); see the file [COPYING](COPYING) for details.
strace test suite is released under the terms of [the GNU General Public License version 2 or later](tests/GPL-2.0-or-later); see the file [tests/COPYING](tests/COPYING) for details.
See the file [NEWS](NEWS) for information on what has changed in recent versions.
Please read the file [INSTALL-git](INSTALL-git.md) for installation instructions.
Please take a look at [the guide for new contributors](https://strace.io/wiki/NewContributorGuide) if you want to get involved in strace development.
The user discussion and development of strace take place on [the strace mailing list](https://lists.strace.io/mailman/listinfo/strace-devel) -- everyone is welcome to post bug reports, feature requests, comments and patches to strace-devel@lists.strace.io. The mailing list archives are available at https://lists.strace.io/pipermail/strace-devel/ and other archival sites.
The GIT repository of strace is available at [GitHub](https://github.com/strace/strace/) and [GitLab](https://gitlab.com/strace/strace/).

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include <fcntl.h>

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
* Copyright (c) 2009-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2009-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

24
aio.c
View File

@ -6,27 +6,7 @@
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -70,7 +50,7 @@ tprint_lio_opcode(unsigned int cmd)
[IOCB_CMD_PWRITEV] = SUB_VECTOR,
};
printxval_indexn_ex(ARRSZ_PAIR(aio_cmds), cmd, "IOCB_CMD_???",
printxval_indexn_ex(ARRSZ_PAIR(aio_cmds) - 1, cmd, "IOCB_CMD_???",
XLAT_STYLE_FMT_U);
return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;

22
alpha.c
View File

@ -3,27 +3,7 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,8 +1,15 @@
/*
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
/* Architecture-specific definitions. */
#ifndef STRACE_ARCH_DEFS_H
#define STRACE_ARCH_DEFS_H
# define STRACE_ARCH_DEFS_H
#include "arch_defs_.h"
#include "linux/arch_defs_.h"
# include "arch_defs_.h"
# include "linux/arch_defs_.h"
#endif /* !STRACE_ARCH_DEFS_H */

View File

@ -3,27 +3,7 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -174,6 +154,7 @@ lookup_class(const char *s)
{ "%process", TRACE_PROCESS },
{ "%signal", TRACE_SIGNAL },
{ "%ipc", TRACE_IPC },
{ "%net", TRACE_NETWORK },
{ "%network", TRACE_NETWORK },
{ "%stat", TRACE_STAT },
{ "%lstat", TRACE_LSTAT },

24
bind.c
View File

@ -3,30 +3,10 @@
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999-2017 The strace developers.
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

24
bjm.c
View File

@ -3,30 +3,10 @@
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999-2017 The strace developers.
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

81
block.c
View File

@ -4,27 +4,7 @@
* Copyright (c) 2011-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -65,60 +45,15 @@ typedef struct blk_user_trace_setup {
uint32_t pid;
} struct_blk_user_trace_setup;
/* Provide fall-back definitions for BLK* ioctls */
#define XLAT_MACROS_ONLY
#include "xlat/block_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
#include MPERS_DEFS
#include "print_fields.h"
#ifndef BLKPG
# define BLKPG _IO(0x12, 105)
#endif
/*
* ioctl numbers <= 114 are present in Linux 2.4. The following ones have been
* added since then and headers containing them may not be available on every
* system.
*/
#ifndef BLKTRACESETUP
# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
#endif
#ifndef BLKTRACESTART
# define BLKTRACESTART _IO(0x12, 116)
#endif
#ifndef BLKTRACESTOP
# define BLKTRACESTOP _IO(0x12, 117)
#endif
#ifndef BLKTRACETEARDOWN
# define BLKTRACETEARDOWN _IO(0x12, 118)
#endif
#ifndef BLKDISCARD
# define BLKDISCARD _IO(0x12, 119)
#endif
#ifndef BLKIOMIN
# define BLKIOMIN _IO(0x12, 120)
#endif
#ifndef BLKIOOPT
# define BLKIOOPT _IO(0x12, 121)
#endif
#ifndef BLKALIGNOFF
# define BLKALIGNOFF _IO(0x12, 122)
#endif
#ifndef BLKPBSZGET
# define BLKPBSZGET _IO(0x12, 123)
#endif
#ifndef BLKDISCARDZEROES
# define BLKDISCARDZEROES _IO(0x12, 124)
#endif
#ifndef BLKSECDISCARD
# define BLKSECDISCARD _IO(0x12, 125)
#endif
#ifndef BLKROTATIONAL
# define BLKROTATIONAL _IO(0x12, 126)
#endif
#ifndef BLKZEROOUT
# define BLKZEROOUT _IO(0x12, 127)
#endif
#include "xlat/blkpg_ops.h"
static void
@ -181,6 +116,8 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
case BLKIOMIN:
case BLKIOOPT:
case BLKDISCARDZEROES:
case BLKGETZONESZ:
case BLKGETNRZONES:
if (entering(tcp))
return 0;
tprints(", ");
@ -204,7 +141,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
printnum_ulong(tcp, arg);
break;
#ifdef HAVE_BLKGETSIZE64
/* returns an uint64_t */
case BLKGETSIZE64:
if (entering(tcp))
@ -212,7 +148,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
tprints(", ");
printnum_int64(tcp, arg, "%" PRIu64);
break;
#endif
/* takes a pair of uint64_t */
case BLKDISCARD:

View File

@ -1,4 +1,9 @@
#!/bin/sh -eu
#
# Copyright (c) 2014-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
./m4/gen_bpf_attr_m4.sh
./generate_mpers_am.sh
@ -26,7 +31,7 @@ for m in m32 mx32; do
done
done
for f in README; do
for f in README INSTALL; do
cp "dist/$f" .
done

29
bpf.c
View File

@ -4,27 +4,7 @@
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -292,11 +272,8 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
/* kern_version field was added in Linux commit v4.1-rc1~84^2~50. */
if (len <= offsetof(struct BPF_PROG_LOAD_struct, kern_version))
break;
tprintf(", kern_version=KERNEL_VERSION(%u, %u, %u)",
attr.kern_version >> 16,
(attr.kern_version >> 8) & 0xFF,
attr.kern_version & 0xFF);
tprints(", kern_version=");
print_kernel_version(attr.kern_version);
/* prog_flags field was added in Linux commit v4.12-rc2~34^2~29^2~2. */
if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_flags))
break;

View File

@ -2,31 +2,11 @@
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_BPF_ATTR_H
#define STRACE_BPF_ATTR_H
# define STRACE_BPF_ATTR_H
/*
* The policy is that all fields of type uint64_t in this header file
@ -39,21 +19,21 @@
* v4.16-rc1~123^2~109^2~5^2~4.
*/
#ifndef BPF_OBJ_NAME_LEN
# define BPF_OBJ_NAME_LEN 16U
#else
# if BPF_OBJ_NAME_LEN != 16U
# error "Unexpected value of BPF_OBJ_NAME_LEN"
# ifndef BPF_OBJ_NAME_LEN
# define BPF_OBJ_NAME_LEN 16U
# else
# if BPF_OBJ_NAME_LEN != 16U
# error "Unexpected value of BPF_OBJ_NAME_LEN"
# endif
# endif
#endif
#ifndef BPF_TAG_SIZE
# define BPF_TAG_SIZE 8
#else
# if BPF_TAG_SIZE != 8
# error "Unexpected value of BPF_TAG_SIZE"
# ifndef BPF_TAG_SIZE
# define BPF_TAG_SIZE 8
# else
# if BPF_TAG_SIZE != 8
# error "Unexpected value of BPF_TAG_SIZE"
# endif
# endif
#endif
struct BPF_MAP_CREATE_struct {
uint32_t map_type;
@ -67,9 +47,9 @@ struct BPF_MAP_CREATE_struct {
uint32_t map_ifindex;
};
#define BPF_MAP_CREATE_struct_size \
# define BPF_MAP_CREATE_struct_size \
sizeof(struct BPF_MAP_CREATE_struct)
#define expected_BPF_MAP_CREATE_struct_size 48
# define expected_BPF_MAP_CREATE_struct_size 48
struct BPF_MAP_LOOKUP_ELEM_struct {
uint32_t map_fd;
@ -77,9 +57,9 @@ struct BPF_MAP_LOOKUP_ELEM_struct {
uint64_t ATTRIBUTE_ALIGNED(8) value;
};
#define BPF_MAP_LOOKUP_ELEM_struct_size \
# define BPF_MAP_LOOKUP_ELEM_struct_size \
sizeof(struct BPF_MAP_LOOKUP_ELEM_struct)
#define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24
# define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24
struct BPF_MAP_UPDATE_ELEM_struct {
uint32_t map_fd;
@ -88,18 +68,18 @@ struct BPF_MAP_UPDATE_ELEM_struct {
uint64_t ATTRIBUTE_ALIGNED(8) flags;
};
#define BPF_MAP_UPDATE_ELEM_struct_size \
# define BPF_MAP_UPDATE_ELEM_struct_size \
sizeof(struct BPF_MAP_UPDATE_ELEM_struct)
#define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
# define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
struct BPF_MAP_DELETE_ELEM_struct {
uint32_t map_fd;
uint64_t ATTRIBUTE_ALIGNED(8) key;
};
#define BPF_MAP_DELETE_ELEM_struct_size \
# define BPF_MAP_DELETE_ELEM_struct_size \
sizeof(struct BPF_MAP_DELETE_ELEM_struct)
#define expected_BPF_MAP_DELETE_ELEM_struct_size 16
# define expected_BPF_MAP_DELETE_ELEM_struct_size 16
struct BPF_MAP_GET_NEXT_KEY_struct {
uint32_t map_fd;
@ -107,9 +87,9 @@ struct BPF_MAP_GET_NEXT_KEY_struct {
uint64_t ATTRIBUTE_ALIGNED(8) next_key;
};
#define BPF_MAP_GET_NEXT_KEY_struct_size \
# define BPF_MAP_GET_NEXT_KEY_struct_size \
sizeof(struct BPF_MAP_GET_NEXT_KEY_struct)
#define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
# define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
struct BPF_PROG_LOAD_struct {
uint32_t prog_type;
@ -126,9 +106,9 @@ struct BPF_PROG_LOAD_struct {
uint32_t expected_attach_type;
};
#define BPF_PROG_LOAD_struct_size \
# define BPF_PROG_LOAD_struct_size \
offsetofend(struct BPF_PROG_LOAD_struct, expected_attach_type)
#define expected_BPF_PROG_LOAD_struct_size 72
# define expected_BPF_PROG_LOAD_struct_size 72
struct BPF_OBJ_PIN_struct {
uint64_t ATTRIBUTE_ALIGNED(8) pathname;
@ -136,12 +116,12 @@ struct BPF_OBJ_PIN_struct {
uint32_t file_flags;
};
#define BPF_OBJ_PIN_struct_size \
# define BPF_OBJ_PIN_struct_size \
sizeof(struct BPF_OBJ_PIN_struct)
#define expected_BPF_OBJ_PIN_struct_size 16
# define expected_BPF_OBJ_PIN_struct_size 16
#define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
#define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
# define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
# define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
struct BPF_PROG_ATTACH_struct {
uint32_t target_fd;
@ -150,9 +130,9 @@ struct BPF_PROG_ATTACH_struct {
uint32_t attach_flags;
};
#define BPF_PROG_ATTACH_struct_size \
# define BPF_PROG_ATTACH_struct_size \
sizeof(struct BPF_PROG_ATTACH_struct)
#define expected_BPF_PROG_ATTACH_struct_size 16
# define expected_BPF_PROG_ATTACH_struct_size 16
struct BPF_PROG_DETACH_struct {
uint32_t target_fd;
@ -160,9 +140,9 @@ struct BPF_PROG_DETACH_struct {
uint32_t attach_type;
};
#define BPF_PROG_DETACH_struct_size \
# define BPF_PROG_DETACH_struct_size \
sizeof(struct BPF_PROG_DETACH_struct)
#define expected_BPF_PROG_DETACH_struct_size 12
# define expected_BPF_PROG_DETACH_struct_size 12
struct BPF_PROG_TEST_RUN_struct /* test */ {
uint32_t prog_fd;
@ -175,9 +155,9 @@ struct BPF_PROG_TEST_RUN_struct /* test */ {
uint32_t duration;
};
#define BPF_PROG_TEST_RUN_struct_size \
# define BPF_PROG_TEST_RUN_struct_size \
sizeof(struct BPF_PROG_TEST_RUN_struct)
#define expected_BPF_PROG_TEST_RUN_struct_size 40
# define expected_BPF_PROG_TEST_RUN_struct_size 40
struct BPF_PROG_GET_NEXT_ID_struct {
uint32_t start_id;
@ -185,12 +165,12 @@ struct BPF_PROG_GET_NEXT_ID_struct {
uint32_t open_flags;
};
#define BPF_PROG_GET_NEXT_ID_struct_size \
# define BPF_PROG_GET_NEXT_ID_struct_size \
sizeof(struct BPF_PROG_GET_NEXT_ID_struct)
#define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
# define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
#define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
#define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
# define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
# define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
struct BPF_PROG_GET_FD_BY_ID_struct {
uint32_t prog_id;
@ -198,9 +178,9 @@ struct BPF_PROG_GET_FD_BY_ID_struct {
uint32_t open_flags;
};
#define BPF_PROG_GET_FD_BY_ID_struct_size \
# define BPF_PROG_GET_FD_BY_ID_struct_size \
sizeof(struct BPF_PROG_GET_FD_BY_ID_struct)
#define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
# define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
struct BPF_MAP_GET_FD_BY_ID_struct {
uint32_t map_id;
@ -208,9 +188,9 @@ struct BPF_MAP_GET_FD_BY_ID_struct {
uint32_t open_flags;
};
#define BPF_MAP_GET_FD_BY_ID_struct_size \
# define BPF_MAP_GET_FD_BY_ID_struct_size \
sizeof(struct BPF_MAP_GET_FD_BY_ID_struct)
#define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
# define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
uint32_t bpf_fd;
@ -218,9 +198,9 @@ struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
uint64_t ATTRIBUTE_ALIGNED(8) info;
};
#define BPF_OBJ_GET_INFO_BY_FD_struct_size \
# define BPF_OBJ_GET_INFO_BY_FD_struct_size \
sizeof(struct BPF_OBJ_GET_INFO_BY_FD_struct)
#define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
# define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
struct BPF_PROG_QUERY_struct /* query */ {
uint32_t target_fd;
@ -231,18 +211,18 @@ struct BPF_PROG_QUERY_struct /* query */ {
uint32_t prog_cnt;
};
#define BPF_PROG_QUERY_struct_size \
# define BPF_PROG_QUERY_struct_size \
offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt)
#define expected_BPF_PROG_QUERY_struct_size 28
# define expected_BPF_PROG_QUERY_struct_size 28
struct BPF_RAW_TRACEPOINT_OPEN_struct /* raw_tracepoint */ {
uint64_t ATTRIBUTE_ALIGNED(8) name;
uint32_t prog_fd;
};
#define BPF_RAW_TRACEPOINT_OPEN_struct_size \
# define BPF_RAW_TRACEPOINT_OPEN_struct_size \
offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd)
#define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
# define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
struct bpf_map_info_struct {
uint32_t type;
@ -261,9 +241,9 @@ struct bpf_map_info_struct {
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
};
#define bpf_map_info_struct_size \
# define bpf_map_info_struct_size \
sizeof(struct bpf_map_info_struct)
#define expected_bpf_map_info_struct_size 64
# define expected_bpf_map_info_struct_size 64
struct bpf_prog_info_struct {
uint32_t type;
@ -287,8 +267,8 @@ struct bpf_prog_info_struct {
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
};
#define bpf_prog_info_struct_size \
# define bpf_prog_info_struct_size \
sizeof(struct bpf_prog_info_struct)
#define expected_bpf_prog_info_struct_size 104
# define expected_bpf_prog_info_struct_size 104
#endif /* !STRACE_BPF_ATTR_H */

View File

@ -5,27 +5,7 @@
* Copyright (c) 2017-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,34 +1,14 @@
/*
* Classic BPF filter block.
*
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_BPF_FILTER_H
#define STRACE_BPF_FILTER_H
# define STRACE_BPF_FILTER_H
struct bpf_filter_block {
uint16_t code;

View File

@ -1,5 +1,12 @@
/*
* Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_BPF_FPROG_H
#define STRACE_BPF_FPROG_H
# define STRACE_BPF_FPROG_H
struct bpf_fprog {
unsigned short len;

View File

@ -1,30 +1,10 @@
/*
* Decoder of seccomp filter programs.
*
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -5,27 +5,7 @@
* Copyright (c) 2017-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

156
btrfs.c
View File

@ -3,37 +3,17 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#ifdef HAVE_LINUX_BTRFS_H
#include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args)
#include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args)
#include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args)
#include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2)
# include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args)
# include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args)
# include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args)
# include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2)
# include <linux/btrfs.h>
@ -52,8 +32,8 @@ typedef struct btrfs_ioctl_vol_args_v2
#ifdef HAVE_LINUX_BTRFS_H
#include "print_fields.h"
#include <linux/fs.h>
# include "print_fields.h"
# include <linux/fs.h>
/*
* Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in
@ -61,15 +41,15 @@ typedef struct btrfs_ioctl_vol_args_v2
*/
typedef __u64 u64;
#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
struct btrfs_ioctl_feature_flags {
uint64_t compat_flags;
uint64_t compat_ro_flags;
uint64_t incompat_flags;
};
#endif
# endif
#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
struct btrfs_ioctl_defrag_range_args {
uint64_t start;
uint64_t len;
@ -78,37 +58,37 @@ struct btrfs_ioctl_defrag_range_args {
uint32_t compress_type;
uint32_t unused[4];
};
#endif
# endif
#ifndef BTRFS_LABEL_SIZE
# define BTRFS_LABEL_SIZE 256
#endif
# ifndef BTRFS_LABEL_SIZE
# define BTRFS_LABEL_SIZE 256
# endif
#ifndef BTRFS_IOC_QUOTA_RESCAN
# ifndef BTRFS_IOC_QUOTA_RESCAN
struct btrfs_ioctl_quota_rescan_args {
uint64_t flags, progress, reserved[6];
};
# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
struct btrfs_ioctl_quota_rescan_args)
# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
struct btrfs_ioctl_quota_rescan_args)
#endif
# endif
#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
#endif
# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
# endif
#ifndef BTRFS_IOC_GET_FEATURES
# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
# ifndef BTRFS_IOC_GET_FEATURES
# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags)
# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags[2])
# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags[3])
#endif
# endif
#ifndef BTRFS_IOC_TREE_SEARCH_V2
# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
# ifndef BTRFS_IOC_TREE_SEARCH_V2
# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
struct btrfs_ioctl_search_args_v2)
struct btrfs_ioctl_search_args_v2 {
struct btrfs_ioctl_search_key key; /* in/out - search parameters */
@ -117,34 +97,34 @@ struct btrfs_ioctl_search_args_v2 {
* to store item */
uint64_t buf[0]; /* out - found items */
};
#endif
# endif
#include "xlat/btrfs_balance_args.h"
#include "xlat/btrfs_balance_ctl_cmds.h"
#include "xlat/btrfs_balance_flags.h"
#include "xlat/btrfs_balance_state.h"
#include "xlat/btrfs_compress_types.h"
#include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
#include "xlat/btrfs_defrag_flags.h"
#include "xlat/btrfs_dev_replace_cmds.h"
#include "xlat/btrfs_dev_replace_results.h"
#include "xlat/btrfs_dev_replace_state.h"
#include "xlat/btrfs_dev_stats_flags.h"
#include "xlat/btrfs_dev_stats_values.h"
#include "xlat/btrfs_features_compat.h"
#include "xlat/btrfs_features_compat_ro.h"
#include "xlat/btrfs_features_incompat.h"
#include "xlat/btrfs_key_types.h"
#include "xlat/btrfs_logical_ino_args_flags.h"
#include "xlat/btrfs_qgroup_ctl_cmds.h"
#include "xlat/btrfs_qgroup_inherit_flags.h"
#include "xlat/btrfs_qgroup_limit_flags.h"
#include "xlat/btrfs_qgroup_status_flags.h"
#include "xlat/btrfs_scrub_flags.h"
#include "xlat/btrfs_send_flags.h"
#include "xlat/btrfs_snap_flags_v2.h"
#include "xlat/btrfs_space_info_flags.h"
#include "xlat/btrfs_tree_objectids.h"
# include "xlat/btrfs_balance_args.h"
# include "xlat/btrfs_balance_ctl_cmds.h"
# include "xlat/btrfs_balance_flags.h"
# include "xlat/btrfs_balance_state.h"
# include "xlat/btrfs_compress_types.h"
# include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
# include "xlat/btrfs_defrag_flags.h"
# include "xlat/btrfs_dev_replace_cmds.h"
# include "xlat/btrfs_dev_replace_results.h"
# include "xlat/btrfs_dev_replace_state.h"
# include "xlat/btrfs_dev_stats_flags.h"
# include "xlat/btrfs_dev_stats_values.h"
# include "xlat/btrfs_features_compat.h"
# include "xlat/btrfs_features_compat_ro.h"
# include "xlat/btrfs_features_incompat.h"
# include "xlat/btrfs_key_types.h"
# include "xlat/btrfs_logical_ino_args_flags.h"
# include "xlat/btrfs_qgroup_ctl_cmds.h"
# include "xlat/btrfs_qgroup_inherit_flags.h"
# include "xlat/btrfs_qgroup_limit_flags.h"
# include "xlat/btrfs_qgroup_status_flags.h"
# include "xlat/btrfs_scrub_flags.h"
# include "xlat/btrfs_send_flags.h"
# include "xlat/btrfs_snap_flags_v2.h"
# include "xlat/btrfs_space_info_flags.h"
# include "xlat/btrfs_tree_objectids.h"
static inline char
prnibble(char v)
@ -155,7 +135,7 @@ prnibble(char v)
}
/* 8-4-4-4-12 = 36 characters */
#define UUID_STRING_SIZE 36
# define UUID_STRING_SIZE 36
/* Formats uuid, returns 0 if it's all zeroes */
static int
@ -242,9 +222,9 @@ btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim)
tprints("}");
}
#define btrfs_print_key_type(prefix_, where_, field_) \
# define btrfs_print_key_type(prefix_, where_, field_) \
PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_key_types, NULL)
#define btrfs_print_objectid(prefix_, where_, field_) \
# define btrfs_print_objectid(prefix_, where_, field_) \
PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_tree_objectids, \
NULL)
@ -738,9 +718,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
struct btrfs_ioctl_fs_info_args args;
char uuid[UUID_STRING_SIZE+1];
uint32_t nodesize, sectorsize, clone_alignment;
#ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
# ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
uint32_t *reserved32;
#endif
# endif
if (entering(tcp))
return 0;
@ -749,16 +729,16 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
if (umove_or_printaddr(tcp, arg, &args))
break;
#ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
# ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
nodesize = args.nodesize,
sectorsize = args.sectorsize,
clone_alignment = args.clone_alignment;
#else
# else
reserved32 = (void *) args.reserved;
nodesize = reserved32[0];
sectorsize = reserved32[1];
clone_alignment = reserved32[2];
#endif
# endif
btrfs_unparse_uuid(args.fsid, uuid);
PRINT_FIELD_U("{", args, max_id);
@ -912,11 +892,11 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
tprintf(", flags=");
printflags64(btrfs_logical_ino_args_flags,
#ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS
# ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS
args.flags
#else
# else
args.reserved[3]
#endif
# endif
, "BTRFS_LOGICAL_INO_ARGS_???");
PRINT_FIELD_ADDR64(", ", args, inodes);
tprints("}");
@ -1282,9 +1262,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
case BTRFS_IOC_CLONE: /* FICLONE */
case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */
#ifdef BTRFS_IOC_FILE_EXTENT_SAME
# ifdef BTRFS_IOC_FILE_EXTENT_SAME
case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */
#endif
# endif
/*
* FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as
* btrfs ioctls and the code was kept for the generic

View File

@ -4,30 +4,10 @@
* Copyright (c) 2010 Carmelo Amoroso <carmelo.amoroso@st.com>
* Copyright (c) 2015 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
* Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2014-2017 The strace developers.
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -40,15 +20,15 @@
# include "xlat/cacheflush_scope.h"
static const struct xlat cacheflush_flags[] = {
#ifdef FLUSH_CACHE_BOTH
# ifdef FLUSH_CACHE_BOTH
XLAT(FLUSH_CACHE_BOTH),
#endif
#ifdef FLUSH_CACHE_DATA
# endif
# ifdef FLUSH_CACHE_DATA
XLAT(FLUSH_CACHE_DATA),
#endif
#ifdef FLUSH_CACHE_INSN
# endif
# ifdef FLUSH_CACHE_INSN
XLAT(FLUSH_CACHE_INSN),
#endif
# endif
XLAT_END
};
@ -92,18 +72,18 @@ SYS_FUNC(cacheflush)
#ifdef SH
static const struct xlat cacheflush_flags[] = {
#ifdef CACHEFLUSH_D_INVAL
# ifdef CACHEFLUSH_D_INVAL
XLAT(CACHEFLUSH_D_INVAL),
#endif
#ifdef CACHEFLUSH_D_WB
# endif
# ifdef CACHEFLUSH_D_WB
XLAT(CACHEFLUSH_D_WB),
#endif
#ifdef CACHEFLUSH_D_PURGE
# endif
# ifdef CACHEFLUSH_D_PURGE
XLAT(CACHEFLUSH_D_PURGE),
#endif
#ifdef CACHEFLUSH_I
# endif
# ifdef CACHEFLUSH_I
XLAT(CACHEFLUSH_I),
#endif
# endif
XLAT_END
};

View File

@ -2,30 +2,10 @@
* Copyright (c) 2000 Wichert Akkerman <wakkerma@debian.org>
* Copyright (c) 2011 Denys Vlasenko <dvlasenk@redhat.com>
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2014-2017 The strace developers.
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
CAP_CHOWN,
CAP_DAC_OVERRIDE,
CAP_DAC_READ_SEARCH,

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
CAP_MAC_OVERRIDE,
CAP_MAC_ADMIN,
CAP_SYSLOG,

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(chdir)

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
static void

View File

@ -1,4 +1,9 @@
#!/bin/sh -ex
#
# Copyright (c) 2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later
type sudo >/dev/null 2>&1 && sudo=sudo || sudo=
common_packages='autoconf automake faketime file gawk gcc-multilib git gzip libbluetooth-dev make xz-utils'
@ -49,10 +54,23 @@ clone_repo()
git clone --depth=1 ${branch:+--branch $branch} "$src" "$dst"
}
case "$CC" in
gcc-*)
retry_if_failed \
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt_get_install $common_packages "$CC"-multilib
;;
clang*)
apt_get_install $common_packages "$CC"
;;
*)
apt_get_install $common_packages
;;
esac
case "$KHEADERS" in
*/*)
clone_repo https://github.com/"$KHEADERS" kernel ${KBRANCH-}
apt_get_install $common_packages
$sudo make -C kernel headers_install INSTALL_HDR_PATH=/opt/kernel
$sudo rm -rf kernel
KHEADERS_INC=/opt/kernel/include
@ -63,20 +81,8 @@ case "$KHEADERS" in
esac
case "$CC" in
gcc)
apt_get_install $common_packages
;;
gcc-*)
retry_if_failed \
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt_get_install $common_packages "$CC"-multilib
;;
clang*)
apt_get_install $common_packages "$CC"
;;
musl-gcc)
clone_repo strace/musl musl
apt_get_install $common_packages
cd musl
CC=gcc
build=

View File

@ -1,4 +1,9 @@
#!/bin/sh -ex
#
# Copyright (c) 2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later
DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking'
export DISTCHECK_CONFIGURE_FLAGS
@ -33,6 +38,7 @@ case "${STACKTRACE-}" in
;;
esac
CPPFLAGS=
case "$KHEADERS" in
*/*)
CPPFLAGS='-isystem /opt/kernel/include'
@ -62,7 +68,7 @@ $CC -print-multi-lib ||:
make --version |head -1
autoconf --version |head -1
automake --version |head -1
kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC -E -P -)"
kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC $CPPFLAGS -E -P -)"
printf 'kernel-headers %s.%s.%s\n' $(($kver/65536)) $(($kver/256%256)) $(($kver%256))
echo 'END OF BUILD ENVIRONMENT INFORMATION'

28
clone.c
View File

@ -7,27 +7,7 @@
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -111,8 +91,10 @@ SYS_FUNC(clone)
tprints("flags=");
if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL))
sep = "";
if ((flags & CSIGNAL) != 0)
tprintf("%s%s", sep, signame(flags & CSIGNAL));
if ((flags & CSIGNAL) != 0) {
tprints(sep);
printsignal(flags & CSIGNAL);
}
if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
|CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
return 0;

View File

@ -8,27 +8,7 @@
# Copyright (c) 2002-2018 The strace developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# SPDX-License-Identifier: LGPL-2.1-or-later
AC_PREREQ(2.57)
AC_INIT([strace],
@ -397,7 +377,6 @@ AC_CHECK_HEADERS(m4_normalize([
linux/falloc.h
linux/fib_rules.h
linux/fiemap.h
linux/genetlink.h
linux/hiddev.h
linux/if_addr.h
linux/if_link.h
@ -666,6 +645,8 @@ AC_CHECK_DECLS(m4_normalize([
KERN_MAX_LOCK_DEPTH,
KERN_NMI_WATCHDOG,
KERN_PANIC_ON_NMI,
KERN_PANIC_ON_WARN,
KERN_PANIC_PRINT,
NET_LLC,
NET_NETFILTER,
NET_DCCP,
@ -788,15 +769,6 @@ AC_CHECK_MEMBERS(m4_normalize([
#include <linux/types.h>
#include <linux/videodev2.h>])
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h>
#include <linux/fs.h>], [return !BLKGETSIZE64;])],
[ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
if test $ac_cv_have_blkgetsize64 = yes; then
AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
fi)
AC_CHECK_SIZEOF([long])
SIZEOF_LONG="$ac_cv_sizeof_long"
AC_SUBST(SIZEOF_LONG)

View File

@ -1,28 +1,8 @@
/*
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,4 +1,9 @@
#! /bin/sh
#!/bin/sh
#
# Copyright (c) 2017-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
: ${YEAR_FILE:=$1}
: ${DEFAULT_YEAR:=$2}
@ -14,7 +19,7 @@ year=
[ -f "${YEAR_FILE}" ] && year="$(cat "${YEAR_FILE}")"
[ -n "${year}" ] ||
year="$(date -u +%Y -d "$(git show --format=format:%cD --no-patch)")"
year="$(date -u +%Y -d "$(git show -s --format=format:%cD)")"
[ -n "${year}" ] ||
year="${DEFAULT_YEAR}"

22
count.c
View File

@ -11,27 +11,7 @@
* Copyright (c) 2006-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

18
debian/changelog.in vendored
View File

@ -4,6 +4,24 @@ strace (@PACKAGE_VERSION@-1) experimental; urgency=low
-- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@
strace (4.26-1) unstable; urgency=medium
* New upstream version.
-- Dmitry V. Levin <ldv@altlinux.org> Wed, 26 Dec 2018 18:25:10 +0000
strace (4.25-1) unstable; urgency=medium
* New upstream version.
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 30 Oct 2018 08:09:10 +0000
strace (4.24-1) unstable; urgency=medium
* New upstream version.
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 14 Aug 2018 00:01:02 +0000
strace (4.23-1) unstable; urgency=medium
* New upstream version.

30
debian/copyright vendored
View File

@ -14,24 +14,14 @@ Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
Copyright (c) 2001-2018 The strace developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
strace is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
strace is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details.
strace test suite is provided under the terms of the GNU General Public License
version 2 or later, see tests/COPYING for more details.

658
defs.h

File diff suppressed because it is too large Load Diff

22
delay.c
View File

@ -2,27 +2,7 @@
* Copyright (c) 2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

24
delay.h
View File

@ -2,31 +2,11 @@
* Copyright (c) 2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_DELAY_H
#define STRACE_DELAY_H
# define STRACE_DELAY_H
uint16_t alloc_delay_data(void);
void fill_delay_data(uint16_t delay_idx, int intval, bool isenter);

22
desc.c
View File

@ -6,27 +6,7 @@
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -4,30 +4,10 @@
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2014-2017 The strace developers.
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -4,30 +4,10 @@
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

134
dist/INSTALL vendored Normal file
View File

@ -0,0 +1,134 @@
0. BUILD REQUIREMENTS
- Sane POSIX shell.
- gcc-like compiler that supports C99 and some GNU extensions (namely, empty
structures, empty definitions, zero length arrays, ranged designated
initialisers).
- libc. GNU libc and musl are supported.
- Linux UAPI headers.
- GNU Make.
- GNU coreutils.
- For running test suite: gawk, grep, sed, runtime environment for all
personalities.
- Requirements for optional features are documented in their description.
1. CONFIGURATION AND OPTIONAL FEATURES
Configuration is done using GNU Autoconf-generated configure script.
Please refer to the README-configure file for generic information regarding
configure usage.
In addition to standard configure options, strace's configure file provides
the following options:
1.1. Additional build and testing hardening
--enable-gcc-Werror turn on gcc's -Werror option
--enable-code-coverage Whether to enable code coverage support
--with-gcov=GCOV use given GCOV for coverage (GCOV=gcov).
--enable-valgrind Whether to enable Valgrind on the unit tests
--disable-valgrind-memcheck
Whether to skip memcheck during the Valgrind tests
--disable-valgrind-helgrind
Whether to skip helgrind during the Valgrind tests
--disable-valgrind-drd Whether to skip drd during the Valgrind tests
--enable-valgrind-sgcheck
Whether to use sgcheck during the Valgrind tests
1.2. Optional features
1.2.1. Multiple personalities support
--enable-mpers=yes|no|check|m32|mx32
whether to enable multiple personalities support
required for proper decoding of structures used by
tracees with personalities that differ from the
personality of strace, default is yes.
Personality is a way system call is performed (in terms of ABI). For example,
Linux kernel on multiple 64-bit architectures that evolve from their 32-bit
counterparts have support for running 32-bit binaries with 32-bit system call
ABI, and that system call ABI constitutes a separate personality in strace's
terms. Another example is 32-on-64 bit ABI; while exploiting the same way for
performing system calls as native 64-bit system calls, this ABI has different
type sizes and, as a result, also constitutes a separate personality; the only
such ABI that is currently supported by strace is x32 on x86_64. This is
important as different ABIs use different alignments and type sizes, as a
result, fields in structures in unions have different offsets on different
ABIs. In order to be able to correctly parse all the structures used in various
system calls and ioctl commands, strace compiles these structure definitions
for these different ABI and then parses DWARF of these compiled definitions in
order to generate proper structure definitions that compiled with decoder code.
Taking the aforementioned into account, there are the following requirements:
- gawk (at least version 3)
- Ability to compile for m32 personality (on architectures where it is supported)
- On x86_64, x32, powerpc64, sparc64, riscv64, tile64: gcc -m32
- s390x: gcc -m31
- AArch64: a separate compiler for armv7 EABI
- See information about configuration in "1.3.2. AArch64: AArch32 support"
- Ability to compile for mx32 personality (on architectures where it is supported)
- On x86_64: gcc -mx32
- For tests: runtime support (linker, libc, and loader)
1.2.2. Stack unwinding (-k option)
--with-libunwind use libunwind to implement stack tracing support
--with-libiberty use libiberty to demangle symbols in stack trace
1.3. Architecture-specific features
1.3.1. ARMv7: OABI support
--enable-arm-oabi enable OABI support on ARM EABI
1.3.2. AArch64: AArch32 support
CC_FOR_M32
CPP_FOR_M32
CFLAGS_FOR_M32
CPPFLAGS_FOR_M32
1.4. Miscellanea
1.4.1. Static build configuration
For static linking, provide LDFLAGS='-static -pthread'.
1.4.2. Cross-compilation configuration
2. BUILDING
make
make V=1
3. TESTING
make check
TESTS='list of tests'
VALGRIND_FLAGS
TIMEOUT_DURATION
BTRFS_MOUNTPOINT
4. ADDITIONAL TARGETS
make code-coverage-capture
make code-coverage-capture CODE_COVERAGE_BRANCH_COVERAGE=
5. INSTALLATION
make install
6. PACKAGING
6.1. Distribution tarball
./make-dist
Requires git
6.2. dpkg package
6.3. RPM package

14
dist/README vendored
View File

@ -4,19 +4,29 @@ and tamper with interactions between processes and the Linux kernel, which
include system calls, signal deliveries, and changes of process state.
The operation of strace is made possible by the kernel feature known as ptrace.
strace is released under a Berkeley-style license at the request
of Paul Kranenburg; see the file COPYING for details.
strace is released under the terms of the GNU Lesser General Public License
version 2.1 or later; see the file COPYING for details.
strace test suite is released under the terms of the GNU General Public License
version 2 or later; see the file tests/COPYING for details.
See the file CREDITS for a list of authors and other contributors.
See the file INSTALL for compilation and installation instructions.
See the file NEWS for information on what has changed in recent versions.
See the file README-hacking for information related to strace development.
The project's homepage is at
https://strace.io
The GIT repository of strace is available at
https://github.com/strace/strace/ and https://gitlab.com/strace/strace/
strace has a mailing list:
strace-devel@lists.strace.io
Everyone is welcome to post bug reports, feature requests, comments
and patches to the list. The mailing list archives are available at
https://lists.strace.io/pipermail/strace-devel/
System requirements:
* Linux kernel >= 2.6.18 is recommended. Older versions might still work
but they haven't been thoroughly tested with this release.

24
dm.c
View File

@ -8,27 +8,7 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -118,7 +98,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code,
}
}
#include "xlat/dm_flags.h"
# include "xlat/dm_flags.h"
static void
dm_decode_flags(const struct dm_ioctl *ioc)

View File

@ -1,27 +1,7 @@
/*
* Copyright (c) 2017 The strace developers.
* Copyright (c) 2017-2018 The strace developers.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

22
epoll.c
View File

@ -5,27 +5,7 @@
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -2,27 +2,7 @@
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifdef HAVE_CONFIG_H

View File

@ -4,38 +4,18 @@
* package. Variable 'program_invocation_name' and function 'die()'
* have to be defined globally.
*
* Copyright (c) 2001-2017 The strace developers.
* Copyright (c) 2001-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_ERROR_PRINTS_H
#define STRACE_ERROR_PRINTS_H
# define STRACE_ERROR_PRINTS_H
#include <stdbool.h>
# include <stdbool.h>
#include "gcc_compat.h"
# include "gcc_compat.h"
extern bool debug_flag;
@ -51,29 +31,29 @@ void error_msg_and_die(const char *fmt, ...)
ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
/* Wrappers for if (debug_flag) error_msg(...) */
#define debug_msg(...) \
# define debug_msg(...) \
do { \
if (debug_flag) \
error_msg(__VA_ARGS__); \
} while (0)
#define debug_perror_msg(...) \
# define debug_perror_msg(...) \
do { \
if (debug_flag) \
perror_msg(__VA_ARGS__); \
} while (0)
/* Simple wrappers for providing function name in error messages */
#define error_func_msg(fmt_, ...) \
# define error_func_msg(fmt_, ...) \
error_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
#define perror_func_msg(fmt_, ...) \
# define perror_func_msg(fmt_, ...) \
perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
#define debug_func_msg(fmt_, ...) \
# define debug_func_msg(fmt_, ...) \
debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
#define debug_func_perror_msg(fmt_, ...) \
# define debug_func_perror_msg(fmt_, ...) \
debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
#define error_func_msg_and_die(fmt_, ...) \
# define error_func_msg_and_die(fmt_, ...) \
error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
#define perror_func_msg_and_die(fmt_, ...) \
# define perror_func_msg_and_die(fmt_, ...) \
perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
#endif /* !STRACE_ERROR_PRINTS_H */

38
evdev.c
View File

@ -4,32 +4,13 @@
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include "xlat/evdev_abs.h"
#include "xlat/evdev_ev.h"
#ifdef HAVE_LINUX_INPUT_H
@ -47,7 +28,6 @@
# include "xlat/evdev_relative_axes.h"
# include "xlat/evdev_snd.h"
# include "xlat/evdev_switch.h"
# include "xlat/evdev_sync.h"
# ifndef SYN_MAX
# define SYN_MAX 0xf
@ -171,10 +151,10 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
tprints(", ");
unsigned int size;
if ((kernel_ulong_t) tcp->u_rval > max_nr)
if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
size = max_nr;
else
size = tcp->u_rval;
size = tcp->u_rval * 8;
char decoded_arg[size];
if (umove_or_printaddr(tcp, arg, &decoded_arg))
@ -206,9 +186,9 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
return RVAL_IOCTL_DECODED;
}
#define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
# define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
(dflt_), ARRAY_SIZE(decode_nr_), (xt_))
(dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_))
# ifdef EVIOCGMTSLOTS
static int
@ -258,9 +238,9 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
const kernel_ulong_t arg)
{
switch (ev_nr) {
case EV_SYN:
return decode_bitset(tcp, arg, evdev_sync,
SYN_MAX, "SYN_???", XT_INDEXED);
case 0:
return decode_bitset(tcp, arg, evdev_ev,
EV_MAX, "EV_???", XT_SORTED);
case EV_KEY:
return decode_bitset(tcp, arg, evdev_keycode,
KEY_MAX, "KEY_???", XT_INDEXED);

View File

@ -4,34 +4,14 @@
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#ifdef HAVE_LINUX_INPUT_H
#include DEF_MPERS_TYPE(struct_ff_effect)
# include DEF_MPERS_TYPE(struct_ff_effect)
# include <linux/ioctl.h>
# include <linux/input.h>

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
* Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2008-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -9,27 +9,7 @@
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -2,40 +2,20 @@
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_F_OWNER_EX_H
#define STRACE_F_OWNER_EX_H
# define STRACE_F_OWNER_EX_H
#include <linux/fcntl.h>
# include <linux/fcntl.h>
#if defined HAVE_STRUCT_F_OWNER_EX
# if defined HAVE_STRUCT_F_OWNER_EX
typedef struct f_owner_ex struct_kernel_f_owner_ex;
#elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
# elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
typedef struct __kernel_f_owner_ex struct_kernel_f_owner_ex;
#else
# error struct f_owner_ex definition not found in <linux/fcntl.h>
#endif
# else
# error struct f_owner_ex definition not found in <linux/fcntl.h>
# endif
#endif /* !STRACE_F_OWNER_EX_H */

View File

@ -5,30 +5,10 @@
* Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
* Copyright (c) 2009 Kirill A. Shutemov <kirill@shutemov.name>
* Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2014-2017 The strace developers.
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#ifdef HAVE_LINUX_FALLOC_H

View File

@ -3,27 +3,7 @@
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(fchownat)

24
fcntl.c
View File

@ -6,27 +6,7 @@
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -134,7 +114,7 @@ print_fcntl(struct tcb *tcp)
break;
case F_SETSIG:
tprints(", ");
tprints(signame(tcp->u_arg[2]));
printsignal(tcp->u_arg[2]);
break;
case F_GETOWN:
case F_GETPIPE_SZ:

View File

@ -1,28 +1,8 @@
/*
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -2,27 +2,7 @@
* Copyright (c) 2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2016-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include DEF_MPERS_TYPE(struct_keyctl_kdf_params)

View File

@ -1,28 +1,8 @@
/*
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,28 +1,8 @@
/*
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2017 The strace developers.
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2017 The strace developers.
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2017 The strace developers.
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include DEF_MPERS_TYPE(struct_xfs_dqstats)

View File

@ -1,4 +1,9 @@
#! /bin/sh
#!/bin/sh
#
# Copyright (c) 2017-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
if [ "$1" = "-f" ]; then
shift
@ -22,7 +27,7 @@ date=
[ -f "${DATE_FILE}" ] && date="$(cat "${DATE_FILE}")"
[ -n "${date}" ] ||
date="$(git log -n 1 --format=format:%cD --no-patch "${FILE}")"
date="$(git log -s -n 1 --format=format:%cD "${FILE}")"
[ -n "${date}" ] ||
date="${DEFAULT_DATE}"

View File

@ -1,29 +1,9 @@
/*
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -3,27 +3,7 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -3,31 +3,11 @@
* Copyright (c) 2017-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_FILTER_H
#define STRACE_FILTER_H
# define STRACE_FILTER_H
struct number_set;
typedef int (*string_to_uint_func)(const char *);

View File

@ -3,27 +3,7 @@
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -57,9 +37,12 @@ sigstr_to_uint(const char *s)
if (strncasecmp(s, "SIG", 3) == 0)
s += 3;
for (int i = 0; i <= 255; ++i) {
for (int i = 1; i <= 255; ++i) {
const char *name = signame(i);
if (!name)
continue;
if (strncasecmp(name, "SIG", 3) != 0)
continue;

24
flock.c
View File

@ -3,30 +3,10 @@
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999-2017 The strace developers.
* Copyright (c) 1999-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

48
flock.h
View File

@ -1,50 +1,30 @@
/*
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_FLOCK_H
#define STRACE_FLOCK_H
# define STRACE_FLOCK_H
#include <linux/fcntl.h>
# include <linux/fcntl.h>
#if defined HAVE_STRUCT_FLOCK
# if defined HAVE_STRUCT_FLOCK
typedef struct flock struct_kernel_flock;
#elif defined HAVE_STRUCT___KERNEL_FLOCK
# elif defined HAVE_STRUCT___KERNEL_FLOCK
typedef struct __kernel_flock struct_kernel_flock;
#else
# error struct flock definition not found in <linux/fcntl.h>
#endif
# else
# error struct flock definition not found in <linux/fcntl.h>
# endif
#if defined HAVE_STRUCT_FLOCK64
# if defined HAVE_STRUCT_FLOCK64
typedef struct flock64 struct_kernel_flock64;
#elif defined HAVE_STRUCT___KERNEL_FLOCK64
# elif defined HAVE_STRUCT___KERNEL_FLOCK64
typedef struct __kernel_flock64 struct_kernel_flock64;
#else
# error struct flock64 definition not found in <linux/fcntl.h>
#endif
# else
# error struct flock64 definition not found in <linux/fcntl.h>
# endif
#endif /* !STRACE_FLOCK_H */

View File

@ -1,30 +1,10 @@
/*
* Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2016-2017 The strace developers.
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(fstatfs)

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2016-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(fstatfs64)

29
futex.c
View File

@ -6,27 +6,7 @@
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
@ -41,6 +21,7 @@
# define FUTEX_OP_OPARG_SHIFT 8
#endif
#include "xlat/futexbitset.h"
#include "xlat/futexops.h"
#include "xlat/futexwakeops.h"
#include "xlat/futexwakecmps.h"
@ -74,11 +55,13 @@ SYS_FUNC(futex)
tprintf(", %u", val);
tprints(", ");
print_timespec(tcp, timeout);
tprintf(", %#x", val3);
tprints(", ");
printxval(futexbitset, val3, NULL);
break;
case FUTEX_WAKE_BITSET:
tprintf(", %u", val);
tprintf(", %#x", val3);
tprints(", ");
printxval(futexbitset, val3, NULL);
break;
case FUTEX_REQUEUE:
tprintf(", %u", val);

View File

@ -3,111 +3,118 @@
* Copyright (c) 2015-2018 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_GCC_COMPAT_H
#define STRACE_GCC_COMPAT_H
# define STRACE_GCC_COMPAT_H
#if defined __GNUC__ && defined __GNUC_MINOR__
# define GNUC_PREREQ(maj, min) \
# if defined __GNUC__ && defined __GNUC_MINOR__
# define GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
# define __attribute__(x) /* empty */
# define GNUC_PREREQ(maj, min) 0
#endif
# else
# define GNUC_PREREQ(maj, min) 0
# endif
#if GNUC_PREREQ(2, 5)
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
#else
# define ATTRIBUTE_NORETURN /* empty */
#endif
# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
# define CLANG_PREREQ(maj, min) \
((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
# else
# define CLANG_PREREQ(maj, min) 0
# endif
#if GNUC_PREREQ(2, 7)
# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
# define ATTRIBUTE_PACKED __attribute__((__packed__))
#else
# define ATTRIBUTE_FORMAT(args) /* empty */
# define ATTRIBUTE_ALIGNED(arg) /* empty */
# define ATTRIBUTE_PACKED /* empty */
#endif
# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
# define __attribute__(x) /* empty */
# endif
#if GNUC_PREREQ(3, 0)
# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
# if GNUC_PREREQ(2, 5)
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
# else
# define ATTRIBUTE_NORETURN /* empty */
# endif
# if GNUC_PREREQ(2, 7)
# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
# define ATTRIBUTE_PACKED __attribute__((__packed__))
# else
# define ATTRIBUTE_FORMAT(args) /* empty */
# define ATTRIBUTE_ALIGNED(arg) /* empty */
# define ATTRIBUTE_PACKED /* empty */
# endif
# if GNUC_PREREQ(3, 0)
# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
/* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */
# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
#else
# define SAME_TYPE(x, y) 0
# define MUST_BE_ARRAY(a) 0
#endif
# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
# else
# define SAME_TYPE(x, y) 0
# define MUST_BE_ARRAY(a) 0
# endif
#if GNUC_PREREQ(3, 0)
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
#else
# define ATTRIBUTE_MALLOC /* empty */
#endif
# if GNUC_PREREQ(3, 0)
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
# else
# define ATTRIBUTE_MALLOC /* empty */
# endif
#if GNUC_PREREQ(3, 1)
# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
#else
# define ATTRIBUTE_NOINLINE /* empty */
#endif
# if GNUC_PREREQ(3, 1)
# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
# else
# define ATTRIBUTE_NOINLINE /* empty */
# endif
#if GNUC_PREREQ(4, 0)
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
#else
# define ATTRIBUTE_SENTINEL /* empty */
#endif
# if GNUC_PREREQ(4, 0)
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
# else
# define ATTRIBUTE_SENTINEL /* empty */
# endif
#if GNUC_PREREQ(4, 1)
# define ALIGNOF(t_) __alignof__(t_)
#else
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
#endif
# if GNUC_PREREQ(4, 1)
# define ALIGNOF(t_) __alignof__(t_)
# else
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
# endif
#if GNUC_PREREQ(4, 3)
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
#else
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
#endif
# if GNUC_PREREQ(4, 3)
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
# else
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
# endif
#if GNUC_PREREQ(7, 0)
# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
#else
# define ATTRIBUTE_FALLTHROUGH ((void) 0)
#endif
# if GNUC_PREREQ(7, 0)
# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
# else
# define ATTRIBUTE_FALLTHROUGH ((void) 0)
# endif
#if GNUC_PREREQ(6, 0)
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
# if CLANG_PREREQ(2, 8)
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
_Pragma("clang diagnostic push"); \
_Pragma("clang diagnostic ignored \"-Winitializer-overrides\"");
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
_Pragma("clang diagnostic pop");
# elif GNUC_PREREQ(4, 2)
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Woverride-init\"");
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
_Pragma("GCC diagnostic pop");
# else
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
# endif
# if GNUC_PREREQ(6, 0)
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wtautological-compare\"");
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
_Pragma("GCC diagnostic pop");
#else
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
#endif
# else
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
# endif
#endif /* !STRACE_GCC_COMPAT_H */

View File

@ -2,27 +2,7 @@
# Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# SPDX-License-Identifier: LGPL-2.1-or-later
input="$1"
shift

View File

@ -1,4 +1,9 @@
#!/bin/sh -e
#
# Copyright (c) 2015-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |

View File

@ -1,4 +1,9 @@
#!/bin/sh -e
#
# Copyright (c) 2015-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
echo 'enum {'
echo 'SEN_printargs = 0,'

14
get_personality.c Normal file
View File

@ -0,0 +1,14 @@
/*
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#if SUPPORTED_PERSONALITIES > 1
# include "get_personality.h"
# include <linux/audit.h>
# include "arch_get_personality.c"
#endif

16
get_personality.h Normal file
View File

@ -0,0 +1,16 @@
/*
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_GET_PERSONALITY_H
# define STRACE_GET_PERSONALITY_H
# include "ptrace.h"
extern int
get_personality_from_syscall_info(const struct ptrace_syscall_info *);
#endif /* !STRACE_GET_PERSONALITY_H */

View File

@ -1,28 +1,8 @@
/*
* Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2012-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(getcpu)

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(getcwd)

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
SYS_FUNC(getpagesize)

View File

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include "xlat/getrandom_flags.h"

Some files were not shown because too many files have changed in this diff Show More