Skip to content

Commit d758d5d

Browse files
committed
perf tools: Separate the checking of headers only used to build beautification tables
Some headers are not used in building the tools directly, but instead to generate tables that then gets source code included to do id->string and string->id lookups for things like syscall flags and commands. We were adding it directly to tools/include/ and this sometimes gets in the way of building using system headers, lets untangle this a bit. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 717d182 commit d758d5d

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

‎tools/perf/check-headers.sh‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ include/uapi/asm-generic/mman-common.h
7575
include/uapi/asm-generic/unistd.h
7676
'
7777

78+
# These copies are under tools/perf/trace/beauty/ as they are not used to in
79+
# building object files only by scripts in tools/perf/trace/beauty/ to generate
80+
# tables that then gets included in .c files for things like id->string syscall
81+
# tables (and the reverse lookup as well: string -> id)
82+
83+
BEAUTY_FILES='
84+
include/linux/socket.h
85+
'
86+
7887
check_2 () {
7988
file1=$1
8089
file2=$2
@@ -100,6 +109,14 @@ check () {
100109
check_2 tools/$file $file $*
101110
}
102111

112+
beauty_check () {
113+
file=$1
114+
115+
shift
116+
117+
check_2 tools/perf/trace/beauty/$file $file $*
118+
}
119+
103120
# Check if we have the kernel headers (tools/perf/../../include), else
104121
# we're probably on a detached tarball, so no point in trying to check
105122
# differences.
@@ -128,8 +145,9 @@ check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in
128145
# diff non-symmetric files
129146
check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
130147

131-
# These will require a beauty_check when we get some more like that
132-
check_2 tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h
148+
for i in $BEAUTY_FILES; do
149+
beauty_check $i -B
150+
done
133151

134152
# check duplicated library files
135153
check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

0 commit comments

Comments
 (0)