summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.c
diff options
context:
space:
mode:
authorJiri Olsa2014-04-09 20:54:29 +0200
committerJiri Olsa2014-04-28 13:43:33 +0200
commitcddcef607782966f1601808c17fe9c4c5f79f9f4 (patch)
tree651244dff025c51f8583c29d984ffd3dce63f5ab /tools/perf/util/machine.c
parentperf tools: Reference count map_groups objects (diff)
downloadkernel-qcow2-linux-cddcef607782966f1601808c17fe9c4c5f79f9f4.tar.gz
kernel-qcow2-linux-cddcef607782966f1601808c17fe9c4c5f79f9f4.tar.xz
kernel-qcow2-linux-cddcef607782966f1601808c17fe9c4c5f79f9f4.zip
perf tools: Share map_groups among threads of the same group
Sharing map groups within all process threads. This way there's only one copy of mmap info and it's reachable from any thread within the process. Original-patch-by: Arnaldo Carvalho de Melo <acme@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-5-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r--tools/perf/util/machine.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index a53cd0b8c151..98ec56dc890b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -316,6 +316,17 @@ static struct thread *__machine__findnew_thread(struct machine *machine,
rb_link_node(&th->rb_node, parent, p);
rb_insert_color(&th->rb_node, &machine->threads);
machine->last_match = th;
+
+ /*
+ * We have to initialize map_groups separately
+ * after rb tree is updated.
+ *
+ * The reason is that we call machine__findnew_thread
+ * within thread__init_map_groups to find the thread
+ * leader and that would screwed the rb tree.
+ */
+ if (thread__init_map_groups(th, machine))
+ return NULL;
}
return th;