From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753856AbbJTHuS (ORCPT ); Tue, 20 Oct 2015 03:50:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48401 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753316AbbJTHuO (ORCPT ); Tue, 20 Oct 2015 03:50:14 -0400 Date: Tue, 20 Oct 2015 00:49:58 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, acme@redhat.com, kan.liang@intel.com, dsahern@gmail.com, hpa@zytor.com, namhyung@kernel.org, mingo@kernel.org Reply-To: hpa@zytor.com, kan.liang@intel.com, dsahern@gmail.com, namhyung@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, acme@redhat.com In-Reply-To: <1444992092-17897-51-git-send-email-jolsa@kernel.org> References: <1444992092-17897-51-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Check output fields only for samples Git-Commit-ID: d2b5a315ae84d235f00761468885c466f81d7805 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d2b5a315ae84d235f00761468885c466f81d7805 Gitweb: http://git.kernel.org/tip/d2b5a315ae84d235f00761468885c466f81d7805 Author: Jiri Olsa AuthorDate: Fri, 16 Oct 2015 12:41:25 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 19 Oct 2015 18:05:59 -0300 perf script: Check output fields only for samples There's no need to check sampling output fields for events without perf_event_attr::sample_type field set. Signed-off-by: Jiri Olsa Tested-by: Kan Liang Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1444992092-17897-51-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 8ce1c6b..2653c02 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -686,7 +686,10 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, set_print_ip_opts(&evsel->attr); - return perf_evsel__check_attr(evsel, scr->session); + if (evsel->attr.sample_type) + err = perf_evsel__check_attr(evsel, scr->session); + + return err; } static int process_comm_event(struct perf_tool *tool,