perf beauty: Move uapi/linux/fs.h copy out of the directory used to build perf
[linux-2.6-block.git] / tools / perf / trace / beauty / sync_file_range.sh
CommitLineData
8ef6d74e
ACM
1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1
3
4if [ $# -ne 1 ] ; then
faf7217a 5 linux_header_dir=tools/perf/trace/beauty/include/uapi/linux/
8ef6d74e
ACM
6else
7 linux_header_dir=$1
8fi
9
10linux_fs=${linux_header_dir}/fs.h
11
12printf "static const char *sync_file_range_flags[] = {\n"
13regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+SYNC_FILE_RANGE_([[:alnum:]_]+)[[:space:]]+([[:xdigit:]]+)[[:space:]]*.*'
818448e9 14grep -E $regex ${linux_fs} | \
8ef6d74e
ACM
15 sed -r "s/$regex/\2 \1/g" | \
16 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
17printf "};\n"