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>
This commit is contained in:
John Soo 2020-07-31 12:52:38 +02:00 committed by Mathieu Othacehe
parent 636d573b74
commit c55acb0732
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
3 changed files with 61 additions and 0 deletions

View File

@ -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 \

View File

@ -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)))

View File

@ -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)