[PATCH 1/3] vprintk support
From: Matt Mackall (mpm_at_selenic.com)
Date: 07/31/04
- Previous message: Randy.Dunlap: "Re: 2.6.8-rc2 crash(s)?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jul 2004 17:38:23 -0500 To: linux-kernel <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Add vprintk call. This lets us directly pass varargs stuff to the
console without using vsnprintf to an intermediate buffer.
Signed-off-by: Matt Mackall <mpm@selenic.com>
tiny-mpm/include/linux/kernel.h | 1 +
tiny-mpm/kernel/printk.c | 14 ++++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
Index: tiny/include/linux/kernel.h
===================================================================
--- tiny.orig/include/linux/kernel.h 2004-04-15 14:18:37.000000000 -0500
+++ tiny/include/linux/kernel.h 2004-04-19 13:29:39.000000000 -0500
@@ -87,6 +87,7 @@
extern int kernel_text_address(unsigned long addr);
extern int session_of_pgrp(int pgrp);
+asmlinkage int vprintk(const char *fmt, va_list args);
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
Index: tiny/kernel/printk.c
===================================================================
--- tiny.orig/kernel/printk.c 2004-04-15 14:18:37.000000000 -0500
+++ tiny/kernel/printk.c 2004-04-19 13:29:39.000000000 -0500
@@ -483,6 +483,17 @@
asmlinkage int printk(const char *fmt, ...)
{
va_list args;
+ int r;
+
+ va_start(args, fmt);
+ r = vprintk(fmt, args);
+ va_end(args);
+
+ return r;
+}
+
+asmlinkage int vprintk(const char *fmt, va_list args)
+{
unsigned long flags;
int printed_len;
char *p;
@@ -500,9 +511,7 @@
spin_lock_irqsave(&logbuf_lock, flags);
/* Emit the output into the temporary buffer */
- va_start(args, fmt);
printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
- va_end(args);
/*
* Copy the output into log_buf. If the caller didn't provide
@@ -554,6 +563,7 @@
return printed_len;
}
EXPORT_SYMBOL(printk);
+EXPORT_SYMBOL(vprintk);
/**
* acquire_console_sem - lock the console system for exclusive use.
-- Mathematics is the supreme nostalgia of our time. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Randy.Dunlap: "Re: 2.6.8-rc2 crash(s)?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- [PATCH 1/2] printk_nowakeup()
... asmlinkage int vprintk(const char *fmt, ... va_list args) ...
(Linux-Kernel) - [patch] Re: missing vprintf in kernel.api. Interest in patch?
... +asmlinkage int vprintk(const char *fmt, ... To unsubscribe from this
list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
... (Linux-Kernel) - [PATCH 2.6.11.2][1/2] printk with anti-cluttering-feature
... asmlinkage int vprintk(const char *fmt, ... send the line "unsubscribe
linux-kernel" in ... (Linux-Kernel) - Repost, cant compile the very first code from Late Stevens apue.
... static void err_doit(int, const char *, va_list); ... err_ret(const char
*fmt, ...) ... lock_reg(fd, F_SETLK, F_RDLCK, offset, whence, len) ... (comp.unix.bsd.freebsd.misc) - Repost, cant compile the very first code from Late Stevens apue.
... static void err_doit(int, const char *, va_list); ... err_ret(const char
*fmt, ...) ... lock_reg(fd, F_SETLK, F_RDLCK, offset, whence, len) ... (comp.unix.programmer)