perf check-headers.sh: Add support to check 2 independent files

Add 'check_2' function to check 2 different files, the 'check' function
stays to check files that differs only in the prefix path.

In upcoming changes we need to check header files in locations which
don't follow the prefix logic.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180423090823.32309-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa 2018-04-23 11:08:16 +02:00 committed by Arnaldo Carvalho de Melo
parent 15019e9815
commit 5824729735
1 changed files with 14 additions and 5 deletions

View File

@ -55,18 +55,27 @@ include/uapi/asm-generic/ioctls.h
include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
' '
check_2 () {
file1=$1
file2=$2
shift
shift
cmd="diff $* $file1 $file2 > /dev/null"
test -f $file2 &&
eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
}
check () { check () {
file=$1 file=$1
shift shift
cmd="diff $* ../$file ../../$file > /dev/null" check_2 ../$file ../../$file $*
test -f ../../$file &&
eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
} }
# Check if we have the kernel headers (tools/perf/../../include), else # Check if we have the kernel headers (tools/perf/../../include), else
# we're probably on a detached tarball, so no point in trying to check # we're probably on a detached tarball, so no point in trying to check
# differences. # differences.