Received: by 10.213.65.68 with SMTP id h4csp1790911imn; Mon, 19 Mar 2018 13:21:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELtryxWPkVOqJG8fhalI62Ctu0Y1lfOAd7Vzo8nLclEa5btTXaN1gLsZiAWMu8S+rVevwJsl X-Received: by 10.99.0.2 with SMTP id 2mr5610847pga.395.1521490886181; Mon, 19 Mar 2018 13:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521490886; cv=none; d=google.com; s=arc-20160816; b=m0sUu+0wjESk9dZ5EUJP0VmCRVUH6oclCHEVhz4oI2G+hByvb4cyOr96qDqBFzK/qX fD5thuwH9zopLTnRzWgFWOZPl3lQn/L64r95SRptzU9RcZbTsjTb4ohObcFwBaOH+8c7 4dP7zA8Xs2ObNj37Xut4EMY/Kvni46R8/nNIuBJwQhsmC0b3wBeCbJzfM399VC6uVAMd +/nHh7NsqU4OoDgrnk0oqu6Hv4AFRuPaqIf9ivtDABBwfYbYpa2/PAC14QrEnPlAkinK efoDRPJIh6ZEzM4BDZMMERN8e1j2ZYMKAXkXDCi0LvNC0kT32uSeAOL+I43oEqWKg9o5 yqPA== 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=9uxrGcCuFN0NE0PqcT7uZm676QmAxNG+shrxhQkiRYQ=; b=v1K82gxNdJ8kUrnu+8wFM3CP8HrV0FBm/xJV78Fqu5yVDuXWvJPEZwbaEd/wr3D8i3 XAZfQooKh4eKRBM5eWsurtHafqfob4YrE4KvxaMxqrlzGJsrOk6Q32mlZjB7LD8c+Df+ Dixh/I2nbf5Dd02DyQctJyeeZx5c6ddfGk6lZLH+w7bYioeTw0w/s9n29G+LJHq9MxfU tHGqINLJKNbN0U4FGMuZOX5Bz4ViNmjXDMATzHnbPr423RjRc81YD2fOEgZIBwUYLnBg GZ0AdqgRWqzk4wwqCWjubFU4tLQoiLLmoyQVOraVi4bzPS2H7wo7I9fhTqlsXr+eNQKb Fpkg== 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 u24si15299pgv.424.2018.03.19.13.21.04; Mon, 19 Mar 2018 13:21:26 -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 S971315AbeCSUTR (ORCPT + 99 others); Mon, 19 Mar 2018 16:19:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44534 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965586AbeCSSPR (ORCPT ); Mon, 19 Mar 2018 14:15:17 -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 95FCAF37; Mon, 19 Mar 2018 18:15:16 +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.4 072/134] perf session: Dont rely on evlist in pipe mode Date: Mon, 19 Mar 2018 19:05:55 +0100 Message-Id: <20180319171859.667052979@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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 @@ -135,8 +135,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; @@ -151,7 +157,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;