Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbbFBTUw (ORCPT ); Tue, 2 Jun 2015 15:20:52 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:51309 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbbFBTUo (ORCPT ); Tue, 2 Jun 2015 15:20:44 -0400 Date: Tue, 2 Jun 2015 12:20:02 -0700 From: Sukadev Bhattiprolu To: mingo@redhat.com, ak@linux.intel.com, Michael Ellerman , Jiri Olsa , Arnaldo Carvalho de Melo Cc: namhyung@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 09/14] perf, tools: Group alias perf list by section Message-ID: <20150602192002.GB3978@us.ibm.com> References: <1433265135-20426-1-git-send-email-sukadev@linux.vnet.ibm.com> <1433265135-20426-10-git-send-email-sukadev@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433265135-20426-10-git-send-email-sukadev@linux.vnet.ibm.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15060219-0033-0000-0000-000004B3492D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2679 Lines: 81 Please drop this patch. It was incorrectly included in the set. Also, see the updated Patch 12/14. Current set of patches are in the json-v13.1 branch: https://github.com/sukadev/linux/tree/json-v13.1 Sukadev Sukadev Bhattiprolu [sukadev@linux.vnet.ibm.com] wrote: | From: Andi Kleen | | The first first element in an hardware event name defines the general | area, usually the part of the micro architecture it is refering to. | Group the perf list output by these sections by adding section headers. | | Signed-off-by: Andi Kleen | Signed-off-by: Sukadev Bhattiprolu | --- | tools/perf/util/pmu.c | 17 +++++++++++++++++ | 1 file changed, 17 insertions(+) | | diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c | index 417333b..8d91fa7 100644 | --- a/tools/perf/util/pmu.c | +++ b/tools/perf/util/pmu.c | @@ -1039,6 +1039,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag) | struct pair *aliases; | int numdesc = 0; | int columns = pager_get_columns(); | + const char *last_section; | + int last_section_len; | | pmu = NULL; | len = 0; | @@ -1086,6 +1088,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag) | } | } | len = j; | + last_section = NULL; | + last_section_len = 0; | qsort(aliases, len, sizeof(struct pair), cmp_pair); | for (j = 0; j < len; j++) { | if (name_only) { | @@ -1093,8 +1097,21 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag) | continue; | } | if (aliases[j].desc && !quiet_flag) { | + char *dot; | + char *name = aliases[j].name; | + | if (numdesc++ == 0) | printf("\n"); | + dot = strchr(name, '.'); | + if (dot && | + (!last_section || | + strncmp(last_section, name, last_section_len))) { | + last_section_len = dot - name; | + printf("%s%.*s:\n", | + last_section ? "\n" : "", | + last_section_len, name); | + last_section = name; | + } | printf(" %-50s\n", aliases[j].name); | printf("%*s", 8, "["); | wordwrap(aliases[j].desc, 8, columns, 0); | -- | 1.7.9.5 | | -- | 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/ -- 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/