From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Jiri Olsa" <olsajiri@gmail.com>,
"Alexis Lothoré (eBPF Foundation)" <alexis.lothore@bootlin.com>
Cc: <ebpf@linuxfoundation.org>,
"Bastien Curutchet" <bastien.curutchet@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Shuah Khan" <shuah@kernel.org>, <linux-kernel@vger.kernel.org>,
<bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2] selftests/bpf: port test_ftrace.sh to test_progs
Date: Thu, 05 Nov 2026 18:04:41 +0100 [thread overview]
Message-ID: <DMNFV9TGBTT7.2APJ533JDZBFN@bootlin.com> (raw)
In-Reply-To: <ausZvdHfmevg3mMZ@krava>
Hi Jiri,
On Wed Nov 4, 2026 at 12:40 PM CET, Jiri Olsa wrote:
> On Wed, Nov 04, 2026 at 10:59:33AM +0100, Alexis Lothoré (eBPF Foundation) wrote:
>> Commit ff205766dbbe ("ftrace: Fix function_graph tracer interaction with
>> BPF trampoline") made sure that trampolines generated for tracing
>> programs did not collide with the function graph when we are returning
>> from the hooked function. The series bringing this commit also came with
>> a new test ensuring that the kernel does not crash when executing BPF
>> programs handled by trampolines while the function graph trace is
>> enabled, but this test is a standalone shell script, hence not executed
>> in CI.
[...]
> lgtm, it might be worth to add something like this also for
> tracing-multi (maybe also kprobe-multi) and run some tests
> with function or function_graph enabled
Sure, I can take a look and follow-up with this. I guess it can be a
separate series, unless I'm told that it should be added in a v3.
Alexis
> Reviewed-by: Jiri Olsa <jolsa@kernel.org>
>
> jirka
>
> SNIP
>
>> +void test_modify_return_graph(void)
>> +{
>> + char instance[MAX_INSTANCE_PATH_LEN];
>> + char *ftrace_dir;
>> + int ret;
>> +
>> + ftrace_dir = access(TRACE_FTRACE_DEFAULT, F_OK) ? TRACEFS_IN_DEBUGFS :
>> + TRACEFS_DEFAULT;
>> +
>> + ret = snprintf(instance, MAX_INSTANCE_PATH_LEN,
>> + "%s/instances/bpf-XXXXXX", ftrace_dir);
>> + if (ret < 0)
>> + return;
>> +
>> + if (!ASSERT_OK_PTR(mkdtemp(instance), "mkdtemp"))
>> + return;
>> +
>> + SYS(out, "echo 'bpf_modify_return_test*' > %s/set_ftrace_filter",
>> + instance);
>
> nit, no need for new line
>
>> + SYS(out, "echo function_graph > %s/current_tracer", instance);
>> +
>> + test_modify_return();
>> +
>> + SYS(out, "grep -q bpf_modify_return_test2 %s/trace", instance);
>> +out:
>> + ASSERT_OK(rmdir(instance), "rmdir");
>> +}
>> diff --git a/tools/testing/selftests/bpf/test_ftrace.sh b/tools/testing/selftests/bpf/test_ftrace.sh
>> deleted file mode 100755
>> index f5109eb0e951..000000000000
>> --- a/tools/testing/selftests/bpf/test_ftrace.sh
>> +++ /dev/null
>> @@ -1,44 +0,0 @@
>> -#!/bin/bash
>> -
>> -if [[ -e /sys/kernel/tracing/trace ]]; then
>> - TR=/sys/kernel/tracing/
>> -else
>> - TR=/sys/kernel/debug/tracing/
>> -fi
>> -
>> -clear_trace() { # reset trace output
>> - echo > $TR/trace
>> -}
>> -
>> -disable_tracing() { # stop trace recording
>> - echo 0 > $TR/tracing_on
>> -}
>> -
>> -enable_tracing() { # start trace recording
>> - echo 1 > $TR/tracing_on
>> -}
>> -
>> -reset_tracer() { # reset the current tracer
>> - echo nop > $TR/current_tracer
>> -}
>> -
>> -disable_tracing
>> -clear_trace
>> -
>> -echo "" > $TR/set_ftrace_filter
>> -echo '*printk* *console* *wake* *serial* *lock*' > $TR/set_ftrace_notrace
>> -
>> -echo "bpf_prog_test*" > $TR/set_graph_function
>> -echo "" > $TR/set_graph_notrace
>> -
>> -echo function_graph > $TR/current_tracer
>> -
>> -enable_tracing
>> -./test_progs -t fentry
>> -./test_progs -t fexit
>> -disable_tracing
>> -clear_trace
>> -
>> -reset_tracer
>> -
>> -exit 0
>>
>> ---
>> base-commit: b0e67f50519538b1b4c6364edc7811f482703f75
>> change-id: 20261027-ftrace_in_test_progs-d5f70a2330ac
>>
>> Best regards,
>> --
>> Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
>>
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-11-05 17:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 9:59 [PATCH bpf-next v2] selftests/bpf: port test_ftrace.sh to test_progs Alexis Lothoré (eBPF Foundation)
2026-11-04 11:40 ` Jiri Olsa
2026-11-05 17:04 ` Alexis Lothoré [this message]
2026-11-04 18:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMNFV9TGBTT7.2APJ533JDZBFN@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bastien.curutchet@bootlin.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=ebpf@linuxfoundation.org \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=olsajiri@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.