All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: Alan Maguire <alan.maguire@oracle.com>,
	 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 14:32:05 +0200	[thread overview]
Message-ID: <874irswi4a.fsf@cloudflare.com> (raw)
In-Reply-To: <20251003173620.2892942-1-yonghong.song@linux.dev> (Yonghong Song's message of "Fri, 3 Oct 2025 10:36:20 -0700")

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.

$ 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

  parent reply	other threads:[~2025-10-21 12: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 [this message]
2025-10-21 14:32   ` Alan Maguire
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=874irswi4a.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.