This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: PowerPC - support application profiling
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Gary Thomas <gthomas at eCosCentric dot com>
- Cc: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: Thu, 14 Nov 2002 23:49:23 +0000
- Subject: Re: PowerPC - support application profiling
- References: <1037317030.6215.4631.camel@hermes.chez-thomas.org>
Gary Thomas wrote:
+
+ implements CYGPKG_PROFILE_TIMER
CYGINT_PROFILE_TIMER shirley? Or even CYGINT_PROFILE_HAL_TIMER since the
enable function has "hal" in it.
I'll be interested to see the generic support. I presume it's for gprof?
If it is, I would suggest CYGPKG_PROFILE_GPROF (living in
services/profile/gprof), as gprof isn't the only profiling system out
there. I think NavEcos said he was working on another(?) for example so we
should support more than one, even if we would prefer gprof.
+#ifdef CYGPKG_PROFILE
Hmm... I didn't think we wanted to say that just because a package was
loaded it was therefore necessarily doing stuff.
+//--------------------------------------------------------------------------
+//
+// Profiling support - uses a separate high-speed timer
+//
+
+#include <cyg/hal/hal_arch.h>
+#include <cyg/hal/hal_intr.h>
+#include <cyg/hal/quicc/ppc8xx.h>
+#include <cyg/infra/profile.h>
infra?
+// Can't rely on Cyg_Interrupt class being defined.
+#define Cyg_InterruptHANDLED 1
You can use the driver API.
+void
+hal_enable_profile_timer(int resolution)
+{
+ // Run periodic timer interrupt for profile
+ cyg_uint16 piscr;
+ int period = resolution / 100;
Shouldn't this be a Cyg_resolution (from the driver API) to be properly
generic - i.e. the raison d'etre of having the numerator/denominator split.
I think this shows up how we don't have proper support for a generic
interface to arbitrary hardware timers. Not something to solve now, but
it's something we lack.
Jifl
--
eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine