- Subject: [tip:perf/urgent] oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array
- From: tip-bot for Will Deacon <will.deacon@xxxxxxx>
- Date: Mon, 25 Jun 2012 04:39:47 -0700
- Cc: hpa@xxxxxxxxx, mingo@xxxxxxxxxx, robert.richter@xxxxxxx, linux@xxxxxxxxxxxxxxxx, will.deacon@xxxxxxx, matt@xxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx
- Git-commit-id: e734568b675c985db2026848fefaac01c22977a5
- Reply-to: linux-kernel@xxxxxxxxxxxxxxx, mingo@xxxxxxxxxx, hpa@xxxxxxxxx, will.deacon@xxxxxxx, robert.richter@xxxxxxx, linux@xxxxxxxxxxxxxxxx, matt@xxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx
- Robot-id: <tip-bot.git.kernel.org>
- Robot-unsubscribe: Contact <mailto:hpa@xxxxxxxxxx> to get blacklisted from these emails
Commit-ID: e734568b675c985db2026848fefaac01c22977a5
Gitweb: http://git.kernel.org/tip/e734568b675c985db2026848fefaac01c22977a5
Author: Will Deacon <will.deacon@xxxxxxx>
AuthorDate: Fri, 8 Jun 2012 16:16:04 +0100
Committer: Robert Richter <robert.richter@xxxxxxx>
CommitDate: Thu, 21 Jun 2012 16:15:11 +0200
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@xxxxxxxxxxxxxxxxx>
Reported-by: Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>
Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # v2.6.37+
Signed-off-by: Robert Richter <robert.richter@xxxxxxx>
---
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 da14432..efc4b7f 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;
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux USB Devel]
[Linux Video &Media]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]