lkml.org 
[lkml]   [2007]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] AVR32: Oprofile support
On Thu, 8 Nov 2007 10:28:06 +0100
Philippe Elie <phil.el@wanadoo.fr> wrote:

> On Wed, 07 Nov 2007 at 15:05 +0000, Haavard Skinnemoen wrote:
> > + /* PCCNT */
> > + if (ctr->enabled && (pccr & ctr->flag_mask)) {
> > + sysreg_write(PCCNT, -ctr->count);
> > + oprofile_add_sample(regs, PCCNT);
> > + }
> > + ctr++;
> > + /* PCNT0 */
> > + if (ctr->enabled && (pccr & ctr->flag_mask)) {
> > + sysreg_write(PCNT0, -ctr->count);
> > + oprofile_add_sample(regs, PCNT0);
> > + }
> > + ctr++;
> > + /* PCNT1 */
> > + if (ctr->enabled && (pccr & ctr->flag_mask)) {
> > + sysreg_write(PCNT1, -ctr->count);
> > + oprofile_add_sample(regs, PCNT1);
> > + }
>
> Why not a loop here ?

The system register is coded into the instruction as an immediate, so
it would have to be a loop with a switch in it. And with only three
counters, I thought it looked cleaner (and faster) this way.

Håvard
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-08 11:17    [W:0.049 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site