Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Problem in using GPROF


  • To: "Carlos O'Donell" <carlos@xxxxxxxxxxxxxxxx>
  • Subject: Re: [arm-gnu] Problem in using GPROF
  • From: "Jayant Sonar" <srjayant@xxxxxxxxx>
  • Date: Fri, 29 Aug 2008 11:18:59 +0530

Thank you for your reply Carlos.

>>>> arm-linux-gcc *.c -g -pg -fpack-struct
>> This doesn't look like a CodeSourcery toolchain? What does
>> arm-linux-gcc -v say?

My apologies.
Just to save my time from typing a huge command like
"arm-none-linux-gnueabi-gcc", i have created symbolic link with smaller
name "arm-linux-gcc" for it. It is a code sourcery toolchain 2008q1
(GCC-4.2.3).

>> What does arm-linux-gcc -v say?

It says -
===========================================================
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/sandra/lite/src/gcc-4.2/configure
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap
--disable-libssp --disable-libgomp --disable-libstdcxx-pch --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu
--enable-__cxa_atexit --with-pkgversion=Sourcery G++ Lite 2008q1-126
--with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls
--prefix=/opt/codesourcery
--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc
--with-build-sysroot=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/libc
--enable-poison-system-directories
--with-build-time-tools=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/bin
--with-build-time-tools=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.2.3 (Sourcery G++ Lite 2008q1-126)
===========================================================

>>Your should install the CodeSourcery Sourcery G++ ARM GNU/Linux
>> libraries on the target, and you should be using them when you run
>> your application (either at build-time via -rpath/--dyanmic-linker
>> or with LD_LIBRARY_PATH at runtime).

I tried both of these suggestions -
a) I copied all libraries from <TC_DIR/arm-none-linux-gnueabi/libc/lib/>
to the target's </lib> directory. Then I set the LD_LIBRARY_PATH to
that directory. But it didn't help and it still giving me all ZEROs
in all time related columns.

b) I built my application using "--dynamic-linker" option as
following -
     arm-linux-gcc *.c -fpack-struct -g -pg -Wl,--dynamic-linker
/root/arm-4.2.3/arm-none-linux-gnueabi/libc/lib/ld-linux.so.3

However, when I tried to execute generated out file on hardware, it
threw me following error -
     a.out: line 1: syntax error: word unexpected (expecting ")")

Regards
Jayant



On Thu, Aug 28, 2008 at 9:35 PM, Carlos O'Donell <carlos@xxxxxxxxxxxxxxxx>wrote:

> Jayant Sonar wrote:
>
>> Hi,
>>
>> I am using ARM toolchain 2008q1 (GCC-4.2.3) to compile my application
>> for my OMAP3430 target hardware.
>>
>> I am trying to use GPROF utility to get profiling information about
>> my application. I compile my application using following command -
>>
>> arm-linux-gcc *.c -g -pg -fpack-struct
>>
>
> This doesn't look like a CodeSourcery toolchain? What does arm-linux-gcc
>  -v say?
>
>  The generated output file when executed on hardware runs properly and
>> generates gmon.out also. When GPROF is used to generate the profiling
>> information from this gmon.out, the generated information shows
>> appropriate number of calls made for each function.
>> However all the time related columns - % time, cumulative seconds,
>> self seconds etc - has only ZERO value everywhere.
>>
>> The information line at the top of generated profile says -
>>     Each sample counts as 0.01 seconds.
>>     no time accumulated
>>
>> I have commented all "clock()" or "gettimeofday()" function calls as
>> I read somewhere that they could cause inappropriate time information
>> generation. But still what i am getting is all time fields flooded
>> with zero values.
>>
>> What could be the problem??
>> My target OS has GLIBC-2.5.
>>
>
> Your should install the CodeSourcery Sourcery G++ ARM GNU/Linux libraries
> on the target, and you should be using them when you run your application
> (either at build-time via -rpath/--dyanmic-linker or with LD_LIBRARY_PATH at
> runtime).
>
> Cheers,
> Carlos.
> --
> Carlos O'Donell
> CodeSourcery
> carlos@xxxxxxxxxxxxxxxx
> (650) 331-3385 x716
>