public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <p_gortmaker@yahoo.com>
To: Andrew Morton <andrewm@uow.edu.au>
Cc: Stefani Seibold <stefani@seibold.net>, linux-kernel@vger.kernel.org
Subject: Re: patch for 2.4.0 disable printk
Date: Sun, 28 Jan 2001 21:48:08 -0500	[thread overview]
Message-ID: <3A74D9E8.112A101B@yahoo.com> (raw)
In-Reply-To: <01012723313500.01190@deepthought.seibold.net> <3A736B76.214D4193@uow.edu.au>

Andrew Morton wrote:
> 
> Stefani Seibold wrote:
> >
> > Second, i had change the macro so it calls now a inline funciton
> > printk_inline which always return 0. So it should be now compatibel to the
> > standard printk funciton.
> 
> A #define is better.
> 
> You see, even if printk is a null inline function,
> 
>         printk("foo");
> 
> will still cause "foo" to appear in your output. Apparently
> very recent versions of gcc have fixed this.

I missed earlier parts of this, so maybe I'm not even on the same page...

Here is part of an old patch I made to replace panic messages with
a simple EIP that you could still look up in System.map to cut down on 
the text in the image for small kernels.  One could use the same macro
trickery for printk() which is what I think Andrew is recommending.

Paul.

--- /mnt2/linux/include/linux/kernel.h	Wed Feb 12 14:17:00 1997
+++ linux/include/linux/kernel.h	Wed Feb 12 13:57:47 1997
@@ -34,8 +34,16 @@
 # define NORET_AND     noreturn,
 
 extern void math_error(void);
-NORET_TYPE void panic(const char * fmt, ...)
-	__attribute__ ((NORET_AND format (printf, 1, 2)));
+
+NORET_TYPE void panic_at(const void *location)
+	ATTRIB_NORET;
+
+#define panic(fmt,arg...)	\
+({ __label__ whoops;		\
+whoops:				\
+	panic_at(&&whoops);	\
+})
+ 
 NORET_TYPE void do_exit(long error_code)
 	ATTRIB_NORET;
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
--- /mnt2/linux/kernel/panic.c	Wed Feb 12 14:17:00 1997
+++ linux/kernel/panic.c	Wed Feb 12 14:23:06 1997
@@ -19,50 +19,18 @@
 extern void do_unblank_screen(void);
 extern int C_A_D;
 
-NORET_TYPE void panic(const char * fmt, ...)
+NORET_TYPE void panic_at(const void *location)
 {
-	static char buf[1024];
-	va_list args;
-	int i;
-
-	va_start(args, fmt);
-	vsprintf(buf, fmt, args);
-	va_end(args);
-	printk(KERN_EMERG "Kernel panic: %s\n",buf);
+	printk(KERN_EMERG "Kernel panic at: %p\n",location);
 	if (current == task[0])
 		printk(KERN_EMERG "In swapper task - not syncing\n");
 	else



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-29  8:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-27 22:31 patch for 2.4.0 disable printk Stefani Seibold
2001-01-28  0:44 ` Andrew Morton
2001-01-28  9:27   ` Stefani Seibold
2001-01-28 17:32     ` Jamie Lokier
2001-01-29  2:48   ` Paul Gortmaker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-01-26 20:46 Stefani Seibold
2001-01-26 21:13 ` David Weinehall
2001-01-26 11:05 Stefani Seibold
2001-01-27  0:09 ` Thunder from the hill
2001-01-27 10:57   ` Stefani Seibold
2001-01-29 17:40     ` James Simmons
2001-01-29 20:17       ` Stefani Seibold

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=3A74D9E8.112A101B@yahoo.com \
    --to=p_gortmaker@yahoo.com \
    --cc=andrewm@uow.edu.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefani@seibold.net \
    /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