diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2016-11-26 04:26:10 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-04-28 13:26:53 +0200 |
commit | b71c9ffb140556004caf7ba27083f9d90ae8d14b (patch) | |
tree | 7139123f4a58fc9146c7923ec4af45e8126c9b1d /arch/powerpc/tools/gcc-check-mprofile-kernel.sh | |
parent | powerpc: Use the new post-link pass to check relocations (diff) | |
download | linux-b71c9ffb140556004caf7ba27083f9d90ae8d14b.tar.xz linux-b71c9ffb140556004caf7ba27083f9d90ae8d14b.zip |
powerpc: Add arch/powerpc/tools directory
Move a couple of existing scripts under there. Remove scripts directory:
a script is a tool, a tool is not a script.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/tools/gcc-check-mprofile-kernel.sh')
-rwxr-xr-x | arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh new file mode 100755 index 000000000000..c658d8cf760b --- /dev/null +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e +set -o pipefail + +# To debug, uncomment the following line +# set -x + +# Test whether the compile option -mprofile-kernel exists and generates +# profiling code (ie. a call to _mcount()). +echo "int func() { return 0; }" | \ + $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \ + grep -q "_mcount" + +# Test whether the notrace attribute correctly suppresses calls to _mcount(). + +echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \ + $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \ + grep -q "_mcount" && \ + exit 1 + +echo "OK" +exit 0 |