All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Laurent Vivier <lvivier@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 18/44] spapr_rtas: convert to trace framework instead of DPRINTF
Date: Thu, 22 Sep 2016 16:37:16 +1000	[thread overview]
Message-ID: <1474526262-27011-19-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1474526262-27011-1-git-send-email-david@gibson.dropbear.id.au>

From: Laurent Vivier <lvivier@redhat.com>

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_rtas.c | 30 ++++++++----------------------
 hw/ppc/trace-events |  8 ++++++++
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index b80c1db..add910c 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -45,16 +45,7 @@
 #include <libfdt.h>
 #include "hw/ppc/spapr_drc.h"
 #include "qemu/cutils.h"
-
-/* #define DEBUG_SPAPR */
-
-#ifdef DEBUG_SPAPR
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
-#endif
+#include "trace.h"
 
 static sPAPRConfigureConnectorState *spapr_ccs_find(sPAPRMachineState *spapr,
                                                     uint32_t drc_index)
@@ -436,8 +427,7 @@ static void rtas_set_indicator(PowerPCCPU *cpu, sPAPRMachineState *spapr,
     /* if this is a DR sensor we can assume sensor_index == drc_index */
     drc = spapr_dr_connector_by_index(sensor_index);
     if (!drc) {
-        DPRINTF("rtas_set_indicator: invalid sensor/DRC index: %xh\n",
-                sensor_index);
+        trace_spapr_rtas_set_indicator_invalid(sensor_index);
         ret = RTAS_OUT_PARAM_ERROR;
         goto out;
     }
@@ -476,8 +466,7 @@ out:
 
 out_unimplemented:
     /* currently only DR-related sensors are implemented */
-    DPRINTF("rtas_set_indicator: sensor/indicator not implemented: %d\n",
-            sensor_type);
+    trace_spapr_rtas_set_indicator_not_supported(sensor_index, sensor_type);
     rtas_st(rets, 0, RTAS_OUT_NOT_SUPPORTED);
 }
 
@@ -503,16 +492,15 @@ static void rtas_get_sensor_state(PowerPCCPU *cpu, sPAPRMachineState *spapr,
 
     if (sensor_type != RTAS_SENSOR_TYPE_ENTITY_SENSE) {
         /* currently only DR-related sensors are implemented */
-        DPRINTF("rtas_get_sensor_state: sensor/indicator not implemented: %d\n",
-                sensor_type);
+        trace_spapr_rtas_get_sensor_state_not_supported(sensor_index,
+                                                        sensor_type);
         ret = RTAS_OUT_NOT_SUPPORTED;
         goto out;
     }
 
     drc = spapr_dr_connector_by_index(sensor_index);
     if (!drc) {
-        DPRINTF("rtas_get_sensor_state: invalid sensor/DRC index: %xh\n",
-                sensor_index);
+        trace_spapr_rtas_get_sensor_state_invalid(sensor_index);
         ret = RTAS_OUT_PARAM_ERROR;
         goto out;
     }
@@ -569,8 +557,7 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
     drc_index = rtas_ld(wa_addr, 0);
     drc = spapr_dr_connector_by_index(drc_index);
     if (!drc) {
-        DPRINTF("rtas_ibm_configure_connector: invalid DRC index: %xh\n",
-                drc_index);
+        trace_spapr_rtas_ibm_configure_connector_invalid(drc_index);
         rc = RTAS_OUT_PARAM_ERROR;
         goto out;
     }
@@ -578,8 +565,7 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
     drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
     fdt = drck->get_fdt(drc, NULL);
     if (!fdt) {
-        DPRINTF("rtas_ibm_configure_connector: Missing FDT for DRC index: %xh\n",
-                drc_index);
+        trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index);
         rc = SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE;
         goto out;
     }
diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
index 59caffd..34b5ec3 100644
--- a/hw/ppc/trace-events
+++ b/hw/ppc/trace-events
@@ -56,6 +56,14 @@ spapr_drc_realize_child(uint32_t index, char *childname) "drc: 0x%"PRIx32", chil
 spapr_drc_realize_complete(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_unrealize(uint32_t index) "drc: 0x%"PRIx32
 
+# hw/ppc/spapr_rtas.c
+spapr_rtas_set_indicator_invalid(uint32_t index) "sensor index: 0x%"PRIx32
+spapr_rtas_set_indicator_not_supported(uint32_t index, uint32_t type) "sensor index: 0x%"PRIx32", type: %"PRIu32
+spapr_rtas_get_sensor_state_not_supported(uint32_t index, uint32_t type) "sensor index: 0x%"PRIx32", type: %"PRIu32
+spapr_rtas_get_sensor_state_invalid(uint32_t index) "sensor index: 0x%"PRIx32
+spapr_rtas_ibm_configure_connector_invalid(uint32_t index) "DRC index: 0x%"PRIx32
+spapr_rtas_ibm_configure_connector_missing_fdt(uint32_t index) "DRC index: 0x%"PRIx32
+
 # 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)"
 
-- 
2.7.4

  parent reply	other threads:[~2016-09-22  6:38 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22  6:36 [Qemu-devel] [PULL 00/44] ppc-for-2.8 queue 20160922 David Gibson
2016-09-22  6:36 ` [Qemu-devel] [PULL 01/44] MAINTAINERS: Add some missing ppc-related files David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 02/44] ppc: restrict the use of the rfi instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 03/44] target-ppc: add vector insert instructions David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 04/44] target-ppc: add vector extract instructions David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 05/44] target-ppc: add vector count trailing zeros instructions David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 06/44] target-ppc: add vector bit permute doubleword instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 07/44] target-ppc: add vector permute right indexed instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 08/44] ppc: Fix signal delivery in ppc-user and ppc64-user David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 09/44] qtest: replace strtoXX() by qemu_strtoXX() David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 10/44] libqos: define SPAPR libqos functions David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 11/44] tests: add RTAS command in the protocol David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 12/44] MAINTAINERS: add sPAPR tests David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 13/44] adb-keys.h: initial commit David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 14/44] adb.c: add support for QKeyCode David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 15/44] adb.c: correct several key assignments David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 16/44] adb.c: prevent NO_KEY value from going to guest David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 17/44] spapr_drc: convert to trace framework instead of DPRINTF David Gibson
2016-09-22  6:37 ` David Gibson [this message]
2016-09-22  6:37 ` [Qemu-devel] [PULL 19/44] spapr_vio: " David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 20/44] spapr_llan: " David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 21/44] spapr_vscsi: " David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 22/44] target-ppc: consolidate load operations David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 23/44] target-ppc: convert ld64 to use new macro David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 24/44] target-ppc: convert ld[16, 32, 64]ur " David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 25/44] target-ppc: consolidate store operations David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 26/44] target-ppc: convert st64 to use new macro David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 27/44] target-ppc: convert st[16, 32, 64]r " David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 28/44] target-ppc: consolidate load with reservation David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 29/44] target-ppc: move out stqcx impementation David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 30/44] target-ppc: consolidate store conditional David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 31/44] target-ppc: add xxspltib instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 32/44] target-ppc: add lxsi[bw]zx instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 33/44] target-ppc: add stxsi[bh]x instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 34/44] target-ppc: implement darn instruction David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 35/44] spapr: Introduce sPAPRCPUCoreClass David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 36/44] target-ppc: add TLB_NEED_LOCAL_FLUSH flag David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 37/44] target-ppc: add flag in check_tlb_flush() David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 38/44] target-ppc: tlbie/tlbivax should have global effect David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 39/44] Enable H_CLEAR_MOD and H_CLEAR_REF hypercalls on KVM/PPC64 David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 40/44] ppc/xics: account correct irq status David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 41/44] ppc/xics: An ICS with offset 0 is assumed to be uninitialized David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 42/44] ppc/kvm: Mark 64kB page size support as disabled if not available David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 43/44] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP David Gibson
2016-09-22  6:37 ` [Qemu-devel] [PULL 44/44] monitor: fix crash for platforms without a CPU 0 David Gibson
2016-09-22  7:54 ` [Qemu-devel] [PULL 00/44] ppc-for-2.8 queue 20160922 no-reply
2016-09-22 14:03 ` Peter Maydell
2016-09-22 17:38   ` [Qemu-devel] [Qemu-ppc] " Nikunj A Dadhania
2016-09-22 19:12     ` Nikunj A Dadhania
2016-09-22 19:41     ` Richard Henderson
2016-09-23  2:40   ` [Qemu-devel] " David Gibson
2016-09-23  7:42     ` Alex Bennée
2016-09-24  1:19       ` David Gibson
2016-09-24 14:31         ` Alex Bennée
2016-09-25 10:59           ` David Gibson
2016-09-26  9:04           ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2016-09-26 23:11             ` Alex Bennée

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=1474526262-27011-19-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=lvivier@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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.