From b8b02baf0b2bfa42e0b2d19a47bb5895e0004f93 Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 13 Jun 2020 23:16:56 -0700 Subject: [PATCH 5/5] [WIP] gnu: Add bpftrace. * gnu/packages/linux.scm (bpftrace): New variable. --- gnu/packages/linux.scm | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 362e041ba9..b7956f3d61 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -7264,3 +7264,48 @@ makes use of extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 and above.") (license license:asl2.0)))) + +(define-public bpftrace + (let* ((ver "0.10.0") + (commit (string-append "v" ver)) + (revision "1")) + (package + (name "bpftrace") + (version (git-version ver revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/iovisor/bpftrace") + (commit commit))) + (file-name (git-file-name name ver)) + (sha256 + (base32 + "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn")))) + (build-system cmake-build-system) + (inputs + `(("bcc" ,bcc) + ("bison" ,bison) + ("clang-toolchain" ,clang-toolchain) + ("elfutils" ,elfutils) + ("flex" ,flex) + ;; FIXME: Tests require googletest but not from system + ;; ("googletest" ,googletest) + ("linux-libre-headers" ,linux-libre-headers))) + (arguments + `(#:configure-flags + '(;; FIXME: Make tests not clone the googletest repository + "-DBUILD_TESTING=OFF" + "-DLIBBFD_DISASM_FOUR_ARGS_SIGNATURE=ON"))) + (home-page "https://github.com/iovisor/bpftrace") + (synopsis "High-level tracing language for Linux eBPF") + (description + "bpftrace is a high-level tracing language for Linux enhanced Berkeley +Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses +LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for +interacting with the Linux BPF system, as well as existing Linux tracing +capabilities: kernel dynamic tracing (kprobes), user-level dynamic +tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk +and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was +created by Alastair Robertson.") + (license license:asl2.0)))) -- 2.26.2