Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for C++ profiling tools [closed]

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.

like image 368
Component 10 Avatar asked Nov 04 '10 10:11

Component 10


People also ask

How to do profiling in Visual Studio 2019?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

How to use Performance Profiler?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). The tool shows each async operation in a list view. You can see information such as the start time, end time, and total time for an async operation.

What is C profiling?

The C Profiler tool enables the collection and display of execution profile data on C software source code bases of arbitrary size. It is a member of SD's family of Profiler tools.


1 Answers

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):

alt text

like image 75
Robert S. Barnes Avatar answered Sep 21 '22 12:09

Robert S. Barnes