diff options
author | Will Deacon <will.deacon@arm.com> | 2012-06-08 16:16:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 08:47:48 -0700 |
commit | d2b32167957d2cb234636bac6dd46056c17bc272 (patch) | |
tree | cb4ea11d285270aab784eee9d93f99a4742214cf /drivers/oprofile | |
parent | 4575efeebc7c614b981f7a399b2ba614fad39689 (diff) | |
download | kernel_samsung_smdk4412-d2b32167957d2cb234636bac6dd46056c17bc272.zip kernel_samsung_smdk4412-d2b32167957d2cb234636bac6dd46056c17bc272.tar.gz kernel_samsung_smdk4412-d2b32167957d2cb234636bac6dd46056c17bc272.tar.bz2 |
oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array
commit e734568b675c985db2026848fefaac01c22977a5 upstream.
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>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 9046f7b..137406c 100644 --- a/drivers/oprofile/oprofile_perf.c +++ b/drivers/oprofile/oprofile_perf.c @@ -25,7 +25,7 @@ static int oprofile_perf_enabled; static DEFINE_MUTEX(oprofile_perf_mutex); static struct op_counter_config *counter_config; -static struct perf_event **perf_events[nr_cpumask_bits]; +static struct perf_event **perf_events[NR_CPUS]; static int num_counters; /* |