[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230515075701.6f49b3e7@gandalf.local.home>
Date: Mon, 15 May 2023 07:57:01 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org,
Florent Revest <revest@...omium.org>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Martin KaFai Lau <martin.lau@...ux.dev>, bpf@...r.kernel.org
Subject: Re: [PATCH v10 07/11] tracing/probes: Add $args meta argument for
all function args
On Sun, 14 May 2023 23:12:11 +0900
"Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>
> Add the '$args' meta fetch argument for function-entry probe events. This
> will be expanded to the all arguments of the function and the tracepoint
> using BTF function argument information.
>
> e.g.
> # echo 'p vfs_read $args' >> dynamic_events
> # echo 'f vfs_write $args' >> dynamic_events
> # echo 't sched_overutilized_tp $args' >> dynamic_events
> # cat dynamic_events
> p:kprobes/p_vfs_read_0 vfs_read file=file buf=buf count=count pos=pos
> f:fprobes/vfs_write__entry vfs_write file=file buf=buf count=count pos=pos
> t:tracepoints/sched_overutilized_tp sched_overutilized_tp rd=rd overutilized=overutilized
>
> NOTE: This is not like other $-vars, you can not use this $args as a
> part of fetch args, e.g. specifying name "foo=$args" and using it in
> dereferences "+0($args)" will lead a parse error.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> ---
> Changes in v10:
> - Change $$args to $args so that user can use $$ for current task's pid.
I hate coming up with new apis, because you never know if what you pick is
correct ;-) And then you are stuck with whatever you decided on. :-/
I know I suggested $args, but since it is special, should we call it
"$arg*" ?
That way it follows bash wildcard semantics?
# echo 'p vfs_read $arg*' >> dynamic_events
I think that is more along the lines of what people would expect.
What do you think?
-- Steve
> Changes in v6:
> - update patch description.
> ---
> kernel/trace/trace_fprobe.c | 21 ++++++++-
> kernel/trace/trace_kprobe.c | 23 ++++++++--
> kernel/trace/trace_probe.c | 98 +++++++++++++++++++++++++++++++++++++++++++
> kernel/trace/trace_probe.h | 10 ++++
> 4 files changed, 144 insertions(+), 8 deletions(-)
>
>
Powered by blists - more mailing lists