aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/trace/beauty/kcmp_type.sh
blob: 5df9dcbd674e27dd4fa38245f2666daa66883e62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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+)),'
grep -E $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"