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 dwarf unwind 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>
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-2-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
bdaba8ae 5dcf16df

+2 -6
+2 -6
tools/perf/tests/dwarf-unwind.c
··· 160 160 161 161 int test__dwarf_unwind(int subtest __maybe_unused) 162 162 { 163 - struct machines machines; 164 163 struct machine *machine; 165 164 struct thread *thread; 166 165 int err = -1; 167 166 168 - machines__init(&machines); 169 - 170 - machine = machines__find(&machines, HOST_KERNEL_ID); 167 + machine = machine__new_host(); 171 168 if (!machine) { 172 169 pr_err("Could not get machine\n"); 173 170 return -1; ··· 196 199 197 200 out: 198 201 machine__delete_threads(machine); 199 - machine__exit(machine); 200 - machines__exit(&machines); 202 + machine__delete(machine); 201 203 return err; 202 204 }