public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf, tools, stat: Avoid crash with --per-thread
@ 2016-03-01 23:32 Andi Kleen
  2016-03-02  6:36 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2016-03-01 23:32 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

Bug fix:

The earlier metrics changes broke --per-thread causing a segfault.
Handle this case correctly. We actually don't print metrics
in per thread mode, so using a 0 shadow CPU is fine.

Could be folded into
"perf, tools, stat: Support metrics in --per-core/socket mode"

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/builtin-stat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c11374b..52a37a5 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -977,6 +977,9 @@ static int first_shadow_cpu(struct perf_evsel *evsel, int id)
 {
 	int i;
 
+	if (!aggr_get_id)
+		return 0;
+
 	if (stat_config.aggr_mode == AGGR_NONE)
 		return id;
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-02 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 23:32 [PATCH] perf, tools, stat: Avoid crash with --per-thread Andi Kleen
2016-03-02  6:36 ` Jiri Olsa
2016-03-02 12:12   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox