linux-stable/tools
Zechuan Chen 7ae6c39089 perf probe: Fix ppc64 'perf probe add events failed' case
commit 4624f19932 upstream.

Because of commit bf794bf52a ("powerpc/kprobes: Fix kallsyms
lookup across powerpc ABIv1 and ABIv2"), in ppc64 ABIv1, our perf
command eliminates the need to use the prefix "." at the symbol name.

But when the command "perf probe -a schedule" is executed on ppc64
ABIv1, it obtains two symbol address information through /proc/kallsyms,
for example:

  cat /proc/kallsyms | grep -w schedule
  c000000000657020 T .schedule
  c000000000d4fdb8 D schedule

The symbol "D schedule" is not a function symbol, and perf will print:
"p:probe/schedule _text+13958584"Failed to write event: Invalid argument

Therefore, when searching symbols from map and adding probe point for
them, a symbol type check is added. If the type of symbol is not a
function, skip it.

Fixes: bf794bf52a ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2")
Signed-off-by: Zechuan Chen <chenzechuan1@huawei.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jianlin Lv <Jianlin.Lv@arm.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20211228111338.218602-1-chenzechuan1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sudip: adjust context]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-16 12:51:45 +01:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-04-13 10:45:10 +02:00
arch ia64: tools: remove duplicate definition of ia64_mf() on ia64 2021-04-28 13:16:53 +02:00
bpf bpftool: Check malloc return value in mount_bpffs_for_pin 2021-07-28 11:13:48 +02:00
build tools build: Remove needless libpython-version feature check that breaks test-all fast path 2021-12-14 10:18:07 +01:00
cgroup
firewire
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:14:39 +02:00
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning 2019-09-10 10:33:50 +01:00
iio iio: iio-utils: Fix possible incorrect mask calculation 2019-07-31 07:27:02 +02:00
include tools headers UAPI: Sync linux/in.h copy with the kernel sources 2021-06-30 08:48:26 -04:00
kvm/kvm_stat tools/kvm_stat: Fix kvm_exit filter name 2020-02-11 04:34:08 -08:00
laptop
leds
lib bpf: Add BPF_F_ANY_ALIGNMENT. 2021-06-10 13:24:08 +02:00
memory-model
nfsd
objtool objtool: Don't fail on missing symbol table 2021-02-07 14:48:38 +01:00
pci tools: PCI: Fix broken pcitest compilation 2019-11-24 08:21:08 +01:00
pcmcia
perf perf probe: Fix ppc64 'perf probe add events failed' case 2022-02-16 12:51:45 +01:00
power tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:32:13 +01:00
scripts tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:32:13 +01:00
spi
testing selftests: futex: Use variable MAKE instead of make 2022-02-08 18:23:18 +01:00
thermal/tmon tools/thermal/tmon: Add cross compiling support 2021-09-22 11:47:59 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:11:03 +02:00
virtio
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-10-09 14:11:03 +02:00
wmi
Makefile