lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd9vx2pM3Ds9-dzk@smile.fi.intel.com>
Date: Wed, 28 Feb 2024 19:39:19 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: Chris Down <chris@...isdown.name>, Petr Mladek <pmladek@...e.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jessica Yu <jeyu@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
	John Ogness <john.ogness@...utronix.de>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Jason Baron <jbaron@...mai.com>, Jim Cromie <jim.cromie@...il.com>,
	Ilya Dryomov <idryomov@...il.com>, Xiubo Li <xiubli@...hat.com>,
	Jeff Layton <jlayton@...nel.org>, linux-kernel@...r.kernel.org,
	ceph-devel@...r.kernel.org
Subject: Re: [PATCH 2/4] dev_printk: Add and use dev_no_printk()

On Wed, Feb 28, 2024 at 03:00:03PM +0100, Geert Uytterhoeven wrote:
> When printk-indexing is enabled, each dev_printk() invocation emits a
> pi_entry structure.  This is even true when the dev_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.
> 
> Avoid emitting pi_entry structures for unavailable dev_printk() kernel
> messages by:
>   1. Introducing a dev_no_printk() helper, mimicked after the existing
>      no_printk() helper, which calls _dev_printk() instead of
>      dev_printk(),
>   2. Replacing all "if (0) dev_printk(...)" constructs by calls to the
>      new helper.
> 
> This reduces the size of an arm64 defconfig kernel with
> CONFIG_PRINTK_INDEX=y by 957 KiB.

..

> +/*
> + * Dummy dev_printk for disabled debugging statements to use whilst maintaining

dev_printk()

> + * gcc's format checking.
> + */
> +#define dev_no_printk(level, dev, fmt, ...)				\
> +	({								\
> +		if (0)							\
> +			_dev_printk(level, dev, fmt, ##__VA_ARGS__);	\
> +	})

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ