xref: /linux/tools/perf/trace/beauty/fsconfig.sh (revision 6fdcba32711044c35c0e1b094cbd8f3f0b4472c9)
1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1
3
4if [ $# -ne 1 ] ; then
5	linux_header_dir=tools/include/uapi/linux
6else
7	linux_header_dir=$1
8fi
9
10linux_mount=${linux_header_dir}/mount.h
11
12printf "static const char *fsconfig_cmds[] = {\n"
13regex='^[[:space:]]*+FSCONFIG_([[:alnum:]_]+)[[:space:]]*=[[:space:]]*([[:digit:]]+)[[:space:]]*,[[:space:]]*.*'
14egrep $regex ${linux_mount} | \
15	sed -r "s/$regex/\2 \1/g"	| \
16	xargs printf "\t[%s] = \"%s\",\n"
17printf "};\n"
18