Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 378
Heinrich Schmetterling Avatar asked Apr 27 '10 00:04

Heinrich Schmetterling


People also ask

Which tool allows the user to attach to a running process in C Plus Plus?

++ Yes, Zoom is a good tool for the performance part.

What is a profiler C?

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.


2 Answers

Free

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

Not Free

  1. VTune
like image 181
Zan Lynx Avatar answered Sep 23 '22 13:09

Zan Lynx


My recommendation would be Zoom from RotateRight - you can download a free 30 day evaluation from their web site.

like image 22
Paul R Avatar answered Sep 25 '22 13:09

Paul R