aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2010-12-05 21:37:04 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-12-06 12:12:34 -0500
commit1437a30aae865d83c7d96e3401f503a73fffe14d (patch)
treea61ca4af883961b41a6e621668fcb029a308df9e
parent9c90a61c7e4286aa5a38b314a2d8f5a1e70b5135 (diff)
perf hist: Better displaying of unresolved DSOs and symbols
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 Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <1291603026-11785-2-git-send-email-imunsie@au1.ibm.com> Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/sort.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b62a553cc67d..f44fa541d56e 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,
170 return repsep_snprintf(bf, size, "%-*s", width, dso_name); 170 return repsep_snprintf(bf, size, "%-*s", width, dso_name);
171 } 171 }
172 172
173 return repsep_snprintf(bf, size, "%*Lx", width, self->ip); 173 return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
174} 174}
175 175
176/* --sort symbol */ 176/* --sort symbol */
@@ -196,7 +196,7 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
196 196
197 if (verbose) { 197 if (verbose) {
198 char o = self->ms.map ? dso__symtab_origin(self->ms.map->dso) : '!'; 198 char o = self->ms.map ? dso__symtab_origin(self->ms.map->dso) : '!';
199 ret += repsep_snprintf(bf, size, "%*Lx %c ", 199 ret += repsep_snprintf(bf, size, "%-#*llx %c ",
200 BITS_PER_LONG / 4, self->ip, o); 200 BITS_PER_LONG / 4, self->ip, o);
201 } 201 }
202 202
@@ -205,7 +205,7 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
205 ret += repsep_snprintf(bf + ret, size - ret, "%s", 205 ret += repsep_snprintf(bf + ret, size - ret, "%s",
206 self->ms.sym->name); 206 self->ms.sym->name);
207 else 207 else
208 ret += repsep_snprintf(bf + ret, size - ret, "%*Lx", 208 ret += repsep_snprintf(bf + ret, size - ret, "%-#*llx",
209 BITS_PER_LONG / 4, self->ip); 209 BITS_PER_LONG / 4, self->ip);
210 210
211 return ret; 211 return ret;