Received: by 10.213.65.68 with SMTP id h4csp1753478imn; Mon, 19 Mar 2018 12:18:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELvSz/B1kEVvHfvu+1plQwqFdb+tzoILc4lQS0/Sv5c6ogj0AyuZZRmgtR4bSy+BU1xkk5/M X-Received: by 10.101.100.216 with SMTP id t24mr9983570pgv.59.1521487138082; Mon, 19 Mar 2018 12:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521487138; cv=none; d=google.com; s=arc-20160816; b=cAJgeMrL5XeQ5WIA2RPPQBUw97dDNWo6qwVuKovvab8CKZWV3XtTApmrbiJXCOiVGF YgDVINVHH+KfIYA+kXCuDahx8mfqqoGii/uPQwwJoEWD2TaZ5pG9I71gnoxYkta8XfBO wSxzWT3q+iijl91hOQ/O3he7+pD9u7HWqpZN8vc83riaxbPkrPFUeKMQz6qWrEhkmgKo ND95Vaj/1pAD2FexO8I2PGMCgPg9GcVDoKE6YhwIfsb6WgA6ndeX5Bt3G22jXyne8zrx pOhUzTMopRu9VQT8BIUOsZeTVOCRjsJVPPP5o3Kq+4Bl2Ecsiznb0GxKsR9eCGscXLy+ ov2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jwpOkOgpRXnKl00tb/+AD5gNPR/KWIU9BMwia3ct5X0=; b=Hjpqr+fAf6JVtNude/Ba2kU8O++y1VP5SfVEBXTpwkVQ7SJUa139rQP+AXZ79WhW39 HLDXtvU4ddSOC4/2lRqsnu546xl3CTDD0GZuP+enwuEyhZRtFFcA5Fumv0gFJh02HJnW yTYubvFEuf+FPwmWAy+C/aeODA39mCiZah+YX+J+cqvKJCyg9MIKR6lh3BgZt2DYPLkc jiThMZ72vjGrfvyqqLI60z6wG5H5GR8XHQqcsh8FKRziIrC37UVF/sdVrfVERd25r2I1 2aSv3qwcjEeswEBaodsXT3o0aQeO8ECTZ99rBr73DRYfrS9TVEkp7j5foidA2WYCdHKE KlHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e127si422509pfc.315.2018.03.19.12.18.43; Mon, 19 Mar 2018 12:18:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031478AbeCSS0P (ORCPT + 99 others); Mon, 19 Mar 2018 14:26:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50670 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969844AbeCSS0D (ORCPT ); Mon, 19 Mar 2018 14:26:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9BB56100B; Mon, 19 Mar 2018 18:26:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Carrillo-Cisneros , Jiri Olsa , Alexander Shishkin , Andi Kleen , He Kuang , Masami Hiramatsu , Paul Turner , Peter Zijlstra , Simon Que , Stephane Eranian , Wang Nan , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.9 146/241] perf session: Dont rely on evlist in pipe mode Date: Mon, 19 Mar 2018 19:06:51 +0100 Message-Id: <20180319180757.228986745@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Carrillo-Cisneros [ Upstream commit 0973ad97c187e06aece61f685b9c3b2d93290a73 ] 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 [ Check if file != NULL in perf_session__new(), like when used by builtin-top.c ] Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/session.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -139,8 +139,14 @@ struct perf_session *perf_session__new(s 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; @@ -155,7 +161,11 @@ struct perf_session *perf_session__new(s 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 || !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;