From patchwork Sun Feb 25 01:09:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brennan Vincent X-Patchwork-Id: 61090 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1C56027BBE9; Sun, 25 Feb 2024 01:09:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B32AE27BBE2 for ; Sun, 25 Feb 2024 01:09:46 +0000 (GMT) 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 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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. 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