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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Kernel commit:

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

	      landlock: Use square brackets around "landlock-ruleset"

	      commit aea0b9f2486da8497f35c7114b764bf55e17c7ea upstream.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

