[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/10] Add spent time to migration
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 01/10] Add spent time to migration |
Date: |
Wed, 24 Nov 2010 00:02:58 +0100 |
From: Juan Quintela <address@hidden>
When printing debug information for migration, print total time spent.
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/migration.c b/migration.c
index 9ee8b17..4786406 100644
--- a/migration.c
+++ b/migration.c
@@ -26,9 +26,16 @@
#ifdef DEBUG_MIGRATION
#define DPRINTF(fmt, ...) \
do { printf("migration: " fmt, ## __VA_ARGS__); } while (0)
+static int64_t start, stop;
+#define START_MIGRATION_CLOCK() do { start = qemu_get_clock(rt_clock);
} while (0)
+#define STOP_MIGRATION_CLOCK() \
+ do { stop = qemu_get_clock(rt_clock) - start; \
+ } while (0)
#else
#define DPRINTF(fmt, ...) \
do { } while (0)
+#define START_MIGRATION_CLOCK() do {} while (0)
+#define STOP_MIGRATION_CLOCK() do {} while (0)
#endif
/* Migration speed throttling */
@@ -88,6 +95,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject
**ret_data)
return -1;
}
+ START_MIGRATION_CLOCK();
if (strstart(uri, "tcp:", &p)) {
s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
blk, inc);
@@ -127,6 +135,8 @@ int do_migrate_cancel(Monitor *mon, const QDict *qdict,
QObject **ret_data)
if (s)
s->cancel(s);
+ STOP_MIGRATION_CLOCK();
+ DPRINTF("canceled after %lu milliseconds\n", stop);
return 0;
}
@@ -378,6 +388,9 @@ void migrate_fd_put_ready(void *opaque)
} else {
state = MIG_STATE_COMPLETED;
}
+ STOP_MIGRATION_CLOCK();
+ DPRINTF("ended after %lu milliseconds\n", stop);
+
if (migrate_fd_cleanup(s) < 0) {
if (old_vm_running) {
vm_start();
--
1.7.3.2
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, (continued)
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Michael S. Tsirkin, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Juan Quintela, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Anthony Liguori, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Juan Quintela, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Anthony Liguori, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Juan Quintela, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Anthony Liguori, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Juan Quintela, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Michael S. Tsirkin, 2010/11/30
- [Qemu-devel] Re: [PATCH 02/10] Add buffered_file_internal constant, Anthony Liguori, 2010/11/30
[Qemu-devel] [PATCH 01/10] Add spent time to migration,
Juan Quintela <=
[Qemu-devel] [PATCH 04/10] No need to iterate if we already are over the limit, Juan Quintela, 2010/11/23
[Qemu-devel] [PATCH 05/10] KVM don't care about TLB handling, Juan Quintela, 2010/11/23
[Qemu-devel] [PATCH 03/10] Add printf debug to savevm, Juan Quintela, 2010/11/23
[Qemu-devel] [PATCH 06/10] Only calculate expected_time for stage 2, Juan Quintela, 2010/11/23
[Qemu-devel] [PATCH 07/10] ram_save_remaining() returns an uint64_t, Juan Quintela, 2010/11/23
- Message not available
- Message not available
[Qemu-devel] [PATCH 08/10] Count nanoseconds with uint64_t not doubles, Juan Quintela, 2010/11/23