[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <156741218591.17286.11105173064357616868.tip-bot2@tip-bot2>
Date: Mon, 02 Sep 2019 08:16:25 -0000
From: "tip-bot2 for Kyle Meyer" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kyle Meyer <kyle.meyer@....com>, Jiri Olsa <jolsa@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Russ Anderson <russ.anderson@....com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org
Subject: [tip: perf/core] libperf: Warn when exceeding MAX_NR_CPUS in cpumap
The following commit has been merged into the perf/core branch of tip:
Commit-ID: df552793493ff83b2b7289389d29d417b3ef6d6d
Gitweb: https://git.kernel.org/tip/df552793493ff83b2b7289389d29d417b3ef6d6d
Author: Kyle Meyer <meyerk@....com>
AuthorDate: Tue, 27 Aug 2019 16:43:52 -05:00
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Thu, 29 Aug 2019 17:38:32 -03:00
libperf: Warn when exceeding MAX_NR_CPUS in cpumap
Display a warning when attempting to profile more than MAX_NR_CPU CPUs.
This patch should not change any behavior.
Signed-off-by: Kyle Meyer <kyle.meyer@....com>
Reviewed-by: Jiri Olsa <jolsa@...hat.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Russ Anderson <russ.anderson@....com>
Link: http://lore.kernel.org/lkml/20190827214352.94272-8-meyerk@stormcage.eag.rdlabs.hpecorp.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/lib/cpumap.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/lib/cpumap.c b/tools/perf/lib/cpumap.c
index 2834753..1f0e6f3 100644
--- a/tools/perf/lib/cpumap.c
+++ b/tools/perf/lib/cpumap.c
@@ -100,6 +100,9 @@ struct perf_cpu_map *perf_cpu_map__read(FILE *file)
if (prev >= 0) {
int new_max = nr_cpus + cpu - prev - 1;
+ WARN_ONCE(new_max >= MAX_NR_CPUS, "Perf can support %d CPUs. "
+ "Consider raising MAX_NR_CPUS\n", MAX_NR_CPUS);
+
if (new_max >= max_entries) {
max_entries = new_max + MAX_NR_CPUS / 2;
tmp = realloc(tmp_cpus, max_entries * sizeof(int));
@@ -192,6 +195,9 @@ struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list)
end_cpu = start_cpu;
}
+ WARN_ONCE(end_cpu >= MAX_NR_CPUS, "Perf can support %d CPUs. "
+ "Consider raising MAX_NR_CPUS\n", MAX_NR_CPUS);
+
for (; start_cpu <= end_cpu; start_cpu++) {
/* check for duplicates */
for (i = 0; i < nr_cpus; i++)
Powered by blists - more mailing lists