Is it possible to use gprof to line-profile a single function in C++?
gprof -l -F function_name ...
does not seem to work.
Thanks, Bi.
Is it possible to use gprof to line-profile a single function in C++?
gprof -l -F function_name ...
does not seem to work.
Thanks, Bi.
Try using options with [symspec] to filter the results. gprof 2.18.0 says that -F and -f are deprecated and to use symspec instead.
Also, -l may not work with binaries compiled with newer versions of gcc. Try gcov instead.
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.
Are you looking for a suspected performance problem? If you have a preconception of where it is, chances are it's not there. If you really want to find performance problems, first you may need to look beyond some myths perpetuated by gprof.