Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profile single function in gprof

Tags:

c++

gprof

Is it possible to use gprof to line-profile a single function in C++?

Something like:

gprof -l -F function_name ...

, which does not seem to work.

like image 561
Bi. Avatar asked Jul 31 '09 18:07

Bi.


1 Answers

That can be done easily with valgrind. It is a wonderful tool if you have the chance to use it in your development environment. It even have and graphical interface kcachegrind.

like image 92
javier-sanz Avatar answered Oct 07 '22 22:10

javier-sanz