diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-21 16:29:02 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-29 08:32:46 -0400 |
commit | 11246c708acdfa9512d7b69c18938810c20fd6ab (patch) | |
tree | ef571dcfac1d69884897118276b36781bba53da3 /tools/perf/util/machine.c | |
parent | 7d073b335edc8d97af730c2e3b83ed6642bd3c27 (diff) |
perf tools: Set thread->mg.machine in all places
We were setting this only in machine__init(), i.e. for the map_groups that
holds the kernel module maps, not for the one used for a thread's executable
mmaps.
Now we are sure that we can obtain the machine where a thread is by going
via thread->mg->machine, thus we can, in the following patch, make all
codepaths that receive machine _and_ thread, drop the machine one.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-y6zgaqsvhrf04v57u15e4ybm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r-- | tools/perf/util/machine.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 34fc7c8672e4..c70b3ff7b289 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -21,7 +21,7 @@ static void dsos__init(struct dsos *dsos) | |||
21 | 21 | ||
22 | int machine__init(struct machine *machine, const char *root_dir, pid_t pid) | 22 | int machine__init(struct machine *machine, const char *root_dir, pid_t pid) |
23 | { | 23 | { |
24 | map_groups__init(&machine->kmaps); | 24 | map_groups__init(&machine->kmaps, machine); |
25 | RB_CLEAR_NODE(&machine->rb_node); | 25 | RB_CLEAR_NODE(&machine->rb_node); |
26 | dsos__init(&machine->user_dsos); | 26 | dsos__init(&machine->user_dsos); |
27 | dsos__init(&machine->kernel_dsos); | 27 | dsos__init(&machine->kernel_dsos); |
@@ -32,7 +32,6 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid) | |||
32 | 32 | ||
33 | machine->vdso_info = NULL; | 33 | machine->vdso_info = NULL; |
34 | 34 | ||
35 | machine->kmaps.machine = machine; | ||
36 | machine->pid = pid; | 35 | machine->pid = pid; |
37 | 36 | ||
38 | machine->symbol_filter = NULL; | 37 | machine->symbol_filter = NULL; |
@@ -319,7 +318,7 @@ static void machine__update_thread_pid(struct machine *machine, | |||
319 | goto out_err; | 318 | goto out_err; |
320 | 319 | ||
321 | if (!leader->mg) | 320 | if (!leader->mg) |
322 | leader->mg = map_groups__new(); | 321 | leader->mg = map_groups__new(machine); |
323 | 322 | ||
324 | if (!leader->mg) | 323 | if (!leader->mg) |
325 | goto out_err; | 324 | goto out_err; |