Commit Graph

7173 Commits

Author SHA1 Message Date
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