summaryrefslogtreecommitdiffstats
path: root/tools/perf/trace/beauty/kcmp_type.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/trace/beauty/kcmp_type.sh')
-rwxr-xr-xtools/perf/trace/beauty/kcmp_type.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/trace/beauty/kcmp_type.sh b/tools/perf/trace/beauty/kcmp_type.sh
new file mode 100755
index 000000000..df8b17486
--- /dev/null
+++ b/tools/perf/trace/beauty/kcmp_type.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1
+
+[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
+
+printf "static const char *kcmp_types[] = {\n"
+regex='^[[:space:]]+(KCMP_(\w+)),'
+egrep $regex ${header_dir}/kcmp.h | grep -v KCMP_TYPES, | \
+ sed -r "s/$regex/\1 \2/g" | \
+ xargs printf "\t[%s]\t= \"%s\",\n"
+printf "};\n"