[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19e90ddf9745b28aadd838ca205e548b0139b157.camel@kernel.org>
Date: Thu, 22 Jul 2021 17:11:28 -0500
From: Tom Zanussi <zanussi@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org
Cc: Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH v2 1/2] tracing: Have histogram types be constant when
possible
On Thu, 2021-07-22 at 10:27 -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
>
> Instead of kstrdup("const", GFP_KERNEL), have the hist_field type
> simply
> assign the constant hist_field->type = "const"; And when the value
> passed
> to it is a variable, use "kstrdup_const(var, GFP_KERNEL);" which will
> just
> copy the value if the variable is already a constant. This saves on
> having
> to allocate when not needed.
>
> All frees of the hist_field->type will need to use kfree_const().
>
> Suggested-by: Masami Hiramatsu <mhiramat@...nel.org>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
Looks good to me.
Thanks,
Reviewed-by: <zanussi@...nel.org>
Powered by blists - more mailing lists