From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH 03/17] xenpaging: print DPRINTF ouput if XENPAGING_DEBUG is in environment Date: Mon, 06 Dec 2010 21:59:10 +0100 Message-ID: <20101206205908.989247205@aepfle.de> References: <20101206205907.848643876@aepfle.de> Return-path: Content-Disposition: inline; filename=xen-unstable.xenpaging.xenpaging_init.xentoollog_logger.patch List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org No DPRINTF output is logged because the default loglevel is to low in libxc. Recognize the XENPAGING_DEBUG environment variable to change the default loglevel at runtime. Signed-off-by: Olaf Hering --- tools/xenpaging/xenpaging.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- xen-unstable.hg-4.1.22459.orig/tools/xenpaging/xenpaging.c +++ xen-unstable.hg-4.1.22459/tools/xenpaging/xenpaging.c @@ -39,12 +39,6 @@ #include "policy.h" #include "xenpaging.h" - -#if 0 -#undef DPRINTF -#define DPRINTF(...) ((void)0) -#endif - static char filename[80]; static int interrupted; static void close_handler(int sig) @@ -83,9 +77,12 @@ xenpaging_t *xenpaging_init(xc_interface { xenpaging_t *paging; xc_interface *xch; + xentoollog_logger *dbg = NULL; int rc; - xch = xc_interface_open(NULL, NULL, 0); + if ( getenv("XENPAGING_DEBUG") ) + dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0); + xch = xc_interface_open(dbg, NULL, 0); if ( !xch ) goto err_iface;