From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
"Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 04/11] hw/char/parallel: Convert from pdebug() macro to trace events
Date: Thu, 21 Jun 2018 14:12:50 -0300 [thread overview]
Message-ID: <20180621171257.14897-5-f4bug@amsat.org> (raw)
In-Reply-To: <20180621171257.14897-1-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/char/parallel.c | 16 +++++++++++++---
hw/char/trace-events | 4 ++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 35748e6c1b..a80da47ecf 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -30,6 +30,7 @@
#include "hw/isa/isa.h"
#include "hw/char/parallel.h"
#include "sysemu/sysemu.h"
+#include "trace.h"
//#define DEBUG_PARALLEL
@@ -110,9 +111,8 @@ parallel_ioport_write_sw(void *opaque, uint32_t addr, uint32_t val)
{
ParallelState *s = opaque;
- pdebug("write addr=0x%02x val=0x%02x\n", addr, val);
-
addr &= 7;
+ trace_parallel_ioport_write("SW", addr, val);
switch(addr) {
case PARA_REG_DATA:
s->dataw = val;
@@ -157,6 +157,7 @@ static void parallel_ioport_write_hw(void *opaque, uint32_t addr, uint32_t val)
s->last_read_offset = ~0U;
addr &= 7;
+ trace_parallel_ioport_write("HW", addr, val);
switch(addr) {
case PARA_REG_DATA:
if (s->dataw == val)
@@ -230,6 +231,8 @@ parallel_ioport_eppdata_write_hw2(void *opaque, uint32_t addr, uint32_t val)
struct ParallelIOArg ioarg = {
.buffer = &eppdata, .count = sizeof(eppdata)
};
+
+ trace_parallel_ioport_write("EPP", addr, val);
if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) {
/* Controls not correct for EPP data cycle, so do nothing */
pdebug("we%04x s\n", val);
@@ -253,6 +256,8 @@ parallel_ioport_eppdata_write_hw4(void *opaque, uint32_t addr, uint32_t val)
struct ParallelIOArg ioarg = {
.buffer = &eppdata, .count = sizeof(eppdata)
};
+
+ trace_parallel_ioport_write("EPP", addr, val);
if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) {
/* Controls not correct for EPP data cycle, so do nothing */
pdebug("we%08x s\n", val);
@@ -299,7 +304,7 @@ static uint32_t parallel_ioport_read_sw(void *opaque, uint32_t addr)
ret = s->control;
break;
}
- pdebug("read addr=0x%02x val=0x%02x\n", addr, ret);
+ trace_parallel_ioport_read("SW", addr, ret);
return ret;
}
@@ -371,6 +376,7 @@ static uint32_t parallel_ioport_read_hw(void *opaque, uint32_t addr)
}
break;
}
+ trace_parallel_ioport_read("HW", addr, ret);
s->last_read_offset = addr;
return ret;
}
@@ -399,6 +405,7 @@ parallel_ioport_eppdata_read_hw2(void *opaque, uint32_t addr)
}
else
pdebug("re%04x\n", ret);
+ trace_parallel_ioport_read("EPP", addr, ret);
return ret;
}
@@ -426,11 +433,13 @@ parallel_ioport_eppdata_read_hw4(void *opaque, uint32_t addr)
}
else
pdebug("re%08x\n", ret);
+ trace_parallel_ioport_read("EPP", addr, ret);
return ret;
}
static void parallel_ioport_ecp_write(void *opaque, uint32_t addr, uint32_t val)
{
+ trace_parallel_ioport_write("ECP", addr & 7, val);
pdebug("wecp%d=%02x\n", addr & 7, val);
}
@@ -438,6 +447,7 @@ static uint32_t parallel_ioport_ecp_read(void *opaque, uint32_t addr)
{
uint8_t ret = 0xff;
+ trace_parallel_ioport_read("ECP", addr & 7, ret);
pdebug("recp%d:%02x\n", addr & 7, ret);
return ret;
}
diff --git a/hw/char/trace-events b/hw/char/trace-events
index 158957627e..b64213d4dd 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/parallel.c
+parallel_ioport_read(const char *desc, uint16_t addr, uint8_t value) "read [%s] addr 0x%02x val 0x%02x"
+parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "write [%s] addr 0x%02x val 0x%02x"
+
# 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"
--
2.18.0.rc2
next prev parent reply other threads:[~2018-06-21 17:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 17:12 [Qemu-devel] [PATCH 00/11] hw: various conversions to trace-events Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 01/11] trace: Fix format string for the struct timeval members casted to size_t Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 02/11] sdcard: Reduce sdcard_set_blocklen() trace digits Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 03/11] hw/char/serial: Convert from DPRINTF macro to trace events Philippe Mathieu-Daudé
2018-06-21 17:12 ` Philippe Mathieu-Daudé [this message]
2018-06-21 17:12 ` [Qemu-devel] [PATCH 06/11] hw/input/tsc2005: Convert a fprintf() call " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 07/11] hw/net/ne2000: Add " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 08/11] hw/net/ne2000: Convert printf() calls to " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 09/11] hw/net/etraxfs_eth: " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro " Philippe Mathieu-Daudé
2018-06-21 17:41 ` John Snow
2018-06-21 18:07 ` Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 11/11] hw/block/pflash_cfi: Convert from DPRINTF() " Philippe Mathieu-Daudé
2018-06-24 16:43 ` Philippe Mathieu-Daudé
[not found] ` <20180621171257.14897-6-f4bug@amsat.org>
2018-06-22 6:22 ` [Qemu-devel] [PATCH 05/11] hw/display/cirrus: Convert printf() calls " Gerd Hoffmann
2018-06-22 12:07 ` Philippe Mathieu-Daudé
2018-06-22 12:31 ` Gerd Hoffmann
2018-06-30 16:57 ` Philippe Mathieu-Daudé
2018-06-28 12:50 ` [Qemu-devel] [PATCH 00/11] hw: various conversions to trace-events Stefan Hajnoczi
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=20180621171257.14897-5-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
/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).