From: Alan Maguire <alan.maguire@oracle.com>
To: Jakub Sitnicki <jakub@cloudflare.com>,
Yonghong Song <yonghong.song@linux.dev>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
dwarves@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, Matt Fleming <mfleming@cloudflare.com>,
kernel-team@cloudflare.com
Subject: Re: [PATCH dwarves] pahole: Avoid generating artificial inlined functions for BTF
Date: Tue, 21 Oct 2025 15:32:08 +0100 [thread overview]
Message-ID: <caf3969f-658d-41f9-9de9-9ef3a3773ee8@oracle.com> (raw)
In-Reply-To: <874irswi4a.fsf@cloudflare.com>
On 21/10/2025 13:32, Jakub Sitnicki wrote:
> On Fri, Oct 03, 2025 at 10:36 AM -07, Yonghong Song wrote:
>> But actually, one of function 'foo' is marked as DW_INL_inlined which means
>> we should not treat it as an elf funciton. The patch fixed this issue
>> by filtering subprograms if the corresponding function__inlined() is true.
>
> I have a semi-related question: are there any plans for BTF to indicate
> when a function has been inlined? Not necessarily where it has been
> inlined, just that it has, somewhere, at least once.
>
> When tracing with bpftrace or perf without a vmlinux available, it's
> easy to assume you're tracing all calls to a function, when in fact some
> calls may be inlined within the same compilation unit.
>
> A good example is tracing the rtnl_lock - there are multiple inlined
> copies, but neither bpftrace nor perf can warn you about it when debug
> info is absent.
>
hi Jakub, see the RFC series at [1]. The goal is to represent inline
sites in BTF such that we can see when a function has been partially or
fully inlined, or indeed when optimizations have been applied to its ,
parameters which result in it being unsafe for fprobe()ing - in these
cases we skip representing such functions in BTF today.
In the case of inlined/optimized functions the proposal is to represent
them via BTF location data; not all of these locations will have all
parameters available due to optimization etc. However even absent that
it is still valuable to know such inlining has occurred as you say.
[1]
https://lore.kernel.org/bpf/20251008173512.731801-1-alan.maguire@oracle.com/
> $ sudo perf probe -a rtnl_lock
> Added new event:
> probe:rtnl_lock (on rtnl_lock)
>
> You can now use it in all perf tools, such as:
>
> perf record -e probe:rtnl_lock -aR sleep 1
>
> $ sudo apt install linux-image-`uname -r`-dbg
> Installing:
> linux-image-6.12.53-cloudflare-2025.10.4-dbg
> […]
> $ sudo perf probe -d rtnl_lock
> Removed event: probe:rtnl_lock
> $ sudo perf probe -a rtnl_lock
> Added new events:
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
> probe:rtnl_lock (on rtnl_lock)
>
> You can now use it in all perf tools, such as:
>
> perf record -e probe:rtnl_lock -aR sleep 1
>
> $
>
> Thanks,
> -jkbs
next prev parent reply other threads:[~2025-10-21 14:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 17:36 [PATCH dwarves] pahole: Avoid generating artificial inlined functions for BTF Yonghong Song
2025-10-20 10:53 ` Alan Maguire
2025-10-20 16:01 ` Yonghong Song
2025-10-20 20:11 ` Alan Maguire
2025-10-20 20:44 ` David Faust
2025-10-22 9:23 ` Alan Maguire
2025-10-22 20:19 ` David Faust
2025-10-21 12:32 ` Jakub Sitnicki
2025-10-21 14:32 ` Alan Maguire [this message]
2025-10-21 14:54 ` Arnaldo Carvalho de Melo
2025-10-21 19:06 ` Jakub Sitnicki
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=caf3969f-658d-41f9-9de9-9ef3a3773ee8@oracle.com \
--to=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=jakub@cloudflare.com \
--cc=kernel-team@cloudflare.com \
--cc=kernel-team@fb.com \
--cc=mfleming@cloudflare.com \
--cc=yonghong.song@linux.dev \
/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