]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
perf beauty: Rename socket_ipproto.sh to socket.sh to hold more socket table generators
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Nov 2021 13:05:53 +0000 (10:05 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 12 Nov 2021 13:40:34 +0000 (10:40 -0300)
To avoid having to add new entries to tools/perf/Makefile.perf prep
socket.sh so that it can generate other socket table generators, such as
the upcoming SOL_ socket level one.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf
tools/perf/trace/beauty/socket.c
tools/perf/trace/beauty/socket.sh [new file with mode: 0755]
tools/perf/trace/beauty/socket_ipproto.sh [deleted file]

index a1f22dd7b696913459c2dc6e7397578ca8a99b5f..50ac20798440af6ce2813cc22d20d34653027a65 100644 (file)
@@ -516,11 +516,11 @@ kvm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/kvm_ioctl.sh
 $(kvm_ioctl_array): $(kvm_hdr_dir)/kvm.h $(kvm_ioctl_tbl)
        $(Q)$(SHELL) '$(kvm_ioctl_tbl)' $(kvm_hdr_dir) > $@
 
-socket_ipproto_array := $(beauty_outdir)/socket_ipproto_array.c
-socket_ipproto_tbl := $(srctree)/tools/perf/trace/beauty/socket_ipproto.sh
+socket_arrays := $(beauty_outdir)/socket.c
+socket_tbl := $(srctree)/tools/perf/trace/beauty/socket.sh
 
-$(socket_ipproto_array): $(linux_uapi_dir)/in.h $(socket_ipproto_tbl)
-       $(Q)$(SHELL) '$(socket_ipproto_tbl)' $(linux_uapi_dir) > $@
+$(socket_arrays): $(linux_uapi_dir)/in.h $(socket_tbl)
+       $(Q)$(SHELL) '$(socket_tbl)' $(linux_uapi_dir) > $@
 
 sockaddr_arrays := $(beauty_outdir)/sockaddr.c
 sockaddr_tbl := $(srctree)/tools/perf/trace/beauty/sockaddr.sh
@@ -736,7 +736,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
        $(sndrv_ctl_ioctl_array) \
        $(kcmp_type_array) \
        $(kvm_ioctl_array) \
-       $(socket_ipproto_array) \
+       $(socket_arrays) \
        $(sockaddr_arrays) \
        $(vhost_virtio_ioctl_array) \
        $(madvise_behavior_array) \
@@ -1113,7 +1113,7 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea
                $(OUTPUT)$(sndrv_pcm_ioctl_array) \
                $(OUTPUT)$(kvm_ioctl_array) \
                $(OUTPUT)$(kcmp_type_array) \
-               $(OUTPUT)$(socket_ipproto_array) \
+               $(OUTPUT)$(socket_arrays) \
                $(OUTPUT)$(sockaddr_arrays) \
                $(OUTPUT)$(vhost_virtio_ioctl_array) \
                $(OUTPUT)$(perf_ioctl_array) \
index f23a3dda29026bd00ea4595b12d50476fa22e928..8aba260fcc3367f8595498d66beef0c937974ce3 100644 (file)
@@ -9,9 +9,10 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
+#include "trace/beauty/generated/socket.c"
+
 static size_t socket__scnprintf_ipproto(int protocol, char *bf, size_t size, bool show_prefix)
 {
-#include "trace/beauty/generated/socket_ipproto_array.c"
        static DEFINE_STRARRAY(socket_ipproto, "IPPROTO_");
 
        return strarray__scnprintf(&strarray__socket_ipproto, bf, size, "%d", show_prefix, protocol);
diff --git a/tools/perf/trace/beauty/socket.sh b/tools/perf/trace/beauty/socket.sh
new file mode 100755 (executable)
index 0000000..de0f2f2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1
+
+[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
+
+printf "static const char *socket_ipproto[] = {\n"
+regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
+
+egrep $regex ${header_dir}/in.h | \
+       sed -r "s/$regex/\2 \1/g"       | \
+       sort | xargs printf "\t[%s] = \"%s\",\n"
+printf "};\n"
diff --git a/tools/perf/trace/beauty/socket_ipproto.sh b/tools/perf/trace/beauty/socket_ipproto.sh
deleted file mode 100755 (executable)
index de0f2f2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1
-
-[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
-
-printf "static const char *socket_ipproto[] = {\n"
-regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
-
-egrep $regex ${header_dir}/in.h | \
-       sed -r "s/$regex/\2 \1/g"       | \
-       sort | xargs printf "\t[%s] = \"%s\",\n"
-printf "};\n"