Back to home page

LXR

 
 

    


0001 #!/bin/bash
0002 
0003 set -e
0004 set -o pipefail
0005 
0006 # To debug, uncomment the following line
0007 # set -x
0008 
0009 # Test whether the compile option -mprofile-kernel exists and generates
0010 # profiling code (ie. a call to _mcount()).
0011 echo "int func() { return 0; }" | \
0012     $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
0013     grep -q "_mcount"
0014 
0015 # Test whether the notrace attribute correctly suppresses calls to _mcount().
0016 
0017 echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
0018     $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
0019     grep -q "_mcount" && \
0020     exit 1
0021 
0022 echo "OK"
0023 exit 0