Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
04684793 bdaba8ae

+2 -4
+2 -4
tools/perf/tests/mmap-thread-lookup.c
··· 149 149 150 150 static int mmap_events(synth_cb synth) 151 151 { 152 - struct machines machines; 153 152 struct machine *machine; 154 153 int err, i; 155 154 ··· 161 162 */ 162 163 TEST_ASSERT_VAL("failed to create threads", !threads_create()); 163 164 164 - machines__init(&machines); 165 - machine = &machines.host; 165 + machine = machine__new_host(); 166 166 167 167 dump_trace = verbose > 1 ? 1 : 0; 168 168 ··· 201 203 } 202 204 203 205 machine__delete_threads(machine); 204 - machines__exit(&machines); 206 + machine__delete(machine); 205 207 return err; 206 208 } 207 209