From: Alan Maguire <alan.maguire@oracle.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: andrii@kernel.org, jolsa@kernel.org, acme@redhat.com,
quentin@isovalent.com, eddyz87@gmail.com, mykolal@fb.com,
ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
haoluo@google.com, houtao1@huawei.com, bpf@vger.kernel.org,
masahiroy@kernel.org, mcgrof@kernel.org, nathan@kernel.org
Subject: Re: [PATCH v5 bpf-next 9/9] kbuild,bpf: add module-specific pahole flags for distilled base BTF
Date: Sun, 2 Jun 2024 14:41:31 +0100 [thread overview]
Message-ID: <762bba74-7daa-4ebd-b991-acb9a0b14d82@oracle.com> (raw)
In-Reply-To: <CAEf4Bzbgie89A+j3NeFNDor+_AN84YO=f-f+3ekjauxfL=KZ5g@mail.gmail.com>
On 31/05/2024 20:06, Andrii Nakryiko wrote:
> On Tue, May 28, 2024 at 5:25 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>
>> Support creation of module BTF along with distilled base BTF;
>> the latter is stored in a .BTF.base ELF section and supplements
>> split BTF references to base BTF with information about base types,
>> allowing for later relocation of split BTF with a (possibly
>> changed) base. resolve_btfids detects the presence of a .BTF.base
>> section and will use it instead of the base BTF it is passed in
>> BTF id resolution.
>>
>> Modules will be built with a distilled .BTF.base section for external
>> module build, i.e.
>>
>> make -C. -M=path2/module
>>
>> ...while in-tree module build as part of a normal kernel build will
>> not generate distilled base BTF; this is because in-tree modules
>> change with the kernel and do not require BTF relocation for the
>> running vmlinux.
>>
>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>> ---
>> scripts/Makefile.btf | 5 +++++
>> scripts/Makefile.modfinal | 2 +-
>> 2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf
>> index bca8a8f26ea4..191b4903e864 100644
>> --- a/scripts/Makefile.btf
>> +++ b/scripts/Makefile.btf
>> @@ -21,8 +21,13 @@ else
>> # Switch to using --btf_features for v1.26 and later.
>> pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func
>>
>> +ifneq ($(KBUILD_EXTMOD),)
>> +module-pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=distilled_base
>
> Remind me, please. What's the state of pahole patches? Are they
> waiting on these libbpf changes to land first, right?
>
Exactly. The idea would be this; we land the libbpf patches first, and
then update the dependent commit in the dwarves repo to point at one
with the relocation APIs. In the interim - where we have the code in the
library but not in pahole - everything continues to work as before. It's
just that the above --btf_feature creating distilled BTF is ignored,
which means we don't generate any distilled BTF in any modules until
that support is in the pahole used.
Thanks!
Alan
>> +endif
>> +
>> endif
>>
>> pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust
>>
>> export PAHOLE_FLAGS := $(pahole-flags-y)
>> +export MODULE_PAHOLE_FLAGS := $(module-pahole-flags-y)
>> diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
>> index 79fcf2731686..6d2b8da98ee5 100644
>> --- a/scripts/Makefile.modfinal
>> +++ b/scripts/Makefile.modfinal
>> @@ -39,7 +39,7 @@ quiet_cmd_btf_ko = BTF [M] $@
>> if [ ! -f vmlinux ]; then \
>> printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \
>> else \
>> - LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \
>> + LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) $(MODULE_PAHOLE_FLAGS) --btf_base vmlinux $@; \
>> $(RESOLVE_BTFIDS) -b vmlinux $@; \
>> fi;
>>
>> --
>> 2.31.1
>>
prev parent reply other threads:[~2024-06-02 13:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 12:23 [PATCH v5 bpf-next 0/9] bpf: support resilient split BTF Alan Maguire
2024-05-28 12:24 ` [PATCH v5 bpf-next 1/9] libbpf: add btf__distill_base() creating split BTF with distilled base BTF Alan Maguire
2024-05-30 19:58 ` Eduard Zingerman
2024-05-28 12:24 ` [PATCH v5 bpf-next 2/9] selftests/bpf: test distilled base, split BTF generation Alan Maguire
2024-05-30 20:23 ` Eduard Zingerman
2024-05-28 12:24 ` [PATCH v5 bpf-next 3/9] libbpf: split BTF relocation Alan Maguire
2024-05-31 2:22 ` Eduard Zingerman
2024-05-31 15:38 ` Alan Maguire
2024-05-31 18:44 ` Andrii Nakryiko
2024-06-01 7:56 ` Eduard Zingerman
2024-06-02 13:47 ` Alan Maguire
2024-05-31 18:21 ` Andrii Nakryiko
2024-05-28 12:24 ` [PATCH v5 bpf-next 4/9] selftests/bpf: extend distilled BTF tests to cover " Alan Maguire
2024-05-31 2:23 ` Eduard Zingerman
2024-05-28 12:24 ` [PATCH v5 bpf-next 5/9] libbpf: make btf_parse_elf process .BTF.base transparently Alan Maguire
2024-05-31 18:57 ` Andrii Nakryiko
2024-06-01 8:04 ` Eduard Zingerman
2024-05-28 12:24 ` [PATCH v5 bpf-next 6/9] resolve_btfids: handle presence of .BTF.base section Alan Maguire
2024-05-28 12:24 ` [PATCH v5 bpf-next 7/9] module, bpf: store BTF base pointer in struct module Alan Maguire
2024-05-28 18:27 ` Luis Chamberlain
2024-05-28 12:24 ` [PATCH v5 bpf-next 8/9] libbpf,bpf: share BTF relocate-related code with kernel Alan Maguire
2024-05-31 9:34 ` Eduard Zingerman
2024-05-31 16:13 ` Alan Maguire
2024-05-31 19:04 ` Andrii Nakryiko
2024-06-01 1:59 ` Andrii Nakryiko
2024-06-02 13:42 ` Alan Maguire
2024-05-28 12:24 ` [PATCH v5 bpf-next 9/9] kbuild,bpf: add module-specific pahole flags for distilled base BTF Alan Maguire
2024-05-31 19:06 ` Andrii Nakryiko
2024-06-02 13:41 ` Alan Maguire [this message]
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=762bba74-7daa-4ebd-b991-acb9a0b14d82@oracle.com \
--to=alan.maguire@oracle.com \
--cc=acme@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=houtao1@huawei.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=masahiroy@kernel.org \
--cc=mcgrof@kernel.org \
--cc=mykolal@fb.com \
--cc=nathan@kernel.org \
--cc=quentin@isovalent.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--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