From: Alan Maguire <alan.maguire@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>, bpf <bpf@vger.kernel.org>
Subject: Re: Questions about the state of some BTF features
Date: Fri, 25 Oct 2024 17:38:10 +0100 [thread overview]
Message-ID: <4ce7da07-20f7-4684-b60b-4704405fa703@oracle.com> (raw)
In-Reply-To: <CAADnVQLmSKATXzi+++hGpk0i-UiOKk8qt9N2CGBkznCRVr=qcQ@mail.gmail.com>
On 25/10/2024 17:19, Alexei Starovoitov wrote:
> On Fri, Oct 25, 2024 at 9:15 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>
>> On 25/10/2024 17:09, Alexei Starovoitov wrote:
>>> On Thu, Oct 24, 2024 at 4:26 PM Andrii Nakryiko
>>> <andrii.nakryiko@gmail.com> wrote:
>>>>
>>>>>
>>>>> The good news is that already happens, provided you have the updated
>>>>> pahole to handle distilled base generation. After building selftests I see
>>>>>
>>>>> $ objdump -h bpf_testmod.ko |grep BTF
>>>>> 7 .BTF_ids 000001c8 0000000000000000 0000000000000000 00002c50
>>>>> 2**0
>>>>> 50 .BTF 000036f4 0000000000000000 0000000000000000 0006e048
>>>>> 2**0
>>>>> 51 .BTF.base 000004cc 0000000000000000 0000000000000000 0007173c
>>>>> 2**0
>>>>>
>>>>
>>>> Indeed, after updating to the latest pahole master now I get
>>>> .BTF.base, very nice.
>>>
>>> I pulled the latest pahole, rebuilt everything,
>>> but still cannot get it to generate BTF.base.
>>>
>>> Any special trick needed?
>>
>> Hmm, should just work for bpf_testmod.ko as long as "pahole
>> --supported_btf_features" reports "distilled_base" among the set of
>> features. scripts/Makefile.btf should add that feature if KBUILD_EXTMOD
>> is set, as it should be in the case of building bpf_testmod.ko. I'll
>> double-check at my end with latest bpf-next, but it was working
>> yesterday for me.
>
> There must be something else necessary:
>
> pahole -J -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
> --lang_exclude=rust --btf_features=distilled_base --btf_base vmlinux
> .../bpf/bpf_testmod/bpf_testmod.ko; .../resolve_btfids -b vmlinux
> .../selftests/bpf/bpf_testmod/bpf_testmod.ko;
>
> objdump -h .../testing/selftests/bpf/bpf_testmod/bpf_testmod.ko|grep BTF
> 7 .BTF_ids 000001c8 0000000000000000 0000000000000000 00001d94 2**0
> 50 .BTF 00002ea7 0000000000000000 0000000000000000 00062e30 2**0
>
Not sure what's going on for you here to be honest. I just tried pulling
latest bpf-next and dwarves master branch, rebuilding pahole and
selftests. I see .BTF.base sections for each .ko in selftests/bpf.
Can you provide the output of
pahole --supported_btf_features
? If it contains distilled_base things _should_ be working. The only
other reason I can think of that you might not get .BTF.base sections is
if dwarves was built against a local libbpf (rather than the git
submodule) or local libbpf headers _and_ that libbpf did not include
distilled base BTF support; in that case we skip .BTF.base generation
since the APIs are not available.
next prev parent reply other threads:[~2024-10-25 16:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 0:08 Questions about the state of some BTF features Andrii Nakryiko
2024-10-24 14:10 ` Alan Maguire
2024-10-24 16:53 ` Andrii Nakryiko
2024-10-24 17:20 ` Alan Maguire
2024-10-24 23:26 ` Andrii Nakryiko
2024-10-25 16:09 ` Alexei Starovoitov
2024-10-25 16:15 ` Alan Maguire
2024-10-25 16:19 ` Alexei Starovoitov
2024-10-25 16:38 ` Alan Maguire [this message]
2024-10-25 16:49 ` Alexei Starovoitov
2024-10-25 16:51 ` Alexei Starovoitov
2024-10-25 17:05 ` Alan Maguire
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=4ce7da07-20f7-4684-b60b-4704405fa703@oracle.com \
--to=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=bpf@vger.kernel.org \
/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