public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
To: Philippe Elie <phil.el@wanadoo.fr>
Cc: oprofile-list@lists.sourceforge.net, kernel@avr32linux.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH] AVR32: Oprofile support
Date: Thu, 8 Nov 2007 12:14:13 +0100	[thread overview]
Message-ID: <20071108121413.4919e4a3@siona> (raw)
In-Reply-To: <20071108092806.GB2889@zaniah>

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

  reply	other threads:[~2007-11-08 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 14:05 [RFC/PATCH] AVR32: Oprofile support Haavard Skinnemoen
2007-11-07 15:55 ` Philippe Elie
2007-11-07 18:41   ` Haavard Skinnemoen
2007-11-08  9:28 ` Philippe Elie
2007-11-08 11:14   ` Haavard Skinnemoen [this message]
2007-11-08 12:25     ` Philippe Elie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071108121413.4919e4a3@siona \
    --to=hskinnemoen@atmel.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=phil.el@wanadoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox