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

perf unwind: Use find_map function in access_dso_mem

The find_map helper is already there, so let's use it.

Also we're going to introduce wider search in following patch, so it'll
be easier to make this change on single place.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-4-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
f22ed827 d2190a80

+5 -6
+5 -6
tools/perf/util/unwind-libunwind.c
··· 416 416 static int access_dso_mem(struct unwind_info *ui, unw_word_t addr, 417 417 unw_word_t *data) 418 418 { 419 - struct addr_location al; 419 + struct map *map; 420 420 ssize_t size; 421 421 422 - thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, 423 - MAP__FUNCTION, addr, &al); 424 - if (!al.map) { 422 + map = find_map(addr, ui); 423 + if (!map) { 425 424 pr_debug("unwind: no map for %lx\n", (unsigned long)addr); 426 425 return -1; 427 426 } 428 427 429 - if (!al.map->dso) 428 + if (!map->dso) 430 429 return -1; 431 430 432 - size = dso__data_read_addr(al.map->dso, al.map, ui->machine, 431 + size = dso__data_read_addr(map->dso, map, ui->machine, 433 432 addr, (u8 *) data, sizeof(*data)); 434 433 435 434 return !(size == sizeof(*data));