hw/isa/apm: Convert debug printf()s to trace events
PATCH 1/1 hw/isa/apm: Convert debug printf()s to trace events
Convert APM_DPRINTF() to trace events and remove ifdef'ry.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- hw/isa/apm.c | 15 +++++---------- hw/isa/trace-events | 4 ++++ 2 files changed, 9 insertions(+), 10 deletions(-)
hw/isa/apm.c +5 -10
@@ -24,14 +24,8 @@#include "hw/isa/apm.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" +#include "trace.h" -//#define DEBUG - -#ifdef DEBUG -# define APM_DPRINTF (format, ...) printf(format, ## __VA_ARGS__) -#else -# define APM_DPRINTF (format, ...) do { } while (0) -#endif /* fixed I/O location */ #define APM_STS_IOPORT 0xb3
@@ -41,8 +35,8 @@ static void apm_ioport_writeb(void *opaque, hwaddr addr, uint64_t val, {APMState *apm = opaque; addr &=1 ; -APM_DPRINTF ("apm_ioport_writeb addr=0x%" HWADDR_PRIx -" val=0x%02" PRIx64"\n" , addr, val); + +trace_apm_io_write (addr, val);if (addr ==0 ) { apm->apmc = val;
@@ -65,7 +59,8 @@ static uint64_t apm_ioport_readb(void *opaque, hwaddr addr, unsigned size) }else { val = apm->apms; } -APM_DPRINTF ("apm_ioport_readb addr=0x%" HWADDR_PRIx" val=0x%02x\n" , addr, val); +trace_apm_io_read (addr, val); +return val; }
hw/isa/trace-events +4 -0
@@ -9,3 +9,7 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, # pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" + +# apm.c +apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" +apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
Signature · 1 line
2.21.3
ping for review?
Quoted 62 lines · Philippe Mathieu-Daudé
Convert
APM_DPRINTF()to trace events and remove ifdef'ry.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/isa/apm.c | 15 +++++---------- hw/isa/trace-events | 4 ++++ 2 files changed, 9 insertions(+), 10 deletions(-)hw/isa/apm.c +5
-10@@ -24,14 +24,8 @@#include "hw/isa/apm.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" +#include "trace.h" -//#define DEBUG - -#ifdef DEBUG -# define APM_DPRINTF (format, ...) printf(format, ## __VA_ARGS__) -#else -# define APM_DPRINTF (format, ...) do { } while (0) -#endif /* fixed I/O location */ #define APM_STS_IOPORT 0xb3@@ -41,8 +35,8 @@ static void apm_ioport_writeb(void *opaque, hwaddr addr, uint64_t val, {APMState *apm = opaque; addr &=1 ; -APM_DPRINTF ("apm_ioport_writeb addr=0x%" HWADDR_PRIx -" val=0x%02" PRIx64"\n" , addr, val); + +trace_apm_io_write (addr, val);if (addr ==0 ) { apm->apmc = val;@@ -65,7 +59,8 @@ static uint64_t apm_ioport_readb(void *opaque, hwaddr addr, unsigned size) }else { val = apm->apms; } -APM_DPRINTF ("apm_ioport_readb addr=0x%" HWADDR_PRIx" val=0x%02x\n" , addr, val); +trace_apm_io_read (addr, val); +return val; }hw/isa/trace-events +4
-0@@ -9,3 +9,7 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, # pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" + +# apm.c +apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" +apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
Quoted 7 lines · Philippe Mathieu-Daudé
Convert
APM_DPRINTF()to trace events and remove ifdef'ry.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/isa/apm.c | 15 +++++---------- hw/isa/trace-events | 4 ++++ 2 files changed, 9 insertions(+), 10 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
r~
Laurent Vivier
AppliedLe 24/05/2020 à 18:48, Philippe Mathieu-Daudé a écrit :
Quoted 55 lines
Convert
APM_DPRINTF()to trace events and remove ifdef'ry.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/isa/apm.c | 15 +++++---------- hw/isa/trace-events | 4 ++++ 2 files changed, 9 insertions(+), 10 deletions(-)hw/isa/apm.c +5
-10@@ -24,14 +24,8 @@#include "hw/isa/apm.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" +#include "trace.h" -//#define DEBUG - -#ifdef DEBUG -# define APM_DPRINTF (format, ...) printf(format, ## __VA_ARGS__) -#else -# define APM_DPRINTF (format, ...) do { } while (0) -#endif /* fixed I/O location */ #define APM_STS_IOPORT 0xb3@@ -41,8 +35,8 @@ static void apm_ioport_writeb(void *opaque, hwaddr addr, uint64_t val, {APMState *apm = opaque; addr &=1 ; -APM_DPRINTF ("apm_ioport_writeb addr=0x%" HWADDR_PRIx -" val=0x%02" PRIx64"\n" , addr, val); + +trace_apm_io_write (addr, val);if (addr ==0 ) { apm->apmc = val;@@ -65,7 +59,8 @@ static uint64_t apm_ioport_readb(void *opaque, hwaddr addr, unsigned size) }else { val = apm->apms; } -APM_DPRINTF ("apm_ioport_readb addr=0x%" HWADDR_PRIx" val=0x%02x\n" , addr, val); +trace_apm_io_read (addr, val); +return val; }hw/isa/trace-events +0
-0
hw/isa/trace-events superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, · line 15
Quoted 7 lines
hw/isa/trace-events +4
-0@@ -9,3 +9,7 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, # pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" + +# apm.c +apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" +apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
Applied to my trivial-patches branch.
Thanks,
Laurent