Format of parameter to display call graph for templated method with gprof?
Question
What is the command line format to display function call graph for a method in templated class with gprof?
For simple C method you would specify it like:
gprof -f foo myprogram > gprof.output
How do you specify method parse
from the following:
template <typename T> class A
{
public:
template <typename X> bool parse(X& x, char*buf)
{ ... lots of code here ...;
}
};
Solution 3
I was after the actual format to be used on command line. I can see the compiled symbols by looking at the generated files but I'm not sure what format to use on command line. Thanks anyway for all answers.
OTHER TIPS
Here is python script that can parse this: gprof2dot. The page has further references too.
Personally, I like the Google Performance Tools which can, among other things, also directly generate call graphs (via graphviz / dot).
I believe that C++ template parameters and arg types are used inside the function's name. You could maybe use sed on the profiler output file.
This tool can parse them out of the output file also: http://linux.wareseeker.com/download/gprof2dot.py-0.3.rar/331443