Skip to contentSkip to conversation

perf top: Show RIP only in verbose mode

PATCH In review Arnaldo Carvalho de Melo 1 participant 2 messages Aug 26, 2009 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf top: Show RIP only in verbose mode

---
 tools/perf/builtin-top.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
tools/perf/builtin-top.c +12 -5
index 62b55ec..4002ccb 100644
@@ -483,11 +483,16 @@ static void print_sym_table(void)
 	if (nr_counters == 1)
 		printf("             samples    pcnt");
 	else
-		printf("  weight     samples    pcnt");
+		printf("   weight    samples    pcnt");
 
-	printf("         RIP          kernel function\n"
-	       	       "  ______     _______   _____   ________________   _______________\n\n"
-	);
+	if (verbose)
+		printf("         RIP       ");
+	printf("   kernel function\n");
+	printf("   %s    _______   _____",
+	       nr_counters == 1 ? "      " : "______");
+	if (verbose)
+		printf("   ________________");
+	printf("   _______________\n\n");
 
 	for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
 		struct symbol *sym;
@@ -508,7 +513,9 @@ static void print_sym_table(void)
 			printf("%9.1f %10ld - ", syme->weight, syme->snap_count);
 
 		percent_color_fprintf(stdout, "%4.1f%%", pcnt);
-		printf(" - %016llx : %s", sym->start, sym->name);
+		if (verbose)
+			printf(" - %016llx", sym->start);
+		printf(" : %s", sym->name);
 		if (sym->module)
 			printf("\t[%s]", sym->module->name);
 		printf("\n");
Signature · 1 line
1.6.2.5
#1 lore raw
Commit-ID:  7ced156bb8bb6363b6ed541871bf19a90273f910
Gitweb:     http://git.kernel.org/tip/7ced156bb8bb6363b6ed541871bf19a90273f910
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 26 Aug 2009 11:51:26 -0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 26 Aug 2009 20:21:45 +0200

perf top: Show RIP only in verbose mode

Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/builtin-top.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
tools/perf/builtin-top.c +12 -5
index 62b55ec..4002ccb 100644
@@ -483,11 +483,16 @@ static void print_sym_table(void)
 	if (nr_counters == 1)
 		printf("             samples    pcnt");
 	else
-		printf("  weight     samples    pcnt");
+		printf("   weight    samples    pcnt");
 
-	printf("         RIP          kernel function\n"
-	       	       "  ______     _______   _____   ________________   _______________\n\n"
-	);
+	if (verbose)
+		printf("         RIP       ");
+	printf("   kernel function\n");
+	printf("   %s    _______   _____",
+	       nr_counters == 1 ? "      " : "______");
+	if (verbose)
+		printf("   ________________");
+	printf("   _______________\n\n");
 
 	for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
 		struct symbol *sym;
@@ -508,7 +513,9 @@ static void print_sym_table(void)
 			printf("%9.1f %10ld - ", syme->weight, syme->snap_count);
 
 		percent_color_fprintf(stdout, "%4.1f%%", pcnt);
-		printf(" - %016llx : %s", sym->start, sym->name);
+		if (verbose)
+			printf(" - %016llx", sym->start);
+		printf(" : %s", sym->name);
 		if (sym->module)
 			printf("\t[%s]", sym->module->name);
 		printf("\n");