Skip to content

Commit

Permalink
hw/char/serial: Convert from DPRINTF macro to trace events
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
philmd authored and stefanhaRH committed Jun 29, 2018
1 parent dcfebcf commit 0060918
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hw/char/serial.c
Expand Up @@ -29,6 +29,7 @@
#include "qapi/error.h"
#include "qemu/timer.h"
#include "qemu/error-report.h"
#include "trace.h"

//#define DEBUG_SERIAL

Expand Down Expand Up @@ -335,7 +336,7 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,
SerialState *s = opaque;

addr &= 7;
DPRINTF("write addr=0x%" HWADDR_PRIx " val=0x%" PRIx64 "\n", addr, val);
trace_serial_ioport_write(addr, val);
switch(addr) {
default:
case 0:
Expand Down Expand Up @@ -548,7 +549,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)
ret = s->scr;
break;
}
DPRINTF("read addr=0x%" HWADDR_PRIx " val=0x%02x\n", addr, ret);
trace_serial_ioport_read(addr, ret);
return ret;
}

Expand Down
4 changes: 4 additions & 0 deletions hw/char/trace-events
@@ -1,5 +1,9 @@
# See docs/devel/tracing.txt for syntax documentation.

# hw/char/serial.c
serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x"
serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x"

# hw/char/virtio-serial-bus.c
virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
virtio_serial_throttle_port(unsigned int port, bool throttle) "port %u, throttle %d"
Expand Down

0 comments on commit 0060918

Please sign in to comment.