From d6e0aa4ac500ace4dcf3bb9960eeb5d20359b109 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 26 Jun 2024 14:16:30 +0200 Subject: [PATCH] New package: bpftop-0.5.1 --- srcpkgs/bpftop/patches/no-journald.patch | 34 ++++++++++++++++++++++++ srcpkgs/bpftop/template | 13 +++++++++ 2 files changed, 47 insertions(+) create mode 100644 srcpkgs/bpftop/patches/no-journald.patch create mode 100644 srcpkgs/bpftop/template diff --git a/srcpkgs/bpftop/patches/no-journald.patch b/srcpkgs/bpftop/patches/no-journald.patch new file mode 100644 index 00000000000..d39c3f65d62 --- /dev/null +++ b/srcpkgs/bpftop/patches/no-journald.patch @@ -0,0 +1,34 @@ +From a9a121a0aa0fde095099db03651d83aaf0cbcbc5 Mon Sep 17 00:00:00 2001 +From: Jose Fernandez +Date: Mon, 20 May 2024 21:57:28 -0600 +Subject: [PATCH] Do not error out if journald is not available + +When journald is not available, the program should not error out, but +instead make noop log entries. + +Signed-off-by: Jose Fernandez +--- + src/main.rs | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/main.rs b/src/main.rs +index 00fc067..d95a4c1 100755 +--- a/src/main.rs ++++ b/src/main.rs +@@ -118,9 +118,15 @@ fn main() -> Result<()> { + return Err(anyhow!("This program must be run as root")); + } + ++ // Initialize the journald layer or ignore if not available ++ let journald_layer = match tracing_journald::layer() { ++ Ok(layer) => Some(layer), ++ Err(_) => None, ++ }; ++ + // Initialize the tracing subscriber with the journald layer + let registry = tracing_subscriber::registry() +- .with(tracing_journald::layer()?) ++ .with(journald_layer) + .with(tracing_subscriber::filter::LevelFilter::INFO); + // Try to set this subscriber as the global default + registry.try_init()?; diff --git a/srcpkgs/bpftop/template b/srcpkgs/bpftop/template new file mode 100644 index 00000000000..919c33a7de6 --- /dev/null +++ b/srcpkgs/bpftop/template @@ -0,0 +1,13 @@ +# Template file for 'bpftop' +pkgname=bpftop +version=0.5.1 +revision=1 +build_style=cargo +hostmakedepends="clang elfutils-devel pkg-config" +makedepends="elfutils-devel libbpf-devel" +short_desc="Dynamic real-time view of running eBPF programs" +maintainer="Leah Neukirchen " +license="Apache-2.0" +homepage="https://github.com/Netflix/bpftop" +distfiles="https://github.com/Netflix/bpftop/archive/refs/tags/v${version}.tar.gz" +checksum=8457caf5ededba38aad01ed6317bd737a8079bbb26ca9a79cfdca5848a8c80f6