LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 1/2] ARM: perf: Preparatory work for Scorpion PMU support
Date: Fri, 20 Feb 2015 19:30:34 +0000	[thread overview]
Message-ID: <20150220193034.GD1767@arm.com> (raw)
In-Reply-To: <1423851849-6069-2-git-send-email-sboyd@codeaurora.org>

On Fri, Feb 13, 2015 at 06:24:08PM +0000, Stephen Boyd wrote:
> Do some things to make the Krait PMU support code generic enough
> to be used by the Scorpion PMU support code.
> 
>  * Rename the venum register functions to be venum instead of krait
>    specific because the same registers exist on Scorpion
> 
>  * Add a krait_decode_event() function to decode our Krait specific
>    event encoding that's the same on Scorpion (modulo an extra region).
> 
>  * Drop krait from krait_clear_pmresrn_group() so it can be used
>    by Scorpion code
> 
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  arch/arm/kernel/perf_event_v7.c | 87 ++++++++++++++++++++++-------------------
>  1 file changed, 46 insertions(+), 41 deletions(-)

[...]

> +static void krait_decode_event(u32 event, unsigned int *region,
> +		unsigned int *group, unsigned int *code, bool *venum, bool *cpu)
> +{
> +	if (region)
> +		*region = (event >> 12) & 0xf;
> +	if (group)
> +		*group  = (event >> 0)  & 0xf;
> +	if (code)
> +		*code   = (event >> 4) & 0xff;
> +	if (venum)
> +		*venum  = !!(event & VENUM_EVENT);
> +	if (cpu)
> +		*cpu = !!(event & KRAIT_EVENT);
> +}

Maybe worth sticking these fields in a struct? Failing that, just using
macros for each one and using them in-line isn't so bad.

Will

  reply	other threads:[~2015-02-20 19:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 18:24 [PATCH v2 0/2] " Stephen Boyd
2015-02-13 18:24 ` [PATCH v2 1/2] ARM: perf: Preparatory work for " Stephen Boyd
2015-02-20 19:30   ` Will Deacon [this message]
2015-02-20 20:37     ` Stephen Boyd
2015-02-13 18:24 ` [PATCH v2 2/2] ARM: perf: Add support for Scorpion PMUs Stephen Boyd
2015-02-20 19:35   ` Will Deacon
2015-02-20 20:16     ` Stephen Boyd
2015-02-24 17:23       ` Ashwin Chaugule
2015-02-25 16:58         ` Ashwin Chaugule
2015-02-27 19:36           ` Stephen Boyd
2015-02-27 19:46             ` Will Deacon

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=20150220193034.GD1767@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    --subject='Re: [PATCH v2 1/2] ARM: perf: Preparatory work for Scorpion PMU support' \
    /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

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).