[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1411567455-31264-2-git-send-email-matt@console-pimps.org>
Date: Wed, 24 Sep 2014 15:04:05 +0100
From: Matt Fleming <matt@...sole-pimps.org>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
"H. Peter Anvin" <hpa@...or.com>,
Matt Fleming <matt.fleming@...el.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: [PATCH 01/11] perf stat: Fix AGGR_CORE segfault on multi-socket system
From: Matt Fleming <matt.fleming@...el.com>
When printing the stats associated with a counter in AGGR_MODE mode, the
'cpu' argument represents an encoded socket and core_id, not a 'cpu'.
Using it as an index into the any of the *_stats[MAX_NR_CPUS] arrays
generates a SIGSEGV if the encoded socket id is non-zero.
Follow the AGGR_GLOBAL case and reset the cpu index to 0.
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Matt Fleming <matt.fleming@...el.com>
---
tools/perf/builtin-stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 5fe0edb1de5d..7c30fbd2d9b7 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -964,7 +964,7 @@ static void abs_printout(int cpu, int nr, struct perf_evsel *evsel, double avg)
aggr_printout(evsel, cpu, nr);
- if (aggr_mode == AGGR_GLOBAL)
+ if (aggr_mode == AGGR_GLOBAL || aggr_mode == AGGR_CORE)
cpu = 0;
fprintf(output, fmt, avg, csv_sep);
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists