gprof报告没有时间累积 [英] gprof reports no time accumulated

查看:606
本文介绍了gprof报告没有时间累积的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在运行OSX 10.5.7的机器上配置gprof的C ++应用程序。
我使用g ++编译,但使用-pg标志,运行应用程序并尝试使用gprof查看调用图。

I'm trying to profile a C++ application with gprof on a machine running OSX 10.5.7. I compile with g++ in the usual way, but using -pg flags, run the application and try to view the call graph with gprof.

不幸的是我的调用图形包含所有时间列的所有零。 被调用列中的值具有合理的值,所以它看起来像被分析,但我对于缺乏其他数据的神秘。

Unfortunately my call graph contains all zeroes for all time columns. The values in the "called" columns have reasonable values so it looks like something was profiled but I'm mystified about the lack of other data.

我所有的源文件都是以类似的方式编译的:

All my source files are compiled in a similar way:

g++ -pg -O2 -DNDEBUG -I./ -ansi -c -o  ScenarioLoader.o ScenarioLoader.cpp

然后运行'ar'将所有的目标文件绑定到一个库。
后来,我链接并运行gprof如下:

I then run 'ar' to bundle all the object files into a library. Later, I link and run gprof as so:

g++ -pg -lm  -o vrpalone vrpalone.o ../src/atomicprof.a lastbuild.o
./vrpalone
gprof gmon.out | less

任何想法?

推荐答案

我想我可能会分享这个Apple邮件列表讨论<

I thought I might share this Apple mailing list discussion which I recently ran across.

这里描述的行为正是我遇到的。
看起来gprof已经在OSX上断了很长一段时间。

The behaviour described here is exactly what I am experiencing. It looks like gprof has been broken on OSX for quite some time.

我使用了Shark,这是Dave Rigby的帮助。

I've resorted to Shark which has been helpfully suggested by Dave Rigby.

谢谢!

这篇关于gprof报告没有时间累积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆