* [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs
@ 2017-11-02 18:03 Dr. David Alan Gilbert (git)
2017-11-03 6:41 ` Peter Xu
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2017-11-02 18:03 UTC (permalink / raw)
To: qemu-devel, mst, pbonzini; +Cc: peterx
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Remove the last few DPRINTFs from hw/intc/ioapic.c and turn
them into tracing. In one case it's a new trace, in the others
it's just adding a parameter to the existing traces.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hw/intc/ioapic.c | 17 +++--------------
hw/intc/trace-events | 5 +++--
2 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 37c4386ae3..36139a4db6 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -35,15 +35,6 @@
#include "hw/i386/x86-iommu.h"
#include "trace.h"
-//#define DEBUG_IOAPIC
-
-#ifdef DEBUG_IOAPIC
-#define DPRINTF(fmt, ...) \
- do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
-
#define APIC_DELIVERY_MODE_SHIFT 8
#define APIC_POLARITY_SHIFT 14
#define APIC_TRIG_MODE_SHIFT 15
@@ -157,7 +148,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
* to GSI 2. GSI maps to ioapic 1-1. This is not
* the cleanest way of doing it but it should work. */
- DPRINTF("%s: %s vec %x\n", __func__, level ? "raise" : "lower", vector);
+ trace_ioapic_set_irq(vector, level);
if (vector == 0) {
vector = 2;
}
@@ -290,11 +281,10 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
}
}
}
- DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
break;
}
- trace_ioapic_mem_read(addr, size, val);
+ trace_ioapic_mem_read(addr, s->ioregsel, size, val);
return val;
}
@@ -335,7 +325,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
int index;
addr &= 0xff;
- trace_ioapic_mem_write(addr, size, val);
+ trace_ioapic_mem_write(addr, s->ioregsel, size, val);
switch (addr) {
case IOAPIC_IOREGSEL:
@@ -345,7 +335,6 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
if (size != 4) {
break;
}
- DPRINTF("write: %08x = %08" PRIx64 "\n", s->ioregsel, val);
switch (s->ioregsel) {
case IOAPIC_REG_ID:
s->id = (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK;
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
index b86f242b0f..b298fac7c6 100644
--- a/hw/intc/trace-events
+++ b/hw/intc/trace-events
@@ -18,8 +18,9 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64" = 0x%08x"
ioapic_set_remote_irr(int n) "set remote irr for pin %d"
ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d vector %d"
ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d"
-ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
-ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
+ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
+ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
+ioapic_set_irq(int vector, int level) "vector: %d level: %d"
# hw/intc/slavio_intctl.c
slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = 0x%x"
--
2.14.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs
2017-11-02 18:03 [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs Dr. David Alan Gilbert (git)
@ 2017-11-03 6:41 ` Peter Xu
2017-11-03 9:41 ` Stefan Hajnoczi
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Peter Xu @ 2017-11-03 6:41 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, mst, pbonzini
On Thu, Nov 02, 2017 at 06:03:10PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Remove the last few DPRINTFs from hw/intc/ioapic.c and turn
> them into tracing. In one case it's a new trace, in the others
> it's just adding a parameter to the existing traces.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
> hw/intc/ioapic.c | 17 +++--------------
> hw/intc/trace-events | 5 +++--
> 2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 37c4386ae3..36139a4db6 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -35,15 +35,6 @@
> #include "hw/i386/x86-iommu.h"
> #include "trace.h"
>
> -//#define DEBUG_IOAPIC
> -
> -#ifdef DEBUG_IOAPIC
> -#define DPRINTF(fmt, ...) \
> - do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...)
> -#endif
> -
> #define APIC_DELIVERY_MODE_SHIFT 8
> #define APIC_POLARITY_SHIFT 14
> #define APIC_TRIG_MODE_SHIFT 15
> @@ -157,7 +148,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
> * to GSI 2. GSI maps to ioapic 1-1. This is not
> * the cleanest way of doing it but it should work. */
>
> - DPRINTF("%s: %s vec %x\n", __func__, level ? "raise" : "lower", vector);
> + trace_ioapic_set_irq(vector, level);
> if (vector == 0) {
> vector = 2;
> }
> @@ -290,11 +281,10 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
> }
> }
> }
> - DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
> break;
> }
>
> - trace_ioapic_mem_read(addr, size, val);
> + trace_ioapic_mem_read(addr, s->ioregsel, size, val);
>
> return val;
> }
> @@ -335,7 +325,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> int index;
>
> addr &= 0xff;
> - trace_ioapic_mem_write(addr, size, val);
> + trace_ioapic_mem_write(addr, s->ioregsel, size, val);
>
> switch (addr) {
> case IOAPIC_IOREGSEL:
> @@ -345,7 +335,6 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> if (size != 4) {
> break;
> }
> - DPRINTF("write: %08x = %08" PRIx64 "\n", s->ioregsel, val);
> switch (s->ioregsel) {
> case IOAPIC_REG_ID:
> s->id = (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK;
> diff --git a/hw/intc/trace-events b/hw/intc/trace-events
> index b86f242b0f..b298fac7c6 100644
> --- a/hw/intc/trace-events
> +++ b/hw/intc/trace-events
> @@ -18,8 +18,9 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64" = 0x%08x"
> ioapic_set_remote_irr(int n) "set remote irr for pin %d"
> ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d vector %d"
> ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d"
> -ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> -ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> +ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_set_irq(int vector, int level) "vector: %d level: %d"
>
> # hw/intc/slavio_intctl.c
> slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = 0x%x"
> --
> 2.14.3
>
--
Peter Xu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs
2017-11-02 18:03 [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs Dr. David Alan Gilbert (git)
2017-11-03 6:41 ` Peter Xu
@ 2017-11-03 9:41 ` Stefan Hajnoczi
2017-11-08 13:56 ` Paolo Bonzini
2017-11-28 18:58 ` Michael S. Tsirkin
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2017-11-03 9:41 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, mst, pbonzini, peterx
[-- Attachment #1: Type: text/plain, Size: 591 bytes --]
On Thu, Nov 02, 2017 at 06:03:10PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Remove the last few DPRINTFs from hw/intc/ioapic.c and turn
> them into tracing. In one case it's a new trace, in the others
> it's just adding a parameter to the existing traces.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> hw/intc/ioapic.c | 17 +++--------------
> hw/intc/trace-events | 5 +++--
> 2 files changed, 6 insertions(+), 16 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs
2017-11-02 18:03 [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs Dr. David Alan Gilbert (git)
2017-11-03 6:41 ` Peter Xu
2017-11-03 9:41 ` Stefan Hajnoczi
@ 2017-11-08 13:56 ` Paolo Bonzini
2017-11-28 18:58 ` Michael S. Tsirkin
3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-11-08 13:56 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git), qemu-devel, mst; +Cc: peterx
On 02/11/2017 19:03, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Remove the last few DPRINTFs from hw/intc/ioapic.c and turn
> them into tracing. In one case it's a new trace, in the others
> it's just adding a parameter to the existing traces.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Queued, thanks.
Paolo
> ---
> hw/intc/ioapic.c | 17 +++--------------
> hw/intc/trace-events | 5 +++--
> 2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 37c4386ae3..36139a4db6 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -35,15 +35,6 @@
> #include "hw/i386/x86-iommu.h"
> #include "trace.h"
>
> -//#define DEBUG_IOAPIC
> -
> -#ifdef DEBUG_IOAPIC
> -#define DPRINTF(fmt, ...) \
> - do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...)
> -#endif
> -
> #define APIC_DELIVERY_MODE_SHIFT 8
> #define APIC_POLARITY_SHIFT 14
> #define APIC_TRIG_MODE_SHIFT 15
> @@ -157,7 +148,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
> * to GSI 2. GSI maps to ioapic 1-1. This is not
> * the cleanest way of doing it but it should work. */
>
> - DPRINTF("%s: %s vec %x\n", __func__, level ? "raise" : "lower", vector);
> + trace_ioapic_set_irq(vector, level);
> if (vector == 0) {
> vector = 2;
> }
> @@ -290,11 +281,10 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
> }
> }
> }
> - DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
> break;
> }
>
> - trace_ioapic_mem_read(addr, size, val);
> + trace_ioapic_mem_read(addr, s->ioregsel, size, val);
>
> return val;
> }
> @@ -335,7 +325,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> int index;
>
> addr &= 0xff;
> - trace_ioapic_mem_write(addr, size, val);
> + trace_ioapic_mem_write(addr, s->ioregsel, size, val);
>
> switch (addr) {
> case IOAPIC_IOREGSEL:
> @@ -345,7 +335,6 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> if (size != 4) {
> break;
> }
> - DPRINTF("write: %08x = %08" PRIx64 "\n", s->ioregsel, val);
> switch (s->ioregsel) {
> case IOAPIC_REG_ID:
> s->id = (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK;
> diff --git a/hw/intc/trace-events b/hw/intc/trace-events
> index b86f242b0f..b298fac7c6 100644
> --- a/hw/intc/trace-events
> +++ b/hw/intc/trace-events
> @@ -18,8 +18,9 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64" = 0x%08x"
> ioapic_set_remote_irr(int n) "set remote irr for pin %d"
> ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d vector %d"
> ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d"
> -ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> -ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> +ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_set_irq(int vector, int level) "vector: %d level: %d"
>
> # hw/intc/slavio_intctl.c
> slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = 0x%x"
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs
2017-11-02 18:03 [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs Dr. David Alan Gilbert (git)
` (2 preceding siblings ...)
2017-11-08 13:56 ` Paolo Bonzini
@ 2017-11-28 18:58 ` Michael S. Tsirkin
3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2017-11-28 18:58 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, pbonzini, peterx
On Thu, Nov 02, 2017 at 06:03:10PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Remove the last few DPRINTFs from hw/intc/ioapic.c and turn
> them into tracing. In one case it's a new trace, in the others
> it's just adding a parameter to the existing traces.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/intc/ioapic.c | 17 +++--------------
> hw/intc/trace-events | 5 +++--
> 2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 37c4386ae3..36139a4db6 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -35,15 +35,6 @@
> #include "hw/i386/x86-iommu.h"
> #include "trace.h"
>
> -//#define DEBUG_IOAPIC
> -
> -#ifdef DEBUG_IOAPIC
> -#define DPRINTF(fmt, ...) \
> - do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...)
> -#endif
> -
> #define APIC_DELIVERY_MODE_SHIFT 8
> #define APIC_POLARITY_SHIFT 14
> #define APIC_TRIG_MODE_SHIFT 15
> @@ -157,7 +148,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
> * to GSI 2. GSI maps to ioapic 1-1. This is not
> * the cleanest way of doing it but it should work. */
>
> - DPRINTF("%s: %s vec %x\n", __func__, level ? "raise" : "lower", vector);
> + trace_ioapic_set_irq(vector, level);
> if (vector == 0) {
> vector = 2;
> }
> @@ -290,11 +281,10 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
> }
> }
> }
> - DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
> break;
> }
>
> - trace_ioapic_mem_read(addr, size, val);
> + trace_ioapic_mem_read(addr, s->ioregsel, size, val);
>
> return val;
> }
> @@ -335,7 +325,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> int index;
>
> addr &= 0xff;
> - trace_ioapic_mem_write(addr, size, val);
> + trace_ioapic_mem_write(addr, s->ioregsel, size, val);
>
> switch (addr) {
> case IOAPIC_IOREGSEL:
> @@ -345,7 +335,6 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> if (size != 4) {
> break;
> }
> - DPRINTF("write: %08x = %08" PRIx64 "\n", s->ioregsel, val);
> switch (s->ioregsel) {
> case IOAPIC_REG_ID:
> s->id = (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK;
> diff --git a/hw/intc/trace-events b/hw/intc/trace-events
> index b86f242b0f..b298fac7c6 100644
> --- a/hw/intc/trace-events
> +++ b/hw/intc/trace-events
> @@ -18,8 +18,9 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64" = 0x%08x"
> ioapic_set_remote_irr(int n) "set remote irr for pin %d"
> ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d vector %d"
> ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d"
> -ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> -ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
> +ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
> +ioapic_set_irq(int vector, int level) "vector: %d level: %d"
>
> # hw/intc/slavio_intctl.c
> slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = 0x%x"
> --
> 2.14.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-28 18:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 18:03 [Qemu-devel] [PATCH] ioapic/tracing: Remove last DPRINTFs Dr. David Alan Gilbert (git)
2017-11-03 6:41 ` Peter Xu
2017-11-03 9:41 ` Stefan Hajnoczi
2017-11-08 13:56 ` Paolo Bonzini
2017-11-28 18:58 ` Michael S. Tsirkin
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.