Module Name:    src
Committed By:   pooka
Date:           Wed Jun 10 18:34:49 UTC 2009

Modified Files:
        src/sys/rump/include/rump: rumpuser.h
        src/sys/rump/librump/rumpuser: rumpuser.c

Log Message:
Add rumpuser_dprintf(), which can be used as a "safe" debug print
routine -- the kernel printf does a lot of crud which is not always
nice and dandy especially when debugging locks.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.40 -r1.41 src/sys/rump/librump/rumpuser/rumpuser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.23 src/sys/rump/include/rump/rumpuser.h:1.24
--- src/sys/rump/include/rump/rumpuser.h:1.23	Mon Apr 27 14:28:58 2009
+++ src/sys/rump/include/rump/rumpuser.h	Wed Jun 10 18:34:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.23 2009/04/27 14:28:58 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.24 2009/06/10 18:34:49 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -102,6 +102,8 @@
 int rumpuser_writewatchfile_setup(int, int, intptr_t, int *);
 int rumpuser_writewatchfile_wait(int, intptr_t *, int *);
 
+int rumpuser_dprintf(const char *, ...);
+
 /* rumpuser_pth */
 void rumpuser_thrinit(kernel_lockfn, kernel_unlockfn, int);
 int  rumpuser_bioinit(rump_biodone_fn);

Index: src/sys/rump/librump/rumpuser/rumpuser.c
diff -u src/sys/rump/librump/rumpuser/rumpuser.c:1.40 src/sys/rump/librump/rumpuser/rumpuser.c:1.41
--- src/sys/rump/librump/rumpuser/rumpuser.c:1.40	Sun Apr 26 21:30:43 2009
+++ src/sys/rump/librump/rumpuser/rumpuser.c	Wed Jun 10 18:34:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.c,v 1.40 2009/04/26 21:30:43 pooka Exp $	*/
+/*	$NetBSD: rumpuser.c,v 1.41 2009/06/10 18:34:49 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.40 2009/04/26 21:30:43 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.41 2009/06/10 18:34:49 pooka Exp $");
 #endif /* !lint */
 
 /* thank the maker for this */
@@ -52,6 +52,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
+#include <stdarg.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -494,3 +495,16 @@
 		*opaque = kev.udata;
 	return rv;
 }
+
+int
+rumpuser_dprintf(const char *format, ...)
+{
+	va_list ap;
+	int rv;
+
+	va_start(ap, format);
+	rv = vprintf(format, ap);
+	va_end(ap);
+
+	return rv;
+}

Reply via email to