Re: [PATCH 2/5] ftrace: Comment __ftrace_hash_rec_update() and make filter_hash bool

From: Steven Rostedt
Date: Wed Jun 05 2024 - 12:07:05 EST


On Wed, 5 Jun 2024 10:18:32 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > > + *
> > > + * @filter_hash: True if for the filter hash is udpated, false for the
> > > + * notrace hash
> >
> > Typo: s/udpated/updated/
> >
> > ... though I couldn't parse this regardless; maybe:
> >
> > @filter_hash: true to update the filter hash, false to update
> > the notrace hash
>
> Sure.

Actually, they are both wrong. Because I realized your's was not correct, I
started describing it in more detail and realized it does basically the
same thing (but differently) if filter_hash is set or not. I think it can
be removed completely!

I just tried it. I forced "filter_hash" to always be true, and all the
tests worked just fine. This function is only to update the dyn_ftrace
records when an ops is added or removed. It doesn't matter which filter is
being used, as they are both necessary for the update.

This will make that code a bit cleaner and simpler. Let me go and fix that
first, and then add the documentation on top!

This is what happens when you document your code :-p

This code has been rewritten a few times. When it was first written, which
filter was being changed may have been important. But now it is not.

-- Steve