qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, John Snow <jsnow@redhat.com>
Subject: [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports
Date: Tue,  8 Aug 2017 14:33:00 -0400	[thread overview]
Message-ID: <20170808183306.27474-4-jsnow@redhat.com> (raw)
In-Reply-To: <20170808183306.27474-1-jsnow@redhat.com>

To be used sparingly, but still interesting in the case of small
firmwares designed to reproduce bugs in QEMU IDE.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 hw/ide/core.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 6235bdf..29848ff 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2251,6 +2251,8 @@ void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     IDEState *s = idebus_active_if(bus);
     uint8_t *p;
 
+    trace_ide_data_writew(addr, val, bus, s);
+
     /* PIO data access allowed only when DRQ bit is set. The result of a write
      * during PIO out is indeterminate, just ignore it. */
     if (!(s->status & DRQ_STAT) || ide_is_pio_out(s)) {
@@ -2296,6 +2298,8 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr)
         s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
     }
+
+    trace_ide_data_readw(addr, ret, bus, s);
     return ret;
 }
 
@@ -2305,6 +2309,8 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     IDEState *s = idebus_active_if(bus);
     uint8_t *p;
 
+    trace_ide_data_writel(addr, val, bus, s);
+
     /* PIO data access allowed only when DRQ bit is set. The result of a write
      * during PIO out is indeterminate, just ignore it. */
     if (!(s->status & DRQ_STAT) || ide_is_pio_out(s)) {
@@ -2335,7 +2341,8 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr)
     /* PIO data access allowed only when DRQ bit is set. The result of a read
      * during PIO in is indeterminate, return 0 and don't move forward. */
     if (!(s->status & DRQ_STAT) || !ide_is_pio_out(s)) {
-        return 0;
+        ret = 0;
+        goto out;
     }
 
     p = s->data_ptr;
@@ -2350,6 +2357,9 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr)
         s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
     }
+
+out:
+    trace_ide_data_readl(addr, ret, bus, s);
     return ret;
 }
 
-- 
2.9.4

  parent reply	other threads:[~2017-08-08 18:33 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 18:32 [Qemu-devel] [PATCH 0/9] IDE: replace printfs with tracing John Snow
2017-08-08 18:32 ` [Qemu-devel] [PATCH 1/9] IDE: replace DEBUG_IDE with tracing system John Snow
2017-08-08 20:00   ` Eric Blake
2017-08-08 20:12     ` John Snow
2017-08-08 23:20     ` Philippe Mathieu-Daudé
2017-08-22 19:03     ` John Snow
2017-08-25 13:33   ` Philippe Mathieu-Daudé
2017-08-28 23:34     ` John Snow
2017-08-08 18:32 ` [Qemu-devel] [PATCH 2/9] IDE: Add register hints to tracing John Snow
2017-08-08 20:05   ` Eric Blake
2017-08-25 13:43   ` Philippe Mathieu-Daudé
2017-08-08 18:33 ` John Snow [this message]
2017-08-08 20:10   ` [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports Eric Blake
2017-08-08 20:17     ` John Snow
2017-08-08 20:30   ` Eric Blake
2017-08-08 20:36     ` Eric Blake
2017-08-08 20:44     ` John Snow
2017-08-08 18:33 ` [Qemu-devel] [PATCH 4/9] ATAPI: Replace DEBUG_IDE_ATAPI with tracing events John Snow
2017-08-08 20:59   ` Eric Blake
2017-08-28 23:43     ` John Snow
2017-08-08 18:33 ` [Qemu-devel] [PATCH 5/9] IDE: replace DEBUG_AIO with trace events John Snow
2017-08-25 13:46   ` Philippe Mathieu-Daudé
2017-08-29  0:26     ` John Snow
2017-08-08 18:33 ` [Qemu-devel] [PATCH 6/9] AHCI: Replace DPRINTF with trace-events John Snow
2017-08-25 13:17   ` Philippe Mathieu-Daudé
2017-08-29  0:15     ` John Snow
2017-08-30  3:51       ` Philippe Mathieu-Daudé
2017-08-08 18:33 ` [Qemu-devel] [PATCH 7/9] AHCI: Rework IRQ constants John Snow
2017-08-25 14:00   ` Philippe Mathieu-Daudé
2017-08-29  0:28     ` John Snow
2017-08-30  3:24       ` Philippe Mathieu-Daudé
2017-08-08 18:33 ` [Qemu-devel] [PATCH 8/9] AHCI: pretty-print FIS to buffer instead of stderr John Snow
2017-08-08 18:33 ` [Qemu-devel] [PATCH 9/9] AHCI: remove DPRINTF macro John Snow
2017-08-25 13:48   ` Philippe Mathieu-Daudé
2017-08-29  0:33     ` John Snow
2017-08-09  1:17 ` [Qemu-devel] [PATCH 0/9] IDE: replace printfs with tracing no-reply

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=20170808183306.27474-4-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).