From patchwork Sun Feb 27 11:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stijn Tintel X-Patchwork-Id: 1598237 X-Patchwork-Delegate: stijn@linux-ipv6.be Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=C5uS4a4V; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux-ipv6.be header.i=@linux-ipv6.be header.a=rsa-sha256 header.s=502B7754-045F-11E5-BBC5-64595FD46BE8 header.b=hnQhghHn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K62Bf47qdz9sG7 for ; Sun, 27 Feb 2022 23:00:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PLWvCIl86SGOsp9Kjv7XpxMAQzGD3Qk+HKRQuuY12Gk=; b=C5uS4a4VnAW7yw FyOzqinLiRHWNZGKykw6kzW5Mc4kb0e2Kl5Pxb+Q6sKaC9Tt+DuXS6TIaQMXqw8EABLEDwOSPfCJL e9FD2CCL6zCDX8Zx4tjFgJr3M+xybTD9PO5z81IJFxc2QBOK6CiGeeB+nOmLYUZH/jVs+C/mICt2J GfWFOlJOf5g1KH1ybekhSYjpVaUyAiSWK8atltXBCfKlA+VVigrOMCt/aR9KdSIleyU476LWfCzf+ /0RSawNj2zjPz74XPJuP9z+CWTcvHl0Qh6u7+5AqAfZnrJhCY11hD+df3hrd6Toj9LsyNN/+bFZvm xQIhtJfIo4+hZUk2uRqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOIBf-0096ZE-T9; Sun, 27 Feb 2022 11:58:04 +0000 Received: from mail.tintel.eu ([51.83.127.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOIBF-0096UA-EX for openwrt-devel@lists.openwrt.org; Sun, 27 Feb 2022 11:57:38 +0000 Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id F0D18443B98F; Sun, 27 Feb 2022 12:57:29 +0100 (CET) Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id JGlypOx6Y4EV; Sun, 27 Feb 2022 12:57:29 +0100 (CET) Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id 751ED443C5CB; Sun, 27 Feb 2022 12:57:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.tintel.eu 751ED443C5CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-ipv6.be; s=502B7754-045F-11E5-BBC5-64595FD46BE8; t=1645963049; bh=TZIQeOhZ6bLoDZpoE2HArv/Ga9XBTa88KzvLD75K3xA=; h=From:To:Date:Message-Id:MIME-Version; b=hnQhghHntA26Yld2aO/aGbObHnZ+5iiZw4c0hDLBi1Ois2Y73tk9poUXVxOsUvmiR rfV2W4z/QsSzELrn9bUn1IS0B6a7HzqBgInHDP74aC/C09Za0pI46XT+U4YnsXTzXJ /qhoBDt/HVlYuvU6BuVXH0IWsuQPTCTK8Y4UNj2I= X-Virus-Scanned: amavisd-new at mail.tintel.eu Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id 9D0AoQnkV7st; Sun, 27 Feb 2022 12:57:29 +0100 (CET) Received: from taz.sof.bg.adlevio.net (unknown [IPv6:2001:67c:21bc:20::10]) by mail.tintel.eu (Postfix) with ESMTPS id 23AA9443B974; Sun, 27 Feb 2022 12:57:29 +0100 (CET) From: Stijn Tintel To: openwrt-devel@lists.openwrt.org Cc: nbd@nbd.name, itugrok@yahoo.com Subject: [PATCH 4/6] build: add option KERNEL_DEBUG_INFO_BTF Date: Sun, 27 Feb 2022 13:57:24 +0200 Message-Id: <20220227115726.1272270-4-stijn@linux-ipv6.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220227115726.1272270-1-stijn@linux-ipv6.be> References: <20220227115726.1272270-1-stijn@linux-ipv6.be> MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Rspamd-Queue-Id: 23AA9443B974 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:200533, ipnet:2001:67c:21bc::/48, country:BG]; IP_WHITELIST(0.00)[2001:67c:21bc:20::10] X-Rspamd-Server: skulls X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220227_035737_637873_02CC5EBF X-CRM114-Status: UNSURE ( 8.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Tony Ambardar Generate BTF (BPF Type Format) information from DWARF debug info. This is embedded in the kernel and exported via sysfs as /sys/kernel/btf/vmlinux. BTF data enhances kernel portability and introspecti [...] Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Tony Ambardar Generate BTF (BPF Type Format) information from DWARF debug info. This is embedded in the kernel and exported via sysfs as /sys/kernel/btf/vmlinux. BTF data enhances kernel portability and introspection for BPF programs. Selecting this also enables the dwarves host package which provides the pahole tool used for BTF encoding. Test using: "bpftool btf dump file /sys/kernel/btf/vmlinux format c" This needs to depend on KERNEL_DEBUG_INFO_REDUCED not being set, otherwise we can enable both KERNEL_DEBUG_INFO_BTF and KERNEL_DEBUG_INFO_REDUCED, which will result in undefined behaviour. Signed-off-by: Tony Ambardar Signed-off-by: Felix Fietkau [split DEBUG_INFO_REDUCED into separate commit, add dependency] Signed-off-by: Stijn Tintel --- config/Config-kernel.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 6ba40e15fd..06619fcbb2 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -368,6 +368,20 @@ config KERNEL_DEBUG_INFO help This will compile your kernel and modules with debug information. +config KERNEL_DEBUG_INFO_BTF + + bool "Enable additional BTF type information" + default n + depends on !HOST_OS_MACOS + depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED + select DWARVES + help + Generate BPF Type Format (BTF) information from DWARF debug info. + Turning this on expects presence of pahole tool, which will convert + DWARF type info into equivalent deduplicated BTF type info. + + Required to run BPF CO-RE applications. + config KERNEL_DEBUG_INFO_REDUCED bool "Reduce debugging information" default y