Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Maintainer: Eric Long <i@hack3r.moe>

pkgbase=linux-tools
pkgname=(bpftool tmon)
pkgname=(bpftool tmon perf)
groups=($pkgbase)
pkgver=6.18.8
pkgrel=1
pkgrel=2
pkgdesc='Linux kernel tools'
license=(GPL-2.0-only)
arch=(x86_64 aarch64 riscv64 loongarch64)
Expand All @@ -19,13 +18,18 @@ options=(!strip !lto)
# readline zlib libcap libelf python-docutils
# # tmon
# ncurses
# # perf
# libtraceevent libpfm libelf capstone python llvm-devel xz libnuma slang
# llvm-libs zlib-ng zstd
# )
# HACK: list these dependencies here so that OBS can read them
# Make sure to update both here and `makedepends=` comments above and below
# when modifying dependencies
# Note that OBS upstream currently only supports _x86_64 (and _i686) suffix,
# though.
makedepends=(linux-headers asciidoc xmlto readline zlib libcap libelf python-docutils ncurses)
makedepends=(linux-headers asciidoc xmlto readline zlib libcap libelf python-docutils ncurses
libtraceevent libpfm libelf capstone python llvm-devel xz libnuma
slang llvm-libs zlib-ng zstd)
makedepends_x86_64=(libnl libcap)
source=(https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$pkgver.tar.xz
0001-bpftool-disable-bpf_jit_disasm.patch) # downstream
Expand All @@ -44,6 +48,12 @@ x86_64)
;;
esac

_perfargs=(
prefix=/usr
lib=lib
perfexecdir=lib/perf
)

prepare() {
_patch_ linux-$pkgver
}
Expand All @@ -52,6 +62,14 @@ build() {
_linux="$srcdir"/linux-$pkgver
export CC=cc HOSTCC=cc

# TODO:
# enable babeltrace
msg2 'perf'
cd "$_linux"/tools/perf
# Invoke Makefile.perf directly, or some make arguments may be stripped by
# the wrapper Makefile.
make -f Makefile.perf "${_perfargs[@]}"

msg2 'bpftool'
cd "$_linux"/tools/bpf
# doesn't compile when we don't first compile bpftool in its own directory and
Expand Down Expand Up @@ -141,3 +159,14 @@ package_x86_energy_perf_policy() {
install -Dm755 x86_energy_perf_policy "$pkgdir"/usr/bin/x86_energy_perf_policy
install -Dm644 x86_energy_perf_policy.8 "$pkgdir"/usr/share/man/man8/x86_energy_perf_policy.8
}

package_perf() {
pkgdesc='Linux performance auditing tool'
depends=(musl libtraceevent libpfm libelf capstone python llvm xz libnuma
slang llvm-libs zlib-ng zstd)

cd linux-$pkgver/tools/perf
export CC=cc HOSTCC=cc

make -f Makefile.perf install DESTDIR="$pkgdir" "${_perfargs[@]}"
}