qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory: Use standard log messages for unassigned memory read / write
@ 2016-09-07 19:13 Stefan Weil
  2016-09-07 20:17 ` no-reply
  2016-09-07 21:29 ` Peter Maydell
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Weil @ 2016-09-07 19:13 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Paolo Bonzini, Stefan Weil

The old log messages are implemented by conditional compilation
and not available by default.

The new log messages can be enabled either by a command line option
(-d unimp) or in the QEMU monitor (log unimp).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

The new code is very useful when implementing new platforms or
looking for problems with existing platforms which are only
partially emulated (I use it for Raspberry Pi).

target-sparc/ldst_helper.c also uses DEBUG_UNASSIGNED
and could get similar code.

Regards,
Stefan


 memory.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/memory.c b/memory.c
index 0eb6895..92f8879 100644
--- a/memory.c
+++ b/memory.c
@@ -23,6 +23,7 @@
 #include "qapi/visitor.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
+#include "qemu/log.h"
 #include "qom/object.h"
 #include "trace.h"
 
@@ -31,8 +32,6 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 
-//#define DEBUG_UNASSIGNED
-
 static unsigned memory_region_transaction_depth;
 static bool memory_region_update_pending;
 static bool ioeventfd_update_pending;
@@ -1101,9 +1100,7 @@ static void memory_region_initfn(Object *obj)
 static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
                                     unsigned size)
 {
-#ifdef DEBUG_UNASSIGNED
-    printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
-#endif
+    qemu_log_mask(LOG_UNIMP, "%s " TARGET_FMT_plx "\n", __func__, addr);
     if (current_cpu != NULL) {
         cpu_unassigned_access(current_cpu, addr, false, false, 0, size);
     }
@@ -1113,9 +1110,8 @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
 static void unassigned_mem_write(void *opaque, hwaddr addr,
                                  uint64_t val, unsigned size)
 {
-#ifdef DEBUG_UNASSIGNED
-    printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);
-#endif
+    qemu_log_mask(LOG_UNIMP, "%s " TARGET_FMT_plx " = 0x%" PRIx64 "\n",
+                  __func__, addr, val);
     if (current_cpu != NULL) {
         cpu_unassigned_access(current_cpu, addr, true, false, 0, size);
     }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-08 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-07 19:13 [Qemu-devel] [PATCH] memory: Use standard log messages for unassigned memory read / write Stefan Weil
2016-09-07 20:17 ` no-reply
2016-09-07 20:50   ` Stefan Weil
2016-09-08  5:06     ` Fam Zheng
2016-09-07 21:29 ` Peter Maydell
2016-09-08  5:43   ` Stefan Weil
2016-09-08  9:37     ` Paolo Bonzini
2016-09-08 17:40       ` Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).