All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf probe: Show correct error about @symbol for uprobe
Date: Tue, 1 Aug 2023 09:55:07 -0300	[thread overview]
Message-ID: <ZMkAq5yx3+EiQNkF@kernel.org> (raw)
In-Reply-To: <169055397023.67089.12693645664676964310.stgit@devnote2>

Em Fri, Jul 28, 2023 at 11:19:30PM +0900, Masami Hiramatsu (Google) escreveu:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Since @symbol variable access is not supported by uprobe event, it must be
> correctly warn user instead of kernel version update.

Thanks, less cryptic now, applied.

But is that just a matter of writing code to support reading global
variables from an uprobe?

- Arnaldo

 
> Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
> Closes: https://lore.kernel.org/all/ZLWDEjvFjrrEJODp@kernel.org/
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
>  tools/perf/util/probe-event.c |   13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 6e2110d605fb..c1ded85fe859 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -2800,13 +2800,18 @@ static void warn_uprobe_event_compat(struct probe_trace_event *tev)
>  	if (!tev->uprobes || tev->nargs == 0 || !buf)
>  		goto out;
>  
> -	for (i = 0; i < tev->nargs; i++)
> -		if (strglobmatch(tev->args[i].value, "[$@+-]*")) {
> -			pr_warning("Please upgrade your kernel to at least "
> -				   "3.14 to have access to feature %s\n",
> +	for (i = 0; i < tev->nargs; i++) {
> +		if (strchr(tev->args[i].value, '@')) {
> +			pr_warning("%s accesses a variable by symbol name, but that is not supported for user application probe.\n",
> +				   tev->args[i].value);
> +			break;
> +		}
> +		if (strglobmatch(tev->args[i].value, "[$+-]*")) {
> +			pr_warning("Please upgrade your kernel to at least 3.14 to have access to feature %s\n",
>  				   tev->args[i].value);
>  			break;
>  		}
> +	}
>  out:
>  	free(buf);
>  }
> 

-- 

- Arnaldo

  reply	other threads:[~2023-08-01 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 14:19 [PATCH] perf probe: Show correct error about @symbol for uprobe Masami Hiramatsu (Google)
2023-08-01 12:55 ` Arnaldo Carvalho de Melo [this message]
2023-08-01 13:56   ` Masami Hiramatsu
2023-08-03 17:31     ` Oleg Nesterov
2023-08-04  8:05       ` 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=ZMkAq5yx3+EiQNkF@kernel.org \
    --to=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mhiramat@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.