[ELDK] profiling with this eldk 4.2tool chain

Detlev Zundel dzu at denx.de
Wed Aug 25 15:40:51 CEST 2010


Hi Ratheendran,

> I wanted to see the profiling information of my program.
> the program is basic hello world.
>
> int main()
> {
> printf("Hello world?\n");
> sleep(1);
> }
>
>
> i have compiled my progam with -pg option [ arm-linux-gcc -g -pg -o t t.c ]
> & then i run the program ./t
> gmon.out file is created

Ok, this sounds good.

> but when i type arm-linux-gcc t
> i am not getting the profiling information. gives error "
> /bin/arm-linux-gprof: line 1: syntax error: unexpected "(" "

I do not understand why you type "arm-linux-gcc t" which would try to
compile the ELF binary as a c program....

You should rather do

gprof t

I just checked and this works - well at least it doesn't crash.
Unfortunately it doesn't yield useful output for me.

On the other hand gprof is not state of the art for profiling in the
Linux world anymore.  I would rather point you to the "oprofile"[1] tool
which is much more powerful for real profiling.  The package in ELDK 4.2
is too old for current kernels, so please re-compile the tools from the
sources and be sure to include the neccessary kernel options.

Best wishes
  Detlev

[1] http://oprofile.sourceforge.net/news/

-- 
PUBLIC NOTICE AS REQUIRED BY LAW:    Any Use of  This Product,  in Any Manner
Whatsoever, Will Increase the Amount of Disorder in the Universe. Although No
Liability Is  Implied Herein,  the Consumer Is Warned  That This Process Will
Ultimately Lead to the Heat Death of the Universe.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the eldk mailing list