IOSIG学习笔记
1.配置环境
环境配置其实并不是很难。需要follow网上的userguide。网址:https://code.google.com/p/iosig/wiki/userGuide
按照上面的每一步骤进行配置,就可以完成安装。软件规模本身不大。需要进行进一步的完善。需要MPICH2的支持,以及numpy。这些都是要安装好的。numpy安装本身没有出现在教程中。需要另行安装。2.安装完成后,就可以进行trace过程了。Userguide给出了4个实例。首先运行execution_trace这个实例。这是一个可以记录C程序行为的实例。运行需要对路径进行修改。将Makefile中的IOSIG_LIB_PATH=$(HOME)/install/lib修改为IOSIG_LIB_PATH=$(HOME)/mpich2-install/lib。也就是mpich2的lib。这里userguide并没有给出明确的提示。但是没有这一步是不行的。修改完成后:
IOSIG_LIB_PATH=$(HOME)/mpich2-install/lib
main:main.o
gccmain.o -o main -L${IOSIG_LIB_PATH} -liosig
main.o:main.c
gcc-finstrument-functions -g -c -o main.o main.c
clean:
rm*.o main
-liosig可以记录程序行为。执行指令:sourcerun-example.sh 后可以看到如下结果,即说明成功执行了:
gcc-finstrument-functions -g -c -o main.o main.c
gccmain.o -o main -L/home/tony/mpich2-install/lib -liosig
foo
Entermain at 0.000001, called from ?? (??:0)
Enterfoo at 0.000010, called from main (main.c:10)
Exit foo at 0.000037
Exit main at 0.000038
Entermain at 0.000001, called from ?? (??:0)
Enterfoo at 0.000007, called from main (main.c:10)
Exit foo at 0.000024
Exit main at 0.000025
Entermain at 0.000002, called from ?? (??:0)
Enterfoo at 0.000018, called from main (main.c:10)
Exit foo at 0.000053
Exit main at 0.000056
Entermain at 0.000003, called from ?? (??:0)
Enterfoo at 0.000027, called from main (main.c:10)
Exit foo at 0.000060
Exit main at 0.000061
可以通过这段信息看到程序的执行步骤以及执行时间。