gcc -pg and gprof not showing libc call times

Discussion in 'C Programming' started by jcomeau_ictx, Oct 15, 2009.

  1. jcomeau_ictx

    jcomeau_ictx Guest

    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
     
    jcomeau_ictx, Oct 15, 2009
    #1
    1. Advertising

  2. jcomeau_ictx

    Flash Gordon Guest

    jcomeau_ictx wrote:
    > 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.
    --
    Flash Gordon
     
    Flash Gordon, Oct 15, 2009
    #2
    1. Advertising

  3. jcomeau_ictx

    Tim Prince Guest

    jcomeau_ictx wrote:
    > 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 .
    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.
     
    Tim Prince, Oct 16, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWF2cmlja18xMDE=?=

    SetAuthCookie works some times and fails some times?

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    542
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 23, 2006
  2. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Forms Authentication Fails some times and not some times???

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    506
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 28, 2006
  3. Andrew Bonello

    gprof, -pg and rand() problem

    Andrew Bonello, Sep 12, 2003, in forum: C++
    Replies:
    3
    Views:
    1,257
    Jim Fischer
    Sep 13, 2003
  4. =?iso-8859-1?q?Nicolas_Herv=E9?=

    gcc + gprof : basic bloc counting

    =?iso-8859-1?q?Nicolas_Herv=E9?=, Jul 25, 2007, in forum: C Programming
    Replies:
    2
    Views:
    356
    Richard
    Jul 26, 2007
  5. John Carter
    Replies:
    3
    Views:
    111
    M. Edward (Ed) Borasky
    Mar 28, 2007
Loading...

Share This Page