@@ -27,33 +27,42 @@
#include <string.h>
#include <rdma/rdma_cma.h>
-//#define DEBUG_RDMA
-//#define DEBUG_RDMA_VERBOSE
-//#define DEBUG_RDMA_REALLY_VERBOSE
+//#define DEBUG_RDMA 1
+//#define DEBUG_RDMA_VERBOSE 1
+//#define DEBUG_RDMA_REALLY_VERBOSE 1
+
+#ifndef DEBUG_RDMA
+#define DEBUG_RDMA 0
+#endif
-#ifdef DEBUG_RDMA
-#define DPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
-#else
#define DPRINTF(fmt, ...) \
- do { } while (0)
+ do { \
+ if(DEBUG_RDMA) { \
+ printf("rdma: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
+#ifndef DEBUG_RDMA_VERBOSE
+#define DEBUG_RDMA_VERBOSE 0
#endif
-#ifdef DEBUG_RDMA_VERBOSE
#define DDPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DDPRINTF(fmt, ...) \
- do { } while (0)
+ do { \
+ if(DEBUG_RDMA_VERBOSE) { \
+ printf("rdma: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
+#ifndef DEBUG_RDMA_REALLY_VERBOSE
+#define DEBUG_RDMA_REALLY_VERBOSE 0
#endif
-#ifdef DEBUG_RDMA_REALLY_VERBOSE
-#define DDDPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
-#else
#define DDDPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+ do { \
+ if(DEBUG_RDMA_REALLY_VERBOSE) { \
+ printf("rdma: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
/*
* Print and error on both the Monitor and the Log file.
@@ -25,14 +25,19 @@
#include "qemu-common.h"
#include "migration/page_cache.h"
-#ifdef DEBUG_CACHE
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "cache: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+//#define DEBUG_CACHE 1
+
+#ifndef DEBUG_CACHE
+#define DEBUG_CACHE 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if(DEBUG_CACHE) { \
+ fprintf(stdout, "cache: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
typedef struct CacheItem CacheItem;
struct CacheItem {
@@ -26,16 +26,19 @@
#include <xen/hvm/params.h>
#include <xen/hvm/e820.h>
-//#define DEBUG_XEN
+//#define DEBUG_XEN 1
-#ifdef DEBUG_XEN
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#ifndef DEBUG_XEN
+#define DEBUG_XEN 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if(DEBUG_XEN) { \
+ fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
static MemoryRegion *framebuffer;
static bool xen_in_migration;
@@ -23,16 +23,19 @@
#include "trace.h"
-//#define MAPCACHE_DEBUG
-
-#ifdef MAPCACHE_DEBUG
-# define DPRINTF(fmt, ...) do { \
- fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
-} while (0)
-#else
-# define DPRINTF(fmt, ...) do { } while (0)
+//#define MAPCACHE_DEBUG 1
+
+#ifndef MAPCACHE_DEBUG
+#define MAPCACHE_DEBUG 0
#endif
+# define DPRINTF(fmt, ...) \
+ do { \
+ if(MAPCACHE_DEBUG) { \
+ fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#if defined(__i386__)
# define MCACHE_BUCKET_SHIFT 16
# define MCACHE_MAX_SIZE (1UL<<31) /* 2GB Cap */