xref: /linux/tools/perf/trace/beauty/kcmp_type.sh (revision 307797159ac25fe5a2048bf5c6a5718298edca57)
1#!/bin/sh
2
3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4
5printf "static const char *kcmp_types[] = {\n"
6regex='^[[:space:]]+(KCMP_(\w+)),'
7egrep $regex ${header_dir}/kcmp.h | grep -v KCMP_TYPES, | \
8	sed -r "s/$regex/\1 \2/g" | \
9	xargs printf "\t[%s]\t= \"%s\",\n"
10printf "};\n"
11