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

hw/display/dpcd: Convert debug printf()s to trace events

Convert DPRINTF() to trace events and remove ifdef'ry.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20200526062252.19852-9-f4bug@amsat.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

authored by

Philippe Mathieu-Daudé and committed by
Gerd Hoffmann
eeb11680 91e7fd3a

+7 -13
+3 -13
hw/display/dpcd.c
··· 32 32 #include "hw/misc/auxbus.h" 33 33 #include "migration/vmstate.h" 34 34 #include "hw/display/dpcd.h" 35 - 36 - #ifndef DEBUG_DPCD 37 - #define DEBUG_DPCD 0 38 - #endif 39 - 40 - #define DPRINTF(fmt, ...) do { \ 41 - if (DEBUG_DPCD) { \ 42 - qemu_log("dpcd: " fmt, ## __VA_ARGS__); \ 43 - } \ 44 - } while (0) 35 + #include "trace.h" 45 36 46 37 #define DPCD_READABLE_AREA 0x600 47 38 ··· 70 61 offset); 71 62 ret = 0; 72 63 } 64 + trace_dpcd_read(offset, ret); 73 65 74 - DPRINTF("read 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", ret, offset); 75 66 return ret; 76 67 } 77 68 ··· 80 71 { 81 72 DPCDState *e = DPCD(opaque); 82 73 83 - DPRINTF("write 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", (uint8_t)value, offset); 84 - 74 + trace_dpcd_write(offset, value); 85 75 if (offset < DPCD_READABLE_AREA) { 86 76 e->dpcd_info[offset] = value; 87 77 } else {
+4
hw/display/trace-events
··· 157 157 # cg3.c 158 158 cg3_read(uint32_t addr, uint32_t val, unsigned size) "read addr:0x%06"PRIx32" val:0x%08"PRIx32" size:%u" 159 159 cg3_write(uint32_t addr, uint32_t val, unsigned size) "write addr:0x%06"PRIx32" val:0x%08"PRIx32" size:%u" 160 + 161 + # dpcd.c 162 + dpcd_read(uint32_t addr, uint8_t val) "read addr:0x%"PRIx32" val:0x%02x" 163 + dpcd_write(uint32_t addr, uint8_t val) "write addr:0x%"PRIx32" val:0x%02x"