From patchwork Wed Feb 28 14:00:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 777131 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 C1F8F149DE5 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=TaWuurS1X/Vbstx/XAOUOwYtvw6nt/QEZJKfb+xw/bITIDk13gQKbpFMR5qdwSJcc1JXClAPEv9hxyQdjNKQL0sAiR9F+kwqxgbv12m6aifU+1jHooo7g0TXN2KI8Thk0knXfoxnGLfDqRPYwM/bU4h5UATVer7TYAMwCtFU04Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128823; c=relaxed/simple; bh=QsCae0o9eyN75UvvnzCtyzD7Q33sU4Xy0REKuZlqxLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aOleBBw/qrw2Hhy5rCjUCa4Kmq/L5oFJg6R8WcYwwujEakjeg/zLluVTgwNNOCbPoj8wOLS2f0vhGbCm+wYkHChzYsHeRTyWHYVDpssObDuw9SI2kz+MypRq1Y33zHVE2hctZCJsHg+5hdPhQIgtEW8JWXpONYylaVVfy1T+NdY= 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 se072B0074gWvPH01e07Ym; 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-001tZC-DU; Wed, 28 Feb 2024 15:00:07 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rfKTe-006hlF-Uu; 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 3/4] dyndbg: Use *no_printk() helpers Date: Wed, 28 Feb 2024 15:00:04 +0100 Message-Id: <32e18ceb528b99d9147be9c1af578a1965e2bad9.1709127473.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When printk-indexing is enabled, each printk() or dev_printk() invocation emits a pi_entry structure. This is even true when the call is protected by an always-false check: while the actual code to print the message is optimized out by the compiler, the pi_entry structure is still emitted. Fix this by replacing "if (0) *printk(...)" constructs by calls to the corresponding *no_printk() helpers. Note that this has minimal impact, as most (all?) callers of dynamic_{pr,dev}_debug() are protected by checks for DYNAMIC_DEBUG anyway. Still, using the helpers serves as a good example to follow. Signed-off-by: Geert Uytterhoeven --- include/linux/dynamic_debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 4fcbf4d4fd0a29d1..ff44ec346162a164 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -305,9 +305,9 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, #define DYNAMIC_DEBUG_BRANCH(descriptor) false #define dynamic_pr_debug(fmt, ...) \ - do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) + no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #define dynamic_dev_dbg(dev, fmt, ...) \ - do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0) + dev_no_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__) #define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) \ do { if (0) \