[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gprof total run time incorrect
From: |
Paolo Carlini |
Subject: |
Re: gprof total run time incorrect |
Date: |
Mon, 02 Jul 2001 18:01:00 +0200 |
Hi,
and thank you very much for your reply.
>Was this different before you switched to the current versions of gcc
>and glibc?
Honestly, the last time I profiled *C* code was 2-3 years ago and I'm
quite new to C++ programming.
>Please note that gprof can't measure and account the time spent in
>shared-library routines called by your program. This is usually the
>root of the majority of apparently "missing" time in the gprof
>measurements. To get over this, the only method I know is forcing a
>static linkage of your program, with the profiling version of libc
>(libc_p.a) and friends. "gcc -profile -static" or something similar
>usually does that.
Thank you very much.
I will try what you are suggesting (the -static build, I mean) and then
'll report to you privately.
Anyway, I'm wondering what's different between C and C++: C programs are
correctly profiled even without forcing static linkage... Looks like in
my particular case the problem is with libsdc++, not libc.
Cheers,
Paolo.