BPF List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Jiri Olsa <olsajiri@gmail.com>, Daniel Xu <dxu@dxuuu.xyz>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Quentin Monnet <quentin@isovalent.com>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH dwarves] pahole: Inject kfunc decl tags into BTF
Date: Fri, 22 Dec 2023 09:55:09 +0000	[thread overview]
Message-ID: <64f6db18-ebd5-501b-2457-a8abe6187a0f@oracle.com> (raw)
In-Reply-To: <CAADnVQ+9PZvTc034oHa=7yQFPtyV=Yvjqef2+r97SyKFOgV=RA@mail.gmail.com>

On 21/12/2023 18:07, Alexei Starovoitov wrote:
> On Thu, Dec 21, 2023 at 9:43 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>
>> On 21/12/2023 17:05, Alexei Starovoitov wrote:
>>> On Thu, Dec 21, 2023 at 12:35 AM Jiri Olsa <olsajiri@gmail.com> wrote:
>>>> you need to pick up only 'BTF_ID(func, ...)' IDs that belongs to SET8 lists,
>>>> which are bounded by __BTF_ID__set8__<name> symbols, which also provide size
>>>
>>> +1
>>>
>>>>>
>>>>> Maybe we need a codemod from:
>>>>>
>>>>>         BTF_ID(func, ...
>>>>>
>>>>> to:
>>>>>
>>>>>         BTF_ID(kfunc, ...
>>>>
>>>> I think it's better to keep just 'func' and not to do anything special for
>>>> kfuncs in resolve_btfids logic to keep it simple
>>>>
>>>> also it's going to be already in pahole so if we want to make a fix in future
>>>> you need to change pahole, resolve_btfids and possibly also kernel
>>>
>>> I still don't understand why you guys want to add it to vmlinux BTF.
>>> The kernel has no use in this additional data.
>>> It already knows about all kfuncs.
>>> This extra memory is a waste of space from kernel pov.
>>> Unless I am missing something.
>>>
>>> imo this logic belongs in bpftool only.
>>> It can dump vmlinux BTF and emit __ksym protos into vmlinux.h
>>>
>>
>> If the goal is to have bpftool detect all kfuncs, would having a BPF
>> kfunc iterator that bpftool could use to iterate over registered kfuncs
>> work perhaps?
> 
> The kernel code ? Why ?
> bpftool can do the same thing as this patch. Iterate over set8 in vmlinux elf.

Most distros don't have the vmlinux binary easily available; it needs to
be either downloaded as part of debuginfo packages or uncompressed from
vmlinuz.

  parent reply	other threads:[~2023-12-22  9:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20 22:19 [PATCH dwarves] pahole: Inject kfunc decl tags into BTF Daniel Xu
2023-12-21  6:37 ` Daniel Xu
2023-12-21  8:35   ` Jiri Olsa
2023-12-21 17:05     ` Alexei Starovoitov
2023-12-21 17:42       ` Alan Maguire
2023-12-21 18:07         ` Alexei Starovoitov
2023-12-21 18:18           ` Daniel Xu
2023-12-22  0:52             ` Alexei Starovoitov
2023-12-22 20:50               ` Daniel Xu
2023-12-22  9:55           ` Alan Maguire [this message]
2023-12-22 12:46             ` Jiri Olsa
2023-12-22 16:24               ` Alan Maguire
2023-12-22 20:55                 ` Daniel Xu
2023-12-22 22:11                   ` Alexei Starovoitov
2024-01-03  0:56     ` Daniel Xu
2024-01-03  8:48       ` Jiri Olsa
2024-01-03 20:19         ` Daniel Xu
2023-12-21  8:35 ` Jiri Olsa
2023-12-23 19:35   ` Daniel Xu
2023-12-21 22:57 ` David Marchevsky
2023-12-23 19:40   ` Daniel Xu

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=64f6db18-ebd5-501b-2457-a8abe6187a0f@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dxu@dxuuu.xyz \
    --cc=olsajiri@gmail.com \
    --cc=quentin@isovalent.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