Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891AbbHRQms (ORCPT ); Tue, 18 Aug 2015 12:42:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:35956 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753738AbbHRQlY (ORCPT ); Tue, 18 Aug 2015 12:41:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,702,1432623600"; d="scan'208";a="786447424" From: kan.liang@intel.com To: acme@kernel.org Cc: a.p.zijlstra@chello.nl, mingo@redhat.com, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, eranian@google.com, linux-kernel@vger.kernel.org, Kan Liang Subject: [PATCH RFC 09/10] perf,tools: don't validate non-sample event Date: Tue, 18 Aug 2015 05:25:45 -0400 Message-Id: <1439889946-28986-10-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1439889946-28986-1-git-send-email-kan.liang@intel.com> References: <1439889946-28986-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 49 From: Kan Liang Stat event (:N) doesn't do sampling. So perf tool should not validate its sample_type, read_format and sample_id_all. Signed-off-by: Kan Liang --- tools/perf/util/evlist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ca7bf8d..fc2da23 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1249,6 +1249,8 @@ bool perf_evlist__valid_sample_type(struct perf_evlist *evlist) return false; evlist__for_each(evlist, pos) { + if (!pos->attr.sample_type) + continue; if (pos->id_pos != evlist->id_pos || pos->is_pos != evlist->is_pos) return false; @@ -1293,6 +1295,8 @@ bool perf_evlist__valid_read_format(struct perf_evlist *evlist) u64 sample_type = first->attr.sample_type; evlist__for_each(evlist, pos) { + if (!pos->attr.sample_type) + continue; if (read_format != pos->attr.read_format) return false; } @@ -1350,6 +1354,8 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist) struct perf_evsel *first = perf_evlist__first(evlist), *pos = first; evlist__for_each_continue(evlist, pos) { + if (!pos->attr.sample_type) + continue; if (first->attr.sample_id_all != pos->attr.sample_id_all) return false; } -- 1.8.3.1 -- 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/