mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
As it is not really used when compiling anything, just being parsed to
collect number->string tables for 'perf trace'.
$ git grep fadvise.h tools/
tools/perf/Makefile.perf:$(fadvise_advice_array): $(beauty_uapi_linux_dir)/fadvise.h $(fadvise_advice_tbl)
tools/perf/check-headers.sh: "include/uapi/linux/fadvise.h"
tools/perf/trace/beauty/fadvise.sh:grep -E $regex ${header_dir}/fadvise.h | \
tools/perf/trace/beauty/fadvise.sh:# tools/include/uapi/linux/fadvise.h for details.
$
Link: https://lore.kernel.org/r/CAP-5=fVBNQVF8k3JUQjH1nkP69ZVp8BqP+uwygcx=xO0zC4xrg@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
23 lines
854 B
Bash
Executable File
23 lines
854 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: LGPL-2.1
|
|
|
|
[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/perf/trace/beauty/include/uapi/linux/
|
|
|
|
printf "static const char *fadvise_advices[] = {\n"
|
|
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+POSIX_FADV_(\w+)[[:space:]]+([[:digit:]]+)[[:space:]]+.*'
|
|
|
|
grep -E $regex ${header_dir}/fadvise.h | \
|
|
sed -r "s/$regex/\2 \1/g" | \
|
|
sort | xargs printf "\t[%s] = \"%s\",\n" | \
|
|
grep -v "[6].*DONTNEED" | grep -v "[7].*NOREUSE"
|
|
printf "};\n"
|
|
|
|
# XXX Fix this properly:
|
|
|
|
# The grep 6/7 DONTNEED/NOREUSE are a hack to filter out the s/390 oddity See
|
|
# tools/include/uapi/linux/fadvise.h for details.
|
|
|
|
# Probably fix this when generating the string tables per arch so that We can
|
|
# reliably process on arch FOO a perf.data file collected by 'perf trace
|
|
# record' on arch BAR, e.g. collect on s/390 and process on x86.
|