您的位置:首页 > 其它

程序不产生gmon.out的原因

2017-03-10 13:29 323 查看
最近想用gprof优化一下程序,奇怪的是怎么也不产生gmon.out文件,在网上查了一些方法,也没有解决,然后在
man gcc中看到一句话:

-pg Generate extra code to write profile information suitable for the

analysis program gprof. You must use this option when compiling

the source files you want data about, and
you must also use it when

linking.


要想产生gmon.out文件,必须在编译和链接时,都加上-pg -g选项。

如果还是没有解决:可以参考一下下面网址:

http://blog.csdn.net/crazyhacking/article/details/11972889

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  gprof gmon.out 性能优