This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: gprof/sprof and shared libraries...again

Okay, I did get a little further with the hints from Andrew Cagney.

To profile the calls to my library I made sure I compiled it with -pg.

    gcc -pg -fPIC -I. -c -o prof.lo prof.c
    gcc --shared -o prof.lo

Now, I added the a few options to my call to sprof and seem to be getting
slightly closer...

    sprof --flat-profile --graph

This returns a flat profile that contains the symbol I am looking for, but
the call graph still won't show it like it would with profiling

    Flat profile:

    Each sample counts as 0.01 seconds.
      %   cumulative   self              self     total
     time   seconds   seconds    calls  us/call  us/call  name
    100.00      0.50     0.50        0     0.00           something

    index % time    self  children    called     name

                    0.00    0.00        0/0           <UNKNOWN>
    [0]      0.0    0.00    0.00        0         mcount@@GLIBC_2.0 [0]
                    0.00    0.00        0/0           mcount@@GLIBC_2.0 [0]

Yes, "something" is the symbol I'm looking for, and I get timing on the
call, but it doesn't show up in the call graph.  (Note that this much only
works when I *do not* compile my program with profiling.  If I do compile my
executable with -pg, my symbol won't even show up in the flat profile

So, there's something...not sure what, but something.

Paul Braman

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]