Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932588AbbGUMgP (ORCPT ); Tue, 21 Jul 2015 08:36:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56076 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932222AbbGUMdX (ORCPT ); Tue, 21 Jul 2015 08:33:23 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra Subject: [PATCH 40/47] perf script: Check output fields only for samples Date: Tue, 21 Jul 2015 14:32:00 +0200 Message-Id: <1437481927-29538-41-git-send-email-jolsa@kernel.org> In-Reply-To: <1437481927-29538-1-git-send-email-jolsa@kernel.org> References: <1437481927-29538-1-git-send-email-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1102 Lines: 34 There's no need to check sampling output fields for events without perf_event_attr::sample_type field set. Link: http://lkml.kernel.org/n/tip-uommbr3wo4913tpkkgq2sbvb@git.kernel.org Signed-off-by: Jiri Olsa --- 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 24809787369f..308c022ae918 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -650,7 +650,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, -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/