[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 05/47] improve DPRINTF macros, add to savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v4 05/47] improve DPRINTF macros, add to savevm |
Date: |
Fri, 3 Oct 2014 18:47:11 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Improve the existing DPRINTF macros in migration.c and arch_init
by:
1) Making them go to stderr rather than stdout (so you can run with
-nographic and redirect your debug to a file)
2) Making them print the ms time with each debug - useful for
debugging latency issues
Add the same macro to savevm
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
arch_init.c | 5 ++++-
migration.c | 12 ++++++++++++
savevm.c | 10 ++++++++++
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/arch_init.c b/arch_init.c
index c974f3f..772de36 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -53,9 +53,12 @@
#include "hw/acpi/acpi.h"
#include "qemu/host-utils.h"
+// #define DEBUG_ARCH_INIT
#ifdef DEBUG_ARCH_INIT
#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "arch_init: " fmt, ## __VA_ARGS__); } while (0)
+ do { fprintf(stderr, "address@hidden" PRId64 " " fmt "\n", \
+ qemu_clock_get_ms(QEMU_CLOCK_REALTIME), \
+ ## __VA_ARGS__); } while (0)
#else
#define DPRINTF(fmt, ...) \
do { } while (0)
diff --git a/migration.c b/migration.c
index 8d675b3..e241370 100644
--- a/migration.c
+++ b/migration.c
@@ -26,6 +26,18 @@
#include "qmp-commands.h"
#include "trace.h"
+//#define DEBUG_MIGRATION
+
+#ifdef DEBUG_MIGRATION
+#define DPRINTF(fmt, ...) \
+ do { fprintf(stderr, "address@hidden" PRId64 " " fmt "\n", \
+ qemu_clock_get_ms(QEMU_CLOCK_REALTIME), \
+ ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...) \
+ do { } while (0)
+#endif
+
enum {
MIG_STATE_ERROR = -1,
MIG_STATE_NONE,
diff --git a/savevm.c b/savevm.c
index e19ae0a..c3a1f68 100644
--- a/savevm.c
+++ b/savevm.c
@@ -43,6 +43,16 @@
#include "block/snapshot.h"
#include "block/qapi.h"
+#ifdef DEBUG_SAVEVM
+#define DPRINTF(fmt, ...) \
+ do { fprintf(stderr, "address@hidden" PRId64 " " fmt "\n", \
+ qemu_clock_get_ms(QEMU_CLOCK_REALTIME), \
+ ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...) \
+ do { } while (0)
+#endif
+
#ifndef ETH_P_RARP
#define ETH_P_RARP 0x8035
--
1.9.3
- [Qemu-devel] [PATCH v4 00/47] Postcopy implementation, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 01/47] QEMUSizedBuffer based QEMUFile, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 02/47] Tests: QEMUSizedBuffer/QEMUBuffer, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 03/47] Start documenting how postcopy works., Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 05/47] improve DPRINTF macros, add to savevm,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v4 04/47] qemu_ram_foreach_block: pass up error value, and down the ramblock name, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 06/47] Add qemu_get_counted_string to read a string prefixed by a count byte, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 07/47] Create MigrationIncomingState, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 08/47] socket shutdown, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 09/47] Provide runtime Target page information, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 10/47] Return path: Open a return path on QEMUFile for sockets, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 12/47] Handle bi-directional communication for fd migration, Dr. David Alan Gilbert (git), 2014/10/03