diff options
author | Will Deacon <will.deacon@arm.com> | 2012-06-08 11:16:04 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2012-06-21 10:15:11 -0400 |
commit | e734568b675c985db2026848fefaac01c22977a5 (patch) | |
tree | 75970cb2a9e8fffc98290e3f9f653f964a164a39 /drivers/oprofile | |
parent | 6921a575c9f26f7ea274aaea3b78967810ce5513 (diff) |
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: Russell King - ARM Linux <linux@arm.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: <stable@vger.kernel.org> # v2.6.37+
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile')
-rw-r--r-- | drivers/oprofile/oprofile_perf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c index da14432806c6..efc4b7f308cf 100644 --- a/drivers/oprofile/oprofile_perf.c +++ b/drivers/oprofile/oprofile_perf.c | |||
@@ -25,7 +25,7 @@ static int oprofile_perf_enabled; | |||
25 | static DEFINE_MUTEX(oprofile_perf_mutex); | 25 | static DEFINE_MUTEX(oprofile_perf_mutex); |
26 | 26 | ||
27 | static struct op_counter_config *counter_config; | 27 | static struct op_counter_config *counter_config; |
28 | static struct perf_event **perf_events[nr_cpumask_bits]; | 28 | static struct perf_event **perf_events[NR_CPUS]; |
29 | static int num_counters; | 29 | static int num_counters; |
30 | 30 | ||
31 | /* | 31 | /* |