Skip to content
Commit e734568b authored by Will Deacon's avatar Will Deacon Committed by Robert Richter
Browse files

oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array



The OProfile perf backend uses a static array to keep track of the
perf events on the system. When compiling with CONFIG_CPUMASK_OFFSTACK=y
&& SMP, nr_cpumask_bits is not a compile-time constant and the build
will fail with:

oprofile_perf.c:28: error: variably modified 'perf_events' at file scope

This patch uses NR_CPUs instead of nr_cpumask_bits for the array
initialisation. If this causes space problems in the future, we can
always move to dynamic allocation for the events array.

Cc: Matt Fleming <matt@console-pimps.org>
Reported-by: default avatarRussell King - ARM Linux <linux@arm.linux.org.uk>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: <stable@vger.kernel.org> # v2.6.37+
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 6921a575
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment