[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250729114014.22bf17c8@batman.local.home>
Date: Tue, 29 Jul 2025 11:40:14 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: LKML <linux-kernel@...r.kernel.org>, Linux trace kernel
<linux-trace-kernel@...r.kernel.org>, bpf@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Mark Rutland <mark.rutland@....com>,
Peter Zijlstra <peterz@...radead.org>, Namhyung Kim <namhyung@...nel.org>,
Takaya Saeki <takayas@...gle.com>, Douglas Raillard
<douglas.raillard@....com>, Tom Zanussi <zanussi@...nel.org>, Andrew Morton
<akpm@...ux-foundation.org>, Thomas Gleixner <tglx@...utronix.de>, Ian
Rogers <irogers@...gle.com>, aahringo@...hat.com
Subject: Re: [PATCH] tracing/probes: Allow use of BTF names to dereference
pointers
On Tue, 29 Jul 2025 11:33:35 -0400
Steven Rostedt <rostedt@...dmis.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
Powered by blists - more mailing lists