public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Profiling information for powerpc target - GCC 4.1.1
@ 2007-05-24 14:45 Mohamed Shafi
  2007-05-24 15:18 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Mohamed Shafi @ 2007-05-24 14:45 UTC (permalink / raw)
  To: gcc-help

Hello all,

I am trying to generate profiling information for powerpc target
(rs600) using cross compiler version gcc 4.1.1 and newlib 1.14.0

After i compile a file with -pg option and execute it no gmon.out file
is produced.
When i disassemble the obj file i can find a call to _mcount.But when
i check the newlib sources the mcount call is actually a dummy
function with the following code

	.file	"mcount-dummy.S"
	.text
FUNC_START(_mcount)
	mflr	r11
	lwz	r0,4(sp)
	mtctr	r11
	mtlr	r0
	bctr
FUNC_END(_mcount)

I also couldn't find any particular startup file required for profiling.
Does this mean that profiling is not supported for any powerpc target
build with newlib?
Is there support for profiling for powerpc target with glibc?

Thanks for your time,

Regards,
Shafi

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

* Re: Profiling information for powerpc target - GCC 4.1.1
  2007-05-24 14:45 Profiling information for powerpc target - GCC 4.1.1 Mohamed Shafi
@ 2007-05-24 15:18 ` Ian Lance Taylor
  2007-05-24 16:10   ` Kai Ruottu
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2007-05-24 15:18 UTC (permalink / raw)
  To: Mohamed Shafi; +Cc: gcc-help

"Mohamed Shafi" <shafitvm@gmail.com> writes:

> I also couldn't find any particular startup file required for profiling.
> Does this mean that profiling is not supported for any powerpc target
> build with newlib?

That appears to be the case.  I'm not sure why the file
newlib/libgloss/rs6000/mcount.S was created.  It seems to simply
obscure the fact that -pg does not work for powerpc newlib.  In my
opinion it would be better to get a link error, making it clear that
you need to provide a version of _mcount appropriate for your system.

> Is there support for profiling for powerpc target with glibc?

Yes.

Ian

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

* Re: Profiling information for powerpc target - GCC 4.1.1
  2007-05-24 15:18 ` Ian Lance Taylor
@ 2007-05-24 16:10   ` Kai Ruottu
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Ruottu @ 2007-05-24 16:10 UTC (permalink / raw)
  To: Mohamed Shafi; +Cc: gcc-help

Ian Lance Taylor wrote:
> "Mohamed Shafi" <shafitvm@gmail.com> writes:
>
>   
>> I also couldn't find any particular startup file required for profiling.
>> Does this mean that profiling is not supported for any powerpc target
>> build with newlib?
>>     
>
> That appears to be the case.  I'm not sure why the file
> newlib/libgloss/rs6000/mcount.S was created.  It seems to simply
> obscure the fact that -pg does not work for powerpc newlib.  In my
> opinion it would be better to get a link error, making it clear that
> you need to provide a version of _mcount appropriate for your system.
>   
There once was that Cygnus 'powerpc-cygwin32' target/host for the 
WindowsNT4.0/PPC. And
Cygwin uses/used newlib as the basement for its custom C library.  So 
there is a 'winsup/mcount.c'
probably replacing that in 'libgloss' during build and install....

So theoretically there still is "profiling support for one powerpc 
target build with newlib", for the
Cygwin/PPC :-)

>> Is there support for profiling for powerpc target with glibc?
>>     
>
> Yes.
>   
Also FreeBSD/PPC, NetBSD/PPC, MacOS X/PPC, AIX, BeOS etc. are available 
for PPC...
Generally the clause: "Your program will write the profile data into a 
file called `gmon.out' just
before exiting" taken from the DJGPP docs explains what the big problem 
with newlib is...  One
should ask the question: "Where this file will be written in an embedded 
newlib-based system?"

When cross-developing and running the produced apps in a host system 
capable to accept 'files',
via the 'PSIM' in GDB, it sounds obvious that the 'gmon.out' would be 
written onto the host system's
default directory while "running" the program... But the 'target system' 
really doesn't support any
'filesystem' in its 'runtime environment' - the real PPC based one !  
The 'PSIM' in GDB simulates
only this kind of "dummy system" :-(

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

end of thread, other threads:[~2007-05-24 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24 14:45 Profiling information for powerpc target - GCC 4.1.1 Mohamed Shafi
2007-05-24 15:18 ` Ian Lance Taylor
2007-05-24 16:10   ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).