From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58167 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9Max-0006tN-IJ for qemu-devel@nongnu.org; Fri, 22 Oct 2010 14:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9Mat-0001lO-Vv for qemu-devel@nongnu.org; Fri, 22 Oct 2010 14:44:02 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:43709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9Mat-0001l8-TV for qemu-devel@nongnu.org; Fri, 22 Oct 2010 14:43:59 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9MIRk0T013586 for ; Fri, 22 Oct 2010 14:27:46 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9MIhrit164008 for ; Fri, 22 Oct 2010 14:43:53 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9MIhqBT014794 for ; Fri, 22 Oct 2010 14:43:53 -0400 From: Michael Roth Date: Fri, 22 Oct 2010 13:43:19 -0500 Message-Id: <1287773011-24726-4-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1287773011-24726-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1287773011-24726-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC][PATCH 03/15] virtproxy: add debug functions for virtproxy core List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, agl@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, abeekhof@redhat.com Signed-off-by: Michael Roth --- virtproxy.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/virtproxy.c b/virtproxy.c index f30b859..2f8996c 100644 --- a/virtproxy.c +++ b/virtproxy.c @@ -13,6 +13,23 @@ #include "virtproxy.h" +#define DEBUG_VP + +#ifdef DEBUG_VP +#define TRACE(msg, ...) do { \ + fprintf(stderr, "%s:%s():L%d: " msg "\n", \ + __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \ +} while(0) +#else +#define TRACE(msg, ...) \ + do { } while (0) +#endif + +#define LOG(msg, ...) do { \ + fprintf(stderr, "%s:%s(): " msg "\n", \ + __FILE__, __FUNCTION__, ## __VA_ARGS__); \ +} while(0) + #define VP_SERVICE_ID_LEN 32 /* max length of service id string */ #define VP_PKT_DATA_LEN 1024 /* max proxied bytes per VPPacket */ #define VP_CONN_DATA_LEN 1024 /* max bytes conns can send at a time */ -- 1.7.0.4