views:

36

answers:

2

I need to profile some operations in my program in great detail. Something like cachegrind would be very nice.

But my problem is that it takes a long time to setup the data structure and i can't use it for the whole program. It will take hours to run.

Does anyone know about a profiling tool that comes with a library and where i can just put a "start_profiling()" and "end_profiling()" call around the parts where i want profiling data.

The code is written in C++

A: 

You may not think this is what you're looking for, and you may have a presupposition as to where the problem is. That's OK, you're not alone, but this works.

Mike Dunlavey
A: 

http://sourceforge.net/projects/shinyprofiler/">Shiny C++ Profiler is very fast and capable and allows you (actually, pretty much requires you to) specify which parts of your program that you want to profile by inserting its functions at custom points in your code.

erjiang
Looked at it and it works braindead - well as a simple library it has no other options. You can only say i want to profile this file but not you want to start profiling from here to here in whatever file the executed source code is.
Lothar