@@ -18,13 +18,16 @@
#include "qemu/host-utils.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)
-#endif
+
+#ifndef DEBUG_CACHE
+#define DEBUG_CACHE 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_CACHE) { \
+ fprintf(stderr, "cache: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
/* the page in cache will not be replaced in two cycles */
#define CACHED_PAGE_LIFETIME 2