Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf beauty: Move uapi/linux/vhost.h copy out of the directory used to build perf

It is only used to generate string tables, not to build perf, so move it
to the tools/perf/trace/beauty/include/ hierarchy, that is used just for
scraping.

This is a something that should've have happened, as happened with the
linux/socket.h scrapper, do it now as Ian suggested while doing an
audit/refactor session in the headers used by perf.

No other tools/ living code uses it, just <linux/vhost.h> coming from
either 'make install_headers' or from the system /usr/include/
directory.

Suggested-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/CAP-5=fWZVrpRufO4w-S4EcSi9STXcTAN2ERLwTSN7yrSSA-otQ@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+6 -7
tools/include/uapi/linux/vhost.h tools/perf/trace/beauty/include/uapi/linux/vhost.h
+2 -3
tools/perf/Makefile.perf
··· 580 580 $(Q)$(SHELL) '$(sockaddr_tbl)' $(beauty_linux_dir) > $@ 581 581 582 582 vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c 583 - vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux 584 583 vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh 585 584 586 - $(vhost_virtio_ioctl_array): $(vhost_virtio_hdr_dir)/vhost.h $(vhost_virtio_ioctl_tbl) 587 - $(Q)$(SHELL) '$(vhost_virtio_ioctl_tbl)' $(vhost_virtio_hdr_dir) > $@ 585 + $(vhost_virtio_ioctl_array): $(beauty_uapi_linux_dir)/vhost.h $(vhost_virtio_ioctl_tbl) 586 + $(Q)$(SHELL) '$(vhost_virtio_ioctl_tbl)' $(beauty_uapi_linux_dir) > $@ 588 587 589 588 perf_ioctl_array := $(beauty_ioctl_outdir)/perf_ioctl_array.c 590 589 perf_hdr_dir := $(srctree)/tools/include/uapi/linux
+1 -1
tools/perf/check-headers.sh
··· 16 16 "include/uapi/linux/in.h" 17 17 "include/uapi/linux/perf_event.h" 18 18 "include/uapi/linux/seccomp.h" 19 - "include/uapi/linux/vhost.h" 20 19 "include/linux/bits.h" 21 20 "include/vdso/bits.h" 22 21 "include/linux/const.h" ··· 95 96 "include/uapi/linux/sched.h" 96 97 "include/uapi/linux/stat.h" 97 98 "include/uapi/linux/usbdevice_fs.h" 99 + "include/uapi/linux/vhost.h" 98 100 "include/uapi/sound/asound.h" 99 101 ) 100 102
+3 -3
tools/perf/trace/beauty/vhost_virtio_ioctl.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: LGPL-2.1 3 3 4 - [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ 4 + [ $# -eq 1 ] && beauty_uapi_linux_dir=$1 || beauty_uapi_linux_dir=tools/perf/trace/beauty/include/uapi/linux 5 5 6 6 printf "static const char *vhost_virtio_ioctl_cmds[] = {\n" 7 7 regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*' 8 - grep -E $regex ${header_dir}/vhost.h | \ 8 + grep -E $regex ${beauty_uapi_linux_dir}/vhost.h | \ 9 9 sed -r "s/$regex/\2 \1/g" | \ 10 10 sort | xargs printf "\t[%s] = \"%s\",\n" 11 11 printf "};\n" 12 12 13 13 printf "static const char *vhost_virtio_ioctl_read_cmds[] = {\n" 14 14 regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?R\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*' 15 - grep -E $regex ${header_dir}/vhost.h | \ 15 + grep -E $regex ${beauty_uapi_linux_dir}/vhost.h | \ 16 16 sed -r "s/$regex/\2 \1/g" | \ 17 17 sort | xargs printf "\t[%s] = \"%s\",\n" 18 18 printf "};\n"