[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250220150602.25163ea9@gandalf.local.home>
Date: Thu, 20 Feb 2025 15:06:02 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Mark
Rutland <mark.rutland@....com>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Heiko Carstens <hca@...ux.ibm.com>, Sven
Schnelle <svens@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/5] ftrace: Fix accounting of adding subops to a
manager ops
On Thu, 20 Feb 2025 15:58:58 +0900
Masami Hiramatsu (Google) <mhiramat@...nel.org> wrote:
> On Wed, 19 Feb 2025 17:04:37 -0500
> Steven Rostedt <rostedt@...dmis.org> wrote:
>
> > @@ -3292,16 +3299,18 @@ static int intersect_hash(struct ftrace_hash **hash, struct ftrace_hash *new_has
> > /* Return a new hash that has a union of all @ops->filter_hash entries */
> > static struct ftrace_hash *append_hashes(struct ftrace_ops *ops)
> > {
> > - struct ftrace_hash *new_hash;
> > + struct ftrace_hash *new_hash = NULL;
>
> Isn't this "= EMPTY_HASH"?
>
No it has to be NULL. As the change log stated:
Fix this by initializing the new hash to NULL and if the hash is NULL do
not treat it as an empty hash but instead allocate by copying the content
of the first sub ops. Then on subsequent iterations, the new hash will not
be NULL, but the content of the previous subops. If that first subops
attached to all functions, then new hash may assume that the manager ops
also needs to attach to all functions.
Hmm, but we should return EMPTY_HASH if new_hash is still NULL after the
update. Otherwise the caller may confuse this as a failed allocation.
I'll send a v3.
Thanks,
-- Steve
Powered by blists - more mailing lists