lkml.org 
[lkml]   [2015]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] ARM: perf: Preparatory work for Scorpion PMU support
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


\
 
 \ /
  Last update: 2015-02-20 21:01    [W:0.088 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site