qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PULL 04/11] hw/char/serial: Convert from DPRINTF macro to trace events
Date: Fri, 29 Jun 2018 18:53:23 +0100	[thread overview]
Message-ID: <20180629175330.19391-5-stefanha@redhat.com> (raw)
In-Reply-To: <20180629175330.19391-1-stefanha@redhat.com>

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/char/serial.c     | 5 +++--
 hw/char/trace-events | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/char/serial.c b/hw/char/serial.c
index 605b0d02f9..26f53ba02f 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -29,6 +29,7 @@
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
+#include "trace.h"
 
 //#define DEBUG_SERIAL
 
@@ -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:
@@ -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;
 }
 
diff --git a/hw/char/trace-events b/hw/char/trace-events
index ebd8a92450..158957627e 100644
--- a/hw/char/trace-events
+++ b/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"
-- 
2.17.1

  parent reply	other threads:[~2018-06-29 17:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 17:53 [Qemu-devel] [PULL 00/11] Tracing patches Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 01/11] simpletrace: Convert name from mapping record to str Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 02/11] trace: Fix format string for the struct timeval members casted to size_t Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 03/11] sdcard: Reduce sdcard_set_blocklen() trace digits Stefan Hajnoczi
2018-06-29 17:53 ` Stefan Hajnoczi [this message]
2018-06-29 17:53 ` [Qemu-devel] [PULL 05/11] hw/char/parallel: Convert from pdebug() macro to trace events Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 06/11] hw/input/tsc2005: Convert a fprintf() call " Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 07/11] hw/net/ne2000: Add " Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 08/11] hw/net/ne2000: Convert printf() calls to " Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 09/11] hw/net/etraxfs_eth: " Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro " Stefan Hajnoczi
2018-06-29 17:53 ` [Qemu-devel] [PULL 11/11] hw/block/pflash_cfi: Convert from DPRINTF() " Stefan Hajnoczi
2018-06-30 14:04 ` [Qemu-devel] [PULL 00/11] Tracing patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180629175330.19391-5-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).