From patchwork Fri Feb 26 23:18:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 63115 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp126909lbc; Fri, 26 Feb 2016 15:18:59 -0800 (PST) X-Received: by 10.98.11.88 with SMTP id t85mr5721023pfi.98.1456528733889; Fri, 26 Feb 2016 15:18:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sp7si5896917pac.230.2016.02.26.15.18.53; Fri, 26 Feb 2016 15:18:53 -0800 (PST) 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 S1423264AbcBZXSv (ORCPT + 30 others); Fri, 26 Feb 2016 18:18:51 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:36071 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755193AbcBZXSo (ORCPT ); Fri, 26 Feb 2016 18:18:44 -0500 Received: from [187.65.76.58] (helo=jouet.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1aZRej-0003b1-2q; Fri, 26 Feb 2016 23:18:41 +0000 Received: by jouet.infradead.org (Postfix, from userid 1000) id 2D6BC1440BA; Fri, 26 Feb 2016 20:18:34 -0300 (BRT) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Wang Nan , Alexei Starovoitov , Jiri Olsa , Li Zefan , Peter Zijlstra , pi3orama@163.com, Arnaldo Carvalho de Melo Subject: [PATCH 17/19] perf tools: Only set filter for tracepoints events Date: Fri, 26 Feb 2016 20:18:29 -0300 Message-Id: <1456528711-13793-18-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456528711-13793-1-git-send-email-acme@kernel.org> References: <1456528711-13793-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Nan perf_evlist__set_filter() tries to set filter to every evsel linked in the evlist. However, since filters can only be applied to tracepoints, checking type of evsel before calling perf_evsel__set_filter() would be better. Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Jiri Olsa Cc: Li Zefan Cc: Peter Zijlstra Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1456479154-136027-6-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/evlist.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.5.0 diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index c42e1967e970..86a03836a83f 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1223,6 +1223,9 @@ int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter) int err = 0; evlist__for_each(evlist, evsel) { + if (evsel->attr.type != PERF_TYPE_TRACEPOINT) + continue; + err = perf_evsel__set_filter(evsel, filter); if (err) break;