summaryrefslogtreecommitdiff
path: root/dev-debug/bpftrace
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-debug/bpftrace
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-debug/bpftrace')
-rw-r--r--dev-debug/bpftrace/Manifest7
-rw-r--r--dev-debug/bpftrace/bpftrace-0.24.2.ebuild159
-rw-r--r--dev-debug/bpftrace/bpftrace-0.25.1.ebuild160
-rw-r--r--dev-debug/bpftrace/bpftrace-0.26.1.ebuild160
-rw-r--r--dev-debug/bpftrace/bpftrace-9999.ebuild160
-rw-r--r--dev-debug/bpftrace/files/0.11.4-old-kernels.patch28
-rw-r--r--dev-debug/bpftrace/files/0.21.0-dont-compress-man.patch47
-rw-r--r--dev-debug/bpftrace/files/0.24.1-enable-ubsan.patch88
-rw-r--r--dev-debug/bpftrace/metadata.xml25
9 files changed, 834 insertions, 0 deletions
diff --git a/dev-debug/bpftrace/Manifest b/dev-debug/bpftrace/Manifest
new file mode 100644
index 000000000000..81369d914bf0
--- /dev/null
+++ b/dev-debug/bpftrace/Manifest
@@ -0,0 +1,7 @@
+DIST bpftrace-0.24.2-man.tar.xz 43820 BLAKE2B b0964633f4c1a462874f20934c286c321307a4abf79ebebaf085396e545a119f39f46f35b597921a61a5707a6cad5b368788ca8db682dee0eb916fc8a65b5520 SHA512 5a64c875400ede0050ee13f00351e06f72aeb8d8ce0db6933ac9c9f93023388218dd5fd62db7fd24370ddadbe390c6efa71692afd2e55b7f5755e4816f4832eb
+DIST bpftrace-0.24.2.tar.gz 1375106 BLAKE2B c397eb7ded3a72ea0805487db66f422bda9a0a743b1757056dc1bc70119e2d4fa7e69577a7e295143ce2b9789c62c4469b995ac0dca228c464efb3db8da25eeb SHA512 d9ff773ce39b578877d5e73a48434d3654b46985bb4b9ad458fbf622718049da5075b3a2d2e6d1ae0a9effbdb74658822b4c4535bca384fbd6e539fdec393f4b
+DIST bpftrace-0.25.0-man.tar.xz 44292 BLAKE2B e3ad8255b74836c9947595cd3c39caa201ccc420e573376ea7a144c499f4f74349911df87618f98a877d797b6d3b0c54f0117292537d03e184d2669b8a1331a5 SHA512 343fadffec5d2a6f702e2fe67087718c909f32cd6440dabc0fa93d2c0b8264ceda7d7a1eee7f79b4be2365318170c4eff7582453ec8ff4e15343ce2cb056b2ea
+DIST bpftrace-0.25.1-man.tar.xz 44300 BLAKE2B 54ed5e0e04f74d7c310d14a2d624238d9d7f42a4abab101272693caf714020bb420a221793ea8bef0bd1490cd47e6cc87ed4e75d187c7127c99b2ef771df208a SHA512 d9b28a4e4705714ba38af0dcda6eb78379cb44da5dd2de47cca1061bc2b020b97aca4fd09cb734932a5f925b31b34aa266e4ff2a54ac438715543c054340cd8d
+DIST bpftrace-0.25.1.tar.gz 1486111 BLAKE2B f2b9f2f9d44faa47f846c3c14800424d27dca0d210672cc03f60e5aadfe789fb4842bddfca4a4d73b3714a8d817710cedb66b055f8477e58f1202b64a188a444 SHA512 abe7bfab906894de889c958020b2dcc65bdc0b5c3d8986846ef41a9d593ca16075632916cf281154630221c6e511a11e3139a09bb641570277a44bd47299bbe6
+DIST bpftrace-0.26.1-man.tar.xz 44680 BLAKE2B 21e0c4492b1885f24fdd91c814a5144326c0e7491b07dd1dfcc4f139842d4094371a179842a6d0cfc5666e3cb4e631138ecdaf56e8ba64b001046ce934294ba2 SHA512 653a0877eb4ff74f17adf7688490c3afb63a264cf9fe3f64d3ec7437f2a51ee7dd21a254277cba677fa6fac8cff836d25e94199ee5ac8ef3152eedee38fbf707
+DIST bpftrace-0.26.1.tar.gz 1549419 BLAKE2B f9be88f6767de8752d46377f2833a511972166fc2d857fc11c16264e40f42cd39f12f9a8e04e0c8b9b8a3f11b1c4df17b002acbadbf30658d01494bdb206818b SHA512 2b2f052b742317b991b2e267881167ec58f0b7fa24574950f090d237665930a7ddfaa26e9a9f03eb3db01ab111a99ecb8f4b41f1c944b6f1df0218f109bfe72d
diff --git a/dev-debug/bpftrace/bpftrace-0.24.2.ebuild b/dev-debug/bpftrace/bpftrace-0.24.2.ebuild
new file mode 100644
index 000000000000..ea57a4ba3a3f
--- /dev/null
+++ b/dev-debug/bpftrace/bpftrace-0.24.2.ebuild
@@ -0,0 +1,159 @@
+# Copyright 2019-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {17..21} )
+RUST_MIN_VER="1.85.1"
+RUST_OPTIONAL=1
+
+inherit cmake flag-o-matic linux-info llvm-r1 rust
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/bpftrace/bpftrace"
+MY_PV="${PV//_/}"
+
+if [[ ${PV} == *9999* ]] ; then
+ EGIT_REPO_URI="https://github.com/bpftrace/bpftrace"
+ EGIT_BRANCH="release/0.24.x"
+ inherit git-r3
+ # use a released man page for git
+ MAN_V="0.24.2"
+else
+ SRC_URI="https://github.com/bpftrace/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm64"
+ # the man page version may trail the release
+ #MAN_V="0.24.2"
+fi
+
+SRC_URI+=" https://github.com/bpftrace/${PN}/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> ${PN}-${MAN_V:-${PV}}-man.tar.xz"
+
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+IUSE="pcap systemd test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/blazesym_c-0.1.1
+ >=dev-libs/libbpf-1.5:=
+ >=dev-util/bcc-0.25.0
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}=
+ llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)]
+ ')
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+ systemd? ( sys-apps/systemd:= )
+ pcap? ( net-libs/libpcap:= )
+ virtual/zlib:=
+"
+DEPEND="
+ ${RDEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ app-alternatives/lex
+ app-alternatives/yacc
+ dev-libs/cereal
+ dev-util/bpftool
+ || ( dev-util/xxd app-editors/vim-core )
+ test? (
+ ${RUST_DEPEND}
+ dev-lang/go
+ dev-util/pahole
+ )
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/0.11.4-old-kernels.patch"
+ "${FILESDIR}/0.21.0-dont-compress-man.patch"
+ "${FILESDIR}/0.24.1-enable-ubsan.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~DEBUG_INFO_BTF
+ ~DEBUG_INFO_BTF_MODULES
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+
+ if use test; then
+ if ! linux_config_exists ; then
+ die "Unable to check your kernel for BTF support: tests cannot run."
+ elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then
+ die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run."
+ fi
+ fi
+}
+
+pkg_setup() {
+ llvm-r1_pkg_setup
+ use test && rust_pkg_setup
+}
+
+# git-r3 overrides automatic SRC_URI unpacking
+src_unpack() {
+ default
+
+ if [[ ${PV} == *9999* ]] ; then
+ git-r3_src_unpack
+ fi
+}
+
+src_prepare() {
+ # create a usable version from git
+ if [[ ${PV} == *9999* ]] ; then
+ local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD)
+ sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # suppress one remaining and benign ODR violation warning due to
+ # a generated libbpf header used by the tests, see:
+ # https://github.com/bpftrace/bpftrace/issues/4591
+ use test && append-flags -Wno-odr
+
+ local mycmakeargs=(
+ # DO dynamically link the bpftrace executable
+ -DSTATIC_LINKING=OFF
+ # DO NOT build the internal libs as shared
+ -DBUILD_SHARED_LIBS=OFF
+ -DBUILD_TESTING=$(usex test)
+ # we use the pregenerated man page
+ -DENABLE_MAN=OFF
+ -DENABLE_SKB_OUTPUT=$(usex pcap)
+ -DENABLE_SYSTEMD=$(usex systemd)
+ )
+
+ # enable UBSAN only when enabled in the toolchain
+ if is-flagq -fsanitize=undefined; then
+ filter-flags -fsanitize=undefined
+ mycmakeargs+=( -DBUILD_UBSAN=ON )
+ fi
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ doman man/man8/*.?
+ gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die
+ doman "${WORKDIR}/man/man8/bpftrace.8"
+}
diff --git a/dev-debug/bpftrace/bpftrace-0.25.1.ebuild b/dev-debug/bpftrace/bpftrace-0.25.1.ebuild
new file mode 100644
index 000000000000..ab4ee111d39f
--- /dev/null
+++ b/dev-debug/bpftrace/bpftrace-0.25.1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2019-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {18..22} )
+RUST_MIN_VER="1.85.0"
+RUST_OPTIONAL=1
+
+inherit cmake flag-o-matic linux-info llvm-r1 rust
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/bpftrace/bpftrace"
+MY_PV="${PV//_/}"
+
+if [[ ${PV} == *9999* ]] ; then
+ EGIT_REPO_URI="https://github.com/bpftrace/bpftrace"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ # use a released man page for git
+ MAN_V="0.25.0"
+else
+ SRC_URI="https://github.com/bpftrace/bpftrace/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64"
+ # the man page version may trail the release
+ #MAN_V="0.25.0"
+fi
+
+SRC_URI+=" https://github.com/bpftrace/bpftrace/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> bpftrace-${MAN_V:-${PV}}-man.tar.xz"
+
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+IUSE="pcap systemd test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/blazesym_c-0.1.1
+ >=dev-libs/libbpf-1.6:=[static-libs]
+ >=dev-util/bcc-0.25.0
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}=
+ llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)]
+ ')
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+ systemd? ( sys-apps/systemd:= )
+ pcap? ( net-libs/libpcap:= )
+ virtual/zlib:=
+"
+DEPEND="
+ ${RDEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ app-alternatives/lex
+ app-alternatives/yacc
+ dev-libs/cereal
+ dev-util/bpftool
+ || ( dev-util/xxd app-editors/vim-core )
+ test? (
+ ${RUST_DEPEND}
+ dev-lang/go
+ dev-util/pahole
+ )
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/0.11.4-old-kernels.patch"
+ "${FILESDIR}/0.21.0-dont-compress-man.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~DEBUG_INFO_BTF
+ ~DEBUG_INFO_BTF_MODULES
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+
+ if use test; then
+ if ! linux_config_exists ; then
+ die "Unable to check your kernel for BTF support: tests cannot run."
+ elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then
+ die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run."
+ fi
+ fi
+}
+
+pkg_setup() {
+ llvm-r1_pkg_setup
+ use test && rust_pkg_setup
+}
+
+# git-r3 overrides automatic SRC_URI unpacking
+src_unpack() {
+ default
+
+ if [[ ${PV} == *9999* ]] ; then
+ git-r3_src_unpack
+ fi
+}
+
+src_prepare() {
+ # create a usable version from git
+ if [[ ${PV} == *9999* ]] ; then
+ local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD)
+ sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # suppress one remaining and benign ODR violation warning due to
+ # a generated libbpf header used by the tests, see:
+ # https://github.com/bpftrace/bpftrace/issues/4591
+ use test && append-flags -Wno-odr
+
+ local mycmakeargs=(
+ # DO dynamically link the bpftrace executable
+ -DSTATIC_LINKING=OFF
+ # DO NOT build the internal libs as shared
+ -DBUILD_SHARED_LIBS=OFF
+ -DBUILD_TESTING=$(usex test)
+ # we use the pregenerated man page
+ -DENABLE_MAN=OFF
+ -DENABLE_SKB_OUTPUT=$(usex pcap)
+ -DENABLE_SYSTEMD=$(usex systemd)
+ # always use system libbpf
+ -DUSE_SYSTEM_LIBBPF=ON
+ )
+
+ # enable UBSAN only when enabled in the toolchain
+ if is-flagq -fsanitize=undefined; then
+ filter-flags -fsanitize=undefined
+ mycmakeargs+=( -DBUILD_UBSAN=ON )
+ fi
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ doman man/man8/*.?
+ gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die
+ doman "${WORKDIR}/man/man8/bpftrace.8"
+}
diff --git a/dev-debug/bpftrace/bpftrace-0.26.1.ebuild b/dev-debug/bpftrace/bpftrace-0.26.1.ebuild
new file mode 100644
index 000000000000..726742c759d6
--- /dev/null
+++ b/dev-debug/bpftrace/bpftrace-0.26.1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2019-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {18..22} )
+RUST_MIN_VER="1.85.0"
+RUST_OPTIONAL=1
+
+inherit cmake flag-o-matic linux-info llvm-r2 rust
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/bpftrace/bpftrace"
+MY_PV="${PV//_/}"
+
+if [[ ${PV} == *9999* ]] ; then
+ EGIT_REPO_URI="https://github.com/bpftrace/bpftrace"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ # use a released man page for git
+ MAN_V="0.25.0"
+else
+ SRC_URI="https://github.com/bpftrace/bpftrace/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64"
+ # the man page version may trail the release
+ #MAN_V="0.25.0"
+fi
+
+SRC_URI+=" https://github.com/bpftrace/bpftrace/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> bpftrace-${MAN_V:-${PV}}-man.tar.xz"
+
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+IUSE="pcap systemd test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/blazesym_c-0.1.1
+ >=dev-libs/libbpf-1.6:=[static-libs]
+ >=dev-util/bcc-0.25.0
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}=
+ llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)]
+ ')
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+ systemd? ( sys-apps/systemd:= )
+ pcap? ( net-libs/libpcap:= )
+ virtual/zlib:=
+"
+DEPEND="
+ ${RDEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ app-alternatives/lex
+ app-alternatives/yacc
+ dev-libs/cereal
+ dev-util/bpftool
+ || ( dev-util/xxd app-editors/vim-core )
+ test? (
+ ${RUST_DEPEND}
+ dev-lang/go
+ dev-util/pahole
+ )
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/0.11.4-old-kernels.patch"
+ "${FILESDIR}/0.21.0-dont-compress-man.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~DEBUG_INFO_BTF
+ ~DEBUG_INFO_BTF_MODULES
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+
+ if use test; then
+ if ! linux_config_exists ; then
+ die "Unable to check your kernel for BTF support: tests cannot run."
+ elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then
+ die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run."
+ fi
+ fi
+}
+
+pkg_setup() {
+ llvm-r2_pkg_setup
+ use test && rust_pkg_setup
+}
+
+# git-r3 overrides automatic SRC_URI unpacking
+src_unpack() {
+ default
+
+ if [[ ${PV} == *9999* ]] ; then
+ git-r3_src_unpack
+ fi
+}
+
+src_prepare() {
+ # create a usable version from git
+ if [[ ${PV} == *9999* ]] ; then
+ local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD)
+ sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # suppress one remaining and benign ODR violation warning due to
+ # a generated libbpf header used by the tests, see:
+ # https://github.com/bpftrace/bpftrace/issues/4591
+ use test && append-flags -Wno-odr
+
+ local mycmakeargs=(
+ # DO dynamically link the bpftrace executable
+ -DSTATIC_LINKING=OFF
+ # DO NOT build the internal libs as shared
+ -DBUILD_SHARED_LIBS=OFF
+ -DBUILD_TESTING=$(usex test)
+ # we use the pregenerated man page
+ -DENABLE_MAN=OFF
+ -DENABLE_SKB_OUTPUT=$(usex pcap)
+ -DENABLE_SYSTEMD=$(usex systemd)
+ # always use system libbpf
+ -DUSE_SYSTEM_LIBBPF=ON
+ )
+
+ # enable UBSAN only when enabled in the toolchain
+ if is-flagq -fsanitize=undefined; then
+ filter-flags -fsanitize=undefined
+ mycmakeargs+=( -DBUILD_UBSAN=ON )
+ fi
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ doman man/man8/*.?
+ gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die
+ doman "${WORKDIR}/man/man8/bpftrace.8"
+}
diff --git a/dev-debug/bpftrace/bpftrace-9999.ebuild b/dev-debug/bpftrace/bpftrace-9999.ebuild
new file mode 100644
index 000000000000..726742c759d6
--- /dev/null
+++ b/dev-debug/bpftrace/bpftrace-9999.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2019-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {18..22} )
+RUST_MIN_VER="1.85.0"
+RUST_OPTIONAL=1
+
+inherit cmake flag-o-matic linux-info llvm-r2 rust
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/bpftrace/bpftrace"
+MY_PV="${PV//_/}"
+
+if [[ ${PV} == *9999* ]] ; then
+ EGIT_REPO_URI="https://github.com/bpftrace/bpftrace"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ # use a released man page for git
+ MAN_V="0.25.0"
+else
+ SRC_URI="https://github.com/bpftrace/bpftrace/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64"
+ # the man page version may trail the release
+ #MAN_V="0.25.0"
+fi
+
+SRC_URI+=" https://github.com/bpftrace/bpftrace/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> bpftrace-${MAN_V:-${PV}}-man.tar.xz"
+
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+IUSE="pcap systemd test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/blazesym_c-0.1.1
+ >=dev-libs/libbpf-1.6:=[static-libs]
+ >=dev-util/bcc-0.25.0
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}=
+ llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)]
+ ')
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+ systemd? ( sys-apps/systemd:= )
+ pcap? ( net-libs/libpcap:= )
+ virtual/zlib:=
+"
+DEPEND="
+ ${RDEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ app-alternatives/lex
+ app-alternatives/yacc
+ dev-libs/cereal
+ dev-util/bpftool
+ || ( dev-util/xxd app-editors/vim-core )
+ test? (
+ ${RUST_DEPEND}
+ dev-lang/go
+ dev-util/pahole
+ )
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/0.11.4-old-kernels.patch"
+ "${FILESDIR}/0.21.0-dont-compress-man.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~DEBUG_INFO_BTF
+ ~DEBUG_INFO_BTF_MODULES
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+
+ if use test; then
+ if ! linux_config_exists ; then
+ die "Unable to check your kernel for BTF support: tests cannot run."
+ elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then
+ die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run."
+ fi
+ fi
+}
+
+pkg_setup() {
+ llvm-r2_pkg_setup
+ use test && rust_pkg_setup
+}
+
+# git-r3 overrides automatic SRC_URI unpacking
+src_unpack() {
+ default
+
+ if [[ ${PV} == *9999* ]] ; then
+ git-r3_src_unpack
+ fi
+}
+
+src_prepare() {
+ # create a usable version from git
+ if [[ ${PV} == *9999* ]] ; then
+ local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD)
+ sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # suppress one remaining and benign ODR violation warning due to
+ # a generated libbpf header used by the tests, see:
+ # https://github.com/bpftrace/bpftrace/issues/4591
+ use test && append-flags -Wno-odr
+
+ local mycmakeargs=(
+ # DO dynamically link the bpftrace executable
+ -DSTATIC_LINKING=OFF
+ # DO NOT build the internal libs as shared
+ -DBUILD_SHARED_LIBS=OFF
+ -DBUILD_TESTING=$(usex test)
+ # we use the pregenerated man page
+ -DENABLE_MAN=OFF
+ -DENABLE_SKB_OUTPUT=$(usex pcap)
+ -DENABLE_SYSTEMD=$(usex systemd)
+ # always use system libbpf
+ -DUSE_SYSTEM_LIBBPF=ON
+ )
+
+ # enable UBSAN only when enabled in the toolchain
+ if is-flagq -fsanitize=undefined; then
+ filter-flags -fsanitize=undefined
+ mycmakeargs+=( -DBUILD_UBSAN=ON )
+ fi
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ doman man/man8/*.?
+ gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die
+ doman "${WORKDIR}/man/man8/bpftrace.8"
+}
diff --git a/dev-debug/bpftrace/files/0.11.4-old-kernels.patch b/dev-debug/bpftrace/files/0.11.4-old-kernels.patch
new file mode 100644
index 000000000000..831de6487a84
--- /dev/null
+++ b/dev-debug/bpftrace/files/0.11.4-old-kernels.patch
@@ -0,0 +1,28 @@
+diff --git a/src/btf.h b/src/btf.h
+index 61579a3..4e9f9fc 100644
+--- a/src/btf.h
++++ b/src/btf.h
+@@ -2,6 +2,7 @@
+
+ #include "types.h"
+ #include <linux/types.h>
++#include <linux/version.h>
+ #include <map>
+ #include <regex>
+ #include <string>
+@@ -11,6 +12,15 @@
+ struct btf;
+ struct btf_type;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
++/* this is required to build with 5.4 and earlier kernel headers */
++enum btf_func_linkage {
++ BTF_FUNC_STATIC = 0,
++ BTF_FUNC_GLOBAL = 1,
++ BTF_FUNC_EXTERN = 2,
++};
++#endif
++
+ namespace bpftrace {
+
+ class BTF
diff --git a/dev-debug/bpftrace/files/0.21.0-dont-compress-man.patch b/dev-debug/bpftrace/files/0.21.0-dont-compress-man.patch
new file mode 100644
index 000000000000..93bcfcf73e31
--- /dev/null
+++ b/dev-debug/bpftrace/files/0.21.0-dont-compress-man.patch
@@ -0,0 +1,47 @@
+diff --git a/man/adoc/CMakeLists.txt b/man/adoc/CMakeLists.txt
+index 1a81dee0..c93ccbd2 100644
+--- a/man/adoc/CMakeLists.txt
++++ b/man/adoc/CMakeLists.txt
+@@ -1,7 +1,5 @@
+-find_program(GZIP gzip REQUIRED)
+ find_program(ASCIIDOCTOR asciidoctor)
+ file(GLOB FILES *.adoc)
+-set(GZFILES "")
+ if(NOT "${ASCIIDOCTOR}" STREQUAL "ASCIIDOCTOR-NOTFOUND")
+ foreach(FIL ${FILES})
+ get_filename_component(NAME ${FIL} NAME_WE)
+@@ -12,14 +10,9 @@ if(NOT "${ASCIIDOCTOR}" STREQUAL "ASCIIDOCTOR-NOTFOUND")
+ COMMAND ${ASCIIDOCTOR} ${FIL} -b manpage -o - > ${MANPAGE_FILE}
+ DEPENDS ${FIL})
+
+- add_custom_command(OUTPUT ${GZ_MANPAGE_FILE}
+- COMMAND ${GZIP} -nc ${MANPAGE_FILE} > ${GZ_MANPAGE_FILE}
+- DEPENDS ${MANPAGE_FILE})
+-
+- list(APPEND GZFILES ${GZ_MANPAGE_FILE})
+ endforeach()
+- add_custom_target(adoc_man DEPENDS ${GZFILES})
+- install(FILES ${GZFILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
++ add_custom_target(adoc_man DEPENDS ${FILES})
++ install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
+ else()
+ message(WARNING "asciidoctor not found, building without bpftrace manpage")
+ add_custom_target(adoc_man)
+diff --git a/man/man8/CMakeLists.txt b/man/man8/CMakeLists.txt
+index 2a316cd9..2207cf80 100644
+--- a/man/man8/CMakeLists.txt
++++ b/man/man8/CMakeLists.txt
+@@ -1,12 +1,3 @@
+-find_program(GZIP gzip REQUIRED)
+ file(GLOB FILES *.8)
+-set(GZFILES "")
+-foreach(FIL ${FILES})
+- get_filename_component(NAME ${FIL} NAME)
+- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz
+- COMMAND ${GZIP} -nc ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz
+- DEPENDS ${FIL})
+- list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz")
+-endforeach()
+ add_custom_target(man_man DEPENDS ${GZFILES})
+-install(FILES ${GZFILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
++install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
diff --git a/dev-debug/bpftrace/files/0.24.1-enable-ubsan.patch b/dev-debug/bpftrace/files/0.24.1-enable-ubsan.patch
new file mode 100644
index 000000000000..8e6cc1bb3053
--- /dev/null
+++ b/dev-debug/bpftrace/files/0.24.1-enable-ubsan.patch
@@ -0,0 +1,88 @@
+From: https://github.com/bpftrace/bpftrace/pull/4655
+
+From: =?UTF-8?q?Viktor=20Mal=C3=ADk?= <viktor.malik@gmail.com>
+Date: Thu, 25 Sep 2025 13:34:17 +0200
+Subject: [PATCH] CMake: Enable UBSan builds (#4655)
+
+Add new CMake option `BUILD_UBSAN` which will add `-fsanitize=undefined`
+to the build. This helps to identify undefined behavior.
+
+Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
+---
+ CMakeLists.txt | 1 +
+ src/CMakeLists.txt | 13 +++++++++++++
+ src/aot/CMakeLists.txt | 4 ++++
+ tests/CMakeLists.txt | 5 +++++
+ 4 files changed, 23 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 898ec2f85560..5bb09a2e56be 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,6 +15,7 @@ set(HARDENED_STDLIB OFF CACHE BOOL "Enable hardened definitions for standard lib
+ set(STATIC_LINKING OFF CACHE BOOL "Build bpftrace as a statically linked executable")
+
+ set(BUILD_ASAN OFF CACHE BOOL "Build bpftrace with -fsanitize=address")
++set(BUILD_UBSAN OFF CACHE BOOL "Build bpftrace with -fsanitize=undefined")
+ set(ENABLE_MAN ON CACHE BOOL "Build man pages")
+ set(BUILD_TESTING ON CACHE BOOL "Build test suite")
+ set(ENABLE_TEST_VALIDATE_CODEGEN ON CACHE BOOL "Run LLVM IR validation tests")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 0432e6106e6d..d5432c0995d3 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -2,6 +2,12 @@ if(HAVE_BFD_DISASM)
+ set(BFD_DISASM_SRC bfd-disasm.cpp)
+ endif()
+
++if (BUILD_UBSAN)
++ # This adds -fsanitize=undefined to all below compiler invocations, including
++ # subdirectories.
++ add_compile_options("-fsanitize=undefined")
++endif()
++
+ add_library(required_resources required_resources.cpp)
+ add_dependencies(required_resources parser)
+
+@@ -201,6 +207,13 @@ if (BUILD_ASAN)
+ target_link_options(bpftrace PUBLIC "-fsanitize=address")
+ endif()
+
++if (BUILD_UBSAN)
++ # We do not use add_link_options here since it doesn't work for some reason.
++ # Instead, just pass -fsanitize=undefined to the linker when linking the
++ # bpftrace target.
++ target_link_options(bpftrace PUBLIC "-fsanitize=undefined")
++endif()
++
+ if (STATIC_LINKING)
+ if(ANDROID)
+ target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
+diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
+index 1323bdacb6df..5267e4a1c19e 100644
+--- a/src/aot/CMakeLists.txt
++++ b/src/aot/CMakeLists.txt
+@@ -34,3 +34,7 @@ if(BUILD_ASAN)
+ target_compile_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
+ target_link_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
+ endif()
++
++if(BUILD_UBSAN)
++ target_link_options(bpftrace-aotrt PUBLIC "-fsanitize=undefined")
++endif()
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index b6002e8075ff..141b44d5a30e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -94,6 +94,11 @@ if(BUILD_ASAN)
+ target_link_options(bpftrace_test PUBLIC "-fsanitize=address")
+ endif()
+
++if(BUILD_UBSAN)
++ target_compile_options(bpftrace_test PUBLIC "-fsanitize=undefined")
++ target_link_options(bpftrace_test PUBLIC "-fsanitize=undefined")
++endif()
++
+ # bpftrace tests require (at minimum) version 1.11.
+ # There's no great way to enforce a minimum version from cmake -- the cmake
+ # modules don't respect minimum requested version.
diff --git a/dev-debug/bpftrace/metadata.xml b/dev-debug/bpftrace/metadata.xml
new file mode 100644
index 000000000000..13c1ae7c4586
--- /dev/null
+++ b/dev-debug/bpftrace/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>holger@applied-asynchrony.com</email>
+ <name>Holger Hoffstätte</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="pcap">Enable skb_output using <pkg>net-libs/libpcap</pkg>
+ </flag>
+ </use>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>