Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

From: Peter Zijlstra
Date: Thu Aug 14 2014 - 03:10:45 EST


On Wed, Aug 13, 2014 at 06:17:48PM -0700, Andi Kleen wrote:
> v2: Use correct event name in description. Use EVENT() macro.

> +static unsigned bdw_limit_period(struct perf_event *event, unsigned left)
> +{
> + if ((event->hw.config & 0xffff) ==

I was thinking you should use INTEL_ARCH_EVENT_MASK or something instead
of the raw 0xFFFF there, but that X86_CONFIG() usage is nice too :-)

> + X86_CONFIG(.event=0xc0, .umask=0x01)) {
> + if (left < 128)
> + left = 128;
> + left &= ~0x3fu;
> + }
> + return left;
> +}

Attachment: pgpIGYnwPxj7x.pgp
Description: PGP signature