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?

1:

getnameinfo specifies socklen_t

Free

  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

2:

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

3:

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..

4:

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

5:

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


76 out of 100 based on 51 user ratings 1026 reviews

@