From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>,
Linux trace kernel <linux-trace-kernel@vger.kernel.org>,
bpf@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Namhyung Kim <namhyung@kernel.org>,
Takaya Saeki <takayas@google.com>,
Douglas Raillard <douglas.raillard@arm.com>,
Tom Zanussi <zanussi@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ian Rogers <irogers@google.com>,
aahringo@redhat.com
Subject: Re: [PATCH] tracing/probes: Allow use of BTF names to dereference pointers
Date: Tue, 29 Jul 2025 11:40:14 -0400 [thread overview]
Message-ID: <20250729114014.22bf17c8@batman.local.home> (raw)
In-Reply-To: <20250729113335.2e4f087d@batman.local.home>
On Tue, 29 Jul 2025 11:33:35 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> Anonymous structures are also handled:
>
> # echo 'e:xmit net.net_dev_xmit +net_device.name(+sk_buff.dev($skbaddr)):string' >> dynamic_events
>
> Where "+net_device.name(+sk_buff.dev($skbaddr))" is equivalent to:
>
> (*(struct net_device *)((*(struct sk_buff *)($skbaddr))->dev)->name)
The above in wrong. It is equivalent to:
(*(struct net_device *)((*(struct sk_buff *)($skbaddr)).dev).name)
I purposely tried to not use "->" but then failed to do so :-p
>
> And nested structures can be found by adding more members to the arg:
>
> # echo 'f:read filemap_readahead.isra.0 file=+0(+dentry.d_name.name(+file.f_path.dentry($arg2))):string' >> dynamic_events
>
> The above is equivalent to:
>
> *((*(struct dentry *)(*(struct file *)$arg2)->f_path.dentry)->d_name.name)
And this is supposed to be:
*((*(struct dentry *)(*(struct file *)$arg2).f_path.dentry).d_name.name)
-- Steve
next prev parent reply other threads:[~2025-07-29 15:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 15:33 [PATCH] tracing/probes: Allow use of BTF names to dereference pointers Steven Rostedt
2025-07-29 15:40 ` Steven Rostedt [this message]
2025-07-30 13:53 ` Masami Hiramatsu
2025-07-30 14:33 ` Steven Rostedt
2025-07-31 11:44 ` Douglas Raillard
2025-07-31 13:29 ` Steven Rostedt
2025-07-31 15:42 ` Douglas Raillard
2025-07-31 21:52 ` Jiri Olsa
2025-07-31 22:15 ` Steven Rostedt
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=20250729114014.22bf17c8@batman.local.home \
--to=rostedt@goodmis.org \
--cc=aahringo@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=douglas.raillard@arm.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=takayas@google.com \
--cc=tglx@linutronix.de \
--cc=zanussi@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).