Re: [PATCH bpf-next 0/2] selftests/bpf: port test_ftrace.sh into test_progs

From: Alexis Lothoré

Date: Tue Nov 03 2026 - 13:53:11 EST


On Tue Nov 3, 2026 at 7:14 PM CET, Alexei Starovoitov wrote:
> On Tue, Nov 03, 2026 at 01:13 AM Alexis Lothoré <alexis.lothore@xxxxxxxxxxx> wrote:
>> I initially went with a ftrace instance, but I came back to global
>> ftrace because graph function filters (set_graph_function,
>> set_graph_notrace) are not handled at instance level, only at global
>> level. But maybe setting only set_ftrace_filter and set_ftrace_notrace
>> is enough for this test ? That would indeed simplify a lot the setup.
>
> Yes. set_ftrace_filter alone is enough.
> The test needs function_graph and a trampoline on the same function.
> set_ftrace_filter of the instance does that.
>
>>> all functions are patched only the filtered functions
>>
>> Are all functions really patched with the current series ? It is still
>> applying filters.
>
> Yes. All but the ones in set_ftrace_notrace.
> Only set_ftrace_filter and set_ftrace_notrace decide what is patched,
> and set_ftrace_filter is empty in the series.
> set_graph_function is a run time check. Every patched function calls
> into fgraph. Then graph_entry() -> ftrace_graph_addr() drops the ones
> that are not below bpf_prog_test*.
> enabled_functions shows what is patched.

Ah, thanks for the additional explanation and the enabled_functions
hint! That definitely clarifies something I've been struggling to
figure out. v2 in progress with your suggestions.

Alexis

--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com