[Gllug] Profiling - where is all the time going?

Daniel P. Berrange dan at berrange.com
Tue Jul 20 10:17:02 UTC 2004


On Tue, Jul 20, 2004 at 11:10:51AM +0100, John Winters wrote:
> Hi all,
> 
> I'm experimenting with profiling a compute intensive program.  It does
> practically no i/o and it isn't memory bound - it just thinks hard.
> 
> I've compiled and linked with -pg and I seem to be getting a reasonably
> meaningful output except for one thing.  If I let the program run for 60
> seconds and then examine the profiling information I'm told that the
> cumulative time used by all the functions is 10.77 seconds.  Where could
> the other 49 seconds be going?

-pg is pretty limited level of profiling really. I'd recommend
installing OProfile, which uses CPU performance counters to 
profile across both user & kernel space (it will associate kernel
space time which the process responsible). It has very low impact
on program runtime compared to -pg, and can track various differnet
metrics depending on your processor. For example, simple counter
is 'time during which CPU is not halted' - ie running time. More
advanced counters can track 2nd/3rd level cache hits/misses,
branch prediction success rate, all sort of funky stuff....

Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20040720/e183b75e/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list