lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  2 Jun 2015 10:12:09 -0700
From:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To:	mingo@...hat.com, ak@...ux.intel.com,
	Michael Ellerman <mpe@...erman.id.au>,
	Jiri Olsa <jolsa@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	namhyung@...nel.org, linuxppc-dev@...ts.ozlabs.org,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH v13 09/14] perf, tools: Group alias perf list by section

From: Andi Kleen <ak@...ux.intel.com>

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 <ak@...ux.intel.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ