Re: [PATCH v2 0/5] ftrace: Fix fprobe with function graph accounting

From: Heiko Carstens
Date: Thu Feb 20 2025 - 06:53:21 EST


On Wed, Feb 19, 2025 at 05:04:36PM -0500, Steven Rostedt wrote:
> Heiko Carstens reported[1] a bug when running the ftrace selftests.
> After running them, he noticed that the enabled_functions file had
> all functions enabled in it. That means something was registered to
> ftrace that shouldn't be.
>
> The issue was with the accounting of the new fprobe logic which was
> built on top of the function graph infrastructure. Patch 3 of this
> series is the fix for that bug, but while debugging that, 3 other
> accounting bugs were discovered.
...
> Steven Rostedt (5):
> ftrace: Fix accounting of adding subops to a manager ops
> ftrace: Do not add duplicate entries in subops manager ops
> fprobe: Always unregister fgraph function from ops
> fprobe: Fix accounting of when to unregister from function graph
> selftests/ftrace: Update fprobe test to check enabled_functions file
>
> ----
> kernel/trace/fprobe.c | 12 ++---
> kernel/trace/ftrace.c | 33 +++++++++----
> .../ftrace/test.d/dynevent/add_remove_fprobe.tc | 54 ++++++++++++++++++++++
> 3 files changed, 82 insertions(+), 17 deletions(-)

FWIW, I can confirm that this fixes the bug I reported.
Feel free to add

Tested-by: Heiko Carstens <hca@xxxxxxxxxxxxx>