From: Stephen Boyd <sboyd@codeaurora.org>
To: Will Deacon <will.deacon@arm.com>
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 12:37:38 -0800 [thread overview]
Message-ID: <20150220203738.GE24928@codeaurora.org> (raw)
In-Reply-To: <20150220193034.GD1767@arm.com>
On 02/20, Will Deacon wrote:
> 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.
>
Ok let's see how a macro goes. Is there any advantage either way?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] ARM: perf: Preparatory work for Scorpion PMU support
Date: Fri, 20 Feb 2015 12:37:38 -0800 [thread overview]
Message-ID: <20150220203738.GE24928@codeaurora.org> (raw)
In-Reply-To: <20150220193034.GD1767@arm.com>
On 02/20, Will Deacon wrote:
> 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.
>
Ok let's see how a macro goes. Is there any advantage either way?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-02-20 20:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 18:24 [PATCH v2 0/2] Scorpion PMU support Stephen Boyd
2015-02-13 18:24 ` Stephen Boyd
2015-02-13 18:24 ` [PATCH v2 1/2] ARM: perf: Preparatory work for " Stephen Boyd
2015-02-13 18:24 ` Stephen Boyd
2015-02-20 19:30 ` Will Deacon
2015-02-20 19:30 ` Will Deacon
2015-02-20 20:37 ` Stephen Boyd [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-13 18:24 ` Stephen Boyd
2015-02-13 18:24 ` Stephen Boyd
2015-02-20 19:35 ` Will Deacon
2015-02-20 19:35 ` Will Deacon
2015-02-20 20:16 ` Stephen Boyd
2015-02-20 20:16 ` Stephen Boyd
2015-02-24 17:23 ` Ashwin Chaugule
2015-02-24 17:23 ` Ashwin Chaugule
2015-02-25 16:58 ` Ashwin Chaugule
2015-02-25 16:58 ` Ashwin Chaugule
2015-02-27 19:36 ` Stephen Boyd
2015-02-27 19:36 ` Stephen Boyd
2015-02-27 19:46 ` Will Deacon
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=20150220203738.GE24928@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will.deacon@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.