All of lore.kernel.org
 help / color / mirror / Atom feed
* problem with mips-linux gprof
@ 2006-04-28  6:37 Krishna
  2006-04-28 19:52 ` James E Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Krishna @ 2006-04-28  6:37 UTC (permalink / raw)
  To: Linux-MIPS

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

Hi,
   
  I have been trying to use mips-linux gprof from last few days. But not able to get profile data. Here what I did: 
   
  1. cross compiled program for mips-linux as follows
  $ mips-unknown-linux-gnu-gcc -o hello hello.c -g -pg -lc
   
  2. then ran hello on target mips-linux system (BCM91480B) which generates gmon.out file.
   
  3. copy gmon.out to the host.
   
  4. run mips-linux gprof as follows 
  $mips-unknown-linux-gnu-gprof hello
   
  But i get the following error message
  mips-unknown-linux-gnu-gprof: gmon.out file is missing call-graph data
   
  Then I googled around and found someone suggesting to use lib_p.a during compilation. But i don't have that library.
  Please someone help me to get rid of this problem.
   
  Thanks and Regards,
  Krishna

			
---------------------------------
Yahoo! Mail goes everywhere you do.  Get it on your phone.

[-- Attachment #2: Type: text/html, Size: 1244 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: problem with mips-linux gprof
  2006-04-28  6:37 problem with mips-linux gprof Krishna
@ 2006-04-28 19:52 ` James E Wilson
  2006-04-28 20:15   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: James E Wilson @ 2006-04-28 19:52 UTC (permalink / raw)
  To: dhunjukrishna; +Cc: Linux-MIPS

On Thu, 2006-04-27 at 23:37, Krishna wrote:
> But i get the following error message
> mips-unknown-linux-gnu-gprof: gmon.out file is missing call-graph data

Add a second function to your testcase.  You have to have at least two
functions in order to have a call graph.

If your testcase has only one function, main, then there will be no
useful call graph info, so the -pg library support won't bother to emit
one, and then gprof complains that it is missing.  This is correct, but
not very useful, and perhaps should be considered a bug.  I think gprof
should just default to emitting a flat profile in this case, without
giving an error, so I'd call this a binutils bug.

In the absence of call-graph info, you can use the gprof -p option to
get a flat profile.

The above assumes you don't have a profiled C library available.  If you
did, then you would have at least two profiled functions, main and
printf, and would have gotten some call graph info emitted.  If you
don't have a profiled C library available, you could try compiling one
yourself.  There is a glibc configure option --enable-profile for that. 
I've never tried this myself.  I'd expect this to be a non-trivial
exercise.  Besides the issue of compiling glibc, you also need to
install the profiled library, and arrange to link with it.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: problem with mips-linux gprof
  2006-04-28 19:52 ` James E Wilson
@ 2006-04-28 20:15   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2006-04-28 20:15 UTC (permalink / raw)
  To: James E Wilson; +Cc: dhunjukrishna, Linux-MIPS

On Fri, Apr 28, 2006 at 12:52:07PM -0700, James E Wilson wrote:
> The above assumes you don't have a profiled C library available.  If you
> did, then you would have at least two profiled functions, main and
> printf, and would have gotten some call graph info emitted.  If you
> don't have a profiled C library available, you could try compiling one
> yourself.  There is a glibc configure option --enable-profile for that. 
> I've never tried this myself.  I'd expect this to be a non-trivial
> exercise.  Besides the issue of compiling glibc, you also need to
> install the profiled library, and arrange to link with it.

Many prebuilt distributions already ship it; FWIW, if you link with
"-profile" instead of "-pg", GCC will automatically attempt to use
-lc_p.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-28 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28  6:37 problem with mips-linux gprof Krishna
2006-04-28 19:52 ` James E Wilson
2006-04-28 20:15   ` Daniel Jacobowitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.