* [PATCH 0/3] selftests/tracing: Fix some testcases for recent change
@ 2023-01-07 13:32 Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file Masami Hiramatsu (Google)
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-01-07 13:32 UTC (permalink / raw)
To: Shuah Khan, Steven Rostedt
Cc: Masami Hiramatsu, linux-kernel, linux-trace-kernel,
linux-kselftest
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file
2023-01-07 13:32 [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Masami Hiramatsu (Google)
@ 2023-01-07 13:32 ` Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 2/3] selftests/ftrace: Fix eprobe syntax test case to check filter support Masami Hiramatsu (Google)
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-01-07 13:32 UTC (permalink / raw)
To: Shuah Khan, Steven Rostedt
Cc: Masami Hiramatsu, linux-kernel, linux-trace-kernel,
linux-kselftest
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"
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] selftests/ftrace: Fix eprobe syntax test case to check filter support
2023-01-07 13:32 [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file Masami Hiramatsu (Google)
@ 2023-01-07 13:32 ` Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 3/3] selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols Masami Hiramatsu (Google)
2023-01-08 21:31 ` [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-01-07 13:32 UTC (permalink / raw)
To: Shuah Khan, Steven Rostedt
Cc: Masami Hiramatsu, linux-kernel, linux-trace-kernel,
linux-kselftest
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
2023-01-07 13:32 [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 2/3] selftests/ftrace: Fix eprobe syntax test case to check filter support Masami Hiramatsu (Google)
@ 2023-01-07 13:32 ` Masami Hiramatsu (Google)
2023-01-08 21:31 ` [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-01-07 13:32 UTC (permalink / raw)
To: Shuah Khan, Steven Rostedt
Cc: Masami Hiramatsu, linux-kernel, linux-trace-kernel,
linux-kselftest
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.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] selftests/tracing: Fix some testcases for recent change
2023-01-07 13:32 [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Masami Hiramatsu (Google)
` (2 preceding siblings ...)
2023-01-07 13:32 ` [PATCH 3/3] selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols Masami Hiramatsu (Google)
@ 2023-01-08 21:31 ` Steven Rostedt
2023-01-26 20:43 ` Shuah Khan
3 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2023-01-08 21:31 UTC (permalink / raw)
To: Masami Hiramatsu (Google)
Cc: Shuah Khan, linux-kernel, linux-trace-kernel, linux-kselftest
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] selftests/tracing: Fix some testcases for recent change
2023-01-08 21:31 ` [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Steven Rostedt
@ 2023-01-26 20:43 ` Shuah Khan
0 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2023-01-26 20:43 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu (Google)
Cc: Shuah Khan, linux-kernel, linux-trace-kernel, linux-kselftest,
Shuah Khan
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-26 20:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-07 13:32 [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 2/3] selftests/ftrace: Fix eprobe syntax test case to check filter support Masami Hiramatsu (Google)
2023-01-07 13:32 ` [PATCH 3/3] selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols Masami Hiramatsu (Google)
2023-01-08 21:31 ` [PATCH 0/3] selftests/tracing: Fix some testcases for recent change Steven Rostedt
2023-01-26 20:43 ` Shuah Khan
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).