This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
mcount and -pg
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- To: newlib at sources dot redhat dot com
- Date: Wed, 12 Feb 2003 16:34:41 -0600
- Subject: mcount and -pg
- Organization: OAR Corporation
Hi,
I noticed that mcount is now in a couple of libgloss targets. is
this all that is required to make profiling work on a target?
If so, any guidance on providing it in a way that could be
shared across more configurations?
My impression is that if you are using gcc, it is only CPU family
dependent and now OS dependent. Is this right?
I see implementations that might be usable for at least 3 common CPU
families in the gcc/newlib tree
./libgloss/i386/cygmon-gmon.c
./libgloss/rs6000/mcount.S -- dummy stub ignore
./gcc/config/m68k/aux-mcount.c
The implementation in ./libgloss/i386/cygmon-gmon.c looks generic
enough given that __builtin_return_address() is available. I
am wondering if the profiling code could be moved out of there
and be used on other target CPUs.
Any thoughts? Advice, experience doing profiling on embedded targets?
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985