linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing/selftests: Ignore __pfx_ symbols in kprobe test
@ 2023-02-07 18:51 Steven Rostedt
  2023-02-07 18:54 ` Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Steven Rostedt @ 2023-02-07 18:51 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel
  Cc: Masami Hiramatsu, Shuah Khan, Shuah Khan, Peter Zijlstra

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The kprobe probepoint.tc test started failing because of the added __pfx_
symbols that were added because of -fpatchable-function-entry=X,Y causing
unwinders to see them as part of the previous functions. But kprobes can
not be added on top of them. The selftest looks for tracefs_create_dir and
picks it and the previous and following functions to add at their address.
This caused it to include __pfx_tracefs_create_dir which is invalid to
attach a kprobe to and caused the test to fail.

Fixes: 9f2899fe36a62 ("objtool: Add option to generate prefix symbols")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc
index 624269c8d534..e1b7506c1b11 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc
@@ -21,7 +21,7 @@ set_offs() { # prev target next
 
 # We have to decode symbol addresses to get correct offsets.
 # If the offset is not an instruction boundary, it cause -EILSEQ.
-set_offs `grep -A1 -B1 ${TARGET_FUNC} /proc/kallsyms | cut -f 1 -d " " | xargs`
+set_offs `grep -v __pfx_ /proc/kallsyms | grep -A1 -B1 ${TARGET_FUNC} |  cut -f 1 -d " " | xargs`
 
 UINT_TEST=no
 # printf "%x" -1 returns (unsigned long)-1.
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-03-20 16:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 18:51 [PATCH] tracing/selftests: Ignore __pfx_ symbols in kprobe test Steven Rostedt
2023-02-07 18:54 ` Steven Rostedt
2023-02-08 18:05   ` Peter Zijlstra
2023-02-08 22:03     ` Steven Rostedt
2023-02-09 10:45       ` Peter Zijlstra
2023-02-09 14:23     ` Masami Hiramatsu
2023-02-10  9:51       ` Peter Zijlstra
2023-02-09 14:06 ` Masami Hiramatsu
2023-02-14  1:46 ` Steven Rostedt
2023-03-18 18:42   ` Steven Rostedt
2023-03-20 12:56     ` Shuah Khan
2023-03-20 16:30       ` Shuah Khan
2023-03-20 16:32         ` Steven Rostedt
2023-03-20 16:40         ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).