diff mbox

[2/3] ppc4xx: replace debug printf with trace points

Message ID 20170210092724.6470-3-lvivier@redhat.com
State New
Headers show

Commit Message

Laurent Vivier Feb. 10, 2017, 9:27 a.m. UTC
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/ppc/ppc4xx_pci.c | 13 +++----------
 hw/ppc/trace-events |  4 ++++
 2 files changed, 7 insertions(+), 10 deletions(-)

Comments

Philippe Mathieu-Daudé Feb. 10, 2017, 1:35 p.m. UTC | #1
On 02/10/2017 06:27 AM, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/ppc/ppc4xx_pci.c | 13 +++----------
>  hw/ppc/trace-events |  4 ++++
>  2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 683218e..dc19682 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -26,13 +26,7 @@
>  #include "hw/pci/pci.h"
>  #include "hw/pci/pci_host.h"
>  #include "exec/address-spaces.h"
> -
> -#undef DEBUG
> -#ifdef DEBUG
> -#define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...)
> -#endif /* DEBUG */
> +#include "trace.h"
>
>  struct PCIMasterMap {
>      uint32_t la;
> @@ -249,8 +243,7 @@ static int ppc4xx_pci_map_irq(PCIDevice *pci_dev, int irq_num)
>  {
>      int slot = pci_dev->devfn >> 3;
>
> -    DPRINTF("%s: devfn %x irq %d -> %d\n", __func__,
> -            pci_dev->devfn, irq_num, slot);
> +    trace_ppc4xx_pci_map_irq(pci_dev->devfn, irq_num, slot);
>
>      return slot - 1;
>  }
> @@ -259,7 +252,7 @@ static void ppc4xx_pci_set_irq(void *opaque, int irq_num, int level)
>  {
>      qemu_irq *pci_irqs = opaque;
>
> -    DPRINTF("%s: PCI irq %d\n", __func__, irq_num);
> +    trace_ppc4xx_pci_set_irq(irq_num);
>      if (irq_num < 0) {
>          fprintf(stderr, "%s: PCI irq %d\n", __func__, irq_num);
>          return;
> diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
> index 6122a12..f04bb1d 100644
> --- a/hw/ppc/trace-events
> +++ b/hw/ppc/trace-events
> @@ -89,3 +89,7 @@ rs6000mc_parity_read(uint32_t addr, uint32_t val) "read addr=%x val=%x"
>  # hw/ppc/mac_newworld.c
>  mac99_uninorth_write(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64
>  mac99_uninorth_read(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64
> +
> +# hw/ppc/ppc4xx_pci.c
> +ppc4xx_pci_map_irq(int32_t devfn, int irq_num, int slot) "devfn %x irq %d -> %d"
> +ppc4xx_pci_set_irq(int irq_num) "PCI irq %d"
>
diff mbox

Patch

diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
index 683218e..dc19682 100644
--- a/hw/ppc/ppc4xx_pci.c
+++ b/hw/ppc/ppc4xx_pci.c
@@ -26,13 +26,7 @@ 
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "exec/address-spaces.h"
-
-#undef DEBUG
-#ifdef DEBUG
-#define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif /* DEBUG */
+#include "trace.h"
 
 struct PCIMasterMap {
     uint32_t la;
@@ -249,8 +243,7 @@  static int ppc4xx_pci_map_irq(PCIDevice *pci_dev, int irq_num)
 {
     int slot = pci_dev->devfn >> 3;
 
-    DPRINTF("%s: devfn %x irq %d -> %d\n", __func__,
-            pci_dev->devfn, irq_num, slot);
+    trace_ppc4xx_pci_map_irq(pci_dev->devfn, irq_num, slot);
 
     return slot - 1;
 }
@@ -259,7 +252,7 @@  static void ppc4xx_pci_set_irq(void *opaque, int irq_num, int level)
 {
     qemu_irq *pci_irqs = opaque;
 
-    DPRINTF("%s: PCI irq %d\n", __func__, irq_num);
+    trace_ppc4xx_pci_set_irq(irq_num);
     if (irq_num < 0) {
         fprintf(stderr, "%s: PCI irq %d\n", __func__, irq_num);
         return;
diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
index 6122a12..f04bb1d 100644
--- a/hw/ppc/trace-events
+++ b/hw/ppc/trace-events
@@ -89,3 +89,7 @@  rs6000mc_parity_read(uint32_t addr, uint32_t val) "read addr=%x val=%x"
 # hw/ppc/mac_newworld.c
 mac99_uninorth_write(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64
 mac99_uninorth_read(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64
+
+# hw/ppc/ppc4xx_pci.c
+ppc4xx_pci_map_irq(int32_t devfn, int irq_num, int slot) "devfn %x irq %d -> %d"
+ppc4xx_pci_set_irq(int irq_num) "PCI irq %d"