From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289AbdDKSk7 (ORCPT ); Tue, 11 Apr 2017 14:40:59 -0400 Received: from mail.kernel.org ([198.145.29.136]:54386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbdDKSk4 (ORCPT ); Tue, 11 Apr 2017 14:40:56 -0400 Date: Tue, 11 Apr 2017 15:40:50 -0300 From: Arnaldo Carvalho de Melo To: David Carrillo-Cisneros Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Andi Kleen , Simon Que , Wang Nan , Jiri Olsa , He Kuang , Masami Hiramatsu , Stephane Eranian , Paul Turner Subject: Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode Message-ID: <20170411184050.GG3275@kernel.org> References: <20170410201432.24807-1-davidcc@google.com> <20170410201432.24807-6-davidcc@google.com> <20170411184014.GF3275@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411184014.GF3275@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Apr 11, 2017 at 03:40:14PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Apr 10, 2017 at 01:14:30PM -0700, David Carrillo-Cisneros escreveu: > > Session sets a number parameters that rely on evlist. These parameters > > are not used in pipe-mode and should not be set, since evlist is > > unavailable. Fix that. > > Ditching this one as well, until further investigation, well, file must > be null in this case... Ah, this is the problem: [root@jouet ~]# perf top perf: Segmentation fault -------- backtrace -------- perf[0x57eddb] /lib64/libc.so.6(+0x35990)[0x7fb435d06990] perf(perf_session__new+0xb7)[0x4eb547] perf(cmd_top+0xde9)[0x44ce89] perf[0x49953f] perf[0x499831] perf(main+0x252)[0x428dd2] /lib64/libc.so.6(__libc_start_main+0xf1)[0x7fb435cf1401] perf(_start+0x2a)[0x4292da] [0x0] [root@jouet ~]# > [acme@jouet linux]$ git bisect bad > 5d71c27204d51492abe9fc69064fd36a0bda410b is the first bad commit > commit 5d71c27204d51492abe9fc69064fd36a0bda410b > Author: David Carrillo-Cisneros > Date: Mon Apr 10 13:14:30 2017 -0700 > > perf session: Don't rely on evlist in pipe mode > > Session sets a number parameters that rely on evlist. These parameters > are not used in pipe-mode and should not be set, since evlist is > unavailable. Fix that. > > Signed-off-by: David Carrillo-Cisneros > Acked-by: Jiri Olsa > Cc: Alexander Shishkin > Cc: Andi Kleen > Cc: He Kuang > Cc: Masami Hiramatsu > Cc: Paul Turner > Cc: Peter Zijlstra > Cc: Simon Que > Cc: Stephane Eranian > Cc: Wang Nan > Link: http://lkml.kernel.org/r/20170410201432.24807-6-davidcc@google.com > Signed-off-by: Arnaldo Carvalho de Melo > > :040000 040000 7df28fe9d7c9d962b78c0532f4961caea2737b59 34e4fed0042b1401c1a1a247d8ae40df17f9d272 M tools > [acme@jouet linux]$ > > > Signed-off-by: David Carrillo-Cisneros > > --- > > tools/perf/util/session.c | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > > index a25302bc55a8..db554b7461b8 100644 > > --- a/tools/perf/util/session.c > > +++ b/tools/perf/util/session.c > > @@ -140,8 +140,14 @@ struct perf_session *perf_session__new(struct perf_data_file *file, > > if (perf_session__open(session) < 0) > > goto out_close; > > > > - perf_session__set_id_hdr_size(session); > > - perf_session__set_comm_exec(session); > > + /* > > + * set session attributes that are present in perf.data > > + * but not in pipe-mode. > > + */ > > + if (!file->is_pipe) { > > + perf_session__set_id_hdr_size(session); > > + perf_session__set_comm_exec(session); > > + } > > } > > } else { > > session->machines.host.env = &perf_env; > > @@ -156,7 +162,11 @@ struct perf_session *perf_session__new(struct perf_data_file *file, > > pr_warning("Cannot read kernel map\n"); > > } > > > > - if (tool && tool->ordering_requires_timestamps && > > + /* > > + * In pipe-mode, evlist is empty until PERF_RECORD_HEADER_ATTR is > > + * processed, so perf_evlist__sample_id_all is not meaningful here. > > + */ > > + if (!file->is_pipe && tool && tool->ordering_requires_timestamps && > > tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) { > > dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n"); > > tool->ordered_events = false; > > -- > > 2.12.2.715.g7642488e1d-goog