android_kernel_oneplus_msm8998/tools
Jiri Olsa 56973cff1a perf tests: Use arch__compare_symbol_names to compare symbols
[ Upstream commit ab6e9a99345131cd8e54268d1d0dc04a33f7ed11 ]

The symbol search called by machine__find_kernel_symbol_by_name is using
internally arch__compare_symbol_names function to compare 2 symbol
names, because different archs have different ways of comparing symbols.
Mostly for skipping '.' prefixes and similar.

In test 1 when we try to find matching symbols in kallsyms and vmlinux,
by address and by symbol name. When either is found we compare the pair
symbol names  by simple strcmp, which is not good enough for reasons
explained in previous paragraph.

On powerpc this can cause lockup, because even thought we found the
pair, the compared names are different and don't match simple strcmp.
Following code path is executed, that leads to lockup:

   - we find the pair in kallsyms by sym->start
next_pair:
   - we compare the names and it fails
   - we find the pair by sym->name
   - the pair addresses match so we call goto next_pair
     because we assume the names match in this case

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 031b84c407 ("perf probe ppc: Enable matching against dot symbols automatically")
Link: http://lkml.kernel.org/r/20180215122635.24029-10-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:49:16 +02:00
..
arch tools include: Add basic atomic.h implementation from the kernel sources 2015-05-08 16:11:05 -03:00
build tools build: Add tools tree support for 'make -s' 2018-02-25 11:03:43 +01:00
cgroup cgroups: fix cgroup_event_listener error handling 2013-01-08 10:00:44 -08:00
firewire tools/firewire: nosy-dump: check for allocation failure 2012-12-02 20:10:18 +01:00
hv hv: kvp: Avoid reading past allocated blocks from KVP file 2017-12-16 10:33:48 +01:00
iio iio: generic_buffer: be helpful about enabling channels 2015-08-16 10:51:26 +01:00
include tools include: Add a __fallthrough statement 2017-07-15 11:57:47 +02:00
laptop/freefall Move freefall program from Documentation/ to tools/ 2015-06-08 16:42:07 -06:00
lguest tools/lguest: Clean up include dir 2015-08-26 06:12:35 +02:00
lib tools/libbpf: handle issues with bpf ELF objects containing .eh_frames 2018-05-30 07:48:57 +02:00
net tools/net: Use include/uapi with __EXPORTED_HEADERS__ 2015-11-15 17:24:33 -05:00
nfsd NFSD: Added fault injection script 2011-11-07 21:10:47 -05:00
perf perf tests: Use arch__compare_symbol_names to compare symbols 2018-05-30 07:49:16 +02:00
power cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores 2017-05-14 13:32:54 +02:00
scripts tools build: Add tools tree support for 'make -s' 2018-02-25 11:03:43 +01:00
testing selftests: Print the test we're running to /dev/kmsg 2018-05-30 07:49:10 +02:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:49:10 +02:00
time tools: add script to test udelay 2014-07-23 10:16:38 -07:00
usb tools/usbip: fixes build with musl libc toolchain 2018-03-22 09:23:28 +01:00
virtio tools/virtio: fix byteswap logic 2015-12-07 17:28:10 +02:00
vm tools/vm/slabinfo: fix an unintentional printf 2016-10-07 15:23:41 +02:00
Makefile tools: Add a "make all" rule 2015-11-12 18:58:10 -03:00