[tip:perfcounters/core] perf report: Add -vvv to print the list of threads and its mmaps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  9ac995457b2a148ed9bb8860e8b7cb869327b102
Gitweb:     http://git.kernel.org/tip/9ac995457b2a148ed9bb8860e8b7cb869327b102
Author:     Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
AuthorDate: Thu, 4 Jun 2009 13:54:00 -0300
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Thu, 4 Jun 2009 21:48:42 +0200

perf report: Add -vvv to print the list of threads and its mmaps

Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 Documentation/perf_counter/builtin-report.c |   36 +++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 5d19121..1a1028d 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -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;
@@ -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;
 
@@ -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
  */
@@ -1126,6 +1159,9 @@ more:
 	if (dump_trace)
 		return 0;
 
+	if (verbose >= 3)
+		threads__fprintf(stdout);
+
 	if (verbose >= 2)
 		dsos__fprintf(stdout);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux