public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Alan Maguire <alan.maguire@oracle.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Menglong Dong <menglong8.dong@gmail.com>,
	dwarves@vger.kernel.org, bpf@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andriin@fb.com>, Yonghong Song <yhs@fb.com>,
	Song Liu <songliubraving@fb.com>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>
Subject: Re: [RFC dwarves] btf_encoder: Remove duplicates from functions entries
Date: Mon, 21 Jul 2025 15:32:52 +0100	[thread overview]
Message-ID: <87tt357gx7.fsf@esperi.org.uk> (raw)
In-Reply-To: <aH5OW0rtSuMn1st1@krava> (Jiri Olsa's message of "Mon, 21 Jul 2025 16:27:39 +0200")

On 21 Jul 2025, Jiri Olsa verbalised:
> On Mon, Jul 21, 2025 at 12:41:00PM +0100, Alan Maguire wrote:
>> On 17/07/2025 16:25, Jiri Olsa wrote:
>> > Menglong reported issue where we can have function in BTF which has
>> > multiple addresses in kallsysm [1].
>> > 
>> > Rather than filtering this in runtime, let's teach pahole to remove
>> > such functions.
>> > 
>> > Removing duplicate records from functions entries that have more
>> > at least one different address. This way btf_encoder__find_function
>> > won't find such functions and they won't be added in BTF.
>> > 
>> > In my setup it removed 428 functions out of 77141.
>> >
>> 
>> Is such removal necessary? If the presence of an mcount annotation is
>> the requirement, couldn't we just utilize
>> 
>> /sys/kernel/tracing/available_filter_functions_addrs
>> 
>> to map name to address safely? It identifies mcount-containing functions
>> and some of these appear to be duplicates, for example there I see
>> 
>> ffffffff8376e8b4 acpi_attr_is_visible
>> ffffffff8379b7d4 acpi_attr_is_visible
>
> for that we'd need new interface for loading fentry/fexit.. programs, right?
>
> the current interface to get fentry/fexit.. attach address is:
>   - user specifies function name, that translates to btf_id
>   - in kernel that btf id translates back to function name
>   - kernel uses kallsyms_lookup_name or find_kallsyms_symbol_value
>     to get the address
>
> so we don't really know which address user wanted in the first place
>
> I think we discussed this issue some time ago, but I'm not sure what
> the proposal was at the end (function address stored in BTF?)

Function address, translation unit name, *some* disambiguator. Really
both seem like they might be useful in different situations.

-- 
NULL && (void)

  reply	other threads:[~2025-07-21 14:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 15:25 [RFC dwarves] btf_encoder: Remove duplicates from functions entries Jiri Olsa
2025-07-21 11:41 ` Alan Maguire
2025-07-21 14:27   ` Jiri Olsa
2025-07-21 14:32     ` Nick Alcock [this message]
2025-07-21 23:27     ` Ihor Solodrai
2025-07-22 10:45       ` Alan Maguire
2025-07-22 22:58         ` Ihor Solodrai
2025-07-23 11:22           ` Jiri Olsa
2025-07-24 17:54             ` Alan Maguire
2025-07-24 21:26               ` Ihor Solodrai
2025-07-22 10:54       ` Jiri Olsa
2025-07-22 16:07         ` Ihor Solodrai

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=87tt357gx7.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=menglong8.dong@gmail.com \
    --cc=olsajiri@gmail.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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