lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZmA8cqXUxxSmHhQT@J2N7QTR9R3>
Date: Wed, 5 Jun 2024 11:22:42 +0100
From: Mark Rutland <mark.rutland@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 4/5] ftrace: Convert "filter_hash" and "inc" to bool in
 ftrace_hash_rec_update_modify()

On Tue, Jun 04, 2024 at 05:28:21PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@...dmis.org>
> 
> The parameters "filter_hash" and "inc" in the function
> ftrace_hash_rec_update_modify() are boolean. Change them to be such.
> 
> Also add documentation to what the function does.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>

Aside from the issue with forward declarations that need to be updated,
this looks good to me, so with that fixed:

Acked-by: Mark Rutland <mark.rutland@....com>

Mark.

> ---
>  kernel/trace/ftrace.c | 33 ++++++++++++++++++++++++++++-----
>  1 file changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index de652201c86c..021024164938 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1915,8 +1915,31 @@ static bool ftrace_hash_rec_enable(struct ftrace_ops *ops)
>  	return __ftrace_hash_rec_update(ops, true, 1);
>  }
>  
> +/*
> + * This function will update what functions @ops traces when its filter
> + * changes. @filter_hash is set to true when modifying the filter_hash
> + * and set to false when modifying the notrace_hash.
> + *
> + * For example, if the user does: echo schedule > set_ftrace_filter
> + * that would call: ftrace_hash_rec_update_modify(ops, true, true);
> + *
> + * For: echo schedule >> set_ftrace_notrace
> + * That would call: ftrace_hash_rec_enable(ops, false, true);
> + *
> + * The @inc states if the @ops callbacks are going to be added or removed.
> + * The dyn_ftrace records are update via:
> + *
> + * ftrace_hash_rec_disable_modify(ops, filter_hash);
> + * ops->hash = new_hash
> + * ftrace_hash_rec_enable_modify(ops, filter_hash);
> + *
> + * Where the @ops is removed from all the records it is tracing using
> + * its old hash. The @ops hash is updated to the new hash, and then
> + * the @ops is added back to the records so that it is tracing all
> + * the new functions.
> + */
>  static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops,
> -					  int filter_hash, int inc)
> +					  bool filter_hash, bool inc)
>  {
>  	struct ftrace_ops *op;
>  
> @@ -1939,15 +1962,15 @@ static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops,
>  }
>  
>  static void ftrace_hash_rec_disable_modify(struct ftrace_ops *ops,
> -					   int filter_hash)
> +					   bool filter_hash)
>  {
> -	ftrace_hash_rec_update_modify(ops, filter_hash, 0);
> +	ftrace_hash_rec_update_modify(ops, filter_hash, false);
>  }
>  
>  static void ftrace_hash_rec_enable_modify(struct ftrace_ops *ops,
> -					  int filter_hash)
> +					  bool filter_hash)
>  {
> -	ftrace_hash_rec_update_modify(ops, filter_hash, 1);
> +	ftrace_hash_rec_update_modify(ops, filter_hash, true);
>  }
>  
>  /*
> -- 
> 2.43.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ