Re: [PATCH] perf_events: fix bogus warn_on(_once) in perf_prepare_sample()

From: Stephane Eranian
Date: Thu Apr 08 2010 - 17:08:43 EST


On Thu, Apr 8, 2010 at 10:55 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Thu, 2010-04-08 at 22:45 +0200, Stephane Eranian wrote:
>> Â Â Â There is a warn_on_once() check for PERF_SAMPLE_RAW which trips
>> Â Â Â when using PEBS on both Core and Nehalem. Core PEBS sample size is 144
>> Â Â Â bytes and 176 bytes for Nehalem. Both are multiples of 8, but the size
>> Â Â Â field is encoded as int, thus the total is never a multiple of 8 which
>> Â Â Â trips the check. I think the size should have been u64, but now it is
>> Â Â Â too late to change given it is ABI.
>
> PEBS hasn't seen -linus yet, so we can fix that.
>
Are you suggesting you add some padding the PEBS raw sample you
return as PERF_SAMPLE_RAW? Then you need to define what RAW
actually means? Seems here, it would mean more than what the
HW returns.

> There's various things that do indeed rely on the perf buffer to always
> be u64 aligned, so this warning isn't bogus at all.
>
I assume this has to do with the wrap-around detection.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/