Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030996AbcJ0Ul3 (ORCPT ); Thu, 27 Oct 2016 16:41:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:37609 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964857AbcJ0UlY (ORCPT ); Thu, 27 Oct 2016 16:41:24 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andi Kleen , Jiri Olsa , Arnaldo Carvalho de Melo Subject: [PATCH 09/15] perf list: Support matching by topic Date: Thu, 27 Oct 2016 18:40:49 -0200 Message-Id: <1477600855-27580-10-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477600855-27580-1-git-send-email-acme@kernel.org> References: <1477600855-27580-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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1893 Lines: 51 From: Andi Kleen Add support in perf list topic to only show events belonging to a specific vendor events topic. For example the following works now: % perf list frontend List of pre-defined events (to be used in -e): stalled-cycles-frontend OR idle-cycles-frontend [Hardware event] stalled-cycles-frontend OR cpu/stalled-cycles-frontend/ [Kernel PMU event] frontend: dsb2mite_switches.count [Decode Stream Buffer (DSB)-to-MITE switches] dsb2mite_switches.penalty_cycles [Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles] dsb_fill.exceed_dsb_lines [Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB) lines] icache.hit [Number of Instruction Cache, Streaming Buffer and Victim Cache Reads. both cacheable and noncacheable, including UC fetches] ... Signed-off-by: Andi Kleen Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1476902724-9586-2-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/pmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 31b845ec32e2..dc6ccaa4e927 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -1141,7 +1141,9 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, if (event_glob != NULL && !(strglobmatch_nocase(name, event_glob) || (!is_cpu && strglobmatch_nocase(alias->name, - event_glob)))) + event_glob)) || + (alias->topic && + strglobmatch_nocase(alias->topic, event_glob)))) continue; if (is_cpu && !name_only && !alias->desc) -- 2.7.4