[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 09/33] ppc/spapr: Use qemu_log_mask() for hcall_dprintf
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 09/33] ppc/spapr: Use qemu_log_mask() for hcall_dprintf() |
Date: |
Mon, 21 Sep 2015 11:06:04 +1000 |
From: Thomas Huth <address@hidden>
To see the output of the hcall_dprintf statements, you currently have
to enable the DEBUG_SPAPR_HCALLS macro in include/hw/ppc/spapr.h.
This is ugly because a) not every user who wants to debug guest
problems can or wants to recompile QEMU to be able to see such issues,
and b) since this macro is disabled by default, the code in the
hcall_dprintf() brackets tends to bitrot until somebody temporarily
enables that macro again.
Since the hcall_dprintf statements except one indicate guest
problems, let's always use qemu_log_mask(LOG_GUEST_ERROR, ...) for
this macro instead. One spot indicated an unimplemented host feature,
so this is changed into qemu_log_mask(LOG_UNIMP, ...) instead. Now
it's possible to see all those messages by simply adding the CLI
parameter "-d guest_errors,unimp", without the need to re-compile
the binary.
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_hcall.c | 3 ++-
include/hw/ppc/spapr.h | 11 +++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 652ddf6..71fc9f2 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -971,7 +971,8 @@ target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong
opcode,
}
}
- hcall_dprintf("Unimplemented hcall 0x" TARGET_FMT_lx "\n", opcode);
+ qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x" TARGET_FMT_lx "\n",
+ opcode);
return H_FUNCTION;
}
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 91a61ab..d250967 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -353,15 +353,10 @@ typedef struct sPAPRDeviceTreeUpdateHeader {
uint32_t version_id;
} sPAPRDeviceTreeUpdateHeader;
-/*#define DEBUG_SPAPR_HCALLS*/
-
-#ifdef DEBUG_SPAPR_HCALLS
-#define hcall_dprintf(fmt, ...) \
- do { fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); } while (0)
-#else
#define hcall_dprintf(fmt, ...) \
- do { } while (0)
-#endif
+ do { \
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: " fmt, __func__, ## __VA_ARGS__); \
+ } while (0)
typedef target_ulong (*spapr_hcall_fn)(PowerPCCPU *cpu, sPAPRMachineState *sm,
target_ulong opcode,
--
2.4.3
- [Qemu-ppc] [PULL 00/33] spapr-next queue 2015-09-16, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 01/33] spapr: Provide an error message when migration fails due to htab_shift mismatch, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 05/33] spapr: Make ibm, change-msi respect 3 return values, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 08/33] spapr_drc: Fix potential undefined behaviour, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 07/33] spapr: add dumpdtb support, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 03/33] spapr: Add /ibm,partition-name, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 10/33] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 06/33] spapr: SPLPAR Characteristics, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 09/33] ppc/spapr: Use qemu_log_mask() for hcall_dprintf(),
David Gibson <=
- [Qemu-ppc] [PULL 04/33] spapr: Add /rtas/ibm,change-msix-capable, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 16/33] spapr_pci: fix device tree props for MSI/MSI-X, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 14/33] pseries: Fix incorrect calculation of threads per socket for chip-id, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 02/33] spapr: Create pseries-2.5 machine, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 11/33] sPAPR: Introduce rtas_ldq(), David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 27/33] spapr: Provide better error message when slots exceed max allowed, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 12/33] pseries: define coldplugged devices as "configured", David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 24/33] spapr: Make hash table size a factor of maxram_size, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 21/33] spapr: Use QEMU limit for maximum CPUs number, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 15/33] spapr: Enable in-kernel H_SET_MODE handling, David Gibson, 2015/09/20