From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>,
Jakub Sitnicki <jakub@cloudflare.com>,
Yonghong Song <yonghong.song@linux.dev>
Cc: 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 11:54:56 -0300 [thread overview]
Message-ID: <54691577-8921-476D-B1BC-AFB9D258B7F5@gmail.com> (raw)
In-Reply-To: <caf3969f-658d-41f9-9de9-9ef3a3773ee8@oracle.com>
On October 21, 2025 11:32:08 AM GMT-03:00, Alan Maguire <alan.maguire@oracle.com> wrote:
>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.
I wonder if at least telling the user that there are such optimized cases around line N on function F, etc it could help with workarounds while tracing.
I.e. represent it in BTF and let tools decide it's unsafe and use it just for these warnings.
>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.
Oh well, that's what you propose 8-)
>
>[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
>
- Arnaldo
next prev parent reply other threads:[~2025-10-21 14:55 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
2025-10-21 14:54 ` Arnaldo Carvalho de Melo [this message]
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=54691577-8921-476D-B1BC-AFB9D258B7F5@gmail.com \
--to=arnaldo.melo@gmail.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--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