Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147616
b: refs/heads/master
c: 0a520c6
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jun 2, 2009
1 parent dc50df1 commit 0ba89ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cf165fc2e7f221a7a95098b47eb990779e29f5f
refs/heads/master: 0a520c63e1625b92ef775da40192e1542910e7f6
28 changes: 20 additions & 8 deletions trunk/Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ static struct thread *thread__new(pid_t pid)

if (self != NULL) {
self->pid = pid;
self->comm = NULL;
self->comm = malloc(30);
if (self->comm)
sprintf(self->comm, ":%d", pid);
INIT_LIST_HEAD(&self->maps);
}

Expand Down Expand Up @@ -333,7 +335,7 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
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 = {
Expand Down Expand Up @@ -363,7 +365,10 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
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 = {
Expand Down Expand Up @@ -392,11 +397,17 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
size_t ret = 0;

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",
self->dso ? self->dso->name : "<unknown>",
self->sym ? self->sym->name : "<unknown>");
if (self->sym)
ret += fprintf(fp, "%s", self->sym->name);
else
ret += fprintf(fp, "%#016llx", (__u64)self->ip);

return ret;
}
Expand Down Expand Up @@ -772,7 +783,8 @@ static int __cmd_report(void)
event->mmap.filename);
}
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;
}
thread__insert_map(thread, map);
Expand Down

0 comments on commit 0ba89ce

Please sign in to comment.