gcc -pg and gprof not showing libc call times

J

jcomeau_ictx

Hi, I'm trying to optimize my code using gprof, but it's not showing
me the time taken by libc routines like scanf, printf, and getchar.
Running ldd on the binary shows just the normal libraries, not the
debug libs, is that correct? I've installed libc6-dbg, no help. This
is a Debian system, gcc 4.3.3. Thanks in advance -- jc
 
F

Flash Gordon

jcomeau_ictx said:
Hi, I'm trying to optimize my code using gprof, but it's not showing
me the time taken by libc routines like scanf, printf, and getchar.
Running ldd on the binary shows just the normal libraries, not the
debug libs, is that correct? I've installed libc6-dbg, no help. This
is a Debian system, gcc 4.3.3. Thanks in advance -- jc

This is about Linux and the GNU tools, not about C, so you need to ask
in a Linux or GNU group or mailing list.
 
T

Tim Prince

jcomeau_ictx said:
Hi, I'm trying to optimize my code using gprof, but it's not showing
me the time taken by libc routines like scanf, printf, and getchar.
Running ldd on the binary shows just the normal libraries, not the
debug libs, is that correct? I've installed libc6-dbg, no help. This
is a Debian system, gcc 4.3.3. Thanks in advance -- jc
This, it would seem, is peripheral to C, even to (e-mail address removed).
However, installing a debug shared object library could have no effect
unless you re-linked specifically against it or set LD_PRELOAD
accordingly. Static linked library functions may be more likely to be
counted under profiling, unless you had a library specifically built for
gprof, or a profiler specifically intended to use debug symbols.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top