diff options
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.patch | 44 |
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 @@ | |||
1 | From fa7b3de0ebfa0cd8a833ea2daa5ded5ea50fd085 Mon Sep 17 00:00:00 2001 | ||
2 | From: Will Deacon <will.deacon@arm.com> | ||
3 | Date: Fri, 8 Jun 2012 16:16:04 +0100 | ||
4 | Subject: [PATCH 32/46] oprofile: perf: use NR_CPUS instead or nr_cpumask_bits | ||
5 | for static array | ||
6 | |||
7 | commit e734568b675c985db2026848fefaac01c22977a5 upstream. | ||
8 | |||
9 | The OProfile perf backend uses a static array to keep track of the | ||
10 | perf 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 | ||
12 | will fail with: | ||
13 | |||
14 | oprofile_perf.c:28: error: variably modified 'perf_events' at file scope | ||
15 | |||
16 | This patch uses NR_CPUs instead of nr_cpumask_bits for the array | ||
17 | initialisation. If this causes space problems in the future, we can | ||
18 | always move to dynamic allocation for the events array. | ||
19 | |||
20 | Cc: Matt Fleming <matt@console-pimps.org> | ||
21 | Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk> | ||
22 | Signed-off-by: Will Deacon <will.deacon@arm.com> | ||
23 | Signed-off-by: Robert Richter <robert.richter@amd.com> | ||
24 | Signed-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 | |||
29 | diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c | ||
30 | index 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 | -- | ||
43 | 1.7.10 | ||
44 | |||