1 #!/bin/sh 2 # SPDX-License-Identifier: LGPL-2.1 3 4 if [ $# -ne 1 ] ; then 5 beauty_uapi_linux_dir=tools/perf/trace/beauty/include/uapi/linux/ 6 else 7 beauty_uapi_linux_dir=$1 8 fi 9 10 linux_stat=${beauty_uapi_linux_dir}/stat.h 11 12 printf "static const char *statx_mask[] = {\n" 13 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+STATX_([^_]+[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*' 14 # STATX_BASIC_STATS its a bitmask formed by the mask in the normal stat struct 15 # STATX_ALL is another bitmask and deprecated 16 # STATX_ATTR_*: Attributes to be found in stx_attributes and masked in stx_attributes_mask 17 grep -E $regex ${linux_stat} | \ 18 grep -v STATX_ALL | \ 19 grep -v STATX_BASIC_STATS | \ 20 grep -v '\<STATX_ATTR_' | \ 21 sed -r "s/$regex/\2 \1/g" | \ 22 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n" 23 printf "};\n"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.