c++ profiler that can attach to a running process?

c++ profiler that can attach to a running process?

I have a program written in c++ that I want to profile, and I want to avoid restarting it when I start and stop profiling. Ideally I would be profiling both CPU usage and memory allocation. Is there any tool that will allow me to do this? I'm running on Linux.

How do I compile on linux to share with all distributions?


getnameinfo specifies socklen_t


  1. oprofile
  2. perf
  3. SystemTap (probably want a RedHat/CentOS distro for this)

Not Free

  1. VTune
Porting Windows platform C++ to POSIX (Linux) C++ - WSAGetLastError()Invoke web page from Linux C


Is there a (Linux) C++ IDE that can 'construct' a project from a makefile?
My recommendation would be Zoom from RotateRight - you must download a free 30 day evaluation from their web site.. Kernel module for /proc
Using many mutex locksQuery size of block device file in Python


If you must receive by with simple metrics, in the past, I have implemented a simple profiler. Track memory and time. Track the start and stop of each function, print a line at the start and stop. Track the memory before and after if important. Have all of this gated by a runtime variable this you must change externally. In a web application, it could be an extra post/receive parameter. In a thick client program, it could be an extra switch.. Then, at runtime, you could start to collect data. I have added multiple levels in the past as well to allow for selective and then more detailed data collection.. Good luck..


You must try valgrind. It is a bundle of different modules put toreceive her into a neat package.


Add metrics to your code. Profile with gprof http://linuxgazette.tuwien.ac.at/100/vinayak.html..

86 out of 100 based on 46 user ratings 446 reviews