From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 06 09:26:20 2020 Received: (at submit) by debbugs.gnu.org; 6 Jul 2020 13:26:21 +0000 Received: from localhost ([127.0.0.1]:33792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jsR8W-0006Ly-Iz for submit@debbugs.gnu.org; Mon, 06 Jul 2020 09:26:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:34330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jsR8S-0006Lp-TU for submit@debbugs.gnu.org; Mon, 06 Jul 2020 09:26:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsR8S-0004qv-GC for guix-patches@gnu.org; Mon, 06 Jul 2020 09:26:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54769) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsR8R-0001wK-Td; Mon, 06 Jul 2020 09:26:15 -0400 Received: from lfbn-ann-1-356-169.w86-200.abo.wanadoo.fr ([86.200.73.169]:40048 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jsR8Q-0006Qt-P7; Mon, 06 Jul 2020 09:26:15 -0400 From: Mathieu Othacehe To: John Soo Subject: Re: BPF in linux-libre References: <44046537-51AD-4BD7-8442-41738C4D8C98@asu.edu> <87lfkqknla.fsf@gnu.org> <87h7vdd6ms.fsf@asu.edu> <87wo46uhdr.fsf@gnu.org> <87zh8wph7h.fsf@asu.edu> <87wo3uxfrq.fsf@gnu.org> <871rlsegf2.fsf@asu.edu> <87h7umjruz.fsf@gnu.org> <87zh8dlbeu.fsf@asu.edu> Date: Mon, 06 Jul 2020 15:26:11 +0200 In-Reply-To: <87zh8dlbeu.fsf@asu.edu> (John Soo's message of "Sun, 05 Jul 2020 17:44:41 -0700") Message-ID: <87d0587p1o.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: guix-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey John, > I think I tidied up the description to match the Guix situation. What do > you think now? Yes it's fine, thanks for the updated serie! I pushed the first patch and patches two and three squashed together. > I could see it being a useful default. BPF seems like a nice technology > but I am making these patches to experiment with it myself. Because I > haven't used it much I can't really speak on the pros of making it > default. Other than my gut feeling that seems like something that > should be opted into rather than opting out of I have no strong feelings > on including it by default. The only other downside I see is that > putting in the default might make the linux definitions less composable. > The way it is now, one can assemble a (mostly) bpf-capable system from > the pieces in gnu/packages/linux.scm. Ok, thanks for explaining. I don't have much experience with BPF either. For now we can work with a separate linux-libre, and will see about merging it into the default, when we'll have more perspective. I'll take more time to review patches 4 and 5. However, while trying some of the examples packaged by BCC, I have the following error: --8<---------------cut here---------------start------------->8--- mathieu@meru:~/guix-master$ /gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop Traceback (most recent call last): File "/gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop", line 21, in from bcc import BPF ModuleNotFoundError: No module named 'bcc' --8<---------------cut here---------------end--------------->8--- I think an additional wrapping is necessary. Could you please have a look? I'm also removing help-guix, and opening a proper guix-patches ticket. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 11 12:28:40 2020 Received: (at 42227) by debbugs.gnu.org; 11 Jul 2020 16:28:40 +0000 Received: from localhost ([127.0.0.1]:44846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juIMe-0000Bg-6m for submit@debbugs.gnu.org; Sat, 11 Jul 2020 12:28:40 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:44921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juIMY-0000BR-Ph for 42227@debbugs.gnu.org; Sat, 11 Jul 2020 12:28:34 -0400 Received: by mail-pl1-f173.google.com with SMTP id w17so3480865ply.11 for <42227@debbugs.gnu.org>; Sat, 11 Jul 2020 09:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/byqWv/ezmWal3vJAbecPt7lzlFcqKZM2IUzZXal6ds=; b=SIkro7OPV/UL2srhN4xZtgWAliOJnEDnhlkSphfH4uK9fPl27f4hr4uTDeP78CQ8wT e0y82VnsiVc5fTMqWtoaGpz2ry8ALRsRiSIkpzHDwd0+/mdtio5yNy6JeX7QiEVli7d2 Gi7DAYfHH+kglmYUDf6YgdPXkfXsPJT1YMYE+4NJnGjLr3ekzMPpOXM38rnfGtPiUmIf mXzIPIwCcPvWtX5QUkOBF/xFRWOE6hFTJwPXRTuL184aRn3MGPsaO0IF1GRe7DKjOoaI CSm5EnP5C/7r51fPxjCvdA6reHvryPMiNc/hJlPovOn5Hm1KP3oHVm/z9AuCROMFkFEd cUYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/byqWv/ezmWal3vJAbecPt7lzlFcqKZM2IUzZXal6ds=; b=FzMhvG2+665OSwxaUMU3SVoLfOqyK0WrWJ3jClSpAgs9+YJ9YwUF8wfhXoSCuibAlT 7Ck0uLivF8Fp4/WW2fjvyYNXIoZMbwqw8CLB7PEnbaAEK5TSvcDwigzWhef7bIn9aFLA uvTIB1hyrTugcmXai+pVboVfZ270kP5X8PYV/LobOiP/HL1krANyHR0QKptBuATGtSmp X3NJkFGqGKwsRNJiaO5u7e/6hN4CVdZk2nnSQ9xV6WvsZDDvZJILlLppau2aGkkTDeBn Nl8H0J9EfoPsWu6qI6SohVLoH3632nCNYSnSHMixGYBa4XQYcaWibopWbQzI4m0o/YGU zkYQ== X-Gm-Message-State: AOAM530cATBbLogJlz0wQ+gy/UiXplsDjdehgFiZwSu0HEYV7NdwkCGZ klYd5z6inwJLQFL/RbQ54jtgJz1g6xc= X-Google-Smtp-Source: ABdhPJz/9FYzkV9OFXPmLP1LSlwAX+pMMTPbpLbEvW6Ho/LuYsNQHGqd1dixiumjGjZE+QTKJqzqsQ== X-Received: by 2002:a17:902:9886:: with SMTP id s6mr40339096plp.112.1594484904444; Sat, 11 Jul 2020 09:28:24 -0700 (PDT) Received: from ecenter ([2600:1700:83b0:8bd0::6a0]) by smtp.gmail.com with ESMTPSA id w29sm9276305pfq.128.2020.07.11.09.28.22 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Jul 2020 09:28:23 -0700 (PDT) From: John Soo To: Mathieu Othacehe Subject: Re: [bug#42227] BPF in linux-libre References: <44046537-51AD-4BD7-8442-41738C4D8C98@asu.edu> <87lfkqknla.fsf@gnu.org> <87h7vdd6ms.fsf@asu.edu> <87wo46uhdr.fsf@gnu.org> <87zh8wph7h.fsf@asu.edu> <87wo3uxfrq.fsf@gnu.org> <871rlsegf2.fsf@asu.edu> <87h7umjruz.fsf@gnu.org> <87zh8dlbeu.fsf@asu.edu> <87d0587p1o.fsf@gnu.org> Date: Sat, 11 Jul 2020 09:28:19 -0700 In-Reply-To: <87d0587p1o.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 06 Jul 2020 15:26:11 +0200") Message-ID: <87r1ti9fto.fsf@asu.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42227 Cc: 42227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Mathieu, > Hey John, > > I'll take more time to review patches 4 and 5. However, while trying > some of the examples packaged by BCC, I have the following error: > > mathieu@meru:~/guix-master$ /gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop > Traceback (most recent call last): > File "/gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop", line 21, in > from bcc import BPF > ModuleNotFoundError: No module named 'bcc' > > I think an additional wrapping is necessary. Could you please have a > look? I'm also removing help-guix, and opening a proper guix-patches > ticket. I wrapped the PYTHONPATH around the various provided python tools. I also found a spare path that required patching. I am not sure this fixes every tool but I did get a few to work now. Thanks for attaching guix-patches. I also added debugfs as a requirement for a bpf system. To use it %bpf-file-systems can be used in place of %base-file-systems in the operating system definition. Thanks, John --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-Add-debugfs-file-system.patch >From cef37cce474bba3d023ad5426da52050469b6196 Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 9 Jul 2020 02:43:14 -0700 Subject: [PATCH 1/4] gnu: Add %debugfs file-system. * gnu/system/file-systems.scm. --- gnu/system/file-systems.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 0f94577760..57e0d64d01 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -428,6 +428,14 @@ TARGET in the other system." '("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer" "blkio" "perf_event" "pids"))))) +(define %debugfs + (file-system + (type "debugfs") + (device "none") + (mount-point "/sys/kernel/debug") + (check? #f) + (create-mount-point? #t))) + (define %elogind-file-systems ;; We don't use systemd, but these file systems are needed for elogind, ;; which was extracted from systemd. -- 2.27.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-Add-bpf-file-systems.patch >From 44d3564b5552605f0ab4f1d06812cc804f046229 Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 9 Jul 2020 02:43:48 -0700 Subject: [PATCH 2/4] gnu: Add %bpf-file-systems. * gnu/system/file-systems.scm (%bpf-file-systems): New variable. --- gnu/system/file-systems.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 57e0d64d01..ee200e4055 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -74,6 +74,7 @@ %elogind-file-systems %base-file-systems + %bpf-file-systems %container-file-systems @@ -476,6 +477,9 @@ TARGET in the other system." %shared-memory-file-system %immutable-store)) +(define %bpf-file-systems + (cons %debugfs %base-file-systems)) + ;; File systems for Linux containers differ from %base-file-systems in that ;; they impose additional restrictions such as no-exec or need different ;; options to function properly. -- 2.27.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-Add-bcc.patch >From f023b62085bf8a1f00092163f827b9dd28b87519 Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 13 Jun 2020 23:16:11 -0700 Subject: [PATCH 3/4] gnu: Add bcc. * gnu/packages/linux.scm (bcc): New variable. --- gnu/packages/linux.scm | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 94d3b37845..b3922b0770 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -98,6 +98,8 @@ #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages libunwind) #:use-module (gnu packages libusb) + #:use-module (gnu packages llvm) + #:use-module (gnu packages lua) #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages multiprecision) @@ -132,6 +134,7 @@ #:use-module (gnu packages rsync) #:use-module (gnu packages selinux) #:use-module (gnu packages swig) + #:use-module (gnu packages version-control) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system go) @@ -7229,3 +7232,85 @@ persistent over reboots.") contrast to BCC, do not require the Clang/LLVM runtime or linux kernel headers.") (license `(,license:lgpl2.1 ,license:bsd-2)))) + +(define-public bcc + (package + (name "bcc") + (version "0.15.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/iovisor/bcc") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1d5j9zanffa1c7lpi5fcrdlx1n7hy86xl82fam2xqr0s41q4ipxw")))) + (build-system cmake-build-system) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex))) + (inputs + `(;; TODO: package optional integrations + ;; ("arping" ,argping) + ;; ("netperf" ,netperf) + ;; ("iperf" ,iperf) or ("iperf3" ,iperf3) + ("clang-toolchain" ,clang-toolchain) + ("libbpf" ,(package-source libbpf)) + ;; LibElf required but libelf does not contain + ;; archives, only object files. + ;; https://github.com/iovisor/bcc/issues/504 + ("elfutils" ,elfutils) + ("linux-libre-headers" ,linux-libre-headers) + ("luajit" ,luajit) + ("python-wrapper" ,python-wrapper))) + (arguments + `(;; Tests all require sudo and a "standard" file heirarchy + #:tests? #f + #:configure-flags + (let ((revision ,version)) + `(,(string-append "-DREVISION=" revision))) + #:phases + (modify-phases %standard-phases + ;; FIXME: "-DCMAKE_USE_LIBBPF_PACKAGE=ON" + ;; Does not make bcc use libbpf from system + (add-after 'unpack 'copy-libbpf + (lambda* (#:key inputs #:allow-other-keys) + (delete-file-recursively "src/cc/libbpf") + (copy-recursively + (assoc-ref inputs "libbpf") "src/cc/libbpf"))) + (add-after 'copy-libbpf 'substitute-libbc + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "src/python/bcc/libbcc.py" + (("(libbcc\\.so.*)\\b" _ libbcc) + (string-append + (assoc-ref outputs "out") "/lib/" libbcc))))) + (add-after 'install 'wrap-tools + (lambda* (#:key outputs #:allow-other-keys) + (use-modules (ice-9 textual-ports)) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (tools (string-append out "/share/bcc/tools")) + (python-executable? + (lambda (filename _) + (call-with-input-file filename + (lambda (port) + (string-contains (get-line port) "/bin/python")))))) + (for-each + (lambda (python-executable) + (format #t "wrapping: ~A~%" python-executable) + (wrap-program python-executable + `("PYTHONPATH" ":" prefix + (,(string-append lib "/python3.8/site-packages"))))) + (find-files tools python-executable?)) + #t)))))) + (home-page "https://github.com/iovisor/bcc") + (synopsis "Tools for BPF on Linux") + (description + "BCC is a toolkit for creating efficient kernel tracing and +manipulation programs, and includes several useful tools and examples. It +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))) -- 2.27.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-gnu-Add-bpftrace.patch >From f17d7242b3821b6a5600bfd5e9a0f75fa4054d60 Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 13 Jun 2020 23:16:56 -0700 Subject: [PATCH 4/4] gnu: Add bpftrace. * gnu/packages/linux.scm (bpftrace): New variable. * gnu/packages/patches/bpftrace-disable-bfd-disasm.patch: Disable bfd disassembly for bpftrace. * gnu/local.mk (dist_patch_DATA): Add bpftrace-disable-bfd-disasm.patch. --- gnu/local.mk | 1 + gnu/packages/linux.scm | 48 +++++++++++++++++++ .../patches/bpftrace-disable-bfd-disasm.patch | 15 ++++++ 3 files changed, 64 insertions(+) create mode 100644 gnu/packages/patches/bpftrace-disable-bfd-disasm.patch diff --git a/gnu/local.mk b/gnu/local.mk index a277e63fa4..5c9d39663f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -819,6 +819,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 b3922b0770..8f19ca11d2 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -7314,3 +7314,51 @@ 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 + (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) + ;; FIXME: Tests require googletest but clone repository + ;; ("googletest" ,googletest) + ("libbpf" ,libbpf) + ("linux-libre-headers" ,linux-libre-headers))) + (arguments + `(#:tests? #f ; FIXME: Enable when googletest from guix is used + #:configure-flags + '(;; FIXME: Make tests not clone the googletest repository + "-DBUILD_TESTING=OFF" + ;; FIXME: libbfd misses some link dependencies + ;; When fixed, remove 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 0000000000..8565d8d851 --- /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) + -- 2.27.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 30 14:49:07 2020 Received: (at 42227) by debbugs.gnu.org; 30 Jul 2020 18:49:07 +0000 Received: from localhost ([127.0.0.1]:36723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1Dc3-0006nj-8H for submit@debbugs.gnu.org; Thu, 30 Jul 2020 14:49:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1Dc1-0006n8-IV for 42227@debbugs.gnu.org; Thu, 30 Jul 2020 14:49:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43357) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1Dbv-00063d-Q3; Thu, 30 Jul 2020 14:48:59 -0400 Received: from [2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5] (port=43578 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k1Dbv-00079S-2M; Thu, 30 Jul 2020 14:48:59 -0400 From: Mathieu Othacehe To: John Soo Subject: Re: [bug#42227] BPF in linux-libre References: <44046537-51AD-4BD7-8442-41738C4D8C98@asu.edu> <87lfkqknla.fsf@gnu.org> <87h7vdd6ms.fsf@asu.edu> <87wo46uhdr.fsf@gnu.org> <87zh8wph7h.fsf@asu.edu> <87wo3uxfrq.fsf@gnu.org> <871rlsegf2.fsf@asu.edu> <87h7umjruz.fsf@gnu.org> <87zh8dlbeu.fsf@asu.edu> <87d0587p1o.fsf@gnu.org> <87r1ti9fto.fsf@asu.edu> Date: Thu, 30 Jul 2020 20:48:55 +0200 Message-ID: <87d04cvnxk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42227 Cc: 42227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey John, Thanks for your patience! > I wrapped the PYTHONPATH around the various provided python tools. > I also found a spare path that required patching. > I am not sure this fixes every tool but I did get a few to work now. Yes, I tested some of them, looks fine :). > I also added debugfs as a requirement for a bpf system. To use it > %bpf-file-systems can be used in place of %base-file-systems in the > operating system definition. Actually, I wonder if we could mount debugfs by default, by adding it to %base-file-systems. Any objections? In the meantime I pushed the bcc patch with a few edits. Regarding bpftrace, I'd like to avoid the "-DHAVE_BFD_DISASM=OFF" patching, I found this ticket which seems related: https://github.com/iovisor/bpftrace/issues/1106, but didn't make any significant progress yet. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 30 22:20:40 2020 Received: (at 42227) by debbugs.gnu.org; 31 Jul 2020 02:20:40 +0000 Received: from localhost ([127.0.0.1]:37017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1Kf2-0004Ke-BD for submit@debbugs.gnu.org; Thu, 30 Jul 2020 22:20:40 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:33409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1Kez-0004KQ-3A for 42227@debbugs.gnu.org; Thu, 30 Jul 2020 22:20:39 -0400 Received: by mail-pl1-f172.google.com with SMTP id g19so3411126plq.0 for <42227@debbugs.gnu.org>; Thu, 30 Jul 2020 19:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6D8y03wfq8jf67eKzIls3w1+ch4+6cUyxIzUeT1h2bk=; b=yHP5pU23mSo5pTIjtAMJvpSTJ4r/L8XoREbqZY/5x0SC1Zc2DNJvziCcf924Fipzuc gGZbzXfLpgQJEK6t7S1blcw6UxRjH6l1fPuUMjchTMIbC3u3lk296JYJiS1rPv8ISVA8 qIgBL+5X1WGHJkx8enqwpnO9GO4TBc1AayDu+VXj4VxKtkcVcaptkP8S7bFUq0qriUPu FkPUS3gLmXwLYhxT6iuaL6Qnper8rJCKSRauaOqjQ1NcTaJtumHE2QJUBLyVt51ZZjXS /rS/VWzmGUQ3i5Izp0MKPWZ/czs8+LDghIhFGWzuneYyjKz7O/wGUOB9uN2X1GULSZ/4 XH1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6D8y03wfq8jf67eKzIls3w1+ch4+6cUyxIzUeT1h2bk=; b=JjjrymD3OkvCr4a7X7MivRQHkkhfpN0PfKMM6DfMUIGI6mYHsyUU1gIbC87aag3Ot1 PHwS4Qca0zaLcrpmxow16mGP9FoVS2L8BNI85dwCEVpF88a+hXwChRqHN1mHD0DeSlHA XR3GswCa6nKKGSYMIJsFTw15bzQ639A630zPswgkxBR000vyPjzzgVQDrYV4hIAXTGkp Ek3jfWXN01neeem0PsXtaOZ6uMnLJIVZuADwVGb/cp6azclhl5eohoPPQYkFatMqz6No u9h7+aYRKZFNaal/7in/VHx49g2JeJZuOMEarxJH5mD0Z7cr1VnaR4wlKyDLhhoxPpUc sDCA== X-Gm-Message-State: AOAM532A2GlUnQuHaMSkwntLWiTIVEDgI4qXHX15ENlbbOjLPej/apwn ta5z9Qi0Tlp7XP5vyb2Cc0Wk2ytL1gY= X-Google-Smtp-Source: ABdhPJzQH+tOKCGGp2JbqcGlV/amYMXgtuEDntjwvxVZ3Ci3zr0KXQ4Na2t9+RYnVjYhyevxTH19nQ== X-Received: by 2002:a17:90a:de0d:: with SMTP id m13mr1962571pjv.23.1596162030377; Thu, 30 Jul 2020 19:20:30 -0700 (PDT) Received: from ecenter ([2600:1700:83b0:8bd0::620]) by smtp.gmail.com with ESMTPSA id my16sm7519134pjb.43.2020.07.30.19.20.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Jul 2020 19:20:29 -0700 (PDT) From: John Soo To: Mathieu Othacehe Subject: Re: [bug#42227] BPF in linux-libre References: <44046537-51AD-4BD7-8442-41738C4D8C98@asu.edu> <87lfkqknla.fsf@gnu.org> <87h7vdd6ms.fsf@asu.edu> <87wo46uhdr.fsf@gnu.org> <87zh8wph7h.fsf@asu.edu> <87wo3uxfrq.fsf@gnu.org> <871rlsegf2.fsf@asu.edu> <87h7umjruz.fsf@gnu.org> <87zh8dlbeu.fsf@asu.edu> <87d0587p1o.fsf@gnu.org> <87r1ti9fto.fsf@asu.edu> <87d04cvnxk.fsf@gnu.org> Date: Thu, 30 Jul 2020 19:20:27 -0700 In-Reply-To: <87d04cvnxk.fsf@gnu.org> (Mathieu Othacehe's message of "Thu, 30 Jul 2020 20:48:55 +0200") Message-ID: <87v9i48lxw.fsf@asu.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 42227 Cc: 42227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Mathieu! > Thanks for your patience! No problem. I'm quite busy too. >> I also added debugfs as a requirement for a bpf system. To use it >> %bpf-file-systems can be used in place of %base-file-systems in the >> operating system definition. > > Actually, I wonder if we could mount debugfs by default, by adding it to > %base-file-systems. Any objections? That seems ok. I did find a few questions about debugfs on old irc logs and mailing lists. My only concern again is that I would prefer to opt in to such a thing. debugfs is much simpler than the bpf kernel flags though, so maybe it will be ok to remove in the future. > In the meantime I pushed the bcc patch with a few edits. Regarding > bpftrace, I'd like to avoid the "-DHAVE_BFD_DISASM=OFF" patching, I > found this ticket which seems related: > https://github.com/iovisor/bpftrace/issues/1106, but didn't make any > significant progress yet. I have tried every which way I can to make HAVE_BFD_DISASM work. A kind persn from the bpftrace irc directed me to this PR: https://github.com/iovisor/bpftrace/pull/1095 But I cannot see anything guix does differently that would cause it to fail. My only feeling is perhaps our configure flags for binutils might be causing the issue. As is, however, bpftrace does work even with out HAVE_BFD_DISASM and I even used it to debug a few processes recently. Thanks again! - John From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 31 07:05:03 2020 Received: (at 42227-done) by debbugs.gnu.org; 31 Jul 2020 11:05:03 +0000 Received: from localhost ([127.0.0.1]:37395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1SqU-0004e1-UT for submit@debbugs.gnu.org; Fri, 31 Jul 2020 07:05:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1SqR-0004dJ-0n for 42227-done@debbugs.gnu.org; Fri, 31 Jul 2020 07:05:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35523) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1SqL-0006Tr-4H; Fri, 31 Jul 2020 07:04:53 -0400 Received: from [2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5] (port=49114 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k1SqJ-0003Rk-2f; Fri, 31 Jul 2020 07:04:52 -0400 From: Mathieu Othacehe To: John Soo Subject: Re: [bug#42227] BPF in linux-libre References: <44046537-51AD-4BD7-8442-41738C4D8C98@asu.edu> <87lfkqknla.fsf@gnu.org> <87h7vdd6ms.fsf@asu.edu> <87wo46uhdr.fsf@gnu.org> <87zh8wph7h.fsf@asu.edu> <87wo3uxfrq.fsf@gnu.org> <871rlsegf2.fsf@asu.edu> <87h7umjruz.fsf@gnu.org> <87zh8dlbeu.fsf@asu.edu> <87d0587p1o.fsf@gnu.org> <87r1ti9fto.fsf@asu.edu> <87d04cvnxk.fsf@gnu.org> <87v9i48lxw.fsf@asu.edu> Date: Fri, 31 Jul 2020 13:04:47 +0200 In-Reply-To: <87v9i48lxw.fsf@asu.edu> (John Soo's message of "Thu, 30 Jul 2020 19:20:27 -0700") Message-ID: <87r1ss0wts.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42227-done Cc: 42227-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > That seems ok. I did find a few questions about debugfs on old irc logs > and mailing lists. My only concern again is that I would prefer to opt > in to such a thing. debugfs is much simpler than the bpf kernel flags > though, so maybe it will be ok to remove in the future. Yeah, but I saw that Ubuntu for instance is enabling it by default, so I guess it could help to have the same behaviour in Guix System. Added it with: 6bb07e91e1ab9367f636a3a5e9d52a9e0772aa89. > But I cannot see anything guix does differently that would cause it to > fail. My only feeling is perhaps our configure flags for binutils might > be causing the issue. > > As is, however, bpftrace does work even with out HAVE_BFD_DISASM and I > even used it to debug a few processes recently. Gave it another try and I think if we could get "binutils" to produce a dynamic version of libbfd.a, that would make the trick. Anyway, let's proceed without BFD support for now. Pushed bpftrace as c55acb073248392b1387017378f36a1d378fa7c4. Closing the serie, thank you! Mathieu From unknown Thu Aug 21 12:10:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 28 Aug 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator