qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, lvivier@redhat.com,
	surajjs@au1.ibm.com, groug@kaod.org,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 04/12] uninorth: convert to trace-events
Date: Mon, 29 Jan 2018 14:28:18 +1100	[thread overview]
Message-ID: <20180129032826.16876-5-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20180129032826.16876-1-david@gibson.dropbear.id.au>

From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/pci-host/trace-events |  6 ++++++
 hw/pci-host/uninorth.c   | 24 +++++-------------------
 2 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/hw/pci-host/trace-events b/hw/pci-host/trace-events
index 5b8fcc228b..341a87a702 100644
--- a/hw/pci-host/trace-events
+++ b/hw/pci-host/trace-events
@@ -12,3 +12,9 @@ sabre_pci_config_write(uint64_t addr, uint64_t val) "addr 0x%"PRIx64" val 0x%"PR
 sabre_pci_config_read(uint64_t addr, uint64_t val) "addr 0x%"PRIx64" val 0x%"PRIx64
 sabre_pci_set_irq(int irq_num, int level) "set irq_in %d level %d"
 sabre_pci_set_obio_irq(int irq_num, int level) "set irq %d level %d"
+
+# hw/pci-host/uninorth.c
+unin_set_irq(int irq_num, int level) "setting INT %d = %d"
+unin_get_config_reg(uint32_t reg, uint32_t addr, uint32_t retval) "converted config space accessor 0x%"PRIx32 "/0x%"PRIx32 " -> 0x%"PRIx32
+unin_data_write(uint64_t addr, unsigned len, uint64_t val) "write addr 0x%"PRIx64 " len %d val 0x%"PRIx64
+unin_data_read(uint64_t addr, unsigned len, uint64_t val) "read addr 0x%"PRIx64 " len %d val 0x%"PRIx64
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 5d8ccaa711..66991da975 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -26,16 +26,7 @@
 #include "hw/ppc/mac.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
-
-/* debug UniNorth */
-//#define DEBUG_UNIN
-
-#ifdef DEBUG_UNIN
-#define UNIN_DPRINTF(fmt, ...)                                  \
-    do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define UNIN_DPRINTF(fmt, ...)
-#endif
+#include "trace.h"
 
 static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e };
 
@@ -69,8 +60,7 @@ static void pci_unin_set_irq(void *opaque, int irq_num, int level)
 {
     qemu_irq *pic = opaque;
 
-    UNIN_DPRINTF("%s: setting INT %d = %d\n", __func__,
-                 unin_irq_line[irq_num], level);
+    trace_unin_set_irq(unin_irq_line[irq_num], level);
     qemu_set_irq(pic[unin_irq_line[irq_num]], level);
 }
 
@@ -103,9 +93,7 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)
         retval |= func << 8;
     }
 
-
-    UNIN_DPRINTF("Converted config space accessor %08x/%08x -> %08x\n",
-                 reg, addr, retval);
+    trace_unin_get_config_reg(reg, addr, retval);
 
     return retval;
 }
@@ -115,8 +103,7 @@ static void unin_data_write(void *opaque, hwaddr addr,
 {
     UNINState *s = opaque;
     PCIHostState *phb = PCI_HOST_BRIDGE(s);
-    UNIN_DPRINTF("write addr " TARGET_FMT_plx " len %d val %"PRIx64"\n",
-                 addr, len, val);
+    trace_unin_data_write(addr, len, val);
     pci_data_write(phb->bus,
                    unin_get_config_reg(phb->config_reg, addr),
                    val, len);
@@ -132,8 +119,7 @@ static uint64_t unin_data_read(void *opaque, hwaddr addr,
     val = pci_data_read(phb->bus,
                         unin_get_config_reg(phb->config_reg, addr),
                         len);
-    UNIN_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n",
-                 addr, len, val);
+    trace_unin_data_read(addr, len, val);
     return val;
 }
 
-- 
2.14.3

  parent reply	other threads:[~2018-01-29  3:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29  3:28 [Qemu-devel] [PULL 00/12] ppc-for-2.12 queue 20180129 David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 01/12] ppc/pnv: fix PnvChip redefinition in <hw/ppc/pnv_xscom.h> David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 02/12] ppc: Deprecate qemu-system-ppcemb David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 03/12] grackle: convert to trace-events David Gibson
2018-01-29  3:28 ` David Gibson [this message]
2018-01-29  3:28 ` [Qemu-devel] [PULL 05/12] input: add missing newline from trace-events David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 06/12] spapr_pci: fix MSI/MSIX selection David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 07/12] target/ppc/kvm: Add cap_ppc_safe_[cache/bounds_check/indirect_branch] David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 08/12] target/ppc/spapr_caps: Add support for tristate spapr_capabilities David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 09/12] target/ppc/spapr_caps: Add new tristate cap safe_cache David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 10/12] target/ppc/spapr_caps: Add new tristate cap safe_bounds_check David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 11/12] target/ppc/spapr_caps: Add new tristate cap safe_indirect_branch David Gibson
2018-01-29  3:28 ` [Qemu-devel] [PULL 12/12] target/ppc/spapr: Add H-Call H_GET_CPU_CHARACTERISTICS David Gibson
2018-02-01 18:22   ` Paolo Bonzini
2018-01-29  3:47 ` [Qemu-devel] [PULL 00/12] ppc-for-2.12 queue 20180129 no-reply
2018-01-29 14:28 ` 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=20180129032826.16876-5-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=surajjs@au1.ibm.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).