qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 04/14] ioport: do not use CPU_LOG_IOPORT
Date: Wed,  4 Nov 2015 17:18:22 +0100	[thread overview]
Message-ID: <1446653912-116150-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1446653912-116150-1-git-send-email-pbonzini@redhat.com>

These messages are disabled by default; a perfect usecase for tracepoints,
which in fact already exist.  Add the missing information to them and
stop using qemu_log_mask.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 ioport.c     | 26 ++++++--------------------
 trace-events |  4 ++--
 2 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/ioport.c b/ioport.c
index e39093e..193ef76 100644
--- a/ioport.c
+++ b/ioport.c
@@ -30,14 +30,6 @@
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
 
-//#define DEBUG_IOPORT
-
-#ifdef DEBUG_IOPORT
-#  define LOG_IOPORT(...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
-#else
-#  define LOG_IOPORT(...) do { } while (0)
-#endif
-
 typedef struct MemoryRegionPortioList {
     MemoryRegion mr;
     void *portio_opaque;
@@ -62,8 +54,7 @@ const MemoryRegionOps unassigned_io_ops = {
 
 void cpu_outb(pio_addr_t addr, uint8_t val)
 {
-    LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val);
-    trace_cpu_out(addr, val);
+    trace_cpu_out(addr, 'b', val);
     address_space_write(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED,
                         &val, 1);
 }
@@ -72,8 +63,7 @@ void cpu_outw(pio_addr_t addr, uint16_t val)
 {
     uint8_t buf[2];
 
-    LOG_IOPORT("outw: %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);
-    trace_cpu_out(addr, val);
+    trace_cpu_out(addr, 'w', val);
     stw_p(buf, val);
     address_space_write(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED,
                         buf, 2);
@@ -83,8 +73,7 @@ void cpu_outl(pio_addr_t addr, uint32_t val)
 {
     uint8_t buf[4];
 
-    LOG_IOPORT("outl: %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
-    trace_cpu_out(addr, val);
+    trace_cpu_out(addr, 'l', val);
     stl_p(buf, val);
     address_space_write(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED,
                         buf, 4);
@@ -96,8 +85,7 @@ uint8_t cpu_inb(pio_addr_t addr)
 
     address_space_read(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED,
                        &val, 1);
-    trace_cpu_in(addr, val);
-    LOG_IOPORT("inb : %04"FMT_pioaddr" %02"PRIx8"\n", addr, val);
+    trace_cpu_in(addr, 'b', val);
     return val;
 }
 
@@ -108,8 +96,7 @@ uint16_t cpu_inw(pio_addr_t addr)
 
     address_space_read(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED, buf, 2);
     val = lduw_p(buf);
-    trace_cpu_in(addr, val);
-    LOG_IOPORT("inw : %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);
+    trace_cpu_in(addr, 'w', val);
     return val;
 }
 
@@ -120,8 +107,7 @@ uint32_t cpu_inl(pio_addr_t addr)
 
     address_space_read(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED, buf, 4);
     val = ldl_p(buf);
-    trace_cpu_in(addr, val);
-    LOG_IOPORT("inl : %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
+    trace_cpu_in(addr, 'l', val);
     return val;
 }
 
diff --git a/trace-events b/trace-events
index bdfe79f..89b38aa 100644
--- a/trace-events
+++ b/trace-events
@@ -139,8 +139,8 @@ paio_submit_co(int64_t sector_num, int nb_sectors, int type) "sector_num %"PRId6
 paio_submit(void *acb, void *opaque, int64_t sector_num, int nb_sectors, int type) "acb %p opaque %p sector_num %"PRId64" nb_sectors %d type %d"
 
 # ioport.c
-cpu_in(unsigned int addr, unsigned int val) "addr %#x value %u"
-cpu_out(unsigned int addr, unsigned int val) "addr %#x value %u"
+cpu_in(unsigned int addr, char size, unsigned int val) "addr %#x(%c) value %u"
+cpu_out(unsigned int addr, char size, unsigned int val) "addr %#x(%c) value %u"
 
 # balloon.c
 # Since requests are raised via monitor, not many tracepoints are needed.
-- 
1.8.3.1

  parent reply	other threads:[~2015-11-04 16:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 16:18 [Qemu-devel] [PULL 00/14] Misc changes for QEMU 2.4-rc1 Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 01/14] file_ram_alloc: propagate error to caller instead of terminating QEMU Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 02/14] scripts/text2pod.pl: Escape left brace Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 03/14] target-i386: fix pcmpxstrx equal-ordered (strstr) mode Paolo Bonzini
2015-11-04 16:18 ` Paolo Bonzini [this message]
2015-11-04 16:18 ` [Qemu-devel] [PULL 05/14] qemu-log: remove -d ioport Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 06/14] pc: Set hw_version on all machine classes Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 07/14] osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version() Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 08/14] megasas: Use qemu_hw_version() instead of QEMU_VERSION Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 09/14] memory: call begin, log_start and commit when registering a new listener Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 10/14] cpu-exec: Fix compiler warning (-Werror=clobbered) Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 11/14] configure: disallow ccache during compile tests Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 12/14] backends/hostmem-file: Allow to specify full pathname for backing file Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 13/14] iscsi: Translate scsi sense into error code Paolo Bonzini
2015-11-04 16:18 ` [Qemu-devel] [PULL 14/14] configure: disable FORTIFY_SOURCE under clang Paolo Bonzini
2015-11-04 16:34 ` [Qemu-devel] [PULL 00/14] Misc changes for QEMU 2.4-rc1 Peter Maydell
2015-11-04 16:36   ` Paolo Bonzini
2015-11-05  4:58   ` Fam Zheng
2015-11-05  8:02     ` Peter Maydell
2015-11-04 16:53 ` Denis V. Lunev

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=1446653912-116150-5-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --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).