diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-12-03 09:34:13 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-12-07 22:12:54 +0100 |
commit | 046847935754f27c2e8334ff15abda0b733a1fd4 (patch) | |
tree | 2cfe4139c84197358b3fdaf8ca48b01199c52c54 /tools/perf/tests/mmap-thread-lookup.c | |
parent | perf test: Use machine__new_host in dwarf unwind test (diff) | |
download | linux-046847935754f27c2e8334ff15abda0b733a1fd4.tar.xz linux-046847935754f27c2e8334ff15abda0b733a1fd4.zip |
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/perf/tests/mmap-thread-lookup.c')
-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) static int mmap_events(synth_cb synth) { - struct machines machines; struct machine *machine; int err, i; @@ -162,8 +161,7 @@ static int mmap_events(synth_cb synth) */ TEST_ASSERT_VAL("failed to create threads", !threads_create()); - machines__init(&machines); - machine = &machines.host; + machine = machine__new_host(); dump_trace = verbose > 1 ? 1 : 0; @@ -203,7 +201,7 @@ static int mmap_events(synth_cb synth) } machine__delete_threads(machine); - machines__exit(&machines); + machine__delete(machine); return err; } |