selftests/tracing: Fix some testcases for recent change
Masami Hiramatsu (Google)
maintainercover selftests/tracing: Fix some testcases for recent change
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) <[email protected]>
Masami Hiramatsu (Google)
maintainerPATCH 1/3 tracing/eprobe: Fix to add filter on eprobe description in README file
From: Masami Hiramatsu (Google) <[email protected]>
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.
--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace.c +1 -1
@@ -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"
Masami Hiramatsu (Google)
maintainerPATCH 2/3 selftests/ftrace: Fix eprobe syntax test case to check filter support
In reply to Masami Hiramatsu (Google)From: Masami Hiramatsu (Google) <[email protected]>
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.
--- .../test.d/dynevent/eprobes_syntax_errors.tc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc +3 -1
@@ -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
Masami Hiramatsu (Google)
maintainerPATCH 3/3 selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
In reply to Masami Hiramatsu (Google)From: Masami Hiramatsu (Google) <[email protected]>
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.
--- .../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc +1 -1
@@ -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.
Quoted 15 lines · On Sat, 7 Jan 2023 22:32:08 +0900 "Masami Hiramatsu (Google)"…
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].
Quoted 10 lines
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
-- Steve
Quoted 29 lines · Steven Rostedt
Quoted 15 lines · On Sat, 7 Jan 2023 22:32:08 +0900 "Masami Hiramatsu (Google)"…
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].
Quoted 10 lines
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
Quoted 4 lines
Reviewed-by Steven Rostedt (Google) <[email protected]>-- Steve
For selftest patches in the series: (Assuming patches 2&3 depend on patch 1.)
thanks,
-- Shuah