Received: by 10.213.65.68 with SMTP id h4csp162594imn; Mon, 19 Mar 2018 23:35:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELv89bBvFnl22WRqJI5Aq1ZuohFxY3GzzFg9tz/n55HdLoQjcdBdGXSvdkN+vYt/QYWMtBXL X-Received: by 2002:a17:902:6589:: with SMTP id c9-v6mr10908416plk.215.1521527717319; Mon, 19 Mar 2018 23:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521527717; cv=none; d=google.com; s=arc-20160816; b=xmDcpVfNpyR6N/Rm3/0k+gGrm+FB6TkuWnc+5qwQVgpX6A81NzZwFuUY9Z3AghoBol QgcS6BJTefhqmpBoBFrXczzkX8Pcl+2gVIY98S3KxDGBbflstoJ4ebERX7lG24Rl2rxO h69s1LoTEYmwXI4r8aSsBKZ15T2SV6HJrYmNTf3Nr8eGUQwSbNBTyW0JPzErzhQZTxDd E/HNTbreOkuY437IX0YQxj1AlD3ckzoKgOYbNNIPR+I5sinoGXjGVDcRzGJy9zV0m6pT k0Y3LJ8GkhH0jRqhdzL4KFEyABPG85eJU/qk3AetrmE7FB8rrVHYE03IKASGZIm/NIhv ys6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=yh8VNtWKHFh7zGsJmFT9KF4IryRER54+JFZJXwSiH4g=; b=IXYXPmvnv/YwmipOcwvThDI27OZkvG/uiJakOl1QjZF3wjFs6esWfp/95M6Sl5JVme k2ZtxZXTsWWF/IrqGZTXTj+Y6JYiCWzVO7BqwndthqdcADSmuhuMyQbxHkTOlf//gEpS i3mMDGbdb6dSTQ82JJUIJSvUISIojZgx6fRBWsjwRFxwqQbij9SjGEPlmxElEaYHznaU DHEzVi3HTyQxjDgrfWlO9sLa3nxhVtj7t4p0QoVMYQBNxWqMT0bpGO8onAKIgVc6tfVX m58tZdB0R8FZYOELV26qU36Pf16W6TH9tjgiMC8mqc022WOs38jGTTWkOtIT3xAc52XE WY8w== 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 u189si789488pfu.212.2018.03.19.23.35.03; Mon, 19 Mar 2018 23:35:17 -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 S1752208AbeCTGce (ORCPT + 99 others); Tue, 20 Mar 2018 02:32:34 -0400 Received: from terminus.zytor.com ([198.137.202.136]:35287 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbeCTGcb (ORCPT ); Tue, 20 Mar 2018 02:32:31 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2K6W8At031455; Mon, 19 Mar 2018 23:32:08 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2K6W8q0031452; Mon, 19 Mar 2018 23:32:08 -0700 Date: Mon, 19 Mar 2018 23:32:08 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: eranian@google.com, alexander.shishkin@linux.intel.com, dsahern@gmail.com, acme@redhat.com, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, peterz@infradead.org, namhyung@kernel.org Reply-To: peterz@infradead.org, namhyung@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, tglx@linutronix.de, mingo@kernel.org, acme@redhat.com, dsahern@gmail.com, eranian@google.com, alexander.shishkin@linux.intel.com In-Reply-To: <20180314092205.23291-1-jolsa@kernel.org> References: <20180314092205.23291-1-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf record: Synthesize features before events in pipe mode Git-Commit-ID: a2015516c5c0be932a69e1d3405c2fb03b4eacf1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a2015516c5c0be932a69e1d3405c2fb03b4eacf1 Gitweb: https://git.kernel.org/tip/a2015516c5c0be932a69e1d3405c2fb03b4eacf1 Author: Jiri Olsa AuthorDate: Wed, 14 Mar 2018 10:22:04 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 16 Mar 2018 13:56:50 -0300 perf record: Synthesize features before events in pipe mode We need to synthesize events first, because some features works on top of them (on report side). Signed-off-by: Jiri Olsa Tested-by: Stephane Eranian Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180314092205.23291-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index d33103291b02..22ebeb92ac51 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -754,13 +754,10 @@ static int record__synthesize(struct record *rec, bool tail) return 0; if (data->is_pipe) { - err = perf_event__synthesize_features( - tool, session, rec->evlist, process_synthesized_event); - if (err < 0) { - pr_err("Couldn't synthesize features.\n"); - return err; - } - + /* + * We need to synthesize events first, because some + * features works on top of them (on report side). + */ err = perf_event__synthesize_attrs(tool, session, process_synthesized_event); if (err < 0) { @@ -768,6 +765,13 @@ static int record__synthesize(struct record *rec, bool tail) goto out; } + err = perf_event__synthesize_features(tool, session, rec->evlist, + process_synthesized_event); + if (err < 0) { + pr_err("Couldn't synthesize features.\n"); + return err; + } + if (have_tracepoints(&rec->evlist->entries)) { /* * FIXME err <= 0 here actually means that