summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch
new file mode 100644
index 00000000..e2c5be82
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0032-oprofile-perf-use-NR_CPUS-instead-or-nr_cpumask_bits.patch
@@ -0,0 +1,44 @@
1From fa7b3de0ebfa0cd8a833ea2daa5ded5ea50fd085 Mon Sep 17 00:00:00 2001
2From: Will Deacon <will.deacon@arm.com>
3Date: Fri, 8 Jun 2012 16:16:04 +0100
4Subject: [PATCH 32/46] oprofile: perf: use NR_CPUS instead or nr_cpumask_bits
5 for static array
6
7commit e734568b675c985db2026848fefaac01c22977a5 upstream.
8
9The OProfile perf backend uses a static array to keep track of the
10perf events on the system. When compiling with CONFIG_CPUMASK_OFFSTACK=y
11&& SMP, nr_cpumask_bits is not a compile-time constant and the build
12will fail with:
13
14oprofile_perf.c:28: error: variably modified 'perf_events' at file scope
15
16This patch uses NR_CPUs instead of nr_cpumask_bits for the array
17initialisation. If this causes space problems in the future, we can
18always move to dynamic allocation for the events array.
19
20Cc: Matt Fleming <matt@console-pimps.org>
21Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
22Signed-off-by: Will Deacon <will.deacon@arm.com>
23Signed-off-by: Robert Richter <robert.richter@amd.com>
24Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
25---
26 drivers/oprofile/oprofile_perf.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
30index da14432..efc4b7f 100644
31--- a/drivers/oprofile/oprofile_perf.c
32+++ b/drivers/oprofile/oprofile_perf.c
33@@ -25,7 +25,7 @@ static int oprofile_perf_enabled;
34 static DEFINE_MUTEX(oprofile_perf_mutex);
35
36 static struct op_counter_config *counter_config;
37-static struct perf_event **perf_events[nr_cpumask_bits];
38+static struct perf_event **perf_events[NR_CPUS];
39 static int num_counters;
40
41 /*
42--
431.7.10
44