Re: [PATCH v2 1/2] ARM: perf: Preparatory work for Scorpion PMU support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux