summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ioprio: implement print_ioprio independent of sprint_ioprioesyr/next-ng2-salvageEugene Syromyatnikov2022-09-022-19/+24
|
* syscall: reset auxstrEugene Syromyatnikov2022-09-021-0/+1
| | | | | | Otherwise RVAL_STR may print auxstr remained from a previous syscall. * syscall.c (syscall_entering_trace); Set tcp->auxstr to NULL.
* personality: use PRINT_VAL_X for a constant value printingEugene Syromyatnikov2022-09-021-1/+1
|
* net: use tprints_arg_begin for negation printingEugene Syromyatnikov2022-09-021-2/+2
|
* sg_io_v3, sg_io_v4: use print_charEugene Syromyatnikov2022-09-022-3/+6
|
* src: use print_xlat for printing of named constants where possibleEugene Syromyatnikov2022-09-022-5/+11
|
* defs: add print_xlat_abbrev shorthandEugene Syromyatnikov2022-09-021-0/+2
|
* src: introduce tprint_plus helperEugene Syromyatnikov2022-09-026-17/+28
|
* src: use tprint_or and tprint_shift helpers where possibleEugene Syromyatnikov2022-09-0228-63/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/bpf_filter.c (print_bpf_filter_code): Replace tprints("|") calls with tprint_or(). * src/bpf_seccomp_filter.c (print_seccomp_filter_k): Likewise. * src/capability.c (print_cap_bits): Likewise. * src/clone.c (SYS_FUNC(clone)): Likewise. * src/fanotify.c (SYS_FUNC(fanotify_init)): Likewise. * src/ipc_defs.h (PRINTCTL): Likewise. * src/ipc_msg.c (SYS_FUNC(msgget)): Likewise. * src/ipc_sem.c (SYS_FUNC(semget)): Likewise. * src/ipc_shm.c (SYS_FUNC(shmget)): Likewise. * src/kexec.c (SYS_FUNC(kexec_load)): Likewise. * src/mount.c (SYS_FUNC(mount)): Likewise. * src/net.c (tprint_sock_type): Likewise. * src/nlattr.c (print_nlattr): Likewise. * src/numa.c (print_mode): Likewise. * src/personality.c (SYS_FUNC(personality)): Likewise. * src/scsi.c (scsi_ioctl): Likewise. * src/statx.c (SYS_FUNC(statx)): Likewise. * src/swapon.c (SYS_FUNC(swapon)): Likewise. * src/v4l2.c (print_v4l2_buffer_flags, print_v4l2_cid): Likewise. * src/xlat.c (printflags_ex): Likewise. * src/futex.c (do_futex): Replace tprints("|") calls with tprint_or(); replace tprints("<<_NUMBER_|") calls with a combination of tprint_shift, PRINT_VAL_U, and tprint_or calls. * src/ipc.c (SYS_FUNC(ipc)): Likewise. * src/kd_ioctl.c (kd_mk_tone): Likewise. * src/netlink.c (decode_nlmsg_type_netfilter): Likewise. * src/perf.c (print_perf_event_attr): Likewise. * src/mem.c (print_mmap_flags): Replace tprints("|") call with tprint_or(); replace trpintf("%u<<_XVAL_") with a combination of PRINT_VAL_U, print_shift, and print_xlat_abbrev calls. * src/memfd_create.c (SYS_FUNC(memfd_create)): Likewise. * src/tee.c (tee_print_param_fn): Replace tprints("|TEE_IOCTL_PARAM_ATTR_META") with a combination of tprint_or and print_xlat calls.
* src: use tprint[fs]_pre_comment helpersEugene Syromyatnikov2022-09-022-6/+6
| | | | | | | * src/s390.c (print_sthyi_machine, print_sthyi_partition, print_sthyi_buf): Use tprints_pre_comment. (print_sthyi_hypervisor, print_sthyi_guest): Use tprintf_pre_comment. * src/util.c (print_nonzero_bytes): Use tprintf_pre_comment.
* Add tprint[fs]_pre_comment and tprint_pre_comment_{begin,end} helpersEugene Syromyatnikov2022-09-023-2/+43
| | | | | | | | | | | | For the situations when a comment precedes the thing it comments upon. * src/defs.h (tprintf_pre_comment, tprints_pre_comment): New declarations. * src/print_fields.h (tprint_pre_comment_begin, tprint_pre_comment_end): New functions. * src/strace.c (tprints_comment): Use tprint_comment_begin and tprint_comment_end. (tprints_pre_comment, tprintf_pre_comment): New functions.
* Add support for alternative error/signal namesEugene Syromyatnikov2022-09-0218-2/+135
| | | | | | | | | | | | | | | | | | | | | | | | | There are some error and signal constants that are defined as a synonyms for other errors/sugnals. Let's support their qualification. * filter_qualify.c (struct alt_name): New type definition. (alt_signames, alt_errnames): New variables. (sigstr_to_uint): Check alt_signames for possible alternative signal name usage. (find_errno_by_name): Check alt_errnames for possible alternative error name usage. * linux/alpha/alt_errnoent.h: New file. * linux/alpha/alt_signalent.h: Likewise. * linux/alt_errnoent.h: Likewise. * linux/alt_signalent.h: Likewise. * linux/hppa/alt_errnoent.h: Likewise. * linux/mips/alt_errnoent.h: Likewise. * linux/mips/alt_signalent.h: Likewise. * linux/powerpc/alt_errnoent.h: Likewise. * linux/powerpc64/alt_errnoent.h: Likewise. * linux/sparc/alt_errnoent.h: Likewise. * linux/sparc/alt_signalent.h: Likewise. * linux/sparc64/alt_signalent.h: Likewise. * tests/qual_signal.test: Add some checks for alternative signal names.
* filter_qualify.c: refactor sigstr_to_uintEugene Syromyatnikov2022-09-021-16/+19
| | | | | * filter_qualify.c (signame_eq): New function. (sigstr_to_uint): Use signame_eq for comparing signame.
* Use nsig instead of arbitrary numbersEugene Syromyatnikov2022-09-022-3/+3
| | | | | * filter_qualify.c (sigstr_to_uint): Use nsig. * prctl.c (SYS_FUNC(prctl)) <case PR_SET_PDEATHSIG>: Use nsig.
* signal: provide nsig constantEugene Syromyatnikov2022-09-022-0/+3
| | | | | * defs.h (nsig): New declaration. * signal.c (nsig): New constant.
* ioprio: print "who" argument according to its typeEugene Syromyatnikov2022-09-021-2/+4
| | | | | | | So far there's only UID that has a specific routine. * ioprio.c (print_ioprio_who): New function. (SYS_FUNC(ioprio_get), SYS_FUNC(ioprio_set)): Use it.
* printmode: update print_symbolic_mode_t decoderEugene Syromyatnikov2022-09-024-21/+41
| | | | | | * printmode.c (print_symbolic_mode_t): Rewrite. * xlat/modetypes.in: Add fallback values. * xlat/modeflags.in: New file.
* xlat: add XLAT_STYLE_FMT_O for octal outputEugene Syromyatnikov2022-09-022-4/+9
| | | | | | * xlat.h (enum xlat_style): Add XLAT_STYLE_FMT_O. * xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_O, reorder switch branches in accordance with enum constant order.
* xlat: update sigact_flagsEugene Syromyatnikov2022-09-022-20/+69
| | | | * xlat/sigact_flags.in: Add fallback definitions.
* xlat: sort and add fallback definitions to setsock_ip_optionsEugene Syromyatnikov2022-09-021-22/+24
| | | | | * xlat/setsock_ip_options.in: Add fallback definitions, sort, add "#sorted".
* xlat: provide fallback definitions to ptrace_eventsEugene Syromyatnikov2022-09-021-10/+12
| | | | | * xlat/ptrace_events.in: Provide fallback definitions, define PTRACE_EVENT_MIGRATE only on tile.
* xlat: provide fallback definitions to dirent_typesEugene Syromyatnikov2022-09-021-9/+10
| | | | * xlat/dirent_types.in: Provide fallback definitions.
* xlat: provide fallback values to getsock_ip*_optionsEugene Syromyatnikov2022-09-022-24/+25
| | | | | | | * xlat/getsock_ip_options.in: Provide fallback values. * xlat/getsock_ipv6_options.in: Likewise. Closes: https://github.com/strace/strace/issues/87
* fcntl: decode read/write hints commandsEugene Syromyatnikov2022-09-023-0/+38
| | | | | | | | | | | | Introduced by Linux commit v4.13-rc1~212^2~51. * xlat/fcntl_rw_hints.in: New file. * fcntl.c: Include "xlat/fcntl_rw_hints.h". (print_rwhint): New function. (print_fcntl) <case F_SET_RW_HINT, case F_SET_FILE_RW_HINT, case F_GET_RW_HINT, case F_GET_FILE_RW_HINT>: New fcntl command handlers. * xlat/fcntlcmds.in (F_GET_RW_HINT, F_SET_RW_HINT, F_GET_FILE_RW_HINT, F_SET_FILE_RW_HINT): New constants.
* fcntl: decode F_GETOWNER_UIDSEugene Syromyatnikov2022-09-021-0/+22
| | | | | | * fcntl.c (print_owner_uids): New function. (print_fcntl) <case F_GETOWNER_UIDS>: Decode command using print_owner_uids.
* xlat/fsmagic: rename XFS_SB_MAGIC to XFS_SUPER_MAGICEugene Syromyatnikov2022-09-021-1/+1
| | | | | | Per Linux commit v4.19-rc1-28-gdddde68b8f06. * xlat/fsmagic.in (XFS_SUPER_MAGIC): Rename from XFS_SB_MAGIC.
* printsiginfo: dispatch signal code names using an arrayEugene Syromyatnikov2022-09-021-36/+18
| | | | | * src/printsiginfo.c (print_si_code): Consolidate xlat pointers into an array, dispatch over it using si_code.
* printsiginfo: consider all POLL_* si_codes as a valid reason to print ↵Eugene Syromyatnikov2022-09-021-1/+2
| | | | si_band/si_fd
* printsiginfo: decode SIGEMT the same way as SIG{ILL,FPE,SEGV,BUS}Eugene Syromyatnikov2022-09-021-0/+6
| | | | | * printsiginfo.c (print_si_info) [SIGEMT] <case SIGEMT>: Add to the SIGILL/SIGFPE/SIGSEGV/SIGBUS case.
* linux/powerpc{,64}/syscallent.h: replace empty entries with commentsEugene Syromyatnikov2022-09-022-6/+11
| | | | | | | | | | | | | | | | * linux/powerpc64/syscallent.h ([192]): Remove, add a comment about powerpc32-only mmap2. ([193]): Remove, add a comment about powerpc32-only truncate64. ([194]): Remove, add a comment about powerpc32-only ftruncate64. ([195]): Remove, add a comment about powerpc32-only stat64. ([196]): Remove, add a comment about powerpc32-only lstat64. ([197]): Remove, add a comment about powerpc32-only fstat64. ([204]): Remove, add a comment about powerpc32-only fcntl64. ([224]): Remove, add a comment about unused slot for security syscall. ([226]): Remove, add a comment about powerpc32-only sendfile64. ([254]): Remove, add a comment about powerpc32-only fadvise64_64. * linux/powerpc64/syscallent.h ([224]): Remove, add a comment about unused slot for security syscall.
* rtnl_neigh: add NDA_PROTOCOL attributeEugene Syromyatnikov2022-09-021-1/+1
| | | | | | | * xlat/rtnl_neigh_attrs.in (NDA_PROTOCOL): New constant, introduced by Linux commit v4.20-rc6-1429-gdf9b0e30d44c. * rtnl_neigh.c (ndmsg_nla_decoders) <[NDA_PROTOCOL]>: Decode as an IP protocol.
* xlat: update sysctl_kernEugene Syromyatnikov2022-09-021-0/+2
| | | | | * xlat/sysctl_kern.in (KERN_PANIC_PRINT): New constant, introduced by Linux commit v5.0-rc1~38^2~16.
* prctl: print the rest of the arguments for PR_[GS]ET_SPECULATION_CTRLEugene Syromyatnikov2022-09-022-18/+36
| | | | | | * prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL, case PR_SET_SPECULATION_CTRL>: Call print_prctl_args for printing the rest of the arguments, since non-zero values there lead to EINVAL.
* linux/sparc{,64}: replace empty syscall entries with commentsEugene Syromyatnikov2022-09-022-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | * linux/sparc/syscallent.h ([52]): Remove, add a comment that it is memory_ordering on sparc64. ([164]): Remove, add a comment that it is utrap_install on sparc64. * linux/sparc64/syscallent.h ([31]): Remove, add a comment that it is lchown32 on sparc32. ([32]): Remove, add a comment that it is fchown32 on sparc32. ([35]): Remove, add a comment that it is chown32 on sparc32. ([44]): Remove, add a comment that it is getuid32 on sparc32. ([53]): Remove, add a comment that it is getgid32 on sparc32. ([56]): Remove, add a comment that it is mmap2 on sparc32. ([69]): Remove, add a comment that it is geteuid32 on sparc32. ([70]): Remove, add a comment that it is getegid32 on sparc32. ([72]): Remove, add a comment that it is setreuid32 on sparc32. ([77]): Remove, add a comment that it is truncate64 on sparc32. ([82]): Remove, add a comment that it is setgroups32 on sparc32. ([84]): Remove, add a comment that it is ftruncate64 on sparc32. ([87]): Remove, add a comment that it is setuid32 on sparc32. ([89]): Remove, add a comment that it is setgid32 on sparc32. ([91]): Remove, add a comment that it is setfsuid32 on sparc32. ([94]): Remove, add a comment that it is setfsgid32 on sparc32. ([112]): Remove, add a comment that it is setregid32 on sparc32. ([115]): Remove, add a comment that it is getgroups32 on sparc32. ([155]): Remove, add a comment that it is fcntl64 on sparc32. ([231]): Remove, add a comment that it is time on sparc32.
* powerpc: decode spu_run and spu_create syscallsEugene Syromyatnikov2022-09-0227-4/+414
|
* xlat/gen.sh: define *_flags_strsz and *_flags_mask macrosEugene Syromyatnikov2022-09-021-20/+30
|
* .github: remove gcc7 jobsDmitry V. Levin2022-08-161-46/+0
| | | | | | | | | | This old compiler was provided by the old version of the OS that is currently being deprecated by github actions. * .github/workflows/ci.yml (gcc7-x86_64-kheaders, gcc7-x86_64-dw, gcc7-x86_64-unwind): Remove. Link: https://github.com/actions/runner-images/issues/6002
* Post-release administriviaDmitry V. Levin2022-08-153-2/+16
| | | | | | * NEWS: Add a header line for the next release. * debian/changelog.in: Add a changelog entry for 5.19-1. * strace.spec.in: Likewise.
* Prepare for 5.19 releasev5.19Dmitry V. Levin2022-08-121-1/+1
| | | | * NEWS: Update for 5.19 release.
* Update .mailmapDmitry V. Levin2022-08-121-0/+1
| | | | | * .mailmap: Add both email addresses of Sergei Trofimovich to avoid duplication in CREDITS file.
* README.md: update Fedora strace repo locationJoubin Jabbari2022-08-111-1/+1
| | | | Resolves: https://github.com/strace/strace/pull/218
* tests: add PR_SVE_[GS]ET_VL checksEugene Syromyatnikov2022-08-1112-16/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-purpose prct-sme.c for that, since these commands identical to PR_SME_[GS]ET_VL so far, save for s/SME/SVE/ in identifier names. Retain the original prct-sve.c to retain test coverage diversity. * tests/.gitignore: Add prctl-sve-Xabbrev, prctl-sve-Xraw, prctl-sve-Xverbose, prctl-sve-success, prctl-sve-success-Xabbrev, prctl-sve-success-Xraw, and prctl-sve-success-Xverbose. * tests/Makefile.am (check_PROGRAMS): Add prctl-sve-success, prctl-sve-success-Xabbrev, prctl-sve-success-Xraw, and prctl-sve-success-Xverbose. * tests/gen_tests.in (prctl-sve-Xabbrev, prctl-sve-Xraw, prctl-sve-Xverbose, prctl-sve-success, prctl-sve-success-Xabbrev, prctl-sve-success-Xraw, prctl-sve-success-Xverbose): New tests. * tests/prctl-sme.c [!EXT] (EXT): New macro. (EXT_STR, GLUE_, GLUE, _): New macros. (print_sme_vl_arg, main): Use _ and EXT_STR macros. * tests/prctl-sve-Xabbrev.c: New file. * tests/prctl-sve-Xraw.c: Likewise. * tests/prctl-sve-Xverbose.c: Likewise. * tests/prctl-sve-success-Xabbrev.c: Likewise. * tests/prctl-sve-success-Xraw.c: Likewise. * tests/prctl-sve-success-Xverbose.c: Likewise. * tests/prctl-sve-success.c: Likewise. * tests/pure_executables.list: Add prctl-sve-Xabbrev, prctl-sve-Xraw, and prctl-sve-Xverbose.
* tests: expand so_error test checksEugene Syromyatnikov2022-08-111-43/+73
| | | | | | Check decoding with various optlen values. * tests/so_error.c: Add checks.
* net: print unexpectedly short integer sockopts in hexEugene Syromyatnikov2022-08-112-3/+5
| | | | | | | | | Since it makes little sence to print ASCII character codes when we know that the bytes are part of a number. * src/net.c (print_get_error, print_txrehash, print_getsockopt): Use printstr_ex with QUOTE_FORCE_HEX parameter instead of printstrn. * tests/sockopt-sol_socket.c: Update expected output.
* net: print the data returned by SO_ERROR as a string if it is too shortDmitry V. Levin2022-08-111-4/+6
| | | | | | | | | The data returned by getsockopt SO_ERROR is an integer. If the buffer size specified by userspace is less than sizeof(int), the data written by the kernel should not be interpreted as an integer. * src/net.c (print_get_error): Print the buffer as a string if its length is less than sizeof(int).
* net: implement SO_TXREHASH socket option supportEugene Syromyatnikov2022-08-115-13/+70
| | | | | | | | | | | | * src/xlat/sock_options.in (SO_TXREHASH): New constant, introduced by Linux commit v5.18-rc1~136^2~484^2~3. * src/xlat/sockopt_txrehash_vals.in: New file. * src/net.c: Include "xlat/sockopt_txrehash_vals.h". (print_txrehash): New function. (print_getsockopt, print_setsockopt) <case SO_TXREHASH>: Call print_txrehash. * tests/sockopt-sol_socket.c: Add checks for SO_TXREHASH decoding. * NEWS: Mention it.
* io_uring: add support for IORING_{,UN}REGISTER_PBUF_RING opcodesEugene Syromyatnikov2022-08-112-0/+98
| | | | | | | | | | | | Introduced by Linux commit v5.19-rc1~251^2~10. * src/xlat/uring_register_opcodes.in (IORING_REGISTER_PBUF_RING, IORING_UNREGISTER_PBUF_RING): New constants. * src/io_uring.c (print_io_uring_buf_reg): New function. (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_PBUF_RING, case IORING_UNREGISTER_PBUF_RING>: Call print_io_uring_buf_reg for decoding. * tests/io_uring_register.c: Update expected output, add checks.
* io_uring: decode struct io_uring_rsrc_register.flags fieldEugene Syromyatnikov2022-08-114-31/+16
| | | | | | | | | | | | Introduced by Linux commit v5.19-rc1~251^2~20. * configure.ac: Remove struct io_uring_rsrc_register.resv check. * src/xlat/uring_register_rsrc_flags.in: New file. * src/io_uring.c: Include "xlat/uring_register_rsrc_flags.h". (print_io_uring_register_rsrc): Remove CHECK_TYPE_SIZE for arg.resv, decode flags field using PRINT_FIELD_FLAGS instead of optional decoding of no longer existing resv field. * tests/io_uring_register.c: Update expected output.
* tests: fix ioctl_dm test with new kernel headersEugene Syromyatnikov2022-08-111-2/+1
| | | | | | | | | | | | | | | | | | | Linux commit v5.19-rc2-1-g94dfc73e7cf4 replaced the zero-length array dm_target_msg.sector field declaration with a flexible-array declaration, which led to the following error when compiled with clang: ../../../tests/ioctl_dm.c:53:25: error: field 'target_msg' with variable sized type 'struct dm_target_msg' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] struct dm_target_msg target_msg; ^ 1 error generated. Work around it by removing the following field and adjusting the untyped message size. * tests/ioctl_dm.c (struct s): Remove tm.target_string field, adjust string field size.
* arch_prctl: decode ARCH_GET_XCOMP_SUPP, ARCH_{GET,REQ}_XCOMP{,_GUEST}_PERMEugene Syromyatnikov2022-08-1119-16/+506
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xlat/archvals.in (ARCH_GET_XCOMP_SUPP, ARCH_GET_XCOMP_PERM, ARCH_REQ_XCOMP_PERM): New constants, introduced by Linux commit v5.16-rc1~195^2~21. (ARCH_GET_XCOMP_GUEST_PERM, ARCH_REQ_XCOMP_GUEST_PERM): New constants, introduced by Linux commit v5.17-rc1~15^2~70. * src/xlat/x86_xfeature_bits.in: New file. * src/xlat/x86_xfeatures.in: Likewise. * src/prctl.c [X86_64 || X32 || I386]: Include "xlat/x86_xfeature_bits.h", "xlat/x86_xfeatures.h". * tests/.gitignore: Add arch_prctl, arch_prctl-Xabbrev, arch_prctl-Xraw, arch_prctl-Xverbose, arch_prctl-success, arch_prctl-success-Xabbrev, arch_prctl-success-Xraw, and arch_prctl-success-Xverbose. * tests/Makefile.am (check_PROGRAMS): Add arch_prctl-success, arch_prctl-success-Xabbrev, arch_prctl-success-Xraw, and arch_prctl-success-Xverbose. * tests/arch_prctl.c: New file. * tests/arch_prctl-Xabbrev.c: Likewise. * tests/arch_prctl-Xraw.c: Likewise. * tests/arch_prctl-Xverbose.c: Likewise. * tests/arch_prctl-success.c: Likewise. * tests/arch_prctl-success-Xabbrev.c: Likewise. * tests/arch_prctl-success-Xraw.c: Likewise. * tests/arch_prctl-success-Xverbose.c: Likewise. * tests/arch_prctl.sh: Likewise. * tests/gen_tests.in (arch_prctl, arch_prctl-Xabbrev, arch_prctl-Xraw, arch_prctl-Xverbose, arch_prctl-success, arch_prctl-success-Xabbrev, arch_prctl-success-Xraw, arch_prctl-success-Xverbose): New tests. * tests/prctl-success.sh (PRCTL_SYSCALL, PRCTL_MARKER_RE): New vaiables. Handle "ARCH_PRCTL_INJECT_RETVALS" in addition to "PRCTL_INJECT_RETVALS", set PRCTL_SYSCALL and PRCTL_MARKER_RE accordingly; use $PRCTL_SYSCALL and $PRCTL_MARKER_RE in run_strace and sed calls. * tests/pure_executables.list: Add arch_prctl, arch_prctl-Xabbrev, arch_prctl-Xraw, and arch_prctl-Xverbose. * NEWS: Mention it.