]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - arch/powerpc/scripts/gcc-check-mprofile-kernel.sh
Merge git://www.linux-watchdog.org/linux-watchdog
[mirror_ubuntu-zesty-kernel.git] / arch / powerpc / scripts / gcc-check-mprofile-kernel.sh
CommitLineData
8c50b72a
TD
1#!/bin/bash
2
3set -e
4set -o pipefail
5
6# To debug, uncomment the following line
7# set -x
8
9# Test whether the compile option -mprofile-kernel exists and generates
10# profiling code (ie. a call to _mcount()).
11echo "int func() { return 0; }" | \
12 $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
13 grep -q "_mcount"
14
15# Test whether the notrace attribute correctly suppresses calls to _mcount().
16
17echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
18 $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
19 grep -q "_mcount" && \
20 exit 1
21
22echo "OK"
23exit 0