qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

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é <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200524164806.12658-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>

authored by

Philippe Mathieu-Daudé and committed by
Laurent Vivier
18cdeb72 3b34ee67

+9 -10
+5 -10
hw/isa/apm.c
··· 24 24 #include "hw/isa/apm.h" 25 25 #include "hw/pci/pci.h" 26 26 #include "migration/vmstate.h" 27 + #include "trace.h" 27 28 28 - //#define DEBUG 29 - 30 - #ifdef DEBUG 31 - # define APM_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) 32 - #else 33 - # define APM_DPRINTF(format, ...) do { } while (0) 34 - #endif 35 29 36 30 /* fixed I/O location */ 37 31 #define APM_STS_IOPORT 0xb3 ··· 41 35 { 42 36 APMState *apm = opaque; 43 37 addr &= 1; 44 - APM_DPRINTF("apm_ioport_writeb addr=0x%" HWADDR_PRIx 45 - " val=0x%02" PRIx64 "\n", addr, val); 38 + 39 + trace_apm_io_write(addr, val); 46 40 if (addr == 0) { 47 41 apm->apmc = val; 48 42 ··· 65 59 } else { 66 60 val = apm->apms; 67 61 } 68 - APM_DPRINTF("apm_ioport_readb addr=0x%" HWADDR_PRIx " val=0x%02x\n", addr, val); 62 + trace_apm_io_read(addr, val); 63 + 69 64 return val; 70 65 } 71 66
+4
hw/isa/trace-events
··· 9 9 # pc87312.c 10 10 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" 11 11 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" 12 + 13 + # apm.c 14 + apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" 15 + apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"