开发者

Recommendations for C++ profiling tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe 开发者_Go百科the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

Can anyone recommend any tools for compile and runtime analysis of C++ code? I'm being hit day after day with requests to identify where certain overloads of functions are being used in a very large code base.

My current method involves a combination of (a) text search using grep / find and (b) spoofing the include files to comment out the overloads in question, and fully recompiling thus breaking the build where the overloads are used. As you can imagine this is very time consuming.

I'm doing this on a Red Hat Linux platform, by the way.


I've used a combination of gprof and a script called gprof2dot which gives you a call graph showing how much time is spent in each method.

See this article on gprof. Also take a look at:

Optimizing C/C++ programs using the GProf profiler

Here is an example call graph showing time spent in each method ( taken from the gprof2dot page):

Recommendations for C++ profiling tools [closed]


I used Intels VTune in the past and found it very helpful.

http://software.intel.com/en-us/articles/intel-vtune/


take a look at valgrind.


You can use Callgrind. Now it is part of the valgrind project.

It has very nice GUI to review the results : KCacheGrind

Both are available for your distro.


I second @RA's recommendation of Intel VTune as worthy of looking at. Don't turn your nose up at gprof, it's ubiquitous and is a good start. You may be able to get the information you want from your debugger -- which is ?

If you told us what compiler you are using, we might be able to tell you what features it has for helping you.


There is also TAU, which although it can be a pain to configure, it is quite powerful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜