[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Profiling a library built with libtool

From: Benoit SIGOURE
Subject: Re: Profiling a library built with libtool
Date: Fri, 13 Jul 2007 18:40:27 +0200

On Jul 13, 2007, at 5:36 PM, Joseph Wakeling wrote:

Benoit SIGOURE wrote:
The .la file is a piece of shell script that contains information useful
to libtool.

Now the answer to your question is to ask libtool to run gprof (or gdb)
for you:
./libtool --mode=execute gprof ./foo

Ah! That explains much.  Thank you.

I still get results that I don't understand.  This is the beginning of
what I get for profiling my executable:

Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
  0.00      0.00     0.00    56133     0.00     0.00  data_start
  0.00      0.00     0.00       19     0.00     0.00

There's a record of calls but not of times, and _nothing_ for the
library functions.  The library and this executable are all built
together in one big ./configure && make.

I don't know whether I need to do more than add -pg to the CFLAGS when
building the library or whether it's simply gprof I'm not using correctly.

Hmm you are right, I didn't notice during my test that I also had zeros.
Build a static version of your project and it'll work.

./configure --disable-shared
make clean all CFLAGS='-pg -all-static'


Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]