From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 4NHnEFuT2mWTXwEAe85BDQ:P1 (envelope-from ) for ; Sun, 25 Feb 2024 02:09:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4NHnEFuT2mWTXwEAe85BDQ (envelope-from ) for ; Sun, 25 Feb 2024 02:09:47 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708823387; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post; bh=mrjJrgolgn1sUna6lQgM6kiFCIuyekAQ7fjWDdXOFsY=; b=XYDKJKT57GRFHD9JJiar+/pGiryW/LFK7PQ5SECpwZ8afCvg2hkMLi/vH2ZJSj8/VvFGbr mEeG8gpiJqpCyoEUUvDzeBjBFfwGswH5wziDzuaiBxngFyjxSCpKKtyseaOkiXFgk7OpDr 6hUYXJ0AuYUEMsZnUjKumWDHX18KPY8Qu0qxIo3vLjGVUXG8QNuVP9YPBiUxXNn7eeYmbx 2J13l28wSnG586SarJyNA566opgrFcK/E76ZqmsuyPWfbKODzvomcM1fTkwIFnF4f3Vafp FVOt0gN20soCVhIvq/yGx2XyzfzhkjfSBYvOBh+RT7aCb/0jjKkOoICL8gnsWg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708823387; a=rsa-sha256; cv=none; b=tvxSrwGqNG5NHeb5KYlmj069pCpjhCiJu8woIhJOy5FBv4rhBnjY8Lx8sERHdwkvVMItwg vfsbjJ2MEBJ6dr0O9PvN4OtTnqA0vauu3rj+clRmSWhCHiOkTLNjxGUXrMkfkCcvoxEeMg 0xtDFGtnmT2QvuOKDIWuU/+kqK2lYDiCpi7gna3K7cppoSPfW1OBouYd5Pp1Jj3U+S/BRW ckVfexi6TdumXEXz1SX9w5wLTocmZwIJt8zNXCyUSs+l+u4FZ+Nm8WCYUZ9lcx2/ifegl6 fZtUIcSwJ0Flsqyykq00tXZmc7RshrhA7div5Jo/7x8muBKLqnejr0WGFfSLCg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 19CCC25411 for ; Sun, 25 Feb 2024 02:09:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1re31Q-0002Oe-Cx; Sat, 24 Feb 2024 20:09:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1re31O-0002OQ-4n for guix-patches@gnu.org; Sat, 24 Feb 2024 20:09:38 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1re31N-0006n5-Sm for guix-patches@gnu.org; Sat, 24 Feb 2024 20:09:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1re31l-0000Wy-Mq for guix-patches@gnu.org; Sat, 24 Feb 2024 20:10:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69364] Three patches which collectively enable BTF debug info in BPF kernel Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 25 Feb 2024 01:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69364 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 69364@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17088233871983 (code B ref -1); Sun, 25 Feb 2024 01:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2024 01:09:47 +0000 Received: from localhost ([127.0.0.1]:49134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1re31W-0000Vq-UH for submit@debbugs.gnu.org; Sat, 24 Feb 2024 20:09:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:52446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1re31U-0000Va-FA for submit@debbugs.gnu.org; Sat, 24 Feb 2024 20:09:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1re314-0002J2-AC for guix-patches@gnu.org; Sat, 24 Feb 2024 20:09:18 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1re310-0006l8-Rc for guix-patches@gnu.org; Sat, 24 Feb 2024 20:09:16 -0500 Received: from localhost ([70.18.6.196]) by smtp.umanwizard.com ; 25 Feb 2024 01:09:11 +0000 X-Fes-Received-For: guix-patches@gnu.org X-Fes-Received-From: From: Brennan Vincent Date: Sat, 24 Feb 2024 20:09:09 -0500 Message-ID: <87il2dfiyy.fsf@san-diego.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.47 X-Spam-Score: -4.47 X-Migadu-Queue-Id: 19CCC25411 X-TUID: sY3Pn42oODkj --=-=-= Content-Type: text/plain This configuration causes /sys/kernel/btf/vmlinux to exist, which is necessary for some eBPF programs (e.g. those that rely on the "BPF CO-RE" feature; see https://docs.kernel.org/bpf/libbpf/libbpf_overview.html for details). The initial two patches introduce userland packages that enable building the kernel with this configuration, and the third one changes the kernel config. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnu-Add-libbpf-1.1.0.patch >From f02af354b559d53009a96d00c0f58a72957678d9 Mon Sep 17 00:00:00 2001 Message-ID: From: Brennan Vincent Date: Sat, 24 Feb 2024 09:34:22 -0500 Subject: [PATCH 1/3] gnu: Add libbpf 1.1.0 * gnu/packages/linux.scm (libbpf-1.1.0): New variable. Change-Id: I5492541a6279a73a1a3fe25381c187168e2dd253 --- gnu/packages/linux.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index ef225479ca..8c665d436d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -9660,6 +9660,20 @@ (define-public libbpf headers.") (license `(,license:lgpl2.1 ,license:bsd-2)))) +(define-public libbpf-1.1.0 + (package + (inherit libbpf) + (version "1.1.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/libbpf/libbpf") + (commit (string-append "v" version)))) + (file-name (git-file-name (package-name libbpf) version)) + (sha256 + (base32 "0rh8828cridphkmynb3nhdcd8l37i11885kmnp2hilk81lh7myzy")))))) + (define-public bcc (package (name "bcc") base-commit: de24aaf13b17d6c019f3f240fd0eb0e1b8654970 -- 2.41.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-gnu-Add-dwarves.patch >From 8b7fa6a86b6e1a7956b6941ecfac337ec6ad0abe Mon Sep 17 00:00:00 2001 Message-ID: <8b7fa6a86b6e1a7956b6941ecfac337ec6ad0abe.1708822862.git.brennan@umanwizard.com> In-Reply-To: References: From: Brennan Vincent Date: Sat, 24 Feb 2024 09:37:44 -0500 Subject: [PATCH 2/3] gnu: Add dwarves. * gnu/packages/cpp.scm (dwarves): New variable. Change-Id: I4d29732c1c04044f66d17b7f0ebc308e0e8134aa --- gnu/packages/cpp.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index e530d1d2a8..58c2da019e 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -84,6 +84,7 @@ (define-module (gnu packages cpp) #:use-module (gnu packages curl) #:use-module (gnu packages datastructures) #:use-module (gnu packages disk) + #:use-module (gnu packages elf) #:use-module (gnu packages documentation) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) @@ -1629,6 +1630,32 @@ (define-public libexpected (home-page "https://tl.tartanllama.xyz/") (license license:cc0))) +(define-public dwarves + (package + (name "dwarves") + (version "1.24") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/acmel/dwarves") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "132ln21xj2xhpj3zzpisl18r189jdz0gn6j5rddz2ifp6zlq2vkx")))) + (build-system cmake-build-system) + (arguments + (list + #:tests? #f + #:configure-flags #~(list "-DLIBBPF_EMBEDDED=OFF" "-D__LIB=lib"))) + (inputs (list pkg-config zlib libbpf-1.1.0 linux-libre-headers-6.6 + elfutils)) + (home-page "https://github.com/acmel/dwarves") + (synopsis "Pahole and the dwarves") + (description + "pahole - Shows, manipulates data structure layout and pretty prints raw data.") + (license license:gpl2))) + (define-public immer (package (name "immer") -- 2.41.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0003-gnu-Set-CONFIG_DEBUG_INFO_BTF-in-bpf-kernel.patch >From d8322b660c45b4f463106c14a4a4cf15820934cf Mon Sep 17 00:00:00 2001 Message-ID: In-Reply-To: References: From: Brennan Vincent Date: Sat, 24 Feb 2024 10:07:51 -0500 Subject: [PATCH 3/3] gnu: Set CONFIG_DEBUG_INFO_BTF in bpf kernel. * gnu/packages/linux.scm (linux-libre-with-bpf): Set CONFIG_DEBUG_INFO_BTF. Change-Id: I9cc0da5394a63ede4a2549cbdcc13b75c8af3001 --- gnu/packages/linux.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 8c665d436d..f894c6cfe3 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -117,6 +117,7 @@ (define-module (gnu packages linux) #:use-module (gnu packages crypto) #:use-module (gnu packages cryptsetup) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages databases) #:use-module (gnu packages datastructures) #:use-module (gnu packages dbm) @@ -891,7 +892,11 @@ (define %bpf-extra-linux-options ;; optional, for kprobes ("CONFIG_BPF_EVENTS" . #t) ;; kheaders module - ("CONFIG_IKHEADERS" . #t))) + ("CONFIG_IKHEADERS" . #t) + ;; BTF debug info, requires `pahole' from `dwarves' package + ("CONFIG_DEBUG_INFO=y" . #t) + ("CONFIG_DEBUG_INFO_DWARF4" . #t) + ("CONFIG_DEBUG_INFO_BTF" . #t))) (define (config->string options) (string-join (map (match-lambda @@ -1342,7 +1347,8 @@ (define-public linux-libre-with-bpf (package (inherit base-linux-libre) (inputs (modify-inputs (package-inputs base-linux-libre) - (prepend cpio))) + (prepend cpio + (@ (gnu packages compression) zlib) python dwarves))) (synopsis "Linux-libre with BPF support") (description "This package provides GNU Linux-Libre with support for @acronym{BPF, the Berkeley Packet Filter}.")))) -- 2.41.0 --=-=-=--