最经利用oprofile分析fortran代码,一个小插曲就是当你的fortran程序运行时间太短的话,oprofile根本就分析不到。先 贴下我的脚本代码;
!/bin/sh
llog=$1
if [ "$#" -ne 1 ]
then
echo "Usage:oprofile.sh interger(300,500,800)"
exit
fi
opcontrol --no-vmlinux
opcontrol --init
opcontrol --reset
opcontrol --setup --event=CPU_CLK_UNHALTED:6000
opcontrol --start
./4_1_1
./4_1_2
./4_1_3
./4_1_4
./4_1_7
./4_1_8
opcontrol --dump
opcontrol --stop
opcontrol --shutdown
opreport -l ./4_1_1 > 1-report-$llog
opreport -l ./4_1_2 > 2-report-$llog
opreport -l ./4_1_3 > 3-report-$llog
opreport -l ./4_1_4 > 4-report-$llog
opreport -l ./4_1_7 > 7-report-$llog
opreport -l ./4_1_8 > 8-report-$llog
opannotate --source ./4_1_1 > 1-a