public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Chris Down <chris@chrisdown.name>, Petr Mladek <pmladek@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jessica Yu <jeyu@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jason Baron <jbaron@akamai.com>,
	Jim Cromie <jim.cromie@gmail.com>,
	Ilya Dryomov <idryomov@gmail.com>, Xiubo Li <xiubli@redhat.com>,
	Jeff Layton <jlayton@kernel.org>,
	linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 2/4] dev_printk: Add and use dev_no_printk()
Date: Wed, 28 Feb 2024 19:39:19 +0200	[thread overview]
Message-ID: <Zd9vx2pM3Ds9-dzk@smile.fi.intel.com> (raw)
In-Reply-To: <8583d54f1687c801c6cda8edddf2cf0344c6e883.1709127473.git.geert+renesas@glider.be>

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



  reply	other threads:[~2024-02-28 17:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 14:00 [PATCH 0/4] printk_index: Fix false positives Geert Uytterhoeven
2024-02-28 14:00 ` [PATCH 1/4] printk: Let no_printk() use _printk() Geert Uytterhoeven
2024-02-28 14:00 ` [PATCH 2/4] dev_printk: Add and use dev_no_printk() Geert Uytterhoeven
2024-02-28 17:39   ` Andy Shevchenko [this message]
2024-02-28 19:33     ` Geert Uytterhoeven
2024-02-28 19:52       ` Andy Shevchenko
2024-02-28 14:00 ` [PATCH 3/4] dyndbg: Use *no_printk() helpers Geert Uytterhoeven
2024-02-28 14:00 ` [PATCH 4/4] ceph: Use no_printk() helper Geert Uytterhoeven
2024-02-28 17:41 ` [PATCH 0/4] printk_index: Fix false positives Andy Shevchenko
2024-02-29  0:37 ` Xiubo Li
2024-03-01  0:35 ` Chris Down
2024-03-19 15:08 ` Petr Mladek
2024-03-26 15:36   ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zd9vx2pM3Ds9-dzk@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chris@chrisdown.name \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=idryomov@gmail.com \
    --cc=jbaron@akamai.com \
    --cc=jeyu@kernel.org \
    --cc=jim.cromie@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=xiubli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox