linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kui-Feng Lee <sinquersw@gmail.com>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	linux-trace-kernel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Florent Revest <revest@chromium.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	bpf@vger.kernel.org, Bagas Sanjaya <bagasdotme@gmail.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] tracing/probes: Fix tracepoint event with $arg* to fetch correct argument
Date: Wed, 14 Jun 2023 12:50:34 -0700	[thread overview]
Message-ID: <12b0c61d-1270-ab34-63bf-a5c389fd45bc@gmail.com> (raw)
In-Reply-To: <168657113778.3038017.12245893750241701312.stgit@mhiramat.roam.corp.google.com>



On 6/12/23 04:58, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> To hide the first dummy 'data' argument on the tracepoint probe events,
> the BTF argument array was modified (skip the first argument for tracepoint),
> but the '$arg*' meta argument parser missed that.
> 
> Fix to increment the argument index if it is tracepoint probe. And decrement
> the index when searching the type of the argument.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
>   kernel/trace/trace_probe.c |   10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index 473e1c43bc57..643aa3a51d5a 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -456,7 +456,10 @@ static int parse_btf_arg(const char *varname, struct fetch_insn *code,
>   
>   		if (name && !strcmp(name, varname)) {
>   			code->op = FETCH_OP_ARG;
> -			code->param = i;
> +			if (ctx->flags & TPARG_FL_TPOINT)
> +				code->param = i + 1;
> +			else
> +				code->param = i;
>   			return 0;
>   		}
>   	}
> @@ -470,8 +473,11 @@ static const struct fetch_type *parse_btf_arg_type(int arg_idx,
>   	struct btf *btf = traceprobe_get_btf();
>   	const char *typestr = NULL;
>   
> -	if (btf && ctx->params)
> +	if (btf && ctx->params) {
> +		if (ctx->flags & TPARG_FL_TPOINT)
> +			arg_idx--;
>   		typestr = type_from_btf_id(btf, ctx->params[arg_idx].type);
> +	}
>   
>   	return find_fetch_type(typestr, ctx->flags);
>   }
> 
> 

I failed to apply this patch.
Would you mind to rebase this patch?


  reply	other threads:[~2023-06-14 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 11:58 [PATCH] tracing/probes: Fix tracepoint event with $arg* to fetch correct argument Masami Hiramatsu (Google)
2023-06-14 19:50 ` Kui-Feng Lee [this message]
2023-06-22  0:39   ` Masami Hiramatsu
2023-06-21 23:03 ` Steven Rostedt
2023-06-22  0:56   ` 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=12b0c61d-1270-ab34-63bf-a5c389fd45bc@gmail.com \
    --to=sinquersw@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=revest@chromium.org \
    --cc=rostedt@goodmis.org \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).