diff mbox series

UBUNTU: [Packaging] do not attempt to generate BTF header on armhf

Message ID 20240821101322.896500-1-luca.boccassi@gmail.com
State New
Headers show
Series UBUNTU: [Packaging] do not attempt to generate BTF header on armhf | expand

Commit Message

Luca Boccassi Aug. 21, 2024, 10:13 a.m. UTC
From: Luca Boccassi <bluca@debian.org>

BugLink: https://bugs.launchpad.net/bugs/2050083

armhf does not have working BTF for now, so create an empty header file
like Debian does for now, to be dropped once that issue is fixed.

Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 debian/rules.d/2-binary-arch.mk | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Timo Aaltonen Aug. 22, 2024, 1:04 p.m. UTC | #1
luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
> From: Luca Boccassi <bluca@debian.org>
> 
> BugLink: https://bugs.launchpad.net/bugs/2050083
> 
> armhf does not have working BTF for now, so create an empty header file
> like Debian does for now, to be dropped once that issue is fixed.
> 
> Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>   debian/rules.d/2-binary-arch.mk | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index 792276bf8458..5486ceb672f8 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
>   endif
>   	mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
>   	$(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
> +	# TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
> +ifneq ($(arch),armhf)
>   	$(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
> +else
> +	echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
> +endif
>   	rm -f $(builddirpa)/vmlinux
>   ifeq ($(do_tools_x86),true)
>   	cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)


Please amend the previous patch (which is dropped now), and protect this 
(and the other parts) checking for 'do_tools_bpftool' instead of 
hardcoding the arch here.
Luca Boccassi Aug. 22, 2024, 1:12 p.m. UTC | #2
On Thu, 22 Aug 2024 at 14:04, Timo Aaltonen <tjaalton@ubuntu.com> wrote:
>
> luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
> > From: Luca Boccassi <bluca@debian.org>
> >
> > BugLink: https://bugs.launchpad.net/bugs/2050083
> >
> > armhf does not have working BTF for now, so create an empty header file
> > like Debian does for now, to be dropped once that issue is fixed.
> >
> > Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
> >
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> >   debian/rules.d/2-binary-arch.mk | 5 +++++
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > index 792276bf8458..5486ceb672f8 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
> >   endif
> >       mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
> >       $(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
> > +     # TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
> > +ifneq ($(arch),armhf)
> >       $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
> > +else
> > +     echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
> > +endif
> >       rm -f $(builddirpa)/vmlinux
> >   ifeq ($(do_tools_x86),true)
> >       cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
>
>
> Please amend the previous patch (which is dropped now), and protect this
> (and the other parts) checking for 'do_tools_bpftool' instead of
> hardcoding the arch here.

Ok - is https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/oracular
the right git repository to use to base this on? If not, would you be
able to please link the right repo and branch? Thanks
Timo Aaltonen Aug. 22, 2024, 1:46 p.m. UTC | #3
Luca Boccassi kirjoitti 22.8.2024 klo 16.12:
> On Thu, 22 Aug 2024 at 14:04, Timo Aaltonen <tjaalton@ubuntu.com> wrote:
>>
>> luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
>>> From: Luca Boccassi <bluca@debian.org>
>>>
>>> BugLink: https://bugs.launchpad.net/bugs/2050083
>>>
>>> armhf does not have working BTF for now, so create an empty header file
>>> like Debian does for now, to be dropped once that issue is fixed.
>>>
>>> Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
>>>
>>> Signed-off-by: Luca Boccassi <bluca@debian.org>
>>> ---
>>>    debian/rules.d/2-binary-arch.mk | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
>>> index 792276bf8458..5486ceb672f8 100644
>>> --- a/debian/rules.d/2-binary-arch.mk
>>> +++ b/debian/rules.d/2-binary-arch.mk
>>> @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
>>>    endif
>>>        mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
>>>        $(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
>>> +     # TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
>>> +ifneq ($(arch),armhf)
>>>        $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
>>> +else
>>> +     echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
>>> +endif
>>>        rm -f $(builddirpa)/vmlinux
>>>    ifeq ($(do_tools_x86),true)
>>>        cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
>>
>>
>> Please amend the previous patch (which is dropped now), and protect this
>> (and the other parts) checking for 'do_tools_bpftool' instead of
>> hardcoding the arch here.
> 
> Ok - is https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/oracular
> the right git repository to use to base this on? If not, would you be
> able to please link the right repo and branch? Thanks

yes, updated now with 6.11.0-4.4 on top on master-next branch
Timo Aaltonen Sept. 4, 2024, 6:57 a.m. UTC | #4
luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
> From: Luca Boccassi <bluca@debian.org>
> 
> BugLink: https://bugs.launchpad.net/bugs/2050083
> 
> armhf does not have working BTF for now, so create an empty header file
> like Debian does for now, to be dropped once that issue is fixed.
> 
> Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>   debian/rules.d/2-binary-arch.mk | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index 792276bf8458..5486ceb672f8 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
>   endif
>   	mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
>   	$(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
> +	# TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
> +ifneq ($(arch),armhf)
>   	$(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
> +else
> +	echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
> +endif
>   	rm -f $(builddirpa)/vmlinux
>   ifeq ($(do_tools_x86),true)
>   	cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)


Applied with minor changes, added do_tools_bpftool_stub=true to armhf.mk 
to avoid hardcoding the arch in rules.
Luca Boccassi Sept. 4, 2024, 8:31 a.m. UTC | #5
On Wed, 4 Sept 2024 at 07:57, Timo Aaltonen <tjaalton@ubuntu.com> wrote:
>
> luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
> > From: Luca Boccassi <bluca@debian.org>
> >
> > BugLink: https://bugs.launchpad.net/bugs/2050083
> >
> > armhf does not have working BTF for now, so create an empty header file
> > like Debian does for now, to be dropped once that issue is fixed.
> >
> > Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
> >
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> >   debian/rules.d/2-binary-arch.mk | 5 +++++
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > index 792276bf8458..5486ceb672f8 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
> >   endif
> >       mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
> >       $(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
> > +     # TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
> > +ifneq ($(arch),armhf)
> >       $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
> > +else
> > +     echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
> > +endif
> >       rm -f $(builddirpa)/vmlinux
> >   ifeq ($(do_tools_x86),true)
> >       cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
>
>
> Applied with minor changes, added do_tools_bpftool_stub=true to armhf.mk
> to avoid hardcoding the arch in rules.

Thank you very much for your help!
Luca Boccassi Sept. 16, 2024, 7:40 p.m. UTC | #6
On Wed, 4 Sept 2024 at 10:31, Luca Boccassi <luca.boccassi@gmail.com> wrote:
>
> On Wed, 4 Sept 2024 at 07:57, Timo Aaltonen <tjaalton@ubuntu.com> wrote:
> >
> > luca.boccassi@gmail.com kirjoitti 21.8.2024 klo 13.13:
> > > From: Luca Boccassi <bluca@debian.org>
> > >
> > > BugLink: https://bugs.launchpad.net/bugs/2050083
> > >
> > > armhf does not have working BTF for now, so create an empty header file
> > > like Debian does for now, to be dropped once that issue is fixed.
> > >
> > > Follow-up for 60df5eb6035b53143695d8e6a6bff62a05fd0884
> > >
> > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > ---
> > >   debian/rules.d/2-binary-arch.mk | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > >
> > > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > > index 792276bf8458..5486ceb672f8 100644
> > > --- a/debian/rules.d/2-binary-arch.mk
> > > +++ b/debian/rules.d/2-binary-arch.mk
> > > @@ -659,7 +659,12 @@ ifeq ($(do_tools_perf),true)
> > >   endif
> > >       mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
> > >       $(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
> > > +     # TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
> > > +ifneq ($(arch),armhf)
> > >       $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
> > > +else
> > > +     echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
> > > +endif
> > >       rm -f $(builddirpa)/vmlinux
> > >   ifeq ($(do_tools_x86),true)
> > >       cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
> >
> >
> > Applied with minor changes, added do_tools_bpftool_stub=true to armhf.mk
> > to avoid hardcoding the arch in rules.
>
> Thank you very much for your help!

Hello Timo,

Now that the new linux-bpf-dev package is in Oracular, is there any
chance the change could be backported to Noble too, please? The two
commits cherry pick cleanly between the branches.
The systemd upstream CI tests Noble too, so it would be very useful
for us to have it available there as well.

Thanks!
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 792276bf8458..5486ceb672f8 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -659,7 +659,12 @@  ifeq ($(do_tools_perf),true)
 endif
 	mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
 	$(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
+	# TODO: armhf does not have working BTF, so ship a stub header for now, can be removed once it's fixed
+ifneq ($(arch),armhf)
 	$(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
+else
+	echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
+endif
 	rm -f $(builddirpa)/vmlinux
 ifeq ($(do_tools_x86),true)
 	cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)