Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / trace / beauty / move_mount_flags.sh
blob55e59241daa4d69f044d72cd7302f62daa913a48
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1
4 if [ $# -ne 1 ] ; then
5 linux_header_dir=tools/include/uapi/linux
6 else
7 linux_header_dir=$1
8 fi
10 linux_mount=${linux_header_dir}/mount.h
12 printf "static const char *move_mount_flags[] = {\n"
13 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MOVE_MOUNT_([FT]_[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
14 egrep $regex ${linux_mount} | \
15 sed -r "s/$regex/\2 \1/g" | \
16 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
17 printf "};\n"