All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] qemu-log: remove -d ioport
@ 2015-10-16 13:16 Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-10-16 13:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, armbru

All of its uses are disabled at compile-time by default, so convert to
tracepoints or expands the existing ones.

Paolo Bonzini (3):
  prep: do not use CPU_LOG_IOPORT, convert to tracepoints
  ioport: do not use CPU_LOG_IOPORT, expand tracepoints
  qemu-log: remove -d ioport

 hw/ppc/prep.c      | 30 +++---------------------------
 include/qemu/log.h |  1 -
 ioport.c           | 26 ++++++--------------------
 qemu-log.c         |  2 --
 trace-events       |  8 ++++++--
 5 files changed, 15 insertions(+), 52 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints
  2015-10-16 13:16 [Qemu-devel] [PATCH 0/3] qemu-log: remove -d ioport Paolo Bonzini
@ 2015-10-16 13:16 ` Paolo Bonzini
  2015-10-23  1:38   ` [Qemu-devel] [Qemu-ppc] " David Gibson
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 2/3] ioport: do not use CPU_LOG_IOPORT, expand tracepoints Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 3/3] qemu-log: remove -d ioport Paolo Bonzini
  2 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2015-10-16 13:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, Andreas Färber, open list:PReP, armbru,
	Alexander Graf

These messages are disabled by default; a perfect usecase for tracepoints.
Convert them over.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ppc/prep.c | 30 +++---------------------------
 trace-events  |  4 ++++
 2 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index d95222b..5ad28f7 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -42,11 +42,9 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/qtest.h"
 #include "exec/address-spaces.h"
+#include "trace.h"
 #include "elf.h"
 
-//#define HARD_DEBUG_PPC_IO
-//#define DEBUG_PPC_IO
-
 /* SMP is not enabled, for now */
 #define MAX_CPUS 1
 
@@ -57,26 +55,6 @@
 #define KERNEL_LOAD_ADDR 0x01000000
 #define INITRD_LOAD_ADDR 0x01800000
 
-#if defined (HARD_DEBUG_PPC_IO) && !defined (DEBUG_PPC_IO)
-#define DEBUG_PPC_IO
-#endif
-
-#if defined (HARD_DEBUG_PPC_IO)
-#define PPC_IO_DPRINTF(fmt, ...)                         \
-do {                                                     \
-    if (qemu_loglevel_mask(CPU_LOG_IOPORT)) {            \
-        qemu_log("%s: " fmt, __func__ , ## __VA_ARGS__); \
-    } else {                                             \
-        printf("%s : " fmt, __func__ , ## __VA_ARGS__);  \
-    }                                                    \
-} while (0)
-#elif defined (DEBUG_PPC_IO)
-#define PPC_IO_DPRINTF(fmt, ...) \
-qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
-#else
-#define PPC_IO_DPRINTF(fmt, ...) do { } while (0)
-#endif
-
 /* Constants for devices init */
 static const int ide_iobase[2] = { 0x1f0, 0x170 };
 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
@@ -199,8 +177,7 @@ static void PREP_io_800_writeb (void *opaque, uint32_t addr, uint32_t val)
 {
     sysctrl_t *sysctrl = opaque;
 
-    PPC_IO_DPRINTF("0x%08" PRIx32 " => 0x%02" PRIx32 "\n",
-                   addr - PPC_IO_BASE, val);
+    trace_prep_io_800_writeb(addr - PPC_IO_BASE, val);
     switch (addr) {
     case 0x0092:
         /* Special port 92 */
@@ -327,8 +304,7 @@ static uint32_t PREP_io_800_readb (void *opaque, uint32_t addr)
         printf("ERROR: unaffected IO port: %04" PRIx32 " read\n", addr);
         break;
     }
-    PPC_IO_DPRINTF("0x%08" PRIx32 " <= 0x%02" PRIx32 "\n",
-                   addr - PPC_IO_BASE, retval);
+    trace_prep_io_800_readb(addr - PPC_IO_BASE, retval);
 
     return retval;
 }
diff --git a/trace-events b/trace-events
index a0ddc6b..2d3f1d7 100644
--- a/trace-events
+++ b/trace-events
@@ -1383,6 +1383,10 @@ spapr_iommu_new_table(uint64_t liobn, void *tcet, void *table, int fd) "liobn=%"
 # hw/ppc/ppc.c
 ppc_tb_adjust(uint64_t offs1, uint64_t offs2, int64_t diff, int64_t seconds) "adjusted from 0x%"PRIx64" to 0x%"PRIx64", diff %"PRId64" (%"PRId64"s)"
 
+# hw/ppc/prep.c
+prep_io_800_writeb(uint32_t addr, uint32_t val) "0x%08" PRIx32 " => 0x%02" PRIx32
+prep_io_800_readb(uint32_t addr, uint32_t retval) "0x%08" PRIx32 " <= 0x%02" PRIx32
+
 # util/hbitmap.c
 hbitmap_iter_skip_words(const void *hb, void *hbi, uint64_t pos, unsigned long cur) "hb %p hbi %p pos %"PRId64" cur 0x%lx"
 hbitmap_reset(void *hb, uint64_t start, uint64_t count, uint64_t sbit, uint64_t ebit) "hb %p items %"PRIu64",%"PRIu64" bits %"PRIu64"..%"PRIu64
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/3] ioport: do not use CPU_LOG_IOPORT, expand tracepoints
  2015-10-16 13:16 [Qemu-devel] [PATCH 0/3] qemu-log: remove -d ioport Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints Paolo Bonzini
@ 2015-10-16 13:16 ` Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 3/3] qemu-log: remove -d ioport Paolo Bonzini
  2 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-10-16 13:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, armbru

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 2d3f1d7..5d857ea 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.
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 3/3] qemu-log: remove -d ioport
  2015-10-16 13:16 [Qemu-devel] [PATCH 0/3] qemu-log: remove -d ioport Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints Paolo Bonzini
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 2/3] ioport: do not use CPU_LOG_IOPORT, expand tracepoints Paolo Bonzini
@ 2015-10-16 13:16 ` Paolo Bonzini
  2 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-10-16 13:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, armbru

It was disabled at compile-time, and has now been replaced by tracepoints.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qemu/log.h | 1 -
 qemu-log.c         | 2 --
 2 files changed, 3 deletions(-)

diff --git a/include/qemu/log.h b/include/qemu/log.h
index f880e66..d565f16 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -35,7 +35,6 @@ static inline bool qemu_log_enabled(void)
 #define CPU_LOG_INT        (1 << 4)
 #define CPU_LOG_EXEC       (1 << 5)
 #define CPU_LOG_PCALL      (1 << 6)
-#define CPU_LOG_IOPORT     (1 << 7)
 #define CPU_LOG_TB_CPU     (1 << 8)
 #define CPU_LOG_RESET      (1 << 9)
 #define LOG_UNIMP          (1 << 10)
diff --git a/qemu-log.c b/qemu-log.c
index 13f3813..cf74fb5 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -112,8 +112,6 @@ const QEMULogItem qemu_log_items[] = {
       "x86 only: show protected mode far calls/returns/exceptions" },
     { CPU_LOG_RESET, "cpu_reset",
       "show CPU state before CPU resets" },
-    { CPU_LOG_IOPORT, "ioport",
-      "show all i/o ports accesses" },
     { LOG_UNIMP, "unimp",
       "log unimplemented functionality" },
     { LOG_GUEST_ERROR, "guest_errors",
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints
  2015-10-16 13:16 ` [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints Paolo Bonzini
@ 2015-10-23  1:38   ` David Gibson
  2015-10-23  7:30     ` Paolo Bonzini
  2015-10-23  9:37     ` Andreas Färber
  0 siblings, 2 replies; 7+ messages in thread
From: David Gibson @ 2015-10-23  1:38 UTC (permalink / raw)
  To: Paolo Bonzini, g
  Cc: peter.maydell, Andreas Färber, open list:PReP, qemu-devel, armbru

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

On Fri, Oct 16, 2015 at 03:16:11PM +0200, Paolo Bonzini wrote:
> These messages are disabled by default; a perfect usecase for tracepoints.
> Convert them over.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Looks good to me.  Applied to ppc-next.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints
  2015-10-23  1:38   ` [Qemu-devel] [Qemu-ppc] " David Gibson
@ 2015-10-23  7:30     ` Paolo Bonzini
  2015-10-23  9:37     ` Andreas Färber
  1 sibling, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-10-23  7:30 UTC (permalink / raw)
  To: David Gibson, g
  Cc: peter.maydell, Andreas Färber, open list:PReP, qemu-devel, armbru

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



On 23/10/2015 03:38, David Gibson wrote:
> On Fri, Oct 16, 2015 at 03:16:11PM +0200, Paolo Bonzini wrote:
>> These messages are disabled by default; a perfect usecase for
>> tracepoints. Convert them over.
>> 
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Looks good to me.  Applied to ppc-next.

Feel free to apply the whole series then.  Thanks!

Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWKeITAAoJEL/70l94x66DndYH/2FC/HazCk2RGFCvsUn9kHTY
dvCNGXSD8XeJ3Z4WM+8PNMiQl5MPX87VFAY8vDwFWgHecjMSMNJTCLmJr+KeKssS
+wBiZYrY/pfCwyQ3BjDKx/mw4jTbCOE7XnDQ3yKtLkU2WQMqbL89BO1fIgL1QfU3
uI1599TypHPN8VozcDYiInT4P6OoM272XmIcNe8zOMZgT2vqD0sUwAsi5DKNYZ5B
CgFh5VbiItjGLpKoq4WBJaVqD5jD3ZvbGS+ORmYxo5zXLyGxPuCFQj4vOYiKn/28
eUUPy0qCVmymwtLFoh1CBJ95RNg02aPD5hrld2oj3CiJoIKuVoHk4t4u7p0plBg=
=llio
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints
  2015-10-23  1:38   ` [Qemu-devel] [Qemu-ppc] " David Gibson
  2015-10-23  7:30     ` Paolo Bonzini
@ 2015-10-23  9:37     ` Andreas Färber
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2015-10-23  9:37 UTC (permalink / raw)
  To: David Gibson
  Cc: peter.maydell, qemu-devel, armbru, qemu-ppc, Paolo Bonzini, g

Am 23.10.2015 um 03:38 schrieb David Gibson:
> On Fri, Oct 16, 2015 at 03:16:11PM +0200, Paolo Bonzini wrote:
>> These messages are disabled by default; a perfect usecase for tracepoints.
>> Convert them over.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Looks good to me.  Applied to ppc-next.

Would've been nice to ask first, but

Acked-by: Andreas Färber <andreas.faerber@web.de>

I do have some PReP refactorings for a 2.4 issue from Markus that I
would like to get into 2.5, so please submit your ppc queue early.

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-23  9:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 13:16 [Qemu-devel] [PATCH 0/3] qemu-log: remove -d ioport Paolo Bonzini
2015-10-16 13:16 ` [Qemu-devel] [PATCH 1/3] prep: do not use CPU_LOG_IOPORT, convert to tracepoints Paolo Bonzini
2015-10-23  1:38   ` [Qemu-devel] [Qemu-ppc] " David Gibson
2015-10-23  7:30     ` Paolo Bonzini
2015-10-23  9:37     ` Andreas Färber
2015-10-16 13:16 ` [Qemu-devel] [PATCH 2/3] ioport: do not use CPU_LOG_IOPORT, expand tracepoints Paolo Bonzini
2015-10-16 13:16 ` [Qemu-devel] [PATCH 3/3] qemu-log: remove -d ioport Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.