Received: by 10.213.65.68 with SMTP id h4csp865439imn; Wed, 14 Mar 2018 02:26:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELt9jsPeqKW3t88MFDwzoeIdh4psCviQFH+a944PhGKOEKFYKQ8FQhwNP+OHIwMq1B59sz86 X-Received: by 2002:a17:902:9a45:: with SMTP id x5-v6mr3398104plv.18.1521019561217; Wed, 14 Mar 2018 02:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521019561; cv=none; d=google.com; s=arc-20160816; b=Sm/68W00DmJ9h056ybsV+1dKb7atB64IzDz3sqxVPXgU5VivzyNBjDPAcMzXo0/JNp XRQqbGEIXdNUztkqcSEPa3VKk2EW+8NVDzjtBgxDQMf1UbEbBqQ2khjZWh/8SNc1PLR7 AaTQTHDLdikKL/L9pukbu415URV49z6xTMFWjuFCTognWxzc9Tyn3ipNcpBCO0HZAKqA 37DF7YG9akbASoUb0Rnp7FpkEid2MAMFVpaH9gEjYrnDs94uuy9WnivRJnLUak6x0pf9 huOZEvmG3/XUbaIr7+x/WlCnlomAV50NTspkJnvPCbZ6ep0EY2kIgDDuXTaZ8+t84KYe faHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iF5wEJp+3OGJ3c900l2+aFvxQWodFdIOuUb91mSFyGI=; b=cX/+8XZHoLTZmzGV8XCnZzxRzLRJC/I1owUUuTUA/qMxRyjkN46GerLU93096IDHUg WJjIwwE8vARbdSJZ64wQr6lXTr5NDVPhjk35x/CVFjRw0q4f4JUpybPeWhJUSfezPAxi ESDvOqy36zmtdQZsO7rnQrTetp04/JyWHKQxbgaEgZbRpOAA1kjTlh161y9v8Bts3MJn xxVYuwOlvn3t2EfQgn2PUPQW/j2var3G/H++8Hl5bM9KxlFCFKHj1ElOw4aQVAR88EgO FtE8ZahP9/vCYaAXZKtgQmHo7NyegmBw3d+O6hYaoq+MjUcYMP0ccC2hDAbRZjzk4P1l YccA== 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 c22si1769501pfl.371.2018.03.14.02.25.47; Wed, 14 Mar 2018 02:26:01 -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 S1751966AbeCNJWL (ORCPT + 99 others); Wed, 14 Mar 2018 05:22:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49540 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751399AbeCNJWI (ORCPT ); Wed, 14 Mar 2018 05:22:08 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 85EC04040859; Wed, 14 Mar 2018 09:22:07 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id D82F650333; Wed, 14 Mar 2018 09:22:05 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Alexander Shishkin , Peter Zijlstra , Stephane Eranian Subject: [PATCH 1/2] perf record: Synthesize features before events in pipe mode Date: Wed, 14 Mar 2018 10:22:04 +0100 Message-Id: <20180314092205.23291-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 09:22:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 09:22:07 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@kernel.org' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to synthesize events first, because some features works on top of them (on report side). Link: http://lkml.kernel.org/n/tip-vz436m6fobfz8ykmuxo8phyy@git.kernel.org Signed-off-by: Jiri Olsa --- 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 -- 2.13.6