mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-21 16:31:14 +02:00

It is used only to generate string tables, not to build perf, so move it to the tools/perf/trace/beauty/{include,arch}/ hierarchies, that is used just for scraping. This is a something that should've have happened, as happened with the linux/socket.h scrapper, do it now as Ian suggested while doing an audit/refactor session in the headers used by perf. No other tools/ living code uses it, just <linux/usbdevice_fs.h> coming from either 'make install_headers' or from the system /usr/include/ directory. Suggested-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/lkml/20240315204835.748716-3-acme@kernel.org Link: https://lore.kernel.org/lkml/CAP-5=fWZVrpRufO4w-S4EcSi9STXcTAN2ERLwTSN7yrSSA-otQ@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
28 lines
911 B
Bash
Executable File
28 lines
911 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
# SPDX-License-Identifier: LGPL-2.1
|
|
|
|
[ $# -eq 1 ] && beauty_x86_arch_asm_uapi_dir=$1 || beauty_x86_arch_asm_uapi_dir=tools/perf/trace/beauty/arch/x86/include/uapi/asm/
|
|
|
|
prctl_arch_header=${beauty_x86_arch_asm_uapi_dir}/prctl.h
|
|
|
|
print_range () {
|
|
idx=$1
|
|
prefix=$2
|
|
first_entry=$3
|
|
|
|
printf "#define x86_arch_prctl_codes_%d_offset %s\n" $idx $first_entry
|
|
printf "static const char *x86_arch_prctl_codes_%d[] = {\n" $idx
|
|
regex=`printf '^[[:space:]]*#[[:space:]]*define[[:space:]]+ARCH_([[:alnum:]_]+)[[:space:]]+(%s[[:xdigit:]]+).*' ${prefix}`
|
|
fmt="\t[%#x - ${first_entry}]= \"%s\",\n"
|
|
grep -E -q $regex ${prctl_arch_header} && \
|
|
(grep -E $regex ${prctl_arch_header} | \
|
|
sed -r "s/$regex/\2 \1/g" | \
|
|
xargs printf "$fmt")
|
|
printf "};\n\n"
|
|
}
|
|
|
|
print_range 1 0x1 0x1001
|
|
print_range 2 0x2 0x2001
|
|
print_range 3 0x4 0x4001
|