linux/tools/perf/trace/beauty
Arnaldo Carvalho de Melo e7a8074d2f tools include UAPI: Sync linux/vhost.h with the kernel sources
To get the changes in:

  2855c2a782 ("vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE")
  1496c47065 ("vhost-vdpa: uapi to support reporting per vq size")

To pick up these changes and support them:

  $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before
  $ cp include/uapi/linux/vhost.h tools/perf/trace/beauty/include/uapi/linux/vhost.h
  $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after
  $ diff -u before after
  --- before	2024-04-22 13:39:37.185674799 -0300
  +++ after	2024-04-22 13:39:52.043344784 -0300
  @@ -50,5 +50,6 @@
   	[0x7F] = "VDPA_GET_VRING_DESC_GROUP",
   	[0x80] = "VDPA_GET_VQS_COUNT",
   	[0x81] = "VDPA_GET_GROUP_NUM",
  +	[0x82] = "VDPA_GET_VRING_SIZE",
   	[0x8] = "NEW_WORKER",
   };
  $

For instance, see how those 'cmd' ioctl arguments get translated, now
VDPA_GET_VRING_SIZE will be as well:

  # perf trace -a -e ioctl --max-events=10
       0.000 ( 0.011 ms): pipewire/2261 ioctl(fd: 60, cmd: SNDRV_PCM_HWSYNC, arg: 0x1)                   = 0
      21.353 ( 0.014 ms): pipewire/2261 ioctl(fd: 60, cmd: SNDRV_PCM_HWSYNC, arg: 0x1)                   = 0
      25.766 ( 0.014 ms): gnome-shell/2196 ioctl(fd: 14, cmd: DRM_I915_IRQ_WAIT, arg: 0x7ffe4a22c740)    = 0
      25.845 ( 0.034 ms): gnome-shel:cs0/2212 ioctl(fd: 14, cmd: DRM_I915_IRQ_EMIT, arg: 0x7fd43915dc70) = 0
      25.916 ( 0.011 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ADDFB2, arg: 0x7ffe4a22c8a0)       = 0
      25.941 ( 0.025 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ATOMIC, arg: 0x7ffe4a22c840)       = 0
      32.915 ( 0.009 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_RMFB, arg: 0x7ffe4a22cf9c)         = 0
      42.522 ( 0.013 ms): gnome-shell/2196 ioctl(fd: 14, cmd: DRM_I915_IRQ_WAIT, arg: 0x7ffe4a22c740)    = 0
      42.579 ( 0.031 ms): gnome-shel:cs0/2212 ioctl(fd: 14, cmd: DRM_I915_IRQ_EMIT, arg: 0x7fd43915dc70) = 0
      42.644 ( 0.010 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ADDFB2, arg: 0x7ffe4a22c8a0)       = 0
  #

This addresses this perf tools build warning:

  diff -u tools/perf/trace/beauty/include/uapi/linux/vhost.h include/uapi/linux/vhost.h

But this specific process, usually boring, this time around catch a
problem, namely the addition of VDPA_GET_VRING_SIZE used an ioctl number
already taken, which went on unnoticed and only got caught when the
tools/perf/trace/beauty/vhost_virtio_ioctl.sh script was run as part of
the perf tools process of updating the tools copies of system headers it
uses for creating id->string tables that, well, broke the perf tools
build because there were multiple initializations in the strings table
for the 0x80 entry...

I'm adding here a link to the discussion, that is lacking in the fix for
the reported problem, and a quote from one of the developers involved:

"Thanks a lot for taking care of this! So given the header is actually
buggy pls hang on to this change until I merge the fix for the header
(you were CC'd on the patch).  It's great we have this redundancy which
allowed us to catch the bug in time, and many thanks to Namhyung Kim for
reporting the issue!"

This is here as a hint for anyone thinking about ways to automate
checking these issues in a more automated way... ;-)

Link: https://lore.kernel.org/lkml/ 20240402172151-mutt-send-email-mst@kernel.org
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/lkml/ZiaW-csEZLKK48BE@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-04-22 17:44:57 -03:00
..
arch/x86/include Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2024-04-22 13:35:18 -03:00
include tools include UAPI: Sync linux/vhost.h with the kernel sources 2024-04-22 17:44:57 -03:00
tracepoints perf beauty: Move arch/x86/include/asm/irq_vectors.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
arch_errno_names.c perf util: Introduce architecture specific errno/name mapping 2018-01-23 09:51:37 -03:00
arch_errno_names.sh perf trace beauty: Add shellcheck to scripts 2024-04-12 17:54:02 -03:00
arch_prctl.c tools headers UAPI: Sync arch prctl headers with the kernel sources 2023-05-17 11:23:43 -03:00
beauty.h perf beauty: Introduce faccessat2 flags scnprintf routine 2024-03-21 13:54:40 -03:00
Build perf trace beauty: Add shellcheck to scripts 2024-04-12 17:54:02 -03:00
clone.c perf beauty: Introduce scrape script for 'clone' syscall 'flags' argument 2024-03-21 10:41:29 -03:00
clone.sh perf beauty: Introduce scrape script for 'clone' syscall 'flags' argument 2024-03-21 10:41:29 -03:00
drm_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
eventfd.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
fadvise.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
fcntl.c perf beauty: Use the system linux/fcntl.h instead of a copy from the kernel 2024-03-21 10:41:27 -03:00
flock.c perf beauty: Use the system linux/fcntl.h instead of a copy from the kernel 2024-03-21 10:41:27 -03:00
fs_at_flags.c perf beauty: Fix AT_EACCESS undeclared build error for system with kernel versions lower than v5.8 2024-04-03 11:48:57 -03:00
fs_at_flags.sh perf beauty: Introduce scrape script for various fs syscalls 'flags' arguments 2024-03-21 13:54:40 -03:00
fsconfig.sh perf beauty: Move uapi/linux/mount.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
fsmount.c perf beauty: Don't include uapi/linux/mount.h, use sys/mount.h instead 2024-03-21 10:41:27 -03:00
fsmount.sh perf beauty: Move uapi/linux/mount.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
fspick.c perf trace: Beautify 'fspick' arguments 2019-05-28 18:37:42 -03:00
fspick.sh perf beauty: Move uapi/linux/mount.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
futex_op.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
futex_val3.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
ioctl.c perf trace beauty ioctl: Fix off-by-one error in cmd->string table 2019-08-26 11:58:29 -03:00
kcmp_type.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
kcmp.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
kvm_ioctl.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
madvise_behavior.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
mmap_flags.sh perf beauty mmap_flags: Use "test -f" instead of "[-f FILE]" 2023-08-29 14:15:21 -03:00
mmap_prot.sh perf beauty mmap_flags: Use "test -f" instead of "[-f FILE]" 2023-08-29 14:15:21 -03:00
mmap.c perf trace: Use the autogenerated mmap 'prot' string/id table 2020-10-01 11:35:01 -03:00
mode_t.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
mount_flags.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
mount_flags.sh perf beauty: Move uapi/linux/mount.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
move_mount_flags.sh perf beauty: Move uapi/linux/mount.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
move_mount.c perf trace: Beautify 'move_mount' arguments 2019-05-28 18:37:42 -03:00
mremap_flags.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
msg_flags.c perf beauty: Update copy of linux/socket.h with the kernel sources 2023-07-14 09:59:56 -03:00
open_flags.c perf trace beauty: Print O_RDONLY when (flags & O_ACCMODE) == 0 2018-12-18 16:07:42 -03:00
perf_event_open.c perf trace: Add BPF augmenter to perf_event_open()'s 'struct perf_event_attr' arg 2022-11-07 10:56:40 -03:00
perf_ioctl.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
pid.c perf thread: Add accessor functions for thread 2023-06-12 15:57:53 -03:00
pkey_alloc_access_rights.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
pkey_alloc.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
prctl_option.sh perf beauty: Move prctl.h files (uapi/linux and x86's) copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
prctl.c perf beauty: Stop using the copy of uapi/linux/prctl.h 2024-03-21 10:41:27 -03:00
rename_flags.sh perf beauty: Move uapi/linux/fs.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
renameat.c perf trace beauty renameat: No need to include linux/fs.h 2019-04-01 14:49:24 -03:00
sched_policy.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
seccomp.c perf trace: Use correct SECCOMP prefix spelling, "SECOMP_*" -> "SECCOMP_*" 2018-12-28 16:32:54 -03:00
signum.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
sndrv_ctl_ioctl.sh perf beauty: Move uapi/sound/asound.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
sndrv_pcm_ioctl.sh perf beauty: Move uapi/sound/asound.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
sockaddr.c perf beauty: Make all sockaddr files use a common naming scheme 2021-11-12 10:40:34 -03:00
sockaddr.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
socket_type.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
socket.c perf beauty: Add socket level scnprintf that handles ARCH specific SOL_SOCKET 2021-11-12 10:40:34 -03:00
socket.sh perf beauty socket/prctl_option: Cope with extended regexp complaint by grep 2023-10-31 12:31:19 -03:00
statx_mask.sh perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument 2024-03-21 13:54:40 -03:00
statx.c perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument 2024-03-21 13:54:40 -03:00
sync_file_range.c perf beauty: Move uapi/linux/fs.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
sync_file_range.sh perf beauty: Move uapi/linux/fs.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
timespec.c perf trace: Add augmenter for clock_gettime's rqtp timespec arg 2022-11-10 15:30:10 -03:00
usbdevfs_ioctl.sh perf beauty: Move uapi/linux/usbdevice_fs.h copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00
vhost_virtio_ioctl.sh perf beauty: Move uapi/linux/vhost.h copy out of the directory used to build perf 2024-03-21 20:44:35 -03:00
waitid_options.c perf beauty waitid options: Fix up prefix showing logic 2019-02-14 13:31:12 -03:00
x86_arch_prctl.sh perf beauty: Move prctl.h files (uapi/linux and x86's) copy out of the directory used to build perf 2024-03-21 10:41:27 -03:00