From: Marc Marí <5.markm...@gmail.com> Modify debug macros as explained in https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html
Signed-off-by: Marc Marí <5.markm...@gmail.com> --- target-s390x/helper.c | 32 ++++++++++++++++++-------------- target-s390x/kvm.c | 17 ++++++++++------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index aa628b8..8a38f90 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -25,24 +25,28 @@ #include "sysemu/sysemu.h" #endif -//#define DEBUG_S390 -//#define DEBUG_S390_PTE -//#define DEBUG_S390_STDOUT +//#define DEBUG_S390 1 +//#define DEBUG_S390_PTE 1 +//#define DEBUG_S390_STDOUT 1 -#ifdef DEBUG_S390 -#ifdef DEBUG_S390_STDOUT -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); \ - qemu_log(fmt, ##__VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { qemu_log(fmt, ## __VA_ARGS__); } while (0) +#ifndef DEBUG_S390 +#define DEBUG_S390 0 #endif -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) + +#ifndef DEBUG_S390_STDOUT +#define DEBUG_S390_STDOUT 0 #endif +#define DPRINTF(fmt, ...) \ + do { \ + if(DEBUG_S390) { \ + qemu_log(fmt, ##__VA_ARGS__); \ + if(DEBUG_S390_STDOUT) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ + } \ + } while (0) + #ifdef DEBUG_S390_PTE #define PTE_DPRINTF DPRINTF #else diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 56b9af7..3f20b6b 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -37,16 +37,19 @@ #include "qapi/qmp/qjson.h" #include "monitor/monitor.h" -/* #define DEBUG_KVM */ +/* #define DEBUG_KVM 1*/ -#ifdef DEBUG_KVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) +#ifndef DEBUG_KVM +#define DEBUG_KVM 0 #endif +#define DPRINTF(fmt, ...) \ + do { \ + if(DEBUG_KVM) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ + } while (0) + #define IPA0_DIAG 0x8300 #define IPA0_SIGP 0xae00 #define IPA0_B2 0xb200 -- 1.7.10.4