From: Greg Kroah-Hartman Date: Sat, 12 Feb 2022 10:49:44 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.9.302~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19d300da0a9e01e2513c795c155ccb54f26293c2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch --- diff --git a/queue-4.19/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch b/queue-4.19/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch new file mode 100644 index 00000000000..9eea3c6ec96 --- /dev/null +++ b/queue-4.19/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch @@ -0,0 +1,64 @@ +From 4624f199327a704dd1069aca1c3cadb8f2a28c6f Mon Sep 17 00:00:00 2001 +From: Zechuan Chen +Date: Tue, 28 Dec 2021 19:13:38 +0800 +Subject: perf probe: Fix ppc64 'perf probe add events failed' case + +From: Zechuan Chen + +commit 4624f199327a704dd1069aca1c3cadb8f2a28c6f upstream. + +Because of commit bf794bf52a80c627 ("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: bf794bf52a80c627 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2") +Signed-off-by: Zechuan Chen +Acked-by: Masami Hiramatsu +Cc: Alexander Shishkin +Cc: Ingo Molnar +Cc: Jianlin Lv +Cc: Jin Yao +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Michael Ellerman +Cc: Namhyung Kim +Cc: Naveen N. Rao +Cc: Peter Zijlstra +Cc: Ravi Bangoria +Cc: Yang Jihong +Link: https://lore.kernel.org/r/20211228111338.218602-1-chenzechuan1@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +[sudip: adjust context] +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/probe-event.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/perf/util/probe-event.c ++++ b/tools/perf/util/probe-event.c +@@ -2919,6 +2919,9 @@ static int find_probe_trace_events_from_ + for (j = 0; j < num_matched_functions; j++) { + sym = syms[j]; + ++ if (sym->type != STT_FUNC) ++ continue; ++ + tev = (*tevs) + ret; + tp = &tev->point; + if (ret == num_matched_functions) { diff --git a/queue-4.19/series b/queue-4.19/series index 8c2b84332ae..c85da389298 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -18,3 +18,4 @@ net-stmmac-dwmac-sun8i-use-return-val-of-readl_poll_.patch bpf-add-kconfig-knob-for-disabling-unpriv-bpf-by-default.patch arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch net-bridge-fix-stale-eth-hdr-pointer-in-br_dev_xmit.patch +perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch