This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Profiling


Hi -


On Tue, Jun 25, 2002 at 05:03:05PM -0700, Scott Dattalo wrote:
> I'm trying to collect profile info on my ARM-based application. [...]
> connect-pin main perform-activity -> gprof sample
> connect-pin main stopping -> gprof store

The "perform-activity" pin may signal infrequently compared to
CPU instruction rates, so you will get a relatively low sample rate.
You could connect that gprof sample pin from another source, such as
the scheduler's CPU-bound NNN-output signal.

> [...]
> Now when I run gprof:
> $ gprof --flat-profile gmon.out
> I get the error:
> gprof: gmon.out: not in a.out format

This is a simple gprof usage error.  gprof implicitly looks for the 
file named gmon.out, but it doesn't know what *target executable* to
relate it to.  gprof needs to process the executable in order to
extract its symbol table, so that the PC sample addresses in gmon.out
can become sensible.  So, all you need to do is build the cross-gprof,
and run

	arm-elf-gprof file.exe

By the way, the "--flat-profile" option is not always needed any more,
as sid can collect call-graph profiling information from cooperating
cpu models.  (They need to drive a special c-call from subroutine
call semantics.)  I don't recall if the ARM cpu model includes the
few lines of code for this.  If you're interested in fuller profiling,
I'd be happy to give pointers for completing that few-minute job.


> Hmm. After reading the gprof docs, I added -pg to my CFLAGS options in my 
> make files. [...]

Right - this requests gcc to instrument the target code.
sid can profile uninstrumented target code.
(In some cases, sid can execute -pg-instrumented code and
produce a gmon.out file, but this requires many more pieces
of target software, and has some different properties.)


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]