This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gprof and shared libraries
- From: Ian Lance Taylor <iant at google dot com>
- To: "Christian Sturz" <linuxkaffee at gmx dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 28 Dec 2006 09:28:30 -0800
- Subject: Re: Gprof and shared libraries
- References: <20061228130758.20710@gmx.net>
"Christian Sturz" <linuxkaffee@gmx.net> writes:
> I've a larger project that consists of several shared libraries.
> The compilation is done by autoconf and automake. One of the libraries
> seems to be slow so I would like to profile it. My idea was to use gprof
> (I'm using gcc 3.4.6). First, I modified the Makefiles so that each library
> is built with the flags "-g -pg". Next, I've set the variable LD_PROFILE to
> the library I want to analyze: "LD_PROFILE=/path/to/lirary.so". Then, I ran the program and got the file "gmon.out". However, when I execute
> "gpof MYEXECUTABLE gmon.out" all the displayed functions have a time of
> 0 seconds (number of calls is available) and I can't find and references
> to the function from the library I specified by LD_PROFILE.
This question is not appropriate for gcc@gcc.gnu.org, which is a
mailing list for the development of gcc. It is appropriate for
gcc-help@gcc.gnu.org, which is a mailing list about using gcc. Or
maybe for the glibc help mailing list, since LD_PROFILE is actually
handled by glibc, not gcc.
I don't know the answer to your question. It may be that you need to
run "gprof /path/to/lirary.so gmon.out". I'm not sure.
Ian