diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-12-03 03:34:13 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-12-07 16:12:54 -0500 |
commit | 046847935754f27c2e8334ff15abda0b733a1fd4 (patch) | |
tree | 2cfe4139c84197358b3fdaf8ca48b01199c52c54 /tools | |
parent | bdaba8aee5c3806d78ee4f130048b2238c636d47 (diff) |
perf test: Use machine__new_host in mmap thread lookup test
This is more straightforward than what we have now.
It also fixes a segfault within machine__exit, that's caused by not
creating kernel maps for machine.. We're calling
machine__destroy_kernel_maps in machine__exit since commit:
ebe9729c8c31 perf machine: Fix to destroy kernel maps when machine exits
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1449131658-1841-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/tests/mmap-thread-lookup.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c index 6cdb97579c45..0c5ce44f723f 100644 --- a/tools/perf/tests/mmap-thread-lookup.c +++ b/tools/perf/tests/mmap-thread-lookup.c | |||
@@ -149,7 +149,6 @@ static int synth_process(struct machine *machine) | |||
149 | 149 | ||
150 | static int mmap_events(synth_cb synth) | 150 | static int mmap_events(synth_cb synth) |
151 | { | 151 | { |
152 | struct machines machines; | ||
153 | struct machine *machine; | 152 | struct machine *machine; |
154 | int err, i; | 153 | int err, i; |
155 | 154 | ||
@@ -162,8 +161,7 @@ static int mmap_events(synth_cb synth) | |||
162 | */ | 161 | */ |
163 | TEST_ASSERT_VAL("failed to create threads", !threads_create()); | 162 | TEST_ASSERT_VAL("failed to create threads", !threads_create()); |
164 | 163 | ||
165 | machines__init(&machines); | 164 | machine = machine__new_host(); |
166 | machine = &machines.host; | ||
167 | 165 | ||
168 | dump_trace = verbose > 1 ? 1 : 0; | 166 | dump_trace = verbose > 1 ? 1 : 0; |
169 | 167 | ||
@@ -203,7 +201,7 @@ static int mmap_events(synth_cb synth) | |||
203 | } | 201 | } |
204 | 202 | ||
205 | machine__delete_threads(machine); | 203 | machine__delete_threads(machine); |
206 | machines__exit(&machines); | 204 | machine__delete(machine); |
207 | return err; | 205 | return err; |
208 | } | 206 | } |
209 | 207 | ||