aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-report.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index b84aaf18bf1f..270e986c2d42 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -201,7 +201,9 @@ static struct thread *thread__new(pid_t pid)
201 201
202 if (self != NULL) { 202 if (self != NULL) {
203 self->pid = pid; 203 self->pid = pid;
204 self->comm = NULL; 204 self->comm = malloc(30);
205 if (self->comm)
206 sprintf(self->comm, ":%d", pid);
205 INIT_LIST_HEAD(&self->maps); 207 INIT_LIST_HEAD(&self->maps);
206 } 208 }
207 209
@@ -333,7 +335,7 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
333static size_t 335static size_t
334sort__comm_print(FILE *fp, struct hist_entry *self) 336sort__comm_print(FILE *fp, struct hist_entry *self)
335{ 337{
336 return fprintf(fp, " %16s", self->thread->comm ?: "<unknown>"); 338 return fprintf(fp, " %16s", self->thread->comm);
337} 339}
338 340
339static struct sort_entry sort_comm = { 341static struct sort_entry sort_comm = {
@@ -363,7 +365,10 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
363static size_t 365static size_t
364sort__dso_print(FILE *fp, struct hist_entry *self) 366sort__dso_print(FILE *fp, struct hist_entry *self)
365{ 367{
366 return fprintf(fp, " %-25s", self->dso ? self->dso->name : "<unknown>"); 368 if (self->dso)
369 return fprintf(fp, " %-25s", self->dso->name);
370
371 return fprintf(fp, " %016llx", (__u64)self->ip);
367} 372}
368 373
369static struct sort_entry sort_dso = { 374static struct sort_entry sort_dso = {
@@ -392,11 +397,17 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
392 size_t ret = 0; 397 size_t ret = 0;
393 398
394 if (verbose) 399 if (verbose)
395 ret += fprintf(fp, " %#018llx", (unsigned long long)self->ip); 400 ret += fprintf(fp, " %#018llx", (__u64)self->ip);
401
402 if (self->dso)
403 ret += fprintf(fp, " %s: ", self->dso->name);
404 else
405 ret += fprintf(fp, " %#016llx: ", (__u64)self->ip);
396 406
397 ret += fprintf(fp, " %s: %s", 407 if (self->sym)
398 self->dso ? self->dso->name : "<unknown>", 408 ret += fprintf(fp, "%s", self->sym->name);
399 self->sym ? self->sym->name : "<unknown>"); 409 else
410 ret += fprintf(fp, "%#016llx", (__u64)self->ip);
400 411
401 return ret; 412 return ret;
402} 413}
@@ -772,7 +783,8 @@ more:
772 event->mmap.filename); 783 event->mmap.filename);
773 } 784 }
774 if (thread == NULL || map == NULL) { 785 if (thread == NULL || map == NULL) {
775 fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n"); 786 if (verbose)
787 fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n");
776 goto broken_event; 788 goto broken_event;
777 } 789 }
778 thread__insert_map(thread, map); 790 thread__insert_map(thread, map);