Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147661
b: refs/heads/master
c: 9ac9954
h: refs/heads/master
i:
  147659: eb3dfb6
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jun 4, 2009
1 parent 3813d6d commit 3dbf987
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f5486b5c71a831a713ce356d8d06822e3c7c379
refs/heads/master: 9ac995457b2a148ed9bb8860e8b7cb869327b102
36 changes: 36 additions & 0 deletions trunk/Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ static int map__overlap(struct map *l, struct map *r)
return 0;
}

static size_t map__fprintf(struct map *self, FILE *fp)
{
return fprintf(fp, " %lx-%lx %lx %s\n",
self->start, self->end, self->pgoff, self->dso->name);
}


struct thread {
struct rb_node rb_node;
struct list_head maps;
Expand Down Expand Up @@ -264,6 +271,18 @@ static int thread__set_comm(struct thread *self, const char *comm)
return self->comm ? 0 : -ENOMEM;
}

static size_t thread__fprintf(struct thread *self, FILE *fp)
{
struct map *pos;
size_t ret = fprintf(fp, "Thread %d %s\n", self->pid, self->comm);

list_for_each_entry(pos, &self->maps, node)
ret += map__fprintf(pos, fp);

return ret;
}


static struct rb_root threads;
static struct thread *last_match;

Expand Down Expand Up @@ -355,6 +374,20 @@ static struct map *thread__find_map(struct thread *self, uint64_t ip)
return NULL;
}

static size_t threads__fprintf(FILE *fp)
{
size_t ret = 0;
struct rb_node *nd;

for (nd = rb_first(&threads); nd; nd = rb_next(nd)) {
struct thread *pos = rb_entry(nd, struct thread, rb_node);

ret += thread__fprintf(pos, fp);
}

return ret;
}

/*
* histogram, sorted on item, collects counts
*/
Expand Down Expand Up @@ -1126,6 +1159,9 @@ static int __cmd_report(void)
if (dump_trace)
return 0;

if (verbose >= 3)
threads__fprintf(stdout);

if (verbose >= 2)
dsos__fprintf(stdout);

Expand Down

0 comments on commit 3dbf987

Please sign in to comment.