在CentOS下,哪个命令行会分析我的C程序,包括花在系统调用上的时间?yum需要安装哪些程序?
发布于 2012-10-12 05:07:21
安装oprofile:yum install oprofile
初始化oprofile:
opcontrol --no-vmlinux #If you have vmlinux set this option differently
opcontrol --init
opcontrol --reset
opcontrol --separate=lib
opcontrol --callgraph=0 # clear callgraph in case it was used recently
opcontrol --start现在运行要分析的程序。运行足够长的时间后,执行以下操作:
opcontrol --dump
opreport --symbols /path/to/executable有关其他一些示例输出,请参见here。
https://stackoverflow.com/questions/12847734
复制相似问题