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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1259006629-13696-1-git-send-email-acme@infradead.org>
Date:	Mon, 23 Nov 2009 18:03:49 -0200
From:	Arnaldo Carvalho de Melo <acme@...radead.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>
Subject: [PATCH 1/1] perf top: Always show the DSO column, even if its all the same

From: Arnaldo Carvalho de Melo <acme@...hat.com>

Ingo found it confusing, and I agree with that, for 'perf report' its OK
because it is static, but for a tool refreshing it the eventual switch
from column to summary at the top may seem confusing.

Suggested-by: Ingo Molnar <mingo@...e.hu>
Cc: Frédéric Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-top.c |   38 +++++++++++---------------------------
 1 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 6a5de90..b9a321f 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -451,9 +451,8 @@ static void print_sym_table(void)
 	struct sym_entry *syme, *n;
 	struct rb_root tmp = RB_ROOT;
 	struct rb_node *nd;
-	int sym_width = 0, dso_width = 0;
+	int sym_width = 0, dso_width = 0, max_dso_width;
 	const int win_width = winsize.ws_col - 1;
-	struct dso *unique_dso = NULL, *first_dso = NULL;
 
 	samples = userspace_samples = 0;
 
@@ -539,11 +538,6 @@ static void print_sym_table(void)
 		    (int)syme->snap_count < count_filter)
 			continue;
 
-		if (first_dso == NULL)
-			unique_dso = first_dso = syme->map->dso;
-		else if (syme->map->dso != first_dso)
-			unique_dso = NULL;
-
 		if (syme->map->dso->long_name_len > dso_width)
 			dso_width = syme->map->dso->long_name_len;
 
@@ -553,14 +547,10 @@ static void print_sym_table(void)
 
 	printed = 0;
 
-	if (unique_dso)
-		printf("DSO: %s\n", unique_dso->long_name);
-	else {
-		int max_dso_width = winsize.ws_col - sym_width - 29;
-		if (dso_width > max_dso_width)
-			dso_width = max_dso_width;
-		putchar('\n');
-	}
+	max_dso_width = winsize.ws_col - sym_width - 29;
+	if (dso_width > max_dso_width)
+		dso_width = max_dso_width;
+	putchar('\n');
 	if (nr_counters == 1)
 		printf("             samples  pcnt");
 	else
@@ -568,17 +558,13 @@ static void print_sym_table(void)
 
 	if (verbose)
 		printf("         RIP       ");
-	printf(" %-*.*s", sym_width, sym_width, "function");
-	if (!unique_dso)
-		printf(" DSO");
-	putchar('\n');
+	printf(" %-*.*s DSO\n", sym_width, sym_width, "function");
 	printf("   %s    _______ _____",
 	       nr_counters == 1 ? "      " : "______");
 	if (verbose)
 		printf(" ________________");
 	printf(" %-*.*s", sym_width, sym_width, graph_line);
-	if (!unique_dso)
-		printf(" %-*.*s", dso_width, dso_width, graph_line);
+	printf(" %-*.*s", dso_width, dso_width, graph_line);
 	puts("\n");
 
 	for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
@@ -603,12 +589,10 @@ static void print_sym_table(void)
 		if (verbose)
 			printf(" %016llx", sym->start);
 		printf(" %-*.*s", sym_width, sym_width, sym->name);
-		if (!unique_dso)
-			printf(" %-*.*s", dso_width, dso_width,
-			       dso_width >= syme->map->dso->long_name_len ?
-						syme->map->dso->long_name :
-						syme->map->dso->short_name);
-		printf("\n");
+		printf(" %-*.*s\n", dso_width, dso_width,
+		       dso_width >= syme->map->dso->long_name_len ?
+					syme->map->dso->long_name :
+					syme->map->dso->short_name);
 	}
 }
 
-- 
1.6.2.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