From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757819AbcJSSNY (ORCPT ); Wed, 19 Oct 2016 14:13:24 -0400 Received: from mail.kernel.org ([198.145.29.136]:60596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757669AbcJSSNX (ORCPT ); Wed, 19 Oct 2016 14:13:23 -0400 Date: Wed, 19 Oct 2016 15:13:15 -0300 From: Arnaldo Carvalho de Melo To: Andi Kleen Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, Andi Kleen Subject: Re: [PATCH 2/2] perf, tools, list: Support matching by topic Message-ID: <20161019181315.GH25522@kernel.org> References: <1476899402-31460-1-git-send-email-andi@firstfloor.org> <1476899402-31460-2-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476899402-31460-2-git-send-email-andi@firstfloor.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Oct 19, 2016 at 10:50:02AM -0700, Andi Kleen escreveu: > 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 > --- > tools/perf/builtin-list.c | 6 ++++-- > tools/perf/util/pmu.c | 4 +++- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c > index 1095a6dada66..c00b0eb343c0 100644 > --- a/tools/perf/builtin-list.c > +++ b/tools/perf/builtin-list.c > @@ -67,9 +67,11 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) > print_symbol_events(NULL, PERF_TYPE_SOFTWARE, > event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); > else if (strcmp(argv[i], "cache") == 0 || > - strcmp(argv[i], "hwcache") == 0) > + strcmp(argv[i], "hwcache") == 0) { This is changing existing behaviour, please remove it. A separate patch could either make it show both hwcache events and vendor cache events, or you could make: perf list vendor cache Do what you expect. > print_hwcache_events(NULL, raw_dump); > - else if (strcmp(argv[i], "pmu") == 0) > + print_pmu_events(argv[i], raw_dump, !desc_flag, > + long_desc_flag, true); > + } else if (strcmp(argv[i], "pmu") == 0) > print_pmu_events(NULL, raw_dump, !desc_flag, > long_desc_flag, false); What is this here? > else if (strcmp(argv[i], "sdt") == 0) > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 101922b2a243..dc8eb30e8597 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -1142,7 +1142,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.5.5