All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "John Snow" <jsnow@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Paul Durrant" <paul@xen.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	kvm@vger.kernel.org,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	qemu-block@nongnu.org, "Richard Henderson" <rth@twiddle.net>,
	xen-devel@lists.xenproject.org,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Sergio Lopez" <slp@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events
Date: Fri, 13 Dec 2019 17:17:42 +0100	[thread overview]
Message-ID: <20191213161753.8051-2-philmd@redhat.com> (raw)
In-Reply-To: <20191213161753.8051-1-philmd@redhat.com>

Convert the deprecated DPRINTF() macro to trace events.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: rename pc_pic -> x86_pic
---
 hw/i386/pc.c         | 19 +++++--------------
 hw/i386/trace-events |  6 ++++++
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ac08e63604..5f8e39c025 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -90,16 +90,7 @@
 #include "config-devices.h"
 #include "e820_memory_layout.h"
 #include "fw_cfg.h"
-
-/* debug PC/ISA interrupts */
-//#define DEBUG_IRQ
-
-#ifdef DEBUG_IRQ
-#define DPRINTF(fmt, ...)                                       \
-    do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#include "trace.h"
 
 struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
 
@@ -348,7 +339,7 @@ void gsi_handler(void *opaque, int n, int level)
 {
     GSIState *s = opaque;
 
-    DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n);
+    trace_x86_gsi_interrupt(n, level);
     if (n < ISA_NUM_IRQS) {
         qemu_set_irq(s->i8259_irq[n], level);
     }
@@ -426,7 +417,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
     CPUState *cs = first_cpu;
     X86CPU *cpu = X86_CPU(cs);
 
-    DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq);
+    trace_x86_pic_interrupt(irq, level);
     if (cpu->apic_state && !kvm_irqchip_in_kernel()) {
         CPU_FOREACH(cs) {
             cpu = X86_CPU(cs);
@@ -760,7 +751,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val,
     Port92State *s = opaque;
     int oldval = s->outport;
 
-    DPRINTF("port92: write 0x%02" PRIx64 "\n", val);
+    trace_port92_write(val);
     s->outport = val;
     qemu_set_irq(s->a20_out, (val >> 1) & 1);
     if ((val & 1) && !(oldval & 1)) {
@@ -775,7 +766,7 @@ static uint64_t port92_read(void *opaque, hwaddr addr,
     uint32_t ret;
 
     ret = s->outport;
-    DPRINTF("port92: read 0x%02x\n", ret);
+    trace_port92_read(ret);
     return ret;
 }
 
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
index c8bc464bc5..a608a5b635 100644
--- a/hw/i386/trace-events
+++ b/hw/i386/trace-events
@@ -111,3 +111,9 @@ amdvi_ir_irte_ga_val(uint64_t hi, uint64_t lo) "hi 0x%"PRIx64" lo 0x%"PRIx64
 # vmport.c
 vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p"
 vmport_command(unsigned char command) "command: 0x%02x"
+
+# pc.c
+x86_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d"
+x86_pic_interrupt(int irqn, int level) "PIC interrupt #%d level:%d"
+port92_read(uint8_t val) "port92: read 0x%02x"
+port92_write(uint8_t val) "port92: write 0x%02x"
-- 
2.21.0


WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Sergio Lopez" <slp@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Paul Durrant" <paul@xen.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	xen-devel@lists.xenproject.org,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	qemu-block@nongnu.org, "John Snow" <jsnow@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events
Date: Fri, 13 Dec 2019 17:17:42 +0100	[thread overview]
Message-ID: <20191213161753.8051-2-philmd@redhat.com> (raw)
In-Reply-To: <20191213161753.8051-1-philmd@redhat.com>

Convert the deprecated DPRINTF() macro to trace events.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: rename pc_pic -> x86_pic
---
 hw/i386/pc.c         | 19 +++++--------------
 hw/i386/trace-events |  6 ++++++
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ac08e63604..5f8e39c025 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -90,16 +90,7 @@
 #include "config-devices.h"
 #include "e820_memory_layout.h"
 #include "fw_cfg.h"
-
-/* debug PC/ISA interrupts */
-//#define DEBUG_IRQ
-
-#ifdef DEBUG_IRQ
-#define DPRINTF(fmt, ...)                                       \
-    do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#include "trace.h"
 
 struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
 
@@ -348,7 +339,7 @@ void gsi_handler(void *opaque, int n, int level)
 {
     GSIState *s = opaque;
 
-    DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n);
+    trace_x86_gsi_interrupt(n, level);
     if (n < ISA_NUM_IRQS) {
         qemu_set_irq(s->i8259_irq[n], level);
     }
@@ -426,7 +417,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
     CPUState *cs = first_cpu;
     X86CPU *cpu = X86_CPU(cs);
 
-    DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq);
+    trace_x86_pic_interrupt(irq, level);
     if (cpu->apic_state && !kvm_irqchip_in_kernel()) {
         CPU_FOREACH(cs) {
             cpu = X86_CPU(cs);
@@ -760,7 +751,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val,
     Port92State *s = opaque;
     int oldval = s->outport;
 
-    DPRINTF("port92: write 0x%02" PRIx64 "\n", val);
+    trace_port92_write(val);
     s->outport = val;
     qemu_set_irq(s->a20_out, (val >> 1) & 1);
     if ((val & 1) && !(oldval & 1)) {
@@ -775,7 +766,7 @@ static uint64_t port92_read(void *opaque, hwaddr addr,
     uint32_t ret;
 
     ret = s->outport;
-    DPRINTF("port92: read 0x%02x\n", ret);
+    trace_port92_read(ret);
     return ret;
 }
 
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
index c8bc464bc5..a608a5b635 100644
--- a/hw/i386/trace-events
+++ b/hw/i386/trace-events
@@ -111,3 +111,9 @@ amdvi_ir_irte_ga_val(uint64_t hi, uint64_t lo) "hi 0x%"PRIx64" lo 0x%"PRIx64
 # vmport.c
 vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p"
 vmport_command(unsigned char command) "command: 0x%02x"
+
+# pc.c
+x86_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d"
+x86_pic_interrupt(int irqn, int level) "PIC interrupt #%d level:%d"
+port92_read(uint8_t val) "port92: read 0x%02x"
+port92_write(uint8_t val) "port92: write 0x%02x"
-- 
2.21.0



WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Sergio Lopez" <slp@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Paul Durrant" <paul@xen.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	xen-devel@lists.xenproject.org,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	qemu-block@nongnu.org, "John Snow" <jsnow@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Xen-devel] [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events
Date: Fri, 13 Dec 2019 17:17:42 +0100	[thread overview]
Message-ID: <20191213161753.8051-2-philmd@redhat.com> (raw)
In-Reply-To: <20191213161753.8051-1-philmd@redhat.com>

Convert the deprecated DPRINTF() macro to trace events.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: rename pc_pic -> x86_pic
---
 hw/i386/pc.c         | 19 +++++--------------
 hw/i386/trace-events |  6 ++++++
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ac08e63604..5f8e39c025 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -90,16 +90,7 @@
 #include "config-devices.h"
 #include "e820_memory_layout.h"
 #include "fw_cfg.h"
-
-/* debug PC/ISA interrupts */
-//#define DEBUG_IRQ
-
-#ifdef DEBUG_IRQ
-#define DPRINTF(fmt, ...)                                       \
-    do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#include "trace.h"
 
 struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
 
@@ -348,7 +339,7 @@ void gsi_handler(void *opaque, int n, int level)
 {
     GSIState *s = opaque;
 
-    DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n);
+    trace_x86_gsi_interrupt(n, level);
     if (n < ISA_NUM_IRQS) {
         qemu_set_irq(s->i8259_irq[n], level);
     }
@@ -426,7 +417,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
     CPUState *cs = first_cpu;
     X86CPU *cpu = X86_CPU(cs);
 
-    DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq);
+    trace_x86_pic_interrupt(irq, level);
     if (cpu->apic_state && !kvm_irqchip_in_kernel()) {
         CPU_FOREACH(cs) {
             cpu = X86_CPU(cs);
@@ -760,7 +751,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val,
     Port92State *s = opaque;
     int oldval = s->outport;
 
-    DPRINTF("port92: write 0x%02" PRIx64 "\n", val);
+    trace_port92_write(val);
     s->outport = val;
     qemu_set_irq(s->a20_out, (val >> 1) & 1);
     if ((val & 1) && !(oldval & 1)) {
@@ -775,7 +766,7 @@ static uint64_t port92_read(void *opaque, hwaddr addr,
     uint32_t ret;
 
     ret = s->outport;
-    DPRINTF("port92: read 0x%02x\n", ret);
+    trace_port92_read(ret);
     return ret;
 }
 
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
index c8bc464bc5..a608a5b635 100644
--- a/hw/i386/trace-events
+++ b/hw/i386/trace-events
@@ -111,3 +111,9 @@ amdvi_ir_irte_ga_val(uint64_t hi, uint64_t lo) "hi 0x%"PRIx64" lo 0x%"PRIx64
 # vmport.c
 vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p"
 vmport_command(unsigned char command) "command: 0x%02x"
+
+# pc.c
+x86_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d"
+x86_pic_interrupt(int irqn, int level) "PIC interrupt #%d level:%d"
+port92_read(uint8_t val) "port92: read 0x%02x"
+port92_write(uint8_t val) "port92: write 0x%02x"
-- 
2.21.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-12-13 20:39 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 16:17 [PATCH 00/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' Philippe Mathieu-Daudé
2019-12-13 16:17 ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17 ` Philippe Mathieu-Daudé
2019-12-13 16:17 ` Philippe Mathieu-Daudé [this message]
2019-12-13 16:17   ` [Xen-devel] [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 02/12] hw/i386/pc: Move kvm_i8259_init() declaration to sysemu/kvm.h Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 03/12] hw/i386/pc: Remove obsolete pc_pci_device_init() declaration Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:08   ` Paolo Bonzini
2019-12-16 13:08     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:08     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 04/12] hw/i386/pc: Remove obsolete cpu_set_smm_t typedef Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:09   ` Paolo Bonzini
2019-12-16 13:09     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:09     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 05/12] hw/i386/ich9: Remove unused include Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-16 13:11     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:11     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 06/12] hw/i386/ich9: Move unnecessary "pci_bridge.h" include Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-16 13:11     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:11     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 07/12] hw/ide/piix: Remove superfluous DEVICE() cast Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-16 13:11     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:11     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 08/12] hw/ide/piix: Use ARRAY_SIZE() instead of magic numbers Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-16 13:11     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:11     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 09/12] hw/intc/ioapic: Make ioapic_print_redtbl() static Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-16 13:11     ` [Xen-devel] " Paolo Bonzini
2019-12-16 13:11     ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 10/12] hw/i386/pc: Rename allocate_cpu_irq from 'pc' to 'x86_machine' Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 11/12] hw/i386/pc: Move x86_machine_allocate_cpu_irq() to 'hw/i386/x86.c' Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' Philippe Mathieu-Daudé
2019-12-13 16:17   ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:17   ` Philippe Mathieu-Daudé
2019-12-13 16:47   ` Philippe Mathieu-Daudé
2019-12-13 16:47     ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-13 16:47     ` Philippe Mathieu-Daudé
2019-12-15  9:58     ` Michael S. Tsirkin
2019-12-15  9:58       ` [Xen-devel] " Michael S. Tsirkin
2019-12-15  9:58       ` Michael S. Tsirkin
2019-12-16 15:37       ` Philippe Mathieu-Daudé
2019-12-16 15:37         ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-16 15:37         ` Philippe Mathieu-Daudé
2019-12-16 15:41         ` Paolo Bonzini
2019-12-16 15:41           ` [Xen-devel] " Paolo Bonzini
2019-12-16 15:41           ` Paolo Bonzini
2019-12-16 15:48           ` Philippe Mathieu-Daudé
2019-12-16 15:48             ` [Xen-devel] " Philippe Mathieu-Daudé
2019-12-16 15:48             ` Philippe Mathieu-Daudé

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=20191213161753.8051-2-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=slp@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 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.