From patchwork Wed Feb 28 14:00:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13575541 Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1FD014AD34 for ; Wed, 28 Feb 2024 14:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128823; cv=none; b=RWhCsJdl1MYmHTFM7MxoAjw1xjx1VoLLXzmjQueXkeZplXBw8a6xM6vhU/8jB4Z6W0499mN7UWI5/+3XjoHpPX2dITRtbXEAJ7wbUUBcuh/asY2+AY4hgLtvsAzIS4W+Yhg8F8c4QdgVIaLSMGKbaDGZi/PQCVvG3hzbQMZNn1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128823; c=relaxed/simple; bh=OptXvw4/U98wPjo3qpndC/2qRbg6m70hWO/2XjYxTbI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IfHXHt5o0xntDkBHOj811yxnVAE/3zsJRvlOSIR8Y1A1AoP2Wxao3Mr9NOow9GEJP9oTayVDGKTHol8SA6z6/o20kFR3/LMuAXz78ETgxeyVR3nIDv7P5oBx+pvgqwJW3zZJys89mqVNBmqDYxu0MD6W7jZT/bi7Iyd2Oif+j0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:48c4:26a9:d9ec:22cb]) by andre.telenet-ops.be with bizsmtp id se072B0064gWvPH01e07Yl; Wed, 28 Feb 2024 15:00:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rfKTV-001tZA-DK; Wed, 28 Feb 2024 15:00:07 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rfKTe-006hl6-RM; Wed, 28 Feb 2024 15:00:06 +0100 From: Geert Uytterhoeven To: Chris Down , Petr Mladek , Greg Kroah-Hartman , Andy Shevchenko , Jessica Yu , Steven Rostedt , John Ogness , Sergey Senozhatsky , Jason Baron , Jim Cromie , Ilya Dryomov , Xiubo Li , Jeff Layton Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 0/4] printk_index: Fix false positives Date: Wed, 28 Feb 2024 15:00:01 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi all, When printk-indexing is enabled, each printk() invocation emits a pi_entry structure, containing the format string and other information related to its location in the kernel sources. This is even true when the printk() is protected by an always-false check, as is typically the case for debug messages: while the actual code to print the message is optimized out by the compiler, the pi_entry structure is still emitted. Hence when debugging is disabled, this leads to the inclusion in the index of lots of printk formats that cannot be emitted by the current kernel. This series fixes that for the common debug helpers under include/. It reduces the size of an arm64 defconfig kernel with CONFIG_PRINTK_INDEX=y by ca. 1.5 MiB, or 28% of the overhead of enabling CONFIG_PRINTK_INDEX=y. Notes: - netdev_(v)dbg() and netif_(v)dbg() are not affected, as net{dev,if}_printk() do not implement printk-indexing, except for the single global internal instance of __netdev_printk(). - This series fixes only debug code in global header files under include/. There are more cases to fix in subsystem-specific header files and in sources files. Thanks for your comments! Geert Uytterhoeven (4): printk: Let no_printk() use _printk() dev_printk: Add and use dev_no_printk() dyndbg: Use *no_printk() helpers ceph: Use no_printk() helper include/linux/ceph/ceph_debug.h | 18 +++++++----------- include/linux/dev_printk.h | 25 +++++++++++++------------ include/linux/dynamic_debug.h | 4 ++-- include/linux/printk.h | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-) Reviewed-by: Andy Shevchenko Reviewed-by: Xiubo Li Reviewed-by: Chris Down Reviewed-by: Petr Mladek