[PATCH] oprofile, x86: Fix overflow and warning (commit 1d12d35)

From: Robert Richter
Date: Tue Aug 16 2011 - 18:11:24 EST


On 02.08.11 00:16:25, Robert Richter wrote:
> On 01.08.11 17:41:30, Andi Kleen wrote:
> > And what happens when the CPU reports more than 32 counters?
> > You have a silent buffer overflow then.
>
> From the layout of IA32_PERF_GLOBAL_CTRL MSR it seems to be limited to
> 32. Anyway, if there might be cpus out soon with more than 32 counters
> we can either extend the array to 256 or limit the counters used to 32.

See my patch below.

-Robert