public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: "Seokwoo Chung (Ryan)" <seokwoo.chung130@gmail.com>
Cc: rostedt@goodmis.org, corbet@lwn.net, shuah@kernel.org,
	mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v6 2/4] fprobe: Support comma-separated filters in register_fprobe()
Date: Tue, 24 Mar 2026 10:59:13 +0900	[thread overview]
Message-ID: <20260324105913.cf60a2f2fcc64afbe30bd22e@kernel.org> (raw)
In-Reply-To: <20260205135842.20517-3-seokwoo.chung130@gmail.com>

On Thu,  5 Feb 2026 08:58:40 -0500
"Seokwoo Chung (Ryan)" <seokwoo.chung130@gmail.com> wrote:

> register_fprobe() passes its filter and notfilter strings directly to
> glob_match(), which only understands shell-style globs (*, ?, [...]).
> Comma-separated symbol lists such as "vfs_read,vfs_open" never match
> any symbol because no kernel symbol contains a comma.
> 
> Add glob_match_comma_list() that splits the filter on commas and
> checks each entry individually with glob_match().  The existing
> single-pattern fast path is preserved (no commas means the loop
> executes exactly once).
> 
> This is required by the comma-separated fprobe list syntax introduced
> in the preceding patch; without it, enabling a list-mode fprobe event
> fails with "Could not enable event".

OK, in this case, you should reorder patch this as the first one.
Please make this [1/4] and remove this requirement explanation paragraph.
The patch itself looks good to me.

Thank you,

> 
> Signed-off-by: Seokwoo Chung (Ryan) <seokwoo.chung130@gmail.com>
> ---
>  kernel/trace/fprobe.c | 30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> index 1188eefef07c..2acd24b80d04 100644
> --- a/kernel/trace/fprobe.c
> +++ b/kernel/trace/fprobe.c
> @@ -672,12 +672,38 @@ struct filter_match_data {
>  	struct module **mods;
>  };
>  
> +/*
> + * Check if @name matches any comma-separated glob pattern in @list.
> + * If @list contains no commas, this is equivalent to glob_match().
> + */
> +static bool glob_match_comma_list(const char *list, const char *name)
> +{
> +	const char *cur = list;
> +
> +	while (*cur) {
> +		const char *sep = strchr(cur, ',');
> +		int len = sep ? sep - cur : strlen(cur);
> +		char pat[KSYM_NAME_LEN];
> +
> +		if (len > 0 && len < KSYM_NAME_LEN) {
> +			memcpy(pat, cur, len);
> +			pat[len] = '\0';
> +			if (glob_match(pat, name))
> +				return true;
> +		}
> +		if (!sep)
> +			break;
> +		cur = sep + 1;
> +	}
> +	return false;
> +}
> +
>  static int filter_match_callback(void *data, const char *name, unsigned long addr)
>  {
>  	struct filter_match_data *match = data;
>  
> -	if (!glob_match(match->filter, name) ||
> -	    (match->notfilter && glob_match(match->notfilter, name)))
> +	if (!glob_match_comma_list(match->filter, name) ||
> +	    (match->notfilter && glob_match_comma_list(match->notfilter, name)))
>  		return 0;
>  
>  	if (!ftrace_location(addr))
> -- 
> 2.43.0
> 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2026-03-24  1:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 13:58 [PATCH v6 0/4] tracing/fprobe: Support comma-separated symbol lists and :entry/:exit suffixes Seokwoo Chung (Ryan)
2026-02-05 13:58 ` [PATCH v6 1/4] tracing/fprobe: Support comma-separated symbols and :entry/:exit Seokwoo Chung (Ryan)
2026-03-24  1:50   ` Masami Hiramatsu
2026-02-05 13:58 ` [PATCH v6 2/4] fprobe: Support comma-separated filters in register_fprobe() Seokwoo Chung (Ryan)
2026-03-24  1:59   ` Masami Hiramatsu [this message]
2026-02-05 13:58 ` [PATCH v6 3/4] docs: tracing/fprobe: Document list filters and :entry/:exit Seokwoo Chung (Ryan)
2026-03-24  4:07   ` Masami Hiramatsu
2026-02-05 13:58 ` [PATCH v6 4/4] selftests/ftrace: Add accept cases for fprobe list syntax Seokwoo Chung (Ryan)
2026-03-24  4:12   ` Masami Hiramatsu
2026-03-24  1:51 ` [PATCH v6 0/4] tracing/fprobe: Support comma-separated symbol lists and :entry/:exit suffixes 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=20260324105913.cf60a2f2fcc64afbe30bd22e@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rostedt@goodmis.org \
    --cc=seokwoo.chung130@gmail.com \
    --cc=shuah@kernel.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