From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 1/5] ftrace: Rename dup_hash() and comment it
Date: Thu, 6 Jun 2024 08:01:47 +0900 [thread overview]
Message-ID: <20240606080147.99c20cd5a638eda8307dc7a7@kernel.org> (raw)
In-Reply-To: <20240605180408.537723591@goodmis.org>
On Wed, 05 Jun 2024 14:03:35 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> The name "dup_hash()" is a misnomer as it does not duplicate the hash that
> is passed in, but instead moves its entities from that hash to a newly
> allocated one. Rename it to "__move_hash()" (using starting underscores as
> it is an internal function), and add some comments about what it does.
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> kernel/trace/ftrace.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index da7e6abf48b4..9dcdefe9d1aa 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1391,7 +1391,11 @@ ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash);
> static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops,
> struct ftrace_hash *new_hash);
>
> -static struct ftrace_hash *dup_hash(struct ftrace_hash *src, int size)
> +/*
> + * Allocate a new hash and remove entries from @src and move them to the new hash.
> + * On success, the @src hash will be empty and should be freed.
> + */
> +static struct ftrace_hash *__move_hash(struct ftrace_hash *src, int size)
> {
> struct ftrace_func_entry *entry;
> struct ftrace_hash *new_hash;
> @@ -1438,7 +1442,7 @@ __ftrace_hash_move(struct ftrace_hash *src)
> if (ftrace_hash_empty(src))
> return EMPTY_HASH;
>
> - return dup_hash(src, size);
> + return __move_hash(src, size);
> }
>
> static int
> --
> 2.43.0
>
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2024-06-05 23:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 18:03 [PATCH v2 0/5] ftrace: Clean up and comment code Steven Rostedt
2024-06-05 18:03 ` [PATCH v2 1/5] ftrace: Rename dup_hash() and comment it Steven Rostedt
2024-06-05 23:01 ` Masami Hiramatsu [this message]
2024-06-06 12:53 ` Mark Rutland
2024-06-05 18:03 ` [PATCH v2 2/5] ftrace: Remove "ftrace_hash" parameter from __ftrace_hash_rec_update() Steven Rostedt
2024-06-06 17:53 ` Mark Rutland
2024-06-06 18:53 ` Steven Rostedt
2024-06-05 18:03 ` [PATCH v2 3/5] ftrace: Add comments to ftrace_hash_rec_disable/enable() Steven Rostedt
2024-06-05 18:03 ` [PATCH v2 4/5] ftrace: Convert "inc" parameter to bool in ftrace_hash_rec_update_modify() Steven Rostedt
2024-06-06 17:55 ` Mark Rutland
2024-06-05 18:03 ` [PATCH v2 5/5] ftrace: Add comments to ftrace_hash_move() and friends Steven Rostedt
2024-06-06 17:56 ` Mark Rutland
2024-06-05 23:45 ` [PATCH v2 0/5] ftrace: Clean up and comment code Masami Hiramatsu
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=20240606080147.99c20cd5a638eda8307dc7a7@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox