[PATCH 1/3] perf tool: Better displaying of unresolved DSOs and symbols

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ian Munsie
Date: Sunday, December 5, 2010 - 7:37 pm

From: Ian Munsie <imunsie@au1.ibm.com>

In the event that a DSO has not been identified, just print out
[unknown] instead of the instruction pointer as we previously were
doing, which is pretty meaningless for a shared object (at least to the
users perspective).

The IP we print out is fairly meaningless in general anyway - it's just
one (the first) of the many addresses that were lumped together as
unidentified, and could span many shared objects and symbols. In reality
if we see this [unknown] output then the report -D output is going to be
more useful anyway as we can see all the different address that it
represents.

If we are printing the symbols we are still going to see this IP in that
column anyway since they shouldn't resolve either.

This patch also changes the symbol address printouts so that they print
out 0x before the address, are left aligned, and changes the %L format
string (which relies on a glibc bug) to %ll.

Before:
    74.11%    :3259               4a6c  [k]     4a6c
After:
    74.11%    :3259  [unknown]          [k] 0x4a6c

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
---
 tools/perf/util/sort.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b62a553..f44fa54 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -170,7 +170,7 @@ static int hist_entry__dso_snprintf(struct hist_entry *self, char *bf,
 		return repsep_snprintf(bf, size, "%-*s", width, dso_name);
 	}
 
-	return repsep_snprintf(bf, size, "%*Lx", width, self->ip);
+	return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
 }
 
 /* --sort symbol */
@@ -196,7 +196,7 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
 
 	if (verbose) {
 		char o = self->ms.map ? dso__symtab_origin(self->ms.map->dso) : '!';
-		ret += repsep_snprintf(bf, size, "%*Lx %c ",
+		ret += repsep_snprintf(bf, size, "%-#*llx %c ",
 				       BITS_PER_LONG / 4, self->ip, o);
 	}
 
@@ -205,7 +205,7 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
 		ret += repsep_snprintf(bf + ret, size - ret, "%s",
 				       self->ms.sym->name);
 	else
-		ret += repsep_snprintf(bf + ret, size - ret, "%*Lx",
+		ret += repsep_snprintf(bf + ret, size - ret, "%-#*llx",
 				       BITS_PER_LONG / 4, self->ip);
 
 	return ret;
-- 
1.7.2.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL 0/5] perf/core: Support for PERF_SAMPLE_ in all ..., Arnaldo Carvalho de Melo, (Sat Dec 4, 3:26 pm)
[PATCH 3/5] perf events: Make sample_type identity fields ..., Arnaldo Carvalho de Melo, (Sat Dec 4, 3:26 pm)
[PATCH 4/5] perf session: Parse sample earlier, Arnaldo Carvalho de Melo, (Sat Dec 4, 3:26 pm)
[PATCH 5/5] perf tools: Ask for ID PERF_SAMPLE_ info on al ..., Arnaldo Carvalho de Melo, (Sat Dec 4, 3:26 pm)
[PATCH 1/3] perf tool: Better displaying of unresolved DSO ..., Ian Munsie, (Sun Dec 5, 7:37 pm)
[tip:perf/core] perf hist: Better displaying of unresolved ..., tip-bot for Ian Munsie, (Mon Dec 6, 11:56 pm)
[tip:perf/core] perf session: Sort all events if ordered_s ..., tip-bot for Thomas G ..., (Mon Dec 6, 11:57 pm)
Re: [PATCH 3/3] perf record/report: Process events in order, Arnaldo Carvalho de Melo, (Tue Dec 7, 3:54 am)