Commit 49cf0bf6 authored by Yanteng Si's avatar Yanteng Si Committed by Arnaldo Carvalho de Melo

perf beauty mmap_flags: Fix script for archs that use the generic mman.h

To address this error:

  grep: /root/linux-next/tools/arch/xxxxx/include/uapi/asm//mman.h:
  No such file or directory
Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
Acked-by: default avatarHuacai Chen <chenhuacai@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: loongarch@lists.linux.dev
Cc: loongson-kernel@lists.loongnix.cn
Link: https://lore.kernel.org/r/42e8e3565d6035302907426c1e65483b2a4007f5.1692962043.git.siyanteng@loongson.cnSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c56f286f
...@@ -19,7 +19,7 @@ arch_mman=${arch_header_dir}/mman.h ...@@ -19,7 +19,7 @@ arch_mman=${arch_header_dir}/mman.h
printf "static const char *mmap_flags[] = {\n" printf "static const char *mmap_flags[] = {\n"
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MAP_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*' regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MAP_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
grep -E -q $regex ${arch_mman} && \ ([ -f ${arch_mman} ] && grep -E -q $regex ${arch_mman}) && \
(grep -E $regex ${arch_mman} | \ (grep -E $regex ${arch_mman} | \
sed -r "s/$regex/\2 \1 \1 \1 \2/g" | \ sed -r "s/$regex/\2 \1 \1 \1 \2/g" | \
xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n") xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment