* [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around
@ 2026-08-27 9:55 Thomas Petazzoni via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22 Thomas Petazzoni via buildroot
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-27 9:55 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni, Romain Naour
bpftrace often needs very recent kernel headers, more recent than the
runtime version actually needed. We already had a workaround in
libbpf making sure that if the kernel headers are older than 6.1, we
would install the libbpf provided headers instead.
As we are about to update bpftrace to a newer version that uses
BPF_TRACE_KPROBE_SESSION, which was introduced in Linux 6.10, we need
to update this workaround accordingly and ensure that the libbpf
header is installed if the kernel headers are older than 6.10.
This is necessary for the update of bpftrace to 0.26.1.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/libbpf/libbpf.mk | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk
index 5a6d574331..0683ec12c1 100644
--- a/package/libbpf/libbpf.mk
+++ b/package/libbpf/libbpf.mk
@@ -18,14 +18,12 @@ define LIBBPF_BUILD_CMDS
-C $(@D)/src
endef
-# bpftrace uses bpf_iter_link_info.task that was added since kernel 6.1
+# bpftrace uses BPF_TRACE_KPROBE_SESSION that was added since kernel 6.10
# so we need to update some uapi headers in STAGING_DIR if the toolchain
-# is build with linux-headers < 6.1.
+# is build with linux-headers < 6.1.0
# Otherwise bpftrace is broken due to out of date linux/bpf.h installed
# by the toolchain.
-# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f0d74c4da1f060d2a66976193712a5e6abd361f5
-# https://github.com/bpftrace/bpftrace/commit/7578314df67df6bbdffaf493ff3b4d182b235b34
-ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_1),)
+ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_10),)
LIBBPF_UPDATE_UAPI_HEADERS = install_uapi_headers UAPIDIR=/usr/include/bpf
define LIBBPF_FIX_STAGING_PC
--
2.55.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22
2026-08-27 9:55 [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Thomas Petazzoni via buildroot
@ 2026-08-27 9:55 ` Thomas Petazzoni via buildroot
2026-09-04 12:17 ` Thomas Perale via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 3/3] support/testing: add bpftrace test Thomas Petazzoni via buildroot
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-27 9:55 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni, Qais Yousef, Romain Naour
Since Buildroot commit 25cb3813e7fc6ed3e455f983cf0e09c7bc02fccb which
bumped LLVM from 21.x to 22.x, the build of bpftrace is broken as
bpftrace 0.24.2 only supports LLVM up to 21.
We tried backporting the bpftrace patch that allows using LLVM up to
version 22 but the patch didn't apply cleanly but more importantly it
wasn't clear if this patch was sufficient. Therefore, we opt for
bumping bpftrace entirely to fix the issue.
Packaging changes:
- The new version of bpftrace no longer needs host-bison/host-flex,
because bpftrace is now using a handwritten parser.
- Pass -DUSE_SYSTEM_LIBBPF:BOOL=ON to ensure the system libbpf version
is used, and not the bundled version
- Now depends on kernel headers >= 5.10 because it needs CAP_BPF and
CAP_PERFMON
Fixes:
https://autobuild.buildroot.net/results/a3e3fd696685864977c688aa11c2653357cf6207/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/bpftrace/Config.in | 6 +++---
package/bpftrace/bpftrace.hash | 2 +-
package/bpftrace/bpftrace.mk | 7 +++----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/package/bpftrace/Config.in b/package/bpftrace/Config.in
index 8af94443ab..2beb2fdb95 100644
--- a/package/bpftrace/Config.in
+++ b/package/bpftrace/Config.in
@@ -14,7 +14,7 @@ config BR2_PACKAGE_BPFTRACE
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # bcc -> clang
depends on BR2_INSTALL_LIBSTDCPP # bcc -> clang
depends on BR2_HOST_GCC_AT_LEAST_7 # bcc -> clang
- depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13 # libbpf
+ depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 # CAP_BPF, CAP_PERFMON
depends on BR2_USE_WCHAR # bcc -> clang, bcc -> python3, libbpf
depends on BR2_TOOLCHAIN_HAS_THREADS # bcc -> clang, bcc -> python3, libbpf
depends on !BR2_STATIC_LIBS # bcc -> clang, bcc -> python3, libbpf
@@ -47,10 +47,10 @@ config BR2_PACKAGE_BPFTRACE
https://www.github.com/iovisor/bpftrace
-comment "bpftrace needs a glibc toolchain w/ C++, gcc >= 7, host gcc >= 7, kernel headers >= 4.13"
+comment "bpftrace needs a glibc toolchain w/ C++, gcc >= 7, host gcc >= 7, kernel headers >= 5.10"
depends on BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS
depends on BR2_USE_MMU
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || !BR2_HOST_GCC_AT_LEAST_7 \
- || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
+ || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
diff --git a/package/bpftrace/bpftrace.hash b/package/bpftrace/bpftrace.hash
index 4add96aee3..48572d1c58 100644
--- a/package/bpftrace/bpftrace.hash
+++ b/package/bpftrace/bpftrace.hash
@@ -1,3 +1,3 @@
# locally calculated
-sha256 e0514aa3e1a032b0b2de2cf3c281bfee9b9e80509498e70ed78786bbd64db373 bpftrace-0.24.2.tar.gz
+sha256 555368f32f94bfcb74b119a3d9c67b68200be6375b8f452f794a2d3f6ebbcd16 bpftrace-0.26.1.tar.gz
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
diff --git a/package/bpftrace/bpftrace.mk b/package/bpftrace/bpftrace.mk
index f530d4861b..7c9bc6b7a4 100644
--- a/package/bpftrace/bpftrace.mk
+++ b/package/bpftrace/bpftrace.mk
@@ -4,7 +4,7 @@
#
################################################################################
-BPFTRACE_VERSION = 0.24.2
+BPFTRACE_VERSION = 0.26.1
BPFTRACE_SITE = $(call github,bpftrace,bpftrace,v$(BPFTRACE_VERSION))
BPFTRACE_LICENSE = Apache-2.0
BPFTRACE_LICENSE_FILES = LICENSE
@@ -13,8 +13,6 @@ BPFTRACE_DEPENDENCIES = \
bzip2 \
cereal \
elfutils \
- host-bison \
- host-flex \
host-vim \
libbpf \
llvm \
@@ -29,6 +27,7 @@ BPFTRACE_CONF_OPTS += \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include/bpf" \
- -DENABLE_MAN:BOOL=OFF
+ -DENABLE_MAN:BOOL=OFF \
+ -DUSE_SYSTEM_LIBBPF:BOOL=ON
$(eval $(cmake-package))
--
2.55.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-27 9:55 [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Thomas Petazzoni via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22 Thomas Petazzoni via buildroot
@ 2026-08-27 9:55 ` Thomas Petazzoni via buildroot
2026-08-29 14:19 ` Peter Korsgaard
2026-09-04 12:19 ` Thomas Perale via buildroot
2026-08-28 10:58 ` [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Julien Olivain via buildroot
2026-09-04 12:17 ` Thomas Perale via buildroot
3 siblings, 2 replies; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-27 9:55 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
This commit adds a simple bpftrace test that ensures that not only it
builds fine, but it also runs properly on a minimal test scenario.
Assisted-by: GPT-5.6
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 2 +
.../testing/tests/package/test_bpftrace.py | 66 +++++++++++++++++++
.../test_bpftrace/linux-bpftrace.fragment | 4 ++
3 files changed, 72 insertions(+)
create mode 100644 support/testing/tests/package/test_bpftrace.py
create mode 100644 support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
diff --git a/DEVELOPERS b/DEVELOPERS
index 5eb438906f..080aaac5e0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3297,6 +3297,8 @@ F: support/testing/tests/package/sample_python_flask_expects_json.py
F: support/testing/tests/package/sample_python_git.py
F: support/testing/tests/package/sample_python_pyudev.py
F: support/testing/tests/package/sample_python_unittest_xml_reporting.py
+F: support/testing/tests/package/test_bpftrace.py
+F: support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
F: support/testing/tests/package/test_nodejs.py
F: support/testing/tests/package/test_python_augeas.py
F: support/testing/tests/package/test_python_crccheck.py
diff --git a/support/testing/tests/package/test_bpftrace.py b/support/testing/tests/package/test_bpftrace.py
new file mode 100644
index 0000000000..70ccfe8b20
--- /dev/null
+++ b/support/testing/tests/package/test_bpftrace.py
@@ -0,0 +1,66 @@
+import os
+
+import infra.basetest
+
+
+# gitlab-runner: 2xlarge
+class TestBpftrace(infra.basetest.BRTest):
+ kern_fragment = infra.filepath(
+ "tests/package/test_bpftrace/linux-bpftrace.fragment"
+ )
+ config = f"""
+ BR2_aarch64=y
+ BR2_TOOLCHAIN_EXTERNAL=y
+ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+ BR2_LINUX_KERNEL=y
+ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.32"
+ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{kern_fragment}"
+ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+ BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+ BR2_PACKAGE_BPFTRACE=y
+ BR2_PACKAGE_TAR=y
+ BR2_TARGET_ROOTFS_EXT2=y
+ BR2_TARGET_ROOTFS_EXT2_4=y
+ BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
+ # BR2_TARGET_ROOTFS_TAR is not set
+ """
+
+ def test_run(self):
+ drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+ kern = os.path.join(self.builddir, "images", "Image")
+ self.emulator.boot(
+ arch="aarch64",
+ kernel=kern,
+ kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+ options=[
+ "-M",
+ "virt",
+ "-cpu",
+ "cortex-a57",
+ "-m",
+ "256M",
+ "-drive",
+ f"file={drive},if=virtio,format=raw",
+ ],
+ )
+ self.emulator.login()
+
+ self.assertRunOk("mount -t debugfs none /sys/kernel/debug/")
+
+ # Check that bpftrace can find a syscall tracepoint.
+ self.assertRunOk("bpftrace -l 'tracepoint:syscalls:sys_enter_execve'")
+
+ # Compile and attach a tracepoint program, then trigger it with the
+ # command executed by bpftrace. The marker avoids matching volatile
+ # fields such as PIDs or command names.
+ cmd = (
+ "bpftrace -e 'tracepoint:syscalls:sys_enter_execve "
+ '{ printf("buildroot-bpftrace-test\\n"); exit(); }\' '
+ "-c /bin/true"
+ )
+ output, ret = self.emulator.run(cmd)
+ self.assertEqual(ret, 0)
+ self.assertIn("buildroot-bpftrace-test", "\n".join(output))
diff --git a/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment b/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
new file mode 100644
index 0000000000..35359b08f6
--- /dev/null
+++ b/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
@@ -0,0 +1,4 @@
+CONFIG_FTRACE=y
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_FUNCTION_TRACER=y
+CONFIG_KPROBES=y
--
2.55.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around
2026-08-27 9:55 [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Thomas Petazzoni via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22 Thomas Petazzoni via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 3/3] support/testing: add bpftrace test Thomas Petazzoni via buildroot
@ 2026-08-28 10:58 ` Julien Olivain via buildroot
2026-09-04 12:17 ` Thomas Perale via buildroot
3 siblings, 0 replies; 12+ messages in thread
From: Julien Olivain via buildroot @ 2026-08-28 10:58 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot, Romain Naour
On 27/08/2026 11:55, Thomas Petazzoni via buildroot wrote:
> bpftrace often needs very recent kernel headers, more recent than the
> runtime version actually needed. We already had a workaround in
> libbpf making sure that if the kernel headers are older than 6.1, we
> would install the libbpf provided headers instead.
>
> As we are about to update bpftrace to a newer version that uses
> BPF_TRACE_KPROBE_SESSION, which was introduced in Linux 6.10, we need
> to update this workaround accordingly and ensure that the libbpf
> header is installed if the kernel headers are older than 6.10.
>
> This is necessary for the update of bpftrace to 0.26.1.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Series applied to master, thanks.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-27 9:55 ` [Buildroot] [PATCH 3/3] support/testing: add bpftrace test Thomas Petazzoni via buildroot
@ 2026-08-29 14:19 ` Peter Korsgaard
2026-08-29 16:52 ` Julien Olivain via buildroot
2026-09-04 12:19 ` Thomas Perale via buildroot
1 sibling, 1 reply; 12+ messages in thread
From: Peter Korsgaard @ 2026-08-29 14:19 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> This commit adds a simple bpftrace test that ensures that not only it
> builds fine, but it also runs properly on a minimal test scenario.
> + config = f"""
> + BR2_aarch64=y
> + BR2_TOOLCHAIN_EXTERNAL=y
> + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> + BR2_LINUX_KERNEL=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.32"
Any specific reason to use such an old kernel? The qemu_aarch64_virt
defconfig uses a 6.18 kernel. Is it to match the default ARM 15.2
external toolchain? If so, that one is built against 6.6.44.
cat output/host/usr/aarch64-buildroot-linux-gnu/sysroot/usr/include/linux/version.h
#define LINUX_VERSION_CODE 394796
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
#define LINUX_VERSION_MAJOR 6
#define LINUX_VERSION_PATCHLEVEL 6
#define LINUX_VERSION_SUBLEVEL 44
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-29 14:19 ` Peter Korsgaard
@ 2026-08-29 16:52 ` Julien Olivain via buildroot
2026-08-29 17:49 ` Peter Korsgaard
2026-08-29 18:45 ` Thomas Petazzoni via buildroot
0 siblings, 2 replies; 12+ messages in thread
From: Julien Olivain via buildroot @ 2026-08-29 16:52 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: Thomas Petazzoni via buildroot, Thomas Petazzoni
Hi Peter, Thomas,
On 29/08/2026 16:19, Peter Korsgaard wrote:
>>>>>> "Thomas" == Thomas Petazzoni via buildroot
>>>>>> <buildroot@buildroot.org> writes:
>
> > This commit adds a simple bpftrace test that ensures that not only
> it
> > builds fine, but it also runs properly on a minimal test scenario.
>
> > + config = f"""
> > + BR2_aarch64=y
> > + BR2_TOOLCHAIN_EXTERNAL=y
> > + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> > + BR2_LINUX_KERNEL=y
> > + BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> > + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.32"
>
> Any specific reason to use such an old kernel? The qemu_aarch64_virt
> defconfig uses a 6.18 kernel. Is it to match the default ARM 15.2
> external toolchain? If so, that one is built against 6.6.44.
>
> cat
> output/host/usr/aarch64-buildroot-linux-gnu/sysroot/usr/include/linux/version.h
> #define LINUX_VERSION_CODE 394796
> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ?
> 255 : (c)))
> #define LINUX_VERSION_MAJOR 6
> #define LINUX_VERSION_PATCHLEVEL 6
> #define LINUX_VERSION_SUBLEVEL 44
I initially had the same question. Then, I assumed this new runtime test
has been simply copied from the existing test_bcc:
https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/testing/tests/package/test_bcc.py
which was written with kernel 6.6.32, which was the latest LTS at that
time.
Once the next 2026.08 release will be complete, I think we will do a
cleanup
in runtime tests, to add a Aarch64 builtin kernel at the latest LTS. So
all
those runtime tests will be updated.
> --
> Bye, Peter Korsgaard
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-29 16:52 ` Julien Olivain via buildroot
@ 2026-08-29 17:49 ` Peter Korsgaard
2026-08-29 18:45 ` Thomas Petazzoni via buildroot
1 sibling, 0 replies; 12+ messages in thread
From: Peter Korsgaard @ 2026-08-29 17:49 UTC (permalink / raw)
To: Julien Olivain; +Cc: Thomas Petazzoni via buildroot, Thomas Petazzoni
>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:
Hi,
> I initially had the same question. Then, I assumed this new runtime test
> has been simply copied from the existing test_bcc:
> https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/testing/tests/package/test_bcc.py
> which was written with kernel 6.6.32, which was the latest LTS at that
> time.
> Once the next 2026.08 release will be complete, I think we will do a
> cleanup in runtime tests, to add a Aarch64 builtin kernel at the
> latest LTS. So all those runtime tests will be updated.
Ok, good.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-29 16:52 ` Julien Olivain via buildroot
2026-08-29 17:49 ` Peter Korsgaard
@ 2026-08-29 18:45 ` Thomas Petazzoni via buildroot
2026-08-29 19:24 ` Julien Olivain via buildroot
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-29 18:45 UTC (permalink / raw)
To: Julien Olivain; +Cc: romain.naour, Thomas Petazzoni via buildroot
On Sat, Aug 29, 2026 at 06:52:08PM +0200, Julien Olivain wrote:
> I initially had the same question. Then, I assumed this new runtime test
> has been simply copied from the existing test_bcc:
> https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/testing/tests/package/test_bcc.py
> which was written with kernel 6.6.32, which was the latest LTS at that time.
Absolutely correct. And of course, I see no problem in migrating all
these tests to 6.18.
> Once the next 2026.08 release will be complete, I think we will do a cleanup
> in runtime tests, to add a Aarch64 builtin kernel at the latest LTS. So all
> those runtime tests will be updated.
I vaguely remember that one intern from Romain Naour was working on
this, I even vaguely remember seeing patches implementing this, no?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-29 18:45 ` Thomas Petazzoni via buildroot
@ 2026-08-29 19:24 ` Julien Olivain via buildroot
0 siblings, 0 replies; 12+ messages in thread
From: Julien Olivain via buildroot @ 2026-08-29 19:24 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: romain.naour, Thomas Petazzoni via buildroot
Hi Thomas, All,
On 29/08/2026 20:45, Thomas Petazzoni wrote:
> On Sat, Aug 29, 2026 at 06:52:08PM +0200, Julien Olivain wrote:
>
>> I initially had the same question. Then, I assumed this new runtime
>> test
>> has been simply copied from the existing test_bcc:
>> https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/testing/tests/package/test_bcc.py
>> which was written with kernel 6.6.32, which was the latest LTS at that
>> time.
>
> Absolutely correct. And of course, I see no problem in migrating all
> these tests to 6.18.
>
>> Once the next 2026.08 release will be complete, I think we will do a
>> cleanup
>> in runtime tests, to add a Aarch64 builtin kernel at the latest LTS.
>> So all
>> those runtime tests will be updated.
>
> I vaguely remember that one intern from Romain Naour was working on
> this, I even vaguely remember seeing patches implementing this, no?
If I try to summarize the state of this activity:
I merged a series a while back, updating many kernels
in runtime tests:
https://patchwork.ozlabs.org/project/buildroot/list/?series=500282&state=*
Then, there is an initiative to build the runtime test pre-built
Kernels from the Gitlab CI:
https://patchwork.buildroot.org/project/buildroot/list/?series=210
Ideally we would like to add new kernels (aarch64 for ex).
Then, there is ongoing work to switch most tests on the new relevant
pre-built kernels. I think the most advance ongoing work is at:
https://gitlab.com/kubu93/buildroot/-/commits/prebuilt-aarch64-kernel-v7
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22
2026-08-27 9:55 ` [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22 Thomas Petazzoni via buildroot
@ 2026-09-04 12:17 ` Thomas Perale via buildroot
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Perale via buildroot @ 2026-09-04 12:17 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Thomas Perale, buildroot
In reply of:
> Since Buildroot commit 25cb3813e7fc6ed3e455f983cf0e09c7bc02fccb which
> bumped LLVM from 21.x to 22.x, the build of bpftrace is broken as
> bpftrace 0.24.2 only supports LLVM up to 21.
>
> We tried backporting the bpftrace patch that allows using LLVM up to
> version 22 but the patch didn't apply cleanly but more importantly it
> wasn't clear if this patch was sufficient. Therefore, we opt for
> bumping bpftrace entirely to fix the issue.
>
> Packaging changes:
>
> - The new version of bpftrace no longer needs host-bison/host-flex,
> because bpftrace is now using a handwritten parser.
>
> - Pass -DUSE_SYSTEM_LIBBPF:BOOL=ON to ensure the system libbpf version
> is used, and not the bundled version
>
> - Now depends on kernel headers >= 5.10 because it needs CAP_BPF and
> CAP_PERFMON
>
> Fixes:
>
> https://autobuild.buildroot.net/results/a3e3fd696685864977c688aa11c2653357cf6207/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Applied to 2026.05.x. Thanks
> ---
> package/bpftrace/Config.in | 6 +++---
> package/bpftrace/bpftrace.hash | 2 +-
> package/bpftrace/bpftrace.mk | 7 +++----
> 3 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/package/bpftrace/Config.in b/package/bpftrace/Config.in
> index 8af94443ab..2beb2fdb95 100644
> --- a/package/bpftrace/Config.in
> +++ b/package/bpftrace/Config.in
> @@ -14,7 +14,7 @@ config BR2_PACKAGE_BPFTRACE
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # bcc -> clang
> depends on BR2_INSTALL_LIBSTDCPP # bcc -> clang
> depends on BR2_HOST_GCC_AT_LEAST_7 # bcc -> clang
> - depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13 # libbpf
> + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 # CAP_BPF, CAP_PERFMON
> depends on BR2_USE_WCHAR # bcc -> clang, bcc -> python3, libbpf
> depends on BR2_TOOLCHAIN_HAS_THREADS # bcc -> clang, bcc -> python3, libbpf
> depends on !BR2_STATIC_LIBS # bcc -> clang, bcc -> python3, libbpf
> @@ -47,10 +47,10 @@ config BR2_PACKAGE_BPFTRACE
>
> https://www.github.com/iovisor/bpftrace
>
> -comment "bpftrace needs a glibc toolchain w/ C++, gcc >= 7, host gcc >= 7, kernel headers >= 4.13"
> +comment "bpftrace needs a glibc toolchain w/ C++, gcc >= 7, host gcc >= 7, kernel headers >= 5.10"
> depends on BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS
> depends on BR2_USE_MMU
> depends on BR2_TOOLCHAIN_HAS_SYNC_4
> depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \
> || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || !BR2_HOST_GCC_AT_LEAST_7 \
> - || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
> + || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
> diff --git a/package/bpftrace/bpftrace.hash b/package/bpftrace/bpftrace.hash
> index 4add96aee3..48572d1c58 100644
> --- a/package/bpftrace/bpftrace.hash
> +++ b/package/bpftrace/bpftrace.hash
> @@ -1,3 +1,3 @@
> # locally calculated
> -sha256 e0514aa3e1a032b0b2de2cf3c281bfee9b9e80509498e70ed78786bbd64db373 bpftrace-0.24.2.tar.gz
> +sha256 555368f32f94bfcb74b119a3d9c67b68200be6375b8f452f794a2d3f6ebbcd16 bpftrace-0.26.1.tar.gz
> sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
> diff --git a/package/bpftrace/bpftrace.mk b/package/bpftrace/bpftrace.mk
> index f530d4861b..7c9bc6b7a4 100644
> --- a/package/bpftrace/bpftrace.mk
> +++ b/package/bpftrace/bpftrace.mk
> @@ -4,7 +4,7 @@
> #
> ################################################################################
>
> -BPFTRACE_VERSION = 0.24.2
> +BPFTRACE_VERSION = 0.26.1
> BPFTRACE_SITE = $(call github,bpftrace,bpftrace,v$(BPFTRACE_VERSION))
> BPFTRACE_LICENSE = Apache-2.0
> BPFTRACE_LICENSE_FILES = LICENSE
> @@ -13,8 +13,6 @@ BPFTRACE_DEPENDENCIES = \
> bzip2 \
> cereal \
> elfutils \
> - host-bison \
> - host-flex \
> host-vim \
> libbpf \
> llvm \
> @@ -29,6 +27,7 @@ BPFTRACE_CONF_OPTS += \
> -DBUILD_SHARED_LIBS:BOOL=OFF \
> -DBUILD_TESTING:BOOL=OFF \
> -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include/bpf" \
> - -DENABLE_MAN:BOOL=OFF
> + -DENABLE_MAN:BOOL=OFF \
> + -DUSE_SYSTEM_LIBBPF:BOOL=ON
>
> $(eval $(cmake-package))
> --
> 2.55.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around
2026-08-27 9:55 [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Thomas Petazzoni via buildroot
` (2 preceding siblings ...)
2026-08-28 10:58 ` [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Julien Olivain via buildroot
@ 2026-09-04 12:17 ` Thomas Perale via buildroot
3 siblings, 0 replies; 12+ messages in thread
From: Thomas Perale via buildroot @ 2026-09-04 12:17 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Thomas Perale, buildroot
In reply of:
> bpftrace often needs very recent kernel headers, more recent than the
> runtime version actually needed. We already had a workaround in
> libbpf making sure that if the kernel headers are older than 6.1, we
> would install the libbpf provided headers instead.
>
> As we are about to update bpftrace to a newer version that uses
> BPF_TRACE_KPROBE_SESSION, which was introduced in Linux 6.10, we need
> to update this workaround accordingly and ensure that the libbpf
> header is installed if the kernel headers are older than 6.10.
>
> This is necessary for the update of bpftrace to 0.26.1.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Applied to 2026.05.x. Thanks
> ---
> package/libbpf/libbpf.mk | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk
> index 5a6d574331..0683ec12c1 100644
> --- a/package/libbpf/libbpf.mk
> +++ b/package/libbpf/libbpf.mk
> @@ -18,14 +18,12 @@ define LIBBPF_BUILD_CMDS
> -C $(@D)/src
> endef
>
> -# bpftrace uses bpf_iter_link_info.task that was added since kernel 6.1
> +# bpftrace uses BPF_TRACE_KPROBE_SESSION that was added since kernel 6.10
> # so we need to update some uapi headers in STAGING_DIR if the toolchain
> -# is build with linux-headers < 6.1.
> +# is build with linux-headers < 6.1.0
> # Otherwise bpftrace is broken due to out of date linux/bpf.h installed
> # by the toolchain.
> -# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f0d74c4da1f060d2a66976193712a5e6abd361f5
> -# https://github.com/bpftrace/bpftrace/commit/7578314df67df6bbdffaf493ff3b4d182b235b34
> -ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_1),)
> +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_10),)
> LIBBPF_UPDATE_UAPI_HEADERS = install_uapi_headers UAPIDIR=/usr/include/bpf
>
> define LIBBPF_FIX_STAGING_PC
> --
> 2.55.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH 3/3] support/testing: add bpftrace test
2026-08-27 9:55 ` [Buildroot] [PATCH 3/3] support/testing: add bpftrace test Thomas Petazzoni via buildroot
2026-08-29 14:19 ` Peter Korsgaard
@ 2026-09-04 12:19 ` Thomas Perale via buildroot
1 sibling, 0 replies; 12+ messages in thread
From: Thomas Perale via buildroot @ 2026-09-04 12:19 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Thomas Perale, buildroot
In reply of:
> This commit adds a simple bpftrace test that ensures that not only it
> builds fine, but it also runs properly on a minimal test scenario.
>
> Assisted-by: GPT-5.6
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Applied to 2025.02.x & 2026.05.x. Thanks
> ---
> DEVELOPERS | 2 +
> .../testing/tests/package/test_bpftrace.py | 66 +++++++++++++++++++
> .../test_bpftrace/linux-bpftrace.fragment | 4 ++
> 3 files changed, 72 insertions(+)
> create mode 100644 support/testing/tests/package/test_bpftrace.py
> create mode 100644 support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 5eb438906f..080aaac5e0 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -3297,6 +3297,8 @@ F: support/testing/tests/package/sample_python_flask_expects_json.py
> F: support/testing/tests/package/sample_python_git.py
> F: support/testing/tests/package/sample_python_pyudev.py
> F: support/testing/tests/package/sample_python_unittest_xml_reporting.py
> +F: support/testing/tests/package/test_bpftrace.py
> +F: support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
> F: support/testing/tests/package/test_nodejs.py
> F: support/testing/tests/package/test_python_augeas.py
> F: support/testing/tests/package/test_python_crccheck.py
> diff --git a/support/testing/tests/package/test_bpftrace.py b/support/testing/tests/package/test_bpftrace.py
> new file mode 100644
> index 0000000000..70ccfe8b20
> --- /dev/null
> +++ b/support/testing/tests/package/test_bpftrace.py
> @@ -0,0 +1,66 @@
> +import os
> +
> +import infra.basetest
> +
> +
> +# gitlab-runner: 2xlarge
> +class TestBpftrace(infra.basetest.BRTest):
> + kern_fragment = infra.filepath(
> + "tests/package/test_bpftrace/linux-bpftrace.fragment"
> + )
> + config = f"""
> + BR2_aarch64=y
> + BR2_TOOLCHAIN_EXTERNAL=y
> + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> + BR2_LINUX_KERNEL=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.32"
> + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
> + BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{kern_fragment}"
> + BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> + BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> + BR2_PACKAGE_BPFTRACE=y
> + BR2_PACKAGE_TAR=y
> + BR2_TARGET_ROOTFS_EXT2=y
> + BR2_TARGET_ROOTFS_EXT2_4=y
> + BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
> + # BR2_TARGET_ROOTFS_TAR is not set
> + """
> +
> + def test_run(self):
> + drive = os.path.join(self.builddir, "images", "rootfs.ext4")
> + kern = os.path.join(self.builddir, "images", "Image")
> + self.emulator.boot(
> + arch="aarch64",
> + kernel=kern,
> + kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
> + options=[
> + "-M",
> + "virt",
> + "-cpu",
> + "cortex-a57",
> + "-m",
> + "256M",
> + "-drive",
> + f"file={drive},if=virtio,format=raw",
> + ],
> + )
> + self.emulator.login()
> +
> + self.assertRunOk("mount -t debugfs none /sys/kernel/debug/")
> +
> + # Check that bpftrace can find a syscall tracepoint.
> + self.assertRunOk("bpftrace -l 'tracepoint:syscalls:sys_enter_execve'")
> +
> + # Compile and attach a tracepoint program, then trigger it with the
> + # command executed by bpftrace. The marker avoids matching volatile
> + # fields such as PIDs or command names.
> + cmd = (
> + "bpftrace -e 'tracepoint:syscalls:sys_enter_execve "
> + '{ printf("buildroot-bpftrace-test\\n"); exit(); }\' '
> + "-c /bin/true"
> + )
> + output, ret = self.emulator.run(cmd)
> + self.assertEqual(ret, 0)
> + self.assertIn("buildroot-bpftrace-test", "\n".join(output))
> diff --git a/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment b/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
> new file mode 100644
> index 0000000000..35359b08f6
> --- /dev/null
> +++ b/support/testing/tests/package/test_bpftrace/linux-bpftrace.fragment
> @@ -0,0 +1,4 @@
> +CONFIG_FTRACE=y
> +CONFIG_FTRACE_SYSCALLS=y
> +CONFIG_FUNCTION_TRACER=y
> +CONFIG_KPROBES=y
> --
> 2.55.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-09-04 12:19 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 9:55 [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Thomas Petazzoni via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 2/3] package/bpftrace: bump to version 0.26.1 to fix build with LLVM 22 Thomas Petazzoni via buildroot
2026-09-04 12:17 ` Thomas Perale via buildroot
2026-08-27 9:55 ` [Buildroot] [PATCH 3/3] support/testing: add bpftrace test Thomas Petazzoni via buildroot
2026-08-29 14:19 ` Peter Korsgaard
2026-08-29 16:52 ` Julien Olivain via buildroot
2026-08-29 17:49 ` Peter Korsgaard
2026-08-29 18:45 ` Thomas Petazzoni via buildroot
2026-08-29 19:24 ` Julien Olivain via buildroot
2026-09-04 12:19 ` Thomas Perale via buildroot
2026-08-28 10:58 ` [Buildroot] [PATCH 1/3] package/libbpf: update UAPI header installation work-around Julien Olivain via buildroot
2026-09-04 12:17 ` Thomas Perale via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.