2024-05-21 00:00:30

by Masami Hiramatsu

[permalink] [raw]
Subject: [PATCH 0/2] selftests/ftrace: Fix config related issues

Here is a couple of patches to fix some issues related to kconfig.
I found these issues when I built the kernel with
tools/testing/selftests/ftrace/config.

Thank you,
---

Masami Hiramatsu (Google) (2):
selftests/ftrace: Fix to check required event file
selftests/ftrace: Update required config


tools/testing/selftests/ftrace/config | 26 +++++++++++++++-----
.../ftrace/test.d/dynevent/test_duplicates.tc | 2 +-
2 files changed, 20 insertions(+), 8 deletions(-)

--
Masami Hiramatsu (Google) <[email protected]>


2024-05-21 00:00:38

by Masami Hiramatsu

[permalink] [raw]
Subject: [PATCH 1/2] selftests/ftrace: Fix to check required event file

From: Masami Hiramatsu (Google) <[email protected]>

The dynevent/test_duplicates.tc test case uses `syscalls/sys_enter_openat`
event for defining eprobe on it. Since this `syscalls` events depend on
CONFIG_FTRACE_SYSCALLS=y, if it is not set, the test will fail.

Add the event file to `required` line so that the test will return
`unsupported` result.

Fixes: 297e1dcdca3d ("selftests/ftrace: Add selftest for testing duplicate eprobes and kprobes")
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
---
.../ftrace/test.d/dynevent/test_duplicates.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
index d3a79da215c8..5f72abe6fa79 100644
--- a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
@@ -1,7 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - check if duplicate events are caught
-# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README
+# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README events/syscalls/sys_enter_openat

echo 0 > events/enable



2024-05-21 00:00:50

by Masami Hiramatsu

[permalink] [raw]
Subject: [PATCH 2/2] selftests/ftrace: Update required config

From: Masami Hiramatsu (Google) <[email protected]>

Update required config options for running all tests.
This also sorts the config entries alphabetically.

Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
---
tools/testing/selftests/ftrace/config | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/ftrace/config b/tools/testing/selftests/ftrace/config
index e59d985eeff0..048a312abf40 100644
--- a/tools/testing/selftests/ftrace/config
+++ b/tools/testing/selftests/ftrace/config
@@ -1,16 +1,28 @@
-CONFIG_KPROBES=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_DEBUG_INFO_BTF=y
+CONFIG_DEBUG_INFO_DWARF4=y
+CONFIG_EPROBE_EVENTS=y
+CONFIG_FPROBE=y
+CONFIG_FPROBE_EVENTS=y
CONFIG_FTRACE=y
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_FUNCTION_GRAPH_RETVAL=y
CONFIG_FUNCTION_PROFILER=y
-CONFIG_TRACER_SNAPSHOT=y
-CONFIG_STACK_TRACER=y
CONFIG_HIST_TRIGGERS=y
-CONFIG_SCHED_TRACER=y
-CONFIG_PREEMPT_TRACER=y
CONFIG_IRQSOFF_TRACER=y
-CONFIG_PREEMPTIRQ_DELAY_TEST=m
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KPROBES=y
+CONFIG_KPROBE_EVENTS=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
+CONFIG_PREEMPTIRQ_DELAY_TEST=m
+CONFIG_PREEMPT_TRACER=y
+CONFIG_PROBE_EVENTS_BTF_ARGS=y
CONFIG_SAMPLES=y
CONFIG_SAMPLE_FTRACE_DIRECT=m
CONFIG_SAMPLE_TRACE_PRINTK=m
-CONFIG_KALLSYMS_ALL=y
+CONFIG_SCHED_TRACER=y
+CONFIG_STACK_TRACER=y
+CONFIG_TRACER_SNAPSHOT=y
+CONFIG_UPROBES=y
+CONFIG_UPROBE_EVENTS=y


2024-05-25 04:28:07

by Muhammad Usama Anjum

[permalink] [raw]
Subject: Re: [PATCH 1/2] selftests/ftrace: Fix to check required event file

On 5/20/24 5:00 PM, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <[email protected]>
>
> The dynevent/test_duplicates.tc test case uses `syscalls/sys_enter_openat`
> event for defining eprobe on it. Since this `syscalls` events depend on
> CONFIG_FTRACE_SYSCALLS=y, if it is not set, the test will fail.
>
> Add the event file to `required` line so that the test will return
> `unsupported` result.
>
> Fixes: 297e1dcdca3d ("selftests/ftrace: Add selftest for testing duplicate eprobes and kprobes")
> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
LGTM
Reviewed-by: Muhammad Usama Anjum <[email protected]>

> ---
> .../ftrace/test.d/dynevent/test_duplicates.tc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
> index d3a79da215c8..5f72abe6fa79 100644
> --- a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
> +++ b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc
> @@ -1,7 +1,7 @@
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> # description: Generic dynamic event - check if duplicate events are caught
> -# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README
> +# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README events/syscalls/sys_enter_openat
>
> echo 0 > events/enable
>
>
>

--
BR,
Muhammad Usama Anjum

2024-05-25 04:28:28

by Muhammad Usama Anjum

[permalink] [raw]
Subject: Re: [PATCH 2/2] selftests/ftrace: Update required config

On 5/20/24 5:00 PM, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <[email protected]>
>
> Update required config options for running all tests.
> This also sorts the config entries alphabetically.
>
> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
LGTM
Reviewed-by: Muhammad Usama Anjum <[email protected]>

> ---
> tools/testing/selftests/ftrace/config | 26 +++++++++++++++++++-------
> 1 file changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/ftrace/config b/tools/testing/selftests/ftrace/config
> index e59d985eeff0..048a312abf40 100644
> --- a/tools/testing/selftests/ftrace/config
> +++ b/tools/testing/selftests/ftrace/config
> @@ -1,16 +1,28 @@
> -CONFIG_KPROBES=y
> +CONFIG_BPF_SYSCALL=y
> +CONFIG_DEBUG_INFO_BTF=y
> +CONFIG_DEBUG_INFO_DWARF4=y
> +CONFIG_EPROBE_EVENTS=y
> +CONFIG_FPROBE=y
> +CONFIG_FPROBE_EVENTS=y
> CONFIG_FTRACE=y
> +CONFIG_FTRACE_SYSCALLS=y
> +CONFIG_FUNCTION_GRAPH_RETVAL=y
> CONFIG_FUNCTION_PROFILER=y
> -CONFIG_TRACER_SNAPSHOT=y
> -CONFIG_STACK_TRACER=y
> CONFIG_HIST_TRIGGERS=y
> -CONFIG_SCHED_TRACER=y
> -CONFIG_PREEMPT_TRACER=y
> CONFIG_IRQSOFF_TRACER=y
> -CONFIG_PREEMPTIRQ_DELAY_TEST=m
> +CONFIG_KALLSYMS_ALL=y
> +CONFIG_KPROBES=y
> +CONFIG_KPROBE_EVENTS=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> +CONFIG_PREEMPTIRQ_DELAY_TEST=m
> +CONFIG_PREEMPT_TRACER=y
> +CONFIG_PROBE_EVENTS_BTF_ARGS=y
> CONFIG_SAMPLES=y
> CONFIG_SAMPLE_FTRACE_DIRECT=m
> CONFIG_SAMPLE_TRACE_PRINTK=m
> -CONFIG_KALLSYMS_ALL=y
> +CONFIG_SCHED_TRACER=y
> +CONFIG_STACK_TRACER=y
> +CONFIG_TRACER_SNAPSHOT=y
> +CONFIG_UPROBES=y
> +CONFIG_UPROBE_EVENTS=y
>
>

--
BR,
Muhammad Usama Anjum