guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: Add bpftrace.


From: guix-commits
Subject: 01/02: gnu: Add bpftrace.
Date: Fri, 31 Jul 2020 07:00:01 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit c55acb073248392b1387017378f36a1d378fa7c4
Author: John Soo <jsoo1@asu.edu>
AuthorDate: Fri Jul 31 12:52:38 2020 +0200

    gnu: Add bpftrace.
    
    * gnu/packages/linux.scm (bpftrace): New variable.
    * gnu/packages/patches/bpftrace-disable-bfd-disasm.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    
    Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/linux.scm                             | 45 ++++++++++++++++++++++
 .../patches/bpftrace-disable-bfd-disasm.patch      | 15 ++++++++
 3 files changed, 61 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index a2a1caa..52c295b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -825,6 +825,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/bitcoin-core-python-compat.patch                \
   %D%/packages/patches/blender-2.79-newer-ffmpeg.patch         \
   %D%/packages/patches/blender-2.79-python-3.7-fix.patch       \
+  %D%/packages/patches/bpftrace-disable-bfd-disasm.patch       \
   %D%/packages/patches/busybox-1.31.1-fix-build-with-glibc-2.31.patch \
   %D%/packages/patches/byobu-writable-status.patch             \
   %D%/packages/patches/calibre-no-updates-dialog.patch         \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f98a5c8..149a85b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -7396,3 +7396,48 @@ 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
+  (package
+    (name "bpftrace")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/iovisor/bpftrace";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn"))
+       (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)))
+    (inputs
+     `(("bcc" ,bcc)
+       ("clang-toolchain" ,clang-toolchain)
+       ("elfutils" ,elfutils)
+       ("libbpf" ,libbpf)
+       ("linux-libre-headers" ,linux-libre-headers)))
+    (arguments
+     `(#:tests? #f ;Tests require googletest sources.
+       #:configure-flags
+       '("-DBUILD_TESTING=OFF"
+         ;; FIXME: libbfd misses some link dependencies, when fixed, remove
+         ;; the associated patch.
+         "-DHAVE_BFD_DISASM=OFF")))
+    (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)))
diff --git a/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch 
b/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch
new file mode 100644
index 0000000..8565d8d
--- /dev/null
+++ b/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e89a6a9..a594786 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -126,10 +126,6 @@ find_package(LibBpf)
+ find_package(LibBfd)
+ find_package(LibOpcodes)
+ 
+-if(${LIBBFD_FOUND} AND ${LIBOPCODES_FOUND})
+-  set(HAVE_BFD_DISASM TRUE)
+-endif()
+-
+ include(CheckIncludeFile)
+ check_include_file("sys/sdt.h" HAVE_SYSTEMTAP_SYS_SDT_H)
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]