public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@tglx.de,
	akpm@linux-foundation.org
Subject: Re: [patch] Printk kernel version in WARN_ON
Date: Sat, 17 Nov 2007 15:02:36 -0800	[thread overview]
Message-ID: <200711171502.36478.vda.linux@googlemail.com> (raw)
In-Reply-To: <20071117101552.2a7f34cb@laptopd505.fenrus.org>

On Saturday 17 November 2007 10:15, Arjan van de Ven wrote:
> Hi,
>
>  #define WARN_ON(condition) ({						\
>  	int __ret_warn_on = !!(condition);				\
>  	if (unlikely(__ret_warn_on)) {					\
> -		printk("WARNING: at %s:%d %s()\n", __FILE__,		\
> -			__LINE__, __FUNCTION__);			\
> +		printk("WARNING: at %s:%d %s()  (%s)\n", __FILE__,	\
> +			__LINE__, __FUNCTION__, UTS_RELEASE);		\
>  		dump_stack();						\
>  	}								\
>  	unlikely(__ret_warn_on);					\

We have ~700 WARN_ONs in the tree. Adding UTS_RELEASE to printk
grows every one of them by at least 5 bytes.

I think it makes sense to move printk out-of-line, to

void print_WARN_ON_warning(const char *file, int line, const char *func);

This will save at least 10 bytes per WARN_ON.
--
vda

      parent reply	other threads:[~2007-11-17 23:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-17 18:15 [patch] Printk kernel version in WARN_ON Arjan van de Ven
2007-11-17 18:27 ` Andrew Morton
2007-11-17 18:39   ` Arjan van de Ven
2007-11-17 18:46     ` Andrew Morton
2007-11-17 19:35       ` Arjan van de Ven
2007-11-17 19:42         ` Sam Ravnborg
2007-11-21 12:51           ` Pavel Machek
2007-11-18  0:42         ` Ingo Molnar
2007-11-18  0:57           ` Andrew Morton
2007-11-18  1:04             ` Ingo Molnar
2007-11-18 17:18             ` Arjan van de Ven
2007-11-17 19:28 ` Sam Ravnborg
2007-11-17 23:02 ` Denys Vlasenko [this message]

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=200711171502.36478.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@tglx.de \
    /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