Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: (OT) Profiling under gcc

Author: Robert Hyatt

Date: 17:38:44 05/22/02

Go up one level in this thread


On May 22, 2002 at 14:07:45, Sven Reichard wrote:

>Sorry about being off-topic, but this is probably the best (in terms of quality
>and speed) place to ask this. If you feel otherwise, please ignore.
>
>I'm using gcc (actually g++), versions 2.96 and 3.0.x, and I can't get profiling
>to work. I suspect that the 2.96 specs file is screwed up, but maybe it's me. I
>experimented with all sorts of combinations of the following switches: -g -ggdb
>-pg -p --static --profile, but to no avail. The best I get is a call count for
>every function, but the times don't match. No matter which program I run, gprof
>thinks it takes 10 ms, and spends all that time in one function, usually some
>mem allocation.
>
>I would be grateful for any hint (other than "download 3.1" :-) )
>
>Sven.


I use 2.95.2 all the time and use -pg only.  No other options.  Note that
not only do you compile with -pg but you must also link with the same option
to get the right library.  Then just run the program and when you terminate it
you should have a gmon.out file...  profview (or whatever you want to use such
as gprof) should show you the details...



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.