GPROF -pg C++ and library

Tim Prince tprince@computer.org
Fri Nov 2 15:52:00 GMT 2007


Olivier Delannoy wrote:
> Hi all,
> I hope it's the correct place for this question.
>
>
> I am trying to profile my application which is organized in several
> libraries. I would like to know what I need to do to get a profile
> which actually represent my application and not only a part of it. The
> program is composed of dynamic libraries and I am interesting in
> getting profile from the dynamic libraries functions as well.
> Libraries have been compiled using -pg -g3 -O0  as well as the main
> program but I can't find any statistics on the usage of functions
> defined in libraries. The application is written in C++ and makes use
> of a few C libraries (which I am not interested in for profiling).
>
> What is the common way to gather these information using -pg and gprof.
>
>   
It may seem like a holdover from the dim past, but I make a special 
build with everything I want to profile compiled and static linked with 
-pg. 
Just a day ago, it was pointed out that oprofile would be more 
satisfactory for profiling with dynamic libraries.  Likewise, Intel 
VTune and PTU profilers will capture information from g++ linux or MS 
compatible windows dynamic libraries, if compiled with -g or -Zi.  A few 
days ago, I tried PTU on a g++ build on Windows, and got only 
information by dynamic library, not by function.
Sorry, but it's not evident to me what platform you are discussing.  -pg 
certainly is a gcc option appropriate for discussion on this list.

---AV & Spam Filtering by M+Guardian - Risk Free Email (TM)---



More information about the Gcc-help mailing list