DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Analyzing run-time behavior

profiling C++ programs with prof

Like lprof(CP), prof accepts -C as an option which causes it to generate C++ symbol names in their decoded form.

Using prof with overload2.C, the same program we used in

``Profiling C++ programs with lprof'',

a sample session to compile, run and obtain time profiling and call count information would be as follows:

   $ CC -p -o overload2 overload2.C
   $ overload2
   

in foo(void) in foo(int i), i = 1 in foo(const char *s), s = string..... in foo(const char *s), s = string.....

$ prof overload2

Object: overload2

%Time Seconds Cumsecs #Calls msec/call Name 0.0 0.00 0.00 1 0. main 0.0 0.00 0.00 2 0. foo__FPCc 0.0 0.00 0.00 1 0. foo__Fi 0.0 0.00 0.00 1 0. foo__Fv

$ prof -C overload2

Object: overload2

%Time Seconds Cumsecs #Calls msec/call Name 0.0 0.00 0.00 1 0. main 0.0 0.00 0.00 2 0. foo(const char*) 0.0 0.00 0.00 1 0. foo(int) 0.0 0.00 0.00 1 0. foo(void)


Next topic: Profiling archive or shared object library code with prof
Previous topic: Invoking prof

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005