linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Orsila <shd@zakalwe.fi>
To: Maynard Johnson <maynardj@us.ibm.com>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org,
	oprofile-list@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch
Date: Thu, 16 Nov 2006 16:02:31 +0200	[thread overview]
Message-ID: <20061116140231.GA12227@zakalwe.fi> (raw)
In-Reply-To: <455B619C.7040904@us.ibm.com>

On Wed, Nov 15, 2006 at 12:51:08PM -0600, Maynard Johnson wrote:
> +/* This function is called once for all cpus combined */
> +static void
> +cell_reg_setup(struct op_counter_config *ctr,
> +	       struct op_system_config *sys, int num_ctrs)
> +{
> [SNIP]
> +	for (i = 0; i < num_ctrs; ++i) {
> +
> +		if ((ctr[i].event >= 2100) && (ctr[i].event <= 2111))
> +			pmc_cntrl[1][i].evnts = ctr[i].event + 19;
> +		else if (ctr[i].event == 2203)
> +			pmc_cntrl[1][i].evnts = ctr[i].event;
> +		else if ((ctr[i].event >= 2200) && (ctr[i].event <= 2215))
> +			pmc_cntrl[1][i].evnts = ctr[i].event + 16;
> +		else
> +			pmc_cntrl[1][i].evnts = ctr[i].event;
> +

I think the previous code would be more readable with a switch() 
statement. 

	switch (ctr[i].event) {
	case 2100 ... 2111:
		pmc_cntrl[1][i] = ctr[i].event + 19;
		break;
	case 2200 ... 2202:
	case 2204 ... 2215:
		pmc_cntrl[1][i] = ctr[i].event + 16;
		break;
	default:
		pmc_cntrl[1][i] = ctr[i].event;
	}

 - Heikki

      parent reply	other threads:[~2006-11-16 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 18:51 [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch Maynard Johnson
2006-11-15 19:16 ` Maynard Johnson
2006-11-15 19:19 ` [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- corrected patch with header Maynard Johnson
2006-11-16 14:02 ` Heikki Orsila [this message]

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=20061116140231.GA12227@zakalwe.fi \
    --to=shd@zakalwe.fi \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=maynardj@us.ibm.com \
    --cc=oprofile-list@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).