* [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF
@ 2014-05-17 23:03 Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro Marc Marí
` (15 more replies)
0 siblings, 16 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Add QEMU_DPRINTF to substitute debug printfs and use the same format through
the codebase.
Marc Marí (16):
include/qemu-common.h: Add QEMU_DPRINTF macro
x86: Convert debug printfs to QEMU_DPRINTF
s390: Convert debug printfs to QEMU_DPRINTF
scsi: Convert debug printfs to QEMU_DPRINTF
highbank: Convert debug printfs to QEMU_DPRINTF
xilinx: Convert debug printfs to QEMU_DPRINTF
spapr: Convert debug printfs to QEMU_DPRINTF
stellaris: Convert debug printfs to QEMU_DPRINTF
i82374: Convert debug printfs to QEMU_DPRINTF
i8257: Convert debug printfs to QEMU_DPRINTF
rc4030: Convert debug printfs to QEMU_DPRINTF
sd: Convert debug printfs to QEMU_DPRINTF
isa: Convert debug printfs to QEMU_DPRINTF
lan9118: Convert debug printfs to QEMU_DPRINTF
pci-host: Convert debug printfs to QEMU_DPRINTF
common: Convert debug printfs to QEMU_DPRINTF
hw/dma/i82374.c | 31 ++++++++++++++++---------------
hw/dma/i8257.c | 14 ++++++++------
hw/dma/rc4030.c | 29 +++++++++++++++--------------
hw/i386/kvm/pci-assign.c | 11 ++++++-----
hw/i386/multiboot.c | 7 +++++--
hw/isa/vt82c686.c | 12 ++++++++----
hw/net/cadence_gem.c | 24 ++++++++++++++++--------
hw/net/lan9118.c | 29 +++++++++++++++++++----------
hw/net/spapr_llan.c | 6 ++++--
hw/net/stellaris_enet.c | 21 ++++++++++++++-------
hw/net/xgmac.c | 27 +++++++++++++++------------
hw/pci-host/bonito.c | 13 +++++++++----
hw/pci-host/ppce500.c | 21 +++++++++++++--------
hw/s390x/s390-virtio-bus.c | 9 +++++----
hw/s390x/s390-virtio.c | 9 +++++----
hw/scsi/lsi53c895a.c | 22 +++++++++++++---------
hw/scsi/scsi-generic.c | 14 +++++++-------
hw/scsi/spapr_vscsi.c | 9 +++++----
hw/sd/sd.c | 8 +++++---
hw/sd/ssi-sd.c | 19 ++++++++++++-------
include/qemu-common.h | 7 +++++++
migration-rdma.c | 31 +++++++++++++++++--------------
page_cache.c | 11 +++++++----
target-i386/kvm.c | 9 +++++----
target-s390x/helper.c | 23 +++++++++++++++--------
target-s390x/kvm.c | 9 +++++----
xen-hvm.c | 9 +++++----
xen-mapcache.c | 9 +++++----
28 files changed, 266 insertions(+), 177 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-19 15:28 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF Marc Marí
` (14 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Create this macro to let debug macros to have the same format through the
codebase and use regular ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
include/qemu-common.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 3f3fd60..acdcf08 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int initial);
const char *qemu_ether_ntoa(const MACAddr *mac);
#endif
+
+#define QEMU_DPRINTF(cond,pfx,fmt,...) \
+ do { \
+ if (cond) { \
+ fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \
+ } \
+ } while (0)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-19 15:48 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 03/16] s390: " Marc Marí
` (13 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Peter Crosthwaite, open list:X86, open list:X86,
Stefan Hajnoczi, Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/i386/kvm/pci-assign.c | 11 ++++++-----
hw/i386/multiboot.c | 7 +++++--
target-i386/kvm.c | 9 +++++----
xen-hvm.c | 9 +++++----
xen-mapcache.c | 9 +++++----
5 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index de33657..21330a9 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -51,14 +51,15 @@
//#define DEVICE_ASSIGNMENT_DEBUG
#ifdef DEVICE_ASSIGNMENT_DEBUG
-#define DEBUG(fmt, ...) \
- do { \
- fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \
- } while (0)
+#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 1
#else
-#define DEBUG(fmt, ...)
+#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 0
#endif
+#define DEBUG(fmt, ...) \
+ QEMU_DPRINTF(DEVICE_ASSIGNMENT_DEBUG_ENABLED, \
+ "pci_assign", fmt, ## __VA_ARGS__)
+
typedef struct PCIRegion {
int type; /* Memory or port I/O */
int valid;
diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 985ca1e..cd04339 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -33,11 +33,14 @@
//#define DEBUG_MULTIBOOT
#ifdef DEBUG_MULTIBOOT
-#define mb_debug(a...) fprintf(stderr, ## a)
+#define DEBUG_MULTIBOOT_ENABLED 1
#else
-#define mb_debug(a...)
+#define DEBUG_MULTIBOOT_ENABLED 0
#endif
+#define mb_debug(...) \
+ QEMU_DPRINTF(DEBUG_MULTIBOOT_ENABLED, "i386 multiboot", __VA_ARGS__)
+
#define MULTIBOOT_STRUCT_ADDR 0x9000
#if MULTIBOOT_STRUCT_ADDR > 0xf0000
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 0d894ef..53098ad 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -39,13 +39,14 @@
//#define DEBUG_KVM
#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_KVM_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_KVM_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_KVM_ENABLED, "i386 kvm", fmt, ## __VA_ARGS__)
+
#define MSR_KVM_WALL_CLOCK 0x11
#define MSR_KVM_SYSTEM_TIME 0x12
diff --git a/xen-hvm.c b/xen-hvm.c
index a64486c..a0d0bf1 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -29,13 +29,14 @@
//#define DEBUG_XEN_HVM
#ifdef DEBUG_XEN_HVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_XEN_HVM_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_XEN_HVM_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_XEN_HVM_ENABLED, "xen", fmt, ## __VA_ARGS__)
+
static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
static MemoryRegion *framebuffer;
static bool xen_in_migration;
diff --git a/xen-mapcache.c b/xen-mapcache.c
index eda914a..c6a72c5 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -26,13 +26,14 @@
//#define MAPCACHE_DEBUG
#ifdef MAPCACHE_DEBUG
-# define DPRINTF(fmt, ...) do { \
- fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
-} while (0)
+#define MAPCACHE_DEBUG_ENABLED 1
#else
-# define DPRINTF(fmt, ...) do { } while (0)
+#define MAPCACHE_DEBUG_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(MAPCACHE_DEBUG_ENABLED, "xen_mapcache", fmt, ## __VA_ARGS__)
+
#if defined(__i386__)
# define MCACHE_BUCKET_SHIFT 16
# define MCACHE_MAX_SIZE (1UL<<31) /* 2GB Cap */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-18 9:37 ` Peter Crosthwaite
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 04/16] scsi: " Marc Marí
` (12 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber, open list:Overall
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/s390x/s390-virtio-bus.c | 9 +++++----
hw/s390x/s390-virtio.c | 9 +++++----
target-s390x/helper.c | 23 +++++++++++++++--------
target-s390x/kvm.c | 9 +++++----
4 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 9c71afa..2a1799e 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -38,13 +38,14 @@
/* #define DEBUG_S390 */
#ifdef DEBUG_S390
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_S390_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_S390_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio bus", fmt, ## __VA_ARGS__)
+
#define VIRTIO_EXT_CODE 0x2603
static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size,
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index aef2003..b69afb4 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -42,13 +42,14 @@
//#define DEBUG_S390
#ifdef DEBUG_S390
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_S390_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_S390_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio", fmt, ## __VA_ARGS__)
+
#define MAX_BLK_DEVS 10
#define ZIPL_FILENAME "s390-zipl.rom"
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 7c76fc1..c2aa568 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -30,19 +30,26 @@
//#define DEBUG_S390_STDOUT
#ifdef DEBUG_S390
-#ifdef DEBUG_S390_STDOUT
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); \
- qemu_log(fmt, ##__VA_ARGS__); } while (0)
+#define DEBUG_S390_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { qemu_log(fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_S390_ENABLED 0
#endif
+
+#ifdef DEBUG_S390_STDOUT
+#define DEBUG_S390_STDOUT_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_S390_STDOUT_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if(DEBUG_S390_ENABLED) { \
+ qemu_log(fmt, ##__VA_ARGS__); \
+ QEMU_DPRINTF(DEBUG_S390_STDOUT_ENABLED, "s390x helper", \
+ 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 56179af..63c46c4 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -41,13 +41,14 @@
/* #define DEBUG_KVM */
#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_KVM_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_KVM_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_KVM_ENABLED, "s390 kvm", fmt, ## __VA_ARGS__)
+
#define IPA0_DIAG 0x8300
#define IPA0_SIGP 0xae00
#define IPA0_B2 0xb200
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 04/16] scsi: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (2 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 03/16] s390: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 05/16] highbank: " Marc Marí
` (11 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
open list:sPAPR, Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some warnings appeared because of
non-existing (old) variables, which were removed.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/scsi/lsi53c895a.c | 22 +++++++++++++---------
hw/scsi/scsi-generic.c | 14 +++++++-------
hw/scsi/spapr_vscsi.c | 9 +++++----
3 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index cb30414..1efc905 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -24,16 +24,21 @@
//#define DEBUG_LSI_REG
#ifdef DEBUG_LSI
-#define DPRINTF(fmt, ...) \
-do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
+#define DEBUG_LSI_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
+#define DEBUG_LSI_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_LSI_ENABLED, "lsi_scsi", fmt, ## __VA_ARGS__)
+#define BADF(fmt, ...) \
+ do { \
+ QEMU_DPRINTF(1, "lsi_scsi error", fmt, ## __VA_ARGS__); \
+ if(DEBUG_LSI_ENABLED) { \
+ exit(1); \
+ } \
+ } while (0)
+
#define LSI_MAX_DEVS 7
#define LSI_SCNTL0_TRG 0x01
@@ -1261,12 +1266,11 @@ again:
uint8_t data8;
int reg;
int operator;
-#ifdef DEBUG_LSI
+
static const char *opcode_names[3] =
{"Write", "Read", "Read-Modify-Write"};
static const char *operator_names[8] =
{"MOV", "SHL", "OR", "XOR", "AND", "SHR", "ADD", "ADC"};
-#endif
reg = ((insn >> 16) & 0x7f) | (insn & 0x80);
data8 = (insn >> 8) & 0xff;
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 8d92e0d..6362860 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -21,14 +21,15 @@
//#define DEBUG_SCSI
#ifdef DEBUG_SCSI
-#define DPRINTF(fmt, ...) \
-do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
+#define DEBUG_SCSI_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
+#define DEBUG_SCSI_ENABLED 0
#endif
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_SCSI_ENABLED, "scsi-generic", fmt, ## __VA_ARGS__)
+#define BADF(fmt, ...) \
+ QEMU_DPRINTF(1, "scsi-generic", fmt, ## __VA_ARGS__)
#include <stdio.h>
#include <sys/types.h>
@@ -303,8 +304,7 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
SCSIDevice *s = r->req.dev;
int ret;
- DPRINTF("Command: lun=%d tag=0x%x len %zd data=0x%02x", lun, tag,
- r->req.cmd.xfer, cmd[0]);
+ DPRINTF("Command: len %zd data=0x%02x", r->req.cmd.xfer, cmd[0]);
#ifdef DEBUG_SCSI
{
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index d4ada4f..6406d39 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -45,13 +45,14 @@
/*#define DEBUG_VSCSI*/
#ifdef DEBUG_VSCSI
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_VSCSI_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_VSCSI_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_VSCSI_ENABLED, "spapr_vscsi", fmt, ## __VA_ARGS__)
+
/*
* Virtual SCSI device
*/
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 05/16] highbank: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (3 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 04/16] scsi: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 06/16] xilinx: " Marc Marí
` (10 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Remove header and __func__ in debug printfs, to avoid duplicated messages.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/net/xgmac.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index aeffcb5..4db93d1 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -30,14 +30,17 @@
#include "net/net.h"
#include "net/checksum.h"
+//#define DEBUG_XGMAC
+
#ifdef DEBUG_XGMAC
-#define DEBUGF_BRK(message, args...) do { \
- fprintf(stderr, (message), ## args); \
- } while (0)
+#define DEBUG_XGMAC_ENABLED 1
#else
-#define DEBUGF_BRK(message, args...) do { } while (0)
+#define DEBUG_XGMAC_ENABLED 0
#endif
+#define DEBUGF_BRK(message, args...) \
+ QEMU_DPRINTF(DEBUG_XGMAC_ENABLED, "xgmag", message, ## args)
+
#define XGMAC_CONTROL 0x00000000 /* MAC Configuration */
#define XGMAC_FRAME_FILTER 0x00000001 /* MAC Frame Filter */
#define XGMAC_FLOW_CTRL 0x00000006 /* MAC Flow Control */
@@ -218,20 +221,20 @@ static void xgmac_enet_send(XgmacState *s)
len = (bd.buffer1_size & 0xfff) + (bd.buffer2_size & 0xfff);
if ((bd.buffer1_size & 0xfff) > 2048) {
- DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
+ DEBUGF_BRK("ERROR...ERROR...ERROR... -- "
"xgmac buffer 1 len on send > 2048 (0x%x)\n",
- __func__, bd.buffer1_size & 0xfff);
+ bd.buffer1_size & 0xfff);
}
if ((bd.buffer2_size & 0xfff) != 0) {
- DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
+ DEBUGF_BRK("ERROR...ERROR...ERROR... -- "
"xgmac buffer 2 len on send != 0 (0x%x)\n",
- __func__, bd.buffer2_size & 0xfff);
+ bd.buffer2_size & 0xfff);
}
if (len >= sizeof(frame)) {
- DEBUGF_BRK("qemu:%s: buffer overflow %d read into %zu "
- "buffer\n" , __func__, len, sizeof(frame));
- DEBUGF_BRK("qemu:%s: buffer1.size=%d; buffer2.size=%d\n",
- __func__, bd.buffer1_size, bd.buffer2_size);
+ DEBUGF_BRK("buffer overflow %d read into %zu "
+ "buffer\n" , len, sizeof(frame));
+ DEBUGF_BRK("buffer1.size=%d; buffer2.size=%d\n",
+ bd.buffer1_size, bd.buffer2_size);
}
cpu_physical_memory_read(bd.buffer1_addr, ptr, len);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 06/16] xilinx: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (4 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 05/16] highbank: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 07/16] spapr: " Marc Marí
` (9 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As QEMU_DPRINTF adds a header to the message, when the message is not in a new
line, printf has to be used.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/net/cadence_gem.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index 47e7038..32e940b 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -28,15 +28,17 @@
#include "net/net.h"
#include "net/checksum.h"
+//#define CADENCE_GEM_ERR_DEBUG
+
#ifdef CADENCE_GEM_ERR_DEBUG
-#define DB_PRINT(...) do { \
- fprintf(stderr, ": %s: ", __func__); \
- fprintf(stderr, ## __VA_ARGS__); \
- } while (0);
+#define CADENCE_GEM_ERR_DEBUG_ENABLED 1
#else
- #define DB_PRINT(...)
+#define CADENCE_GEM_ERR_DEBUG_ENABLED 0
#endif
+#define DB_PRINT(...) \
+ QEMU_DPRINTF(CADENCE_GEM_ERR_DEBUG_ENABLED, "cadence_gem", __VA_ARGS__)
+
#define GEM_NWCTRL (0x00000000/4) /* Network Control reg */
#define GEM_NWCFG (0x00000004/4) /* Network Config reg */
#define GEM_NWSTATUS (0x00000008/4) /* Network Status reg */
@@ -1195,7 +1197,9 @@ static void gem_write(void *opaque, hwaddr offset, uint64_t val,
break;
}
- DB_PRINT("newval: 0x%08x\n", s->regs[offset]);
+ if(CADENCE_GEM_ERR_DEBUG_ENABLED) {
+ fprintf(stderr, "newval: 0x%08x\n", s->regs[offset]);
+ }
}
static const MemoryRegionOps gem_ops = {
@@ -1208,13 +1212,17 @@ static void gem_cleanup(NetClientState *nc)
{
GemState *s = qemu_get_nic_opaque(nc);
- DB_PRINT("\n");
+ if(CADENCE_GEM_ERR_DEBUG_ENABLED) {
+ fprintf(stderr, "\n");
+ }
s->nic = NULL;
}
static void gem_set_link(NetClientState *nc)
{
- DB_PRINT("\n");
+ if(CADENCE_GEM_ERR_DEBUG_ENABLED) {
+ fprintf(stderr, "\n");
+ }
phy_update_link(qemu_get_nic_opaque(nc));
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 07/16] spapr: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (5 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 06/16] xilinx: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 08/16] stellaris: " Marc Marí
` (8 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
open list:sPAPR, Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
Acked-by: Alexander Graf <agraf@suse.de>
---
hw/net/spapr_llan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index c433337..1639f4b 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -39,11 +39,13 @@
/*#define DEBUG*/
#ifdef DEBUG
-#define DPRINTF(fmt...) do { fprintf(stderr, fmt); } while (0)
+#define DEBUG_ENABLED 1
#else
-#define DPRINTF(fmt...)
+#define DEBUG_ENABLED 0
#endif
+#define DPRINTF(fmt...) QEMU_DPRINTF(DEBUG_ENABLED, "spapr_llan", fmt)
+
/*
* Virtual LAN device
*/
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 08/16] stellaris: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (6 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 07/16] spapr: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 09/16] i82374: " Marc Marí
` (7 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/net/stellaris_enet.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
index c9ee5d3..ea2b150 100644
--- a/hw/net/stellaris_enet.c
+++ b/hw/net/stellaris_enet.c
@@ -13,16 +13,23 @@
//#define DEBUG_STELLARIS_ENET 1
#ifdef DEBUG_STELLARIS_ENET
-#define DPRINTF(fmt, ...) \
-do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
+#define DEBUG_STELLARIS_ENET_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0)
+#define DEBUG_STELLARIS_ENET_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_STELLARIS_ENET_ENABLED, \
+ "stellaris_enet", fmt, ## __VA_ARGS__)
+
+#define BADF(fmt, ...) \
+ do { \
+ QEMU_DPRINTF(1, "stellaris_enet error", fmt, ## __VA_ARGS__); \
+ if (DEBUG_STELLARIS_ENET_ENABLED) { \
+ exit(1); \
+ }\
+ } while (0)
+
#define SE_INT_RX 0x01
#define SE_INT_TXER 0x02
#define SE_INT_TXEMP 0x04
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 09/16] i82374: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (7 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 08/16] stellaris: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 10/16] i8257: " Marc Marí
` (6 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the QEMU_DPRINTF already writes the function name, remove the __func__ to
avoid writing the function name two times.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/dma/i82374.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
index b8ad2e6..0d9d09b 100644
--- a/hw/dma/i82374.c
+++ b/hw/dma/i82374.c
@@ -27,14 +27,15 @@
//#define DEBUG_I82374
#ifdef DEBUG_I82374
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "i82374: " fmt , ## __VA_ARGS__); } while (0)
+#define DEBUG_I82374_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
-do {} while (0)
+#define DEBUG_I82374_ENABLED 0
#endif
+
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_I82374_ENABLED, "i82374", fmt, ## __VA_ARGS__)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_ARGS__); } while (0)
+ QEMU_DPRINTF(1, "i82374 ERROR", fmt, ## __VA_ARGS__)
typedef struct I82374State {
uint8_t commands[8];
@@ -56,19 +57,19 @@ static uint32_t i82374_read_isr(void *opaque, uint32_t nport)
{
uint32_t val = 0;
- BADF("%s: %08x\n", __func__, nport);
+ BADF("%08x\n", nport);
- DPRINTF("%s: %08x=%08x\n", __func__, nport, val);
+ DPRINTF("%08x=%08x\n", nport, val);
return val;
}
static void i82374_write_command(void *opaque, uint32_t nport, uint32_t data)
{
- DPRINTF("%s: %08x=%08x\n", __func__, nport, data);
+ DPRINTF("%08x=%08x\n", nport, data);
if (data != 0x42) {
/* Not Stop S/G command */
- BADF("%s: %08x=%08x\n", __func__, nport, data);
+ BADF("%08x=%08x\n", nport, data);
}
}
@@ -76,26 +77,26 @@ static uint32_t i82374_read_status(void *opaque, uint32_t nport)
{
uint32_t val = 0;
- BADF("%s: %08x\n", __func__, nport);
+ BADF("%08x\n", nport);
- DPRINTF("%s: %08x=%08x\n", __func__, nport, val);
+ DPRINTF("%08x=%08x\n", nport, val);
return val;
}
static void i82374_write_descriptor(void *opaque, uint32_t nport, uint32_t data)
{
- DPRINTF("%s: %08x=%08x\n", __func__, nport, data);
+ DPRINTF("%08x=%08x\n", nport, data);
- BADF("%s: %08x=%08x\n", __func__, nport, data);
+ BADF("%08x=%08x\n", nport, data);
}
static uint32_t i82374_read_descriptor(void *opaque, uint32_t nport)
{
uint32_t val = 0;
- BADF("%s: %08x\n", __func__, nport);
+ BADF("%08x\n", nport);
- DPRINTF("%s: %08x=%08x\n", __func__, nport, val);
+ DPRINTF("%08x=%08x\n", nport, val);
return val;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 10/16] i8257: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (8 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 09/16] i82374: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 11/16] rc4030: " Marc Marí
` (5 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some formats had to be changed to
avoid warnings treated as errors at compile time.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/dma/i8257.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index 4490372..b4e0535 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -27,15 +27,16 @@
/* #define DEBUG_DMA */
-#define dolog(...) fprintf (stderr, "dma: " __VA_ARGS__)
#ifdef DEBUG_DMA
-#define linfo(...) fprintf (stderr, "dma: " __VA_ARGS__)
-#define ldebug(...) fprintf (stderr, "dma: " __VA_ARGS__)
+#define DEBUG_DMA_ENABLED 1
#else
-#define linfo(...)
-#define ldebug(...)
+#define DEBUG_DMA_ENABLED 0
#endif
+#define dolog(...) QEMU_DPRINTF(1, "dma", __VA_ARGS__)
+#define linfo(...) QEMU_DPRINTF(DEBUG_DMA_ENABLED, "dma", __VA_ARGS__);
+#define ldebug linfo
+
struct dma_regs {
int now[2];
uint16_t base[2];
@@ -301,7 +302,8 @@ static uint64_t read_cont(void *opaque, hwaddr nport, unsigned size)
break;
}
- ldebug ("read_cont: nport %#06x, iport %#04x val %#x\n", nport, iport, val);
+ ldebug ("read_cont: nport %#06" PRIx64 ", iport %#04x val %#x\n",
+ nport, iport, val);
return val;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 11/16] rc4030: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (9 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 10/16] i8257: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 12/16] sd: " Marc Marí
` (4 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Change the output of debug messages from stdout to stderr.
Remove header in debug printfs, as QEMU_DPRINTF already adds it.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/dma/rc4030.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index af26632..54885cc 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -32,17 +32,18 @@
//#define DEBUG_RC4030
//#define DEBUG_RC4030_DMA
-#ifdef DEBUG_RC4030
-#define DPRINTF(fmt, ...) \
-do { printf("rc4030: " fmt , ## __VA_ARGS__); } while (0)
static const char* irq_names[] = { "parallel", "floppy", "sound", "video",
"network", "scsi", "keyboard", "mouse", "serial0", "serial1" };
+#ifdef DEBUG_RC4030
+#define DEBUG_RC4030_ENABLED 1
#else
-#define DPRINTF(fmt, ...)
+#define DEBUG_RC4030_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_RC4030_ENABLED, "rc4030", fmt, ## __VA_ARGS__)
#define RC4030_ERROR(fmt, ...) \
-do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
+ QEMU_DPRINTF(1, "rc4030 ERROR", fmt, ## __VA_ARGS__)
/********************************************************/
/* rc4030 emulation */
@@ -442,13 +443,13 @@ static void update_jazz_irq(rc4030State *s)
DPRINTF("pending irqs:");
for (irq = 0; irq < ARRAY_SIZE(irq_names); irq++) {
if (s->isr_jazz & (1 << irq)) {
- printf(" %s", irq_names[irq]);
+ fprintf(stderr, " %s", irq_names[irq]);
if (!(s->imr_jazz & (1 << irq))) {
- printf("(ignored)");
+ fprintf(stderr, "(ignored)");
}
}
}
- printf("\n");
+ fprintf(stderr, "\n");
}
#endif
@@ -741,7 +742,7 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, int len, int is_wri
#ifdef DEBUG_RC4030_DMA
{
int i, j;
- printf("rc4030 dma: Copying %d bytes %s host %p\n",
+ DPRINTF("Copying %d bytes %s host %p\n",
len, is_write ? "from" : "to", buf);
for (i = 0; i < len; i += 16) {
int n = 16;
@@ -749,13 +750,13 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, int len, int is_wri
n = len - i;
}
for (j = 0; j < n; j++)
- printf("%02x ", buf[i + j]);
+ fprintf(stderr, "%02x ", buf[i + j]);
while (j++ < 16)
- printf(" ");
- printf("| ");
+ fprintf(stderr, " ");
+ fprintf(stderr , "| ");
for (j = 0; j < n; j++)
- printf("%c", isprint(buf[i + j]) ? buf[i + j] : '.');
- printf("\n");
+ fprintf(stderr, "%c", isprint(buf[i + j]) ? buf[i + j] : '.');
+ fprintf(stderr, "\n");
}
}
#endif
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 12/16] sd: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (10 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 11/16] rc4030: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-19 21:05 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 13/16] isa: " Marc Marí
` (3 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/sd/sd.c | 8 +++++---
hw/sd/ssi-sd.c | 19 ++++++++++++-------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 4502ad1..46ad8f4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -37,12 +37,14 @@
//#define DEBUG_SD 1
#ifdef DEBUG_SD
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
+#define DEBUG_SD_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
+#define DEBUG_SD_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_SD_ENABLED, "SD", fmt, ## __VA_ARGS__)
+
#define ACMD41_ENQUIRY_MASK 0x00ffffff
typedef enum {
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index b012e57..cd6fc7b 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -17,16 +17,21 @@
//#define DEBUG_SSI_SD 1
#ifdef DEBUG_SSI_SD
-#define DPRINTF(fmt, ...) \
-do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
+#define DEBUG_SSI_SD_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0)
+#define DEBUG_SSI_SD_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_SSI_SD_ENABLED, "ssi_sd", fmt, ## __VA_ARGS__)
+#define BADF(fmt, ...) \
+ do { \
+ QEMU_DPRINTF(1, "ssi_sd error", fmt, ## __VA_ARGS__); \
+ if(DEBUG_SSI_SD_ENABLED) { \
+ exit(1); \
+ } \
+ } while (0)
+
typedef enum {
SSI_SD_CMD,
SSI_SD_CMDARG,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 13/16] isa: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (11 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 12/16] sd: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-19 21:07 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 14/16] lan9118: " Marc Marí
` (2 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some formats had to be changed to
avoid warnings treated as errors at compile time..
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/isa/vt82c686.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 1a93afd..710c1c8 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -29,11 +29,14 @@
//#define DEBUG_VT82C686B
#ifdef DEBUG_VT82C686B
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
+#define DEBUG_VT82C686B_ENABLED 1
#else
-#define DPRINTF(fmt, ...)
+#define DEBUG_VT82C686B_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_VT82C686B_ENABLED, "vt82c686", fmt, ## __VA_ARGS__)
+
typedef struct SuperIOConfig
{
uint8_t config[0xff];
@@ -53,7 +56,8 @@ static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data,
int can_write;
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
+ DPRINTF("superio_ioport_writeb address 0x%" PRIx64 " val 0x%" PRIx64 "\n",
+ addr, data);
if (addr == 0x3f0) {
superio_conf->index = data & 0xff;
} else {
@@ -99,7 +103,7 @@ static uint64_t superio_ioport_readb(void *opaque, hwaddr addr, unsigned size)
{
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_readb address 0x%x\n", addr);
+ DPRINTF("superio_ioport_readb address 0x%" PRIx64 "\n", addr);
return (superio_conf->config[superio_conf->index]);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 14/16] lan9118: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (12 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 13/16] isa: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 15/16] pci-host: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 16/16] common: " Marc Marí
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some formats had to be changed to
avoid warnings treated as errors at compile time.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/net/lan9118.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index e528290..1781b16 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -21,16 +21,23 @@
//#define DEBUG_LAN9118
#ifdef DEBUG_LAN9118
-#define DPRINTF(fmt, ...) \
-do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { hw_error("lan9118: error: " fmt , ## __VA_ARGS__);} while (0)
+#define DEBUG_LAN9118_ENABLED 1
#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lan9118: error: " fmt , ## __VA_ARGS__);} while (0)
+#define DEBUG_LAN9118_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_LAN9118_ENABLED, "lan9118", fmt, ## __VA_ARGS__)
+
+#define BADF(fmt, ...) \
+ do { \
+ if(DEBUG_LAN9118_ENABLED) { \
+ hw_error("lan9118: error: " fmt , ## __VA_ARGS__); \
+ } else { \
+ fprintf(stderr, "lan9118: error: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define CSR_ID_REV 0x50
#define CSR_IRQ_CFG 0x54
#define CSR_INT_STS 0x58
@@ -1031,7 +1038,7 @@ static void lan9118_writel(void *opaque, hwaddr offset,
s->int_sts |= val & SW_INT;
break;
case CSR_FIFO_INT:
- DPRINTF("FIFO INT levels %08x\n", val);
+ DPRINTF("FIFO INT levels %08" PRIx64 "\n", val);
s->fifo_int = val;
break;
case CSR_RX_CFG:
@@ -1112,9 +1119,11 @@ static void lan9118_writel(void *opaque, hwaddr offset,
if (val & 0x80000000) {
if (val & 0x40000000) {
s->mac_data = do_mac_read(s, val & 0xf);
- DPRINTF("MAC read %d = 0x%08x\n", val & 0xf, s->mac_data);
+ DPRINTF("MAC read %" PRId64 " = 0x%08x\n",
+ (val & 0xf), s->mac_data);
} else {
- DPRINTF("MAC write %d = 0x%08x\n", val & 0xf, s->mac_data);
+ DPRINTF("MAC write %" PRId64 " = 0x%08x\n",
+ (val & 0xf), s->mac_data);
do_mac_write(s, val & 0xf, s->mac_data);
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 15/16] pci-host: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (13 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 14/16] lan9118: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 16/16] common: " Marc Marí
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some formats had to be changed to
avoid warnings treated as errors at compile time.
As QEMU_DPRINTF already puts the function name as the header, __func__ was
removed from debug printfs.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
hw/pci-host/bonito.c | 13 +++++++++----
hw/pci-host/ppce500.c | 21 +++++++++++++--------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 56292ad..814b6d8 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -50,11 +50,14 @@
//#define DEBUG_BONITO
#ifdef DEBUG_BONITO
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
+#define DEBUG_BONITO_ENABLED 1
#else
-#define DPRINTF(fmt, ...)
+#define DEBUG_BONITO_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_BONITO_ENABLED, "bonito", fmt, ## __VA_ARGS__)
+
/* from linux soure code. include/asm-mips/mips-boards/bonito64.h*/
#define BONITO_BOOT_BASE 0x1fc00000
#define BONITO_BOOT_SIZE 0x00100000
@@ -235,7 +238,8 @@ static void bonito_writel(void *opaque, hwaddr addr,
saddr = (addr - BONITO_REGBASE) >> 2;
- DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr);
+ DPRINTF("bonito_writel "TARGET_FMT_plx" val %" PRIx64 " saddr %x\n",
+ addr, val, saddr);
switch (saddr) {
case BONITO_BONPONCFG:
case BONITO_IODEVCFG:
@@ -322,7 +326,8 @@ static void bonito_pciconf_writel(void *opaque, hwaddr addr,
PCIBonitoState *s = opaque;
PCIDevice *d = PCI_DEVICE(s);
- DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x\n", addr, val);
+ DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %" PRIx64 "\n",
+ addr, val);
d->config_write(d, addr, val, 4);
}
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index c80b7cb..ff250ce 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -21,12 +21,17 @@
#include "qemu/bswap.h"
#include "hw/pci-host/ppce500.h"
+//#define DEBUG_PCI
+
#ifdef DEBUG_PCI
-#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
+#define DEBUG_PCI_ENABLED 1
#else
-#define pci_debug(fmt, ...)
+#define DEBUG_PCI_ENABLED 0
#endif
+#define pci_debug(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_PCI_ENABLED, "ppce500", fmt, ## __VA_ARGS__)
+
#define PCIE500_CFGADDR 0x0
#define PCIE500_CFGDATA 0x4
#define PCIE500_REG_BASE 0xC00
@@ -174,7 +179,7 @@ static uint64_t pci_reg_read4(void *opaque, hwaddr addr,
break;
}
- pci_debug("%s: win:%lx(addr:" TARGET_FMT_plx ") -> value:%x\n", __func__,
+ pci_debug("win:%lx(addr:" TARGET_FMT_plx ") -> value:%x\n",
win, addr, value);
return value;
}
@@ -188,8 +193,8 @@ static void pci_reg_write4(void *opaque, hwaddr addr,
win = addr & 0xfe0;
- pci_debug("%s: value:%x -> win:%lx(addr:" TARGET_FMT_plx ")\n",
- __func__, (unsigned)value, win, addr);
+ pci_debug("value:%" PRIx64 " -> win:%lx(addr:" TARGET_FMT_plx ")\n",
+ value, win, addr);
switch (win) {
case PPCE500_PCI_OW1:
@@ -259,8 +264,8 @@ static int mpc85xx_pci_map_irq(PCIDevice *pci_dev, int irq_num)
ret = ppce500_pci_map_irq_slot(devno, irq_num);
- pci_debug("%s: devfn %x irq %d -> %d devno:%x\n", __func__,
- pci_dev->devfn, irq_num, ret, devno);
+ pci_debug("devfn %x irq %d -> %d devno:%x\n",
+ pci_dev->devfn, irq_num, ret, devno);
return ret;
}
@@ -269,7 +274,7 @@ static void mpc85xx_pci_set_irq(void *opaque, int irq_num, int level)
{
qemu_irq *pic = opaque;
- pci_debug("%s: PCI irq %d, level:%d\n", __func__, irq_num, level);
+ pci_debug("PCI irq %d, level:%d\n", irq_num, level);
qemu_set_irq(pic[irq_num], level);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH v3 16/16] common: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
` (14 preceding siblings ...)
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 15/16] pci-host: " Marc Marí
@ 2014-05-17 23:03 ` Marc Marí
15 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-17 23:03 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Stefan Hajnoczi, Peter Crosthwaite,
Andreas Färber
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
---
migration-rdma.c | 31 +++++++++++++++++--------------
page_cache.c | 11 +++++++----
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/migration-rdma.c b/migration-rdma.c
index eeb4302..606ee7c 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -32,36 +32,39 @@
//#define DEBUG_RDMA_REALLY_VERBOSE
#ifdef DEBUG_RDMA
-#define DPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_RDMA_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_RDMA_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_RDMA_ENABLED, "rdma", fmt, ## __VA_ARGS__)
+
#ifdef DEBUG_RDMA_VERBOSE
-#define DDPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_RDMA_VERBOSE_ENABLED 1
#else
-#define DDPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_RDMA_VERBOSE_ENABLED 0
#endif
+#define DDPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_RDMA_VERBOSE_ENABLED, "rdma", fmt, ## __VA_ARGS__)
+
#ifdef DEBUG_RDMA_REALLY_VERBOSE
-#define DDDPRINTF(fmt, ...) \
- do { printf("rdma: " fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_RDMA_REALLY_VERBOSE_ENABLED 1
#else
-#define DDDPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_RDMA_REALLY_VERBOSE_ENABLED 0
#endif
+#define DDDPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_RDMA_REALLY_VERBOSE_ENABLED, "rdma", fmt, ## __VA_ARGS__)
+
/*
* Print and error on both the Monitor and the Log file.
*/
#define ERROR(errp, fmt, ...) \
do { \
- fprintf(stderr, "RDMA ERROR: " fmt "\n", ## __VA_ARGS__); \
- if (errp && (*(errp) == NULL)) { \
+ QEMU_DPRINTF(1, "RDMA ERROR", fmt"\n", ## __VA_ARGS__); \
+ if (errp && !*errp) { \
error_setg(errp, "RDMA ERROR: " fmt, ## __VA_ARGS__); \
} \
} while (0)
diff --git a/page_cache.c b/page_cache.c
index b033681..be206a4 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -25,14 +25,17 @@
#include "qemu-common.h"
#include "migration/page_cache.h"
+//#define DEBUG_CACHE 1
+
#ifdef DEBUG_CACHE
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "cache: " fmt, ## __VA_ARGS__); } while (0)
+#define DEBUG_CACHE_ENABLED 1
#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#define DEBUG_CACHE_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) \
+ QEMU_DPRINTF(DEBUG_CACHE_ENABLED, "cache", fmt, ## __VA_ARGS__)
+
typedef struct CacheItem CacheItem;
struct CacheItem {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 03/16] s390: " Marc Marí
@ 2014-05-18 9:37 ` Peter Crosthwaite
2014-05-19 11:50 ` Alexander Graf
2014-05-19 16:45 ` Marc Marí
0 siblings, 2 replies; 28+ messages in thread
From: Peter Crosthwaite @ 2014-05-18 9:37 UTC (permalink / raw)
To: Marc Marí, Richard Henderson, Alexander Graf
Cc: Stefan Hajnoczi, qemu-devel@nongnu.org Developers,
open list:Overall, Andreas Färber
On Sun, May 18, 2014 at 9:03 AM, Marc Marí <marc.mari.barcelo@gmail.com> wrote:
> Modify debug macros to have the same format through the codebase and use regular
> ifs instead of ifdef.
>
> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> ---
> hw/s390x/s390-virtio-bus.c | 9 +++++----
> hw/s390x/s390-virtio.c | 9 +++++----
> target-s390x/helper.c | 23 +++++++++++++++--------
> target-s390x/kvm.c | 9 +++++----
> 4 files changed, 30 insertions(+), 20 deletions(-)
>
> diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
> index 9c71afa..2a1799e 100644
> --- a/hw/s390x/s390-virtio-bus.c
> +++ b/hw/s390x/s390-virtio-bus.c
> @@ -38,13 +38,14 @@
> /* #define DEBUG_S390 */
>
> #ifdef DEBUG_S390
> -#define DPRINTF(fmt, ...) \
> - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> +#define DEBUG_S390_ENABLED 1
> #else
> -#define DPRINTF(fmt, ...) \
> - do { } while (0)
> +#define DEBUG_S390_ENABLED 0
> #endif
>
> +#define DPRINTF(fmt, ...) \
> + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio bus", fmt, ## __VA_ARGS__)
> +
> #define VIRTIO_EXT_CODE 0x2603
>
> static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size,
> diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
> index aef2003..b69afb4 100644
> --- a/hw/s390x/s390-virtio.c
> +++ b/hw/s390x/s390-virtio.c
> @@ -42,13 +42,14 @@
> //#define DEBUG_S390
>
> #ifdef DEBUG_S390
> -#define DPRINTF(fmt, ...) \
> - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> +#define DEBUG_S390_ENABLED 1
> #else
> -#define DPRINTF(fmt, ...) \
> - do { } while (0)
> +#define DEBUG_S390_ENABLED 0
> #endif
>
> +#define DPRINTF(fmt, ...) \
> + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio", fmt, ## __VA_ARGS__)
> +
> #define MAX_BLK_DEVS 10
> #define ZIPL_FILENAME "s390-zipl.rom"
>
> diff --git a/target-s390x/helper.c b/target-s390x/helper.c
> index 7c76fc1..c2aa568 100644
> --- a/target-s390x/helper.c
> +++ b/target-s390x/helper.c
> @@ -30,19 +30,26 @@
> //#define DEBUG_S390_STDOUT
>
> #ifdef DEBUG_S390
> -#ifdef DEBUG_S390_STDOUT
> -#define DPRINTF(fmt, ...) \
> - do { fprintf(stderr, fmt, ## __VA_ARGS__); \
> - qemu_log(fmt, ##__VA_ARGS__); } while (0)
> +#define DEBUG_S390_ENABLED 1
> #else
> -#define DPRINTF(fmt, ...) \
> - do { qemu_log(fmt, ## __VA_ARGS__); } while (0)
> +#define DEBUG_S390_ENABLED 0
> #endif
> +
> +#ifdef DEBUG_S390_STDOUT
This STDOUT vs _log() choice is a bit irregular, and I think you might
be better off abandoning it completely. Richard, Alex, do we really
need to optionally route printfery to log or stderr? (considering _log
is NOW stderr by default now, and -D option gives you some flexibility
there). Can we have just log and drop STDOUT mode?
Regards,
Peter
> +#define DEBUG_S390_STDOUT_ENABLED 1
> #else
> -#define DPRINTF(fmt, ...) \
> - do { } while (0)
> +#define DEBUG_S390_STDOUT_ENABLED 0
> #endif
>
> +#define DPRINTF(fmt, ...) \
> + do { \
> + if(DEBUG_S390_ENABLED) { \
> + qemu_log(fmt, ##__VA_ARGS__); \
> + QEMU_DPRINTF(DEBUG_S390_STDOUT_ENABLED, "s390x helper", \
> + 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 56179af..63c46c4 100644
> --- a/target-s390x/kvm.c
> +++ b/target-s390x/kvm.c
> @@ -41,13 +41,14 @@
> /* #define DEBUG_KVM */
>
> #ifdef DEBUG_KVM
> -#define DPRINTF(fmt, ...) \
> - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> +#define DEBUG_KVM_ENABLED 1
> #else
> -#define DPRINTF(fmt, ...) \
> - do { } while (0)
> +#define DEBUG_KVM_ENABLED 0
> #endif
>
> +#define DPRINTF(fmt, ...) \
> + QEMU_DPRINTF(DEBUG_KVM_ENABLED, "s390 kvm", fmt, ## __VA_ARGS__)
> +
> #define IPA0_DIAG 0x8300
> #define IPA0_SIGP 0xae00
> #define IPA0_B2 0xb200
> --
> 1.7.10.4
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-18 9:37 ` Peter Crosthwaite
@ 2014-05-19 11:50 ` Alexander Graf
2014-05-19 16:45 ` Marc Marí
1 sibling, 0 replies; 28+ messages in thread
From: Alexander Graf @ 2014-05-19 11:50 UTC (permalink / raw)
To: Peter Crosthwaite, Marc Marí, Richard Henderson
Cc: Stefan Hajnoczi, qemu-devel@nongnu.org Developers, Overall,
Andreas Färber
On 18.05.14 11:37, Peter Crosthwaite wrote:
> On Sun, May 18, 2014 at 9:03 AM, Marc Marí <marc.mari.barcelo@gmail.com> wrote:
>> Modify debug macros to have the same format through the codebase and use regular
>> ifs instead of ifdef.
>>
>> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
>> ---
>> hw/s390x/s390-virtio-bus.c | 9 +++++----
>> hw/s390x/s390-virtio.c | 9 +++++----
>> target-s390x/helper.c | 23 +++++++++++++++--------
>> target-s390x/kvm.c | 9 +++++----
>> 4 files changed, 30 insertions(+), 20 deletions(-)
>>
>> diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
>> index 9c71afa..2a1799e 100644
>> --- a/hw/s390x/s390-virtio-bus.c
>> +++ b/hw/s390x/s390-virtio-bus.c
>> @@ -38,13 +38,14 @@
>> /* #define DEBUG_S390 */
>>
>> #ifdef DEBUG_S390
>> -#define DPRINTF(fmt, ...) \
>> - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
>> +#define DEBUG_S390_ENABLED 1
>> #else
>> -#define DPRINTF(fmt, ...) \
>> - do { } while (0)
>> +#define DEBUG_S390_ENABLED 0
>> #endif
>>
>> +#define DPRINTF(fmt, ...) \
>> + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio bus", fmt, ## __VA_ARGS__)
>> +
>> #define VIRTIO_EXT_CODE 0x2603
>>
>> static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size,
>> diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
>> index aef2003..b69afb4 100644
>> --- a/hw/s390x/s390-virtio.c
>> +++ b/hw/s390x/s390-virtio.c
>> @@ -42,13 +42,14 @@
>> //#define DEBUG_S390
>>
>> #ifdef DEBUG_S390
>> -#define DPRINTF(fmt, ...) \
>> - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
>> +#define DEBUG_S390_ENABLED 1
>> #else
>> -#define DPRINTF(fmt, ...) \
>> - do { } while (0)
>> +#define DEBUG_S390_ENABLED 0
>> #endif
>>
>> +#define DPRINTF(fmt, ...) \
>> + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio", fmt, ## __VA_ARGS__)
>> +
>> #define MAX_BLK_DEVS 10
>> #define ZIPL_FILENAME "s390-zipl.rom"
>>
>> diff --git a/target-s390x/helper.c b/target-s390x/helper.c
>> index 7c76fc1..c2aa568 100644
>> --- a/target-s390x/helper.c
>> +++ b/target-s390x/helper.c
>> @@ -30,19 +30,26 @@
>> //#define DEBUG_S390_STDOUT
>>
>> #ifdef DEBUG_S390
>> -#ifdef DEBUG_S390_STDOUT
>> -#define DPRINTF(fmt, ...) \
>> - do { fprintf(stderr, fmt, ## __VA_ARGS__); \
>> - qemu_log(fmt, ##__VA_ARGS__); } while (0)
>> +#define DEBUG_S390_ENABLED 1
>> #else
>> -#define DPRINTF(fmt, ...) \
>> - do { qemu_log(fmt, ## __VA_ARGS__); } while (0)
>> +#define DEBUG_S390_ENABLED 0
>> #endif
>> +
>> +#ifdef DEBUG_S390_STDOUT
> This STDOUT vs _log() choice is a bit irregular, and I think you might
> be better off abandoning it completely. Richard, Alex, do we really
> need to optionally route printfery to log or stderr? (considering _log
> is NOW stderr by default now, and -D option gives you some flexibility
> there). Can we have just log and drop STDOUT mode?
Works for me :).
Alex
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro Marc Marí
@ 2014-05-19 15:28 ` Eric Blake
0 siblings, 0 replies; 28+ messages in thread
From: Eric Blake @ 2014-05-19 15:28 UTC (permalink / raw)
To: Marc Marí, qemu-devel
Cc: Stefan Hajnoczi, Peter Crosthwaite, Andreas Färber
[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]
On 05/17/2014 05:03 PM, Marc Marí wrote:
> Create this macro to let debug macros to have the same format through the
> codebase and use regular ifs instead of ifdef.
>
> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> ---
> include/qemu-common.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index 3f3fd60..acdcf08 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int initial);
> const char *qemu_ether_ntoa(const MACAddr *mac);
>
> #endif
> +
> +#define QEMU_DPRINTF(cond,pfx,fmt,...) \
Style: space after comma:
#define QEMU_DPRINTF(cond, pfx, fmt, ...) \
> + do { \
Up to you if you want to align \ rather than putting them flush to each
line (I don't know if there is a prevalent style in the codebase).
> + if (cond) { \
> + fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \
Style: spaces between string concatenation:
pfx ": %s:" fmt
This definition requires that pfx and fmt be constant strings to allow
string concatenation. Might it be better to allow for non-constants, by
splitting it into two actions, as in:
fprintf(stderr, "%s: %s:", pfx, __func__);
fprintf(stderr, fmt, ## __VA_ARGS__);
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF Marc Marí
@ 2014-05-19 15:48 ` Eric Blake
0 siblings, 0 replies; 28+ messages in thread
From: Eric Blake @ 2014-05-19 15:48 UTC (permalink / raw)
To: Marc Marí, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi, Peter Crosthwaite, xen-devel,
Andreas Färber, kvm
[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]
[resend, because I got:
----- The following addresses had permanent fatal errors -----
<qemu-devel@nongnu.org>
(reason: 550 Invalid address in message header)
I think it was complaining about:
CC: open list:X86 <xen-devel@lists.xensource.com>
CC: open list:X86 <kvm@vger.kernel.org>
where the RFCs say you should enclose : inside "", as in:
CC: "open list:X86" <...>
to be fully compliant.]
On 05/17/2014 05:03 PM, Marc Marí wrote:
> Modify debug macros to have the same format through the codebase and use regular
> ifs instead of ifdef.
>
> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> ---
> hw/i386/kvm/pci-assign.c | 11 ++++++-----
> hw/i386/multiboot.c | 7 +++++--
> target-i386/kvm.c | 9 +++++----
> xen-hvm.c | 9 +++++----
> xen-mapcache.c | 9 +++++----
> 5 files changed, 26 insertions(+), 19 deletions(-)
>
> #ifdef DEVICE_ASSIGNMENT_DEBUG
> -#define DEBUG(fmt, ...) \
> - do { \
> - fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \
> - } while (0)
> +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 1
> #else
> -#define DEBUG(fmt, ...)
> +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 0
> #endif
>
> +#define DEBUG(fmt, ...) \
> + QEMU_DPRINTF(DEVICE_ASSIGNMENT_DEBUG_ENABLED, \
> + "pci_assign", fmt, ## __VA_ARGS__)
> +
Style - you are replacing aligned \ continuation with one-space \
continuation. I don't know if we have a distinct preference, but it's
probably better to leave the style unchanged if checkpatch.pl doesn't
complain about either way.
As that's minor,
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-18 9:37 ` Peter Crosthwaite
2014-05-19 11:50 ` Alexander Graf
@ 2014-05-19 16:45 ` Marc Marí
2014-05-19 16:50 ` Richard Henderson
1 sibling, 1 reply; 28+ messages in thread
From: Marc Marí @ 2014-05-19 16:45 UTC (permalink / raw)
To: Peter Crosthwaite
Cc: open list:Overall, Stefan Hajnoczi,
qemu-devel@nongnu.org Developers, Alexander Graf,
Andreas Färber, Richard Henderson
El Sun, 18 May 2014 19:37:12 +1000
Peter Crosthwaite <peter.crosthwaite@xilinx.com> escribió:
> On Sun, May 18, 2014 at 9:03 AM, Marc Marí
> <marc.mari.barcelo@gmail.com> wrote:
> > Modify debug macros to have the same format through the codebase
> > and use regular ifs instead of ifdef.
> >
> > Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> > ---
> > hw/s390x/s390-virtio-bus.c | 9 +++++----
> > hw/s390x/s390-virtio.c | 9 +++++----
> > target-s390x/helper.c | 23 +++++++++++++++--------
> > target-s390x/kvm.c | 9 +++++----
> > 4 files changed, 30 insertions(+), 20 deletions(-)
> >
> > diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
> > index 9c71afa..2a1799e 100644
> > --- a/hw/s390x/s390-virtio-bus.c
> > +++ b/hw/s390x/s390-virtio-bus.c
> > @@ -38,13 +38,14 @@
> > /* #define DEBUG_S390 */
> >
> > #ifdef DEBUG_S390
> > -#define DPRINTF(fmt, ...) \
> > - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> > +#define DEBUG_S390_ENABLED 1
> > #else
> > -#define DPRINTF(fmt, ...) \
> > - do { } while (0)
> > +#define DEBUG_S390_ENABLED 0
> > #endif
> >
> > +#define DPRINTF(fmt, ...) \
> > + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio bus", fmt, ##
> > __VA_ARGS__) +
> > #define VIRTIO_EXT_CODE 0x2603
> >
> > static void virtio_s390_bus_new(VirtioBusState *bus, size_t
> > bus_size, diff --git a/hw/s390x/s390-virtio.c
> > b/hw/s390x/s390-virtio.c index aef2003..b69afb4 100644
> > --- a/hw/s390x/s390-virtio.c
> > +++ b/hw/s390x/s390-virtio.c
> > @@ -42,13 +42,14 @@
> > //#define DEBUG_S390
> >
> > #ifdef DEBUG_S390
> > -#define DPRINTF(fmt, ...) \
> > - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> > +#define DEBUG_S390_ENABLED 1
> > #else
> > -#define DPRINTF(fmt, ...) \
> > - do { } while (0)
> > +#define DEBUG_S390_ENABLED 0
> > #endif
> >
> > +#define DPRINTF(fmt, ...) \
> > + QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 virtio", fmt, ##
> > __VA_ARGS__) +
> > #define MAX_BLK_DEVS 10
> > #define ZIPL_FILENAME "s390-zipl.rom"
> >
> > diff --git a/target-s390x/helper.c b/target-s390x/helper.c
> > index 7c76fc1..c2aa568 100644
> > --- a/target-s390x/helper.c
> > +++ b/target-s390x/helper.c
> > @@ -30,19 +30,26 @@
> > //#define DEBUG_S390_STDOUT
> >
> > #ifdef DEBUG_S390
> > -#ifdef DEBUG_S390_STDOUT
> > -#define DPRINTF(fmt, ...) \
> > - do { fprintf(stderr, fmt, ## __VA_ARGS__); \
> > - qemu_log(fmt, ##__VA_ARGS__); } while (0)
> > +#define DEBUG_S390_ENABLED 1
> > #else
> > -#define DPRINTF(fmt, ...) \
> > - do { qemu_log(fmt, ## __VA_ARGS__); } while (0)
> > +#define DEBUG_S390_ENABLED 0
> > #endif
> > +
> > +#ifdef DEBUG_S390_STDOUT
>
> This STDOUT vs _log() choice is a bit irregular, and I think you might
> be better off abandoning it completely. Richard, Alex, do we really
> need to optionally route printfery to log or stderr? (considering _log
> is NOW stderr by default now, and -D option gives you some flexibility
> there). Can we have just log and drop STDOUT mode?
>
> Regards,
> Peter
QEMU_DPRINTF outputs to stderr, and, as you say qemu_log does it too.
Should QEMU_DPRINTF be removed and leave only qemu_log?
Marc
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-19 16:45 ` Marc Marí
@ 2014-05-19 16:50 ` Richard Henderson
2014-05-19 20:33 ` Peter Crosthwaite
0 siblings, 1 reply; 28+ messages in thread
From: Richard Henderson @ 2014-05-19 16:50 UTC (permalink / raw)
To: Marc Marí, Peter Crosthwaite
Cc: Stefan Hajnoczi, Overall, Alexander Graf, Andreas Färber,
qemu-devel@nongnu.org Developers
On 05/19/2014 09:45 AM, Marc Marí wrote:
>> > This STDOUT vs _log() choice is a bit irregular, and I think you might
>> > be better off abandoning it completely. Richard, Alex, do we really
>> > need to optionally route printfery to log or stderr? (considering _log
>> > is NOW stderr by default now, and -D option gives you some flexibility
>> > there). Can we have just log and drop STDOUT mode?
>> >
>> > Regards,
>> > Peter
> QEMU_DPRINTF outputs to stderr, and, as you say qemu_log does it too.
> Should QEMU_DPRINTF be removed and leave only qemu_log?
Yes, I think that all debug output like this should go via qemu_log.
r~
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-19 16:50 ` Richard Henderson
@ 2014-05-19 20:33 ` Peter Crosthwaite
2014-05-19 20:34 ` Alexander Graf
0 siblings, 1 reply; 28+ messages in thread
From: Peter Crosthwaite @ 2014-05-19 20:33 UTC (permalink / raw)
To: Richard Henderson
Cc: Marc Marí, Overall, Stefan Hajnoczi,
qemu-devel@nongnu.org Developers, Alexander Graf,
Andreas Färber
On Tue, May 20, 2014 at 2:50 AM, Richard Henderson <rth@twiddle.net> wrote:
> On 05/19/2014 09:45 AM, Marc Marí wrote:
>>> > This STDOUT vs _log() choice is a bit irregular, and I think you might
>>> > be better off abandoning it completely. Richard, Alex, do we really
>>> > need to optionally route printfery to log or stderr? (considering _log
>>> > is NOW stderr by default now, and -D option gives you some flexibility
>>> > there). Can we have just log and drop STDOUT mode?
>>> >
>>> > Regards,
>>> > Peter
>> QEMU_DPRINTF outputs to stderr, and, as you say qemu_log does it too.
>> Should QEMU_DPRINTF be removed and leave only qemu_log?
Ahh I see now, you want to use the common factored-out code in P1
which is stderr specific. Perhaps that should use qemu_log. One option
would be to create a variant of it in common code that does uses
qemu_log instead of stderr and use that variant here. That way you can
preserve existing behaviour (and maintainer expectations), as much as
possible.
>
> Yes, I think that all debug output like this should go via qemu_log.
>
Thanks.
Regards,
Peter
>
> r~
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/16] s390: Convert debug printfs to QEMU_DPRINTF
2014-05-19 20:33 ` Peter Crosthwaite
@ 2014-05-19 20:34 ` Alexander Graf
0 siblings, 0 replies; 28+ messages in thread
From: Alexander Graf @ 2014-05-19 20:34 UTC (permalink / raw)
To: Peter Crosthwaite, Richard Henderson
Cc: Marc Marí, Stefan Hajnoczi, Andreas Färber, Overall,
qemu-devel@nongnu.org Developers
On 19.05.14 22:33, Peter Crosthwaite wrote:
> On Tue, May 20, 2014 at 2:50 AM, Richard Henderson <rth@twiddle.net> wrote:
>> On 05/19/2014 09:45 AM, Marc Marí wrote:
>>>>> This STDOUT vs _log() choice is a bit irregular, and I think you might
>>>>> be better off abandoning it completely. Richard, Alex, do we really
>>>>> need to optionally route printfery to log or stderr? (considering _log
>>>>> is NOW stderr by default now, and -D option gives you some flexibility
>>>>> there). Can we have just log and drop STDOUT mode?
>>>>>
>>>>> Regards,
>>>>> Peter
>>> QEMU_DPRINTF outputs to stderr, and, as you say qemu_log does it too.
>>> Should QEMU_DPRINTF be removed and leave only qemu_log?
> Ahh I see now, you want to use the common factored-out code in P1
> which is stderr specific. Perhaps that should use qemu_log. One option
> would be to create a variant of it in common code that does uses
> qemu_log instead of stderr and use that variant here. That way you can
> preserve existing behaviour (and maintainer expectations), as much as
> possible.
I think it's safe to assume that all TCG code wants to use qemu_log.
Alex
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 12/16] sd: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 12/16] sd: " Marc Marí
@ 2014-05-19 21:05 ` Eric Blake
0 siblings, 0 replies; 28+ messages in thread
From: Eric Blake @ 2014-05-19 21:05 UTC (permalink / raw)
To: Marc Marí, qemu-devel
Cc: Stefan Hajnoczi, Peter Crosthwaite, Andreas Färber
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]
On 05/17/2014 05:03 PM, Marc Marí wrote:
> Modify debug macros to have the same format through the codebase and use regular
> ifs instead of ifdef.
>
> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> ---
> hw/sd/sd.c | 8 +++++---
> hw/sd/ssi-sd.c | 19 ++++++++++++-------
> 2 files changed, 17 insertions(+), 10 deletions(-)
>
> +#define DPRINTF(fmt, ...) \
> + QEMU_DPRINTF(DEBUG_SSI_SD_ENABLED, "ssi_sd", fmt, ## __VA_ARGS__)
> +#define BADF(fmt, ...) \
> + do { \
> + QEMU_DPRINTF(1, "ssi_sd error", fmt, ## __VA_ARGS__); \
> + if(DEBUG_SSI_SD_ENABLED) { \
Style: space after 'if'
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 13/16] isa: Convert debug printfs to QEMU_DPRINTF
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 13/16] isa: " Marc Marí
@ 2014-05-19 21:07 ` Eric Blake
2014-05-20 6:39 ` Marc Marí
0 siblings, 1 reply; 28+ messages in thread
From: Eric Blake @ 2014-05-19 21:07 UTC (permalink / raw)
To: Marc Marí, qemu-devel
Cc: Stefan Hajnoczi, Peter Crosthwaite, Andreas Färber
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]
On 05/17/2014 05:03 PM, Marc Marí wrote:
> Modify debug macros to have the same format through the codebase and use regular
> ifs instead of ifdef.
>
> As the debug printf is always put in code, some formats had to be changed to
> avoid warnings treated as errors at compile time..
>
> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> ---
> hw/isa/vt82c686.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
>
> - DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
> + DPRINTF("superio_ioport_writeb address 0x%" PRIx64 " val 0x%" PRIx64 "\n",
Any reason you shortened one double space but left the other intact? I
would have expected both or none.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Qemu-devel] [PATCH v3 13/16] isa: Convert debug printfs to QEMU_DPRINTF
2014-05-19 21:07 ` Eric Blake
@ 2014-05-20 6:39 ` Marc Marí
0 siblings, 0 replies; 28+ messages in thread
From: Marc Marí @ 2014-05-20 6:39 UTC (permalink / raw)
To: Eric Blake
Cc: Stefan Hajnoczi, Peter Crosthwaite, qemu-devel,
Andreas Färber
El Mon, 19 May 2014 15:07:18 -0600
Eric Blake <eblake@redhat.com> escribió:
> On 05/17/2014 05:03 PM, Marc Marí wrote:
> > Modify debug macros to have the same format through the codebase
> > and use regular ifs instead of ifdef.
> >
> > As the debug printf is always put in code, some formats had to be
> > changed to avoid warnings treated as errors at compile time..
> >
> > Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com>
> > ---
> > hw/isa/vt82c686.c | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
> >
>
> >
> > - DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n",
> > addr, data);
> > + DPRINTF("superio_ioport_writeb address 0x%" PRIx64 " val 0x%"
> > PRIx64 "\n",
>
> Any reason you shortened one double space but left the other intact?
> I would have expected both or none.
>
That's a typo. I wanted to left it as it was (double space in both
places).
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2014-05-20 6:39 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-17 23:03 [Qemu-devel] [PATCH v3 00/16] Convert debug printfs to QEMU_DPRINTF Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro Marc Marí
2014-05-19 15:28 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 02/16] x86: Convert debug printfs to QEMU_DPRINTF Marc Marí
2014-05-19 15:48 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 03/16] s390: " Marc Marí
2014-05-18 9:37 ` Peter Crosthwaite
2014-05-19 11:50 ` Alexander Graf
2014-05-19 16:45 ` Marc Marí
2014-05-19 16:50 ` Richard Henderson
2014-05-19 20:33 ` Peter Crosthwaite
2014-05-19 20:34 ` Alexander Graf
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 04/16] scsi: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 05/16] highbank: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 06/16] xilinx: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 07/16] spapr: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 08/16] stellaris: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 09/16] i82374: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 10/16] i8257: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 11/16] rc4030: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 12/16] sd: " Marc Marí
2014-05-19 21:05 ` Eric Blake
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 13/16] isa: " Marc Marí
2014-05-19 21:07 ` Eric Blake
2014-05-20 6:39 ` Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 14/16] lan9118: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 15/16] pci-host: " Marc Marí
2014-05-17 23:03 ` [Qemu-devel] [PATCH v3 16/16] common: " Marc Marí
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).