This includes some patches to fix 2 issues on ftrace selftests.
- eprobe filter and eprobe syntax test case were introduced but it doesn't check whether the kernel supports eprobe filter. Thus the new test case fails on the kernel which has eprobe but not support eprobe filter. To solve this issue, add a filter description to README file [1/3] and run the filter syntax error test only if the description is found in the README file [2/3].
- Recently objtool adds prefix symbols for the function padding nops, and the probepoint test case fails because this probepoint test case tests whether the kprobe event can probe the target function and the functions next to the target function. But the prefix symbols can not be probed. Thus these prefix symbols must be skipped [3/3].
Thank you,
---
Masami Hiramatsu (Google) (3): tracing/eprobe: Fix to add filter on eprobe description in README file selftests/ftrace: Fix eprobe syntax test case to check filter support selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
kernel/trace/trace.c | 2 +- .../test.d/dynevent/eprobes_syntax_errors.tc | 4 +++- .../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
-- Masami Hiramatsu (Google) mhiramat@kernel.org
From: Masami Hiramatsu (Google) mhiramat@kernel.org
Fix to add a description of the filter on eprobe in README file. This is required to identify the kernel supports the filter on eprobe or not.
Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) mhiramat@kernel.org --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a555a861b978..d0c22766dc26 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5598,7 +5598,7 @@ static const char readme_msg[] = #ifdef CONFIG_HIST_TRIGGERS "\t s:[synthetic/]<event> <field> [<field>]\n" #endif - "\t e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]\n" + "\t e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>] [if <filter>]\n" "\t -:[<group>/][<event>]\n" #ifdef CONFIG_KPROBE_EVENTS "\t place: [<module>:]<symbol>[+<offset>]|<memaddr>\n"
From: Masami Hiramatsu (Google) mhiramat@kernel.org
Fix eprobe syntax test case to check whether the kernel supports the filter on eprobe for filter syntax test command. Without this fix, this test case will fail if the kernel supports eprobe but doesn't support the filter on eprobe.
Fixes: 9e14bae7d049 ("selftests/ftrace: Add eprobe syntax error testcase") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) mhiramat@kernel.org --- .../test.d/dynevent/eprobes_syntax_errors.tc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc index fc1daac7f066..4f5e8c665156 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc @@ -22,6 +22,8 @@ check_error 'e:foo/^bar.1 syscalls/sys_enter_openat' # BAD_EVENT_NAME check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd' # BAD_FETCH_ARG check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo' # BAD_ATTACH_ARG
-check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER +if grep -q '<attached-group>.<attached-event>.*[if <filter>]' README; then + check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER +fi
exit 0
From: Masami Hiramatsu (Google) mhiramat@kernel.org
Fix kprobe probepoint testcase to ignore __pfx_* prefix symbols. Those are introduced by commit b341b20d648b ("x86: Add prefix symbols for function padding") for identifying PADDING_BYTES of NOPs. Since kprobe events can not probe these prefix symbols, this testcase has to skip those symbols.
Fixes: b341b20d648b ("x86: Add prefix symbols for function padding") Signed-off-by: Masami Hiramatsu (Google) mhiramat@kernel.org --- .../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..68425987a5dd 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.
On Sat, 7 Jan 2023 22:32:08 +0900 "Masami Hiramatsu (Google)" mhiramat@kernel.org wrote:
This includes some patches to fix 2 issues on ftrace selftests.
eprobe filter and eprobe syntax test case were introduced but it doesn't check whether the kernel supports eprobe filter. Thus the new test case fails on the kernel which has eprobe but not support eprobe filter. To solve this issue, add a filter description to README file [1/3] and run the filter syntax error test only if the description is found in the README file [2/3].
Recently objtool adds prefix symbols for the function padding nops, and the probepoint test case fails because this probepoint test case tests whether the kprobe event can probe the target function and the functions next to the target function. But the prefix symbols can not be probed. Thus these prefix symbols must be skipped [3/3].
Thank you,
Masami Hiramatsu (Google) (3): tracing/eprobe: Fix to add filter on eprobe description in README file selftests/ftrace: Fix eprobe syntax test case to check filter support selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
Reviewed-by: Steven Rostedt (Google) rostedt@goodmis.org
-- Steve
On 1/8/23 14:31, Steven Rostedt wrote:
On Sat, 7 Jan 2023 22:32:08 +0900 "Masami Hiramatsu (Google)" mhiramat@kernel.org wrote:
This includes some patches to fix 2 issues on ftrace selftests.
eprobe filter and eprobe syntax test case were introduced but it doesn't check whether the kernel supports eprobe filter. Thus the new test case fails on the kernel which has eprobe but not support eprobe filter. To solve this issue, add a filter description to README file [1/3] and run the filter syntax error test only if the description is found in the README file [2/3].
Recently objtool adds prefix symbols for the function padding nops, and the probepoint test case fails because this probepoint test case tests whether the kprobe event can probe the target function and the functions next to the target function. But the prefix symbols can not be probed. Thus these prefix symbols must be skipped [3/3].
Thank you,
Masami Hiramatsu (Google) (3): tracing/eprobe: Fix to add filter on eprobe description in README file selftests/ftrace: Fix eprobe syntax test case to check filter support selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
Reviewed-by: Steven Rostedt (Google) rostedt@goodmis.org
-- Steve
For selftest patches in the series: (Assuming patches 2&3 depend on patch 1.)
Acked-by: Shuah Khan skhan@linuxfoundation.org
thanks, -- Shuah
linux-kselftest-mirror@lists.linaro.org