PowerPC - support application profiling

Jonathan Larmour jifl@eCosCentric.com
Thu Nov 14 15:49:00 GMT 2002


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



More information about the Ecos-patches mailing list