Commit 0a520c63 authored by Ingo Molnar's avatar Ingo Molnar

perf report: Print more info instead of <unknown> entries

Sometimes we still fail to find a DSO or look up a symbol,
print out the raw information in this case (which an help
debug the problem), instead of a not very helpful <unknown>
string.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3cf165fc
...@@ -201,7 +201,9 @@ static struct thread *thread__new(pid_t pid) ...@@ -201,7 +201,9 @@ static struct thread *thread__new(pid_t pid)
if (self != NULL) { if (self != NULL) {
self->pid = pid; self->pid = pid;
self->comm = NULL; self->comm = malloc(30);
if (self->comm)
sprintf(self->comm, ":%d", pid);
INIT_LIST_HEAD(&self->maps); INIT_LIST_HEAD(&self->maps);
} }
...@@ -333,7 +335,7 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right) ...@@ -333,7 +335,7 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t static size_t
sort__comm_print(FILE *fp, struct hist_entry *self) sort__comm_print(FILE *fp, struct hist_entry *self)
{ {
return fprintf(fp, " %16s", self->thread->comm ?: "<unknown>"); return fprintf(fp, " %16s", self->thread->comm);
} }
static struct sort_entry sort_comm = { static struct sort_entry sort_comm = {
...@@ -363,7 +365,10 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right) ...@@ -363,7 +365,10 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t static size_t
sort__dso_print(FILE *fp, struct hist_entry *self) sort__dso_print(FILE *fp, struct hist_entry *self)
{ {
return fprintf(fp, " %-25s", self->dso ? self->dso->name : "<unknown>"); if (self->dso)
return fprintf(fp, " %-25s", self->dso->name);
return fprintf(fp, " %016llx", (__u64)self->ip);
} }
static struct sort_entry sort_dso = { static struct sort_entry sort_dso = {
...@@ -392,11 +397,17 @@ sort__sym_print(FILE *fp, struct hist_entry *self) ...@@ -392,11 +397,17 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
size_t ret = 0; size_t ret = 0;
if (verbose) if (verbose)
ret += fprintf(fp, " %#018llx", (unsigned long long)self->ip); ret += fprintf(fp, " %#018llx", (__u64)self->ip);
if (self->dso)
ret += fprintf(fp, " %s: ", self->dso->name);
else
ret += fprintf(fp, " %#016llx: ", (__u64)self->ip);
ret += fprintf(fp, " %s: %s", if (self->sym)
self->dso ? self->dso->name : "<unknown>", ret += fprintf(fp, "%s", self->sym->name);
self->sym ? self->sym->name : "<unknown>"); else
ret += fprintf(fp, "%#016llx", (__u64)self->ip);
return ret; return ret;
} }
...@@ -772,7 +783,8 @@ static int __cmd_report(void) ...@@ -772,7 +783,8 @@ static int __cmd_report(void)
event->mmap.filename); event->mmap.filename);
} }
if (thread == NULL || map == NULL) { if (thread == NULL || map == NULL) {
fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n"); if (verbose)
fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n");
goto broken_event; goto broken_event;
} }
thread__insert_map(thread, map); thread__insert_map(thread, map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment