aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-05-21 23:46:44 +0200
committerJuan Quintela <quintela@redhat.com>2012-06-29 13:27:28 +0200
commit517a13c91a975987b4c2850c08078bd3cef4dce7 (patch)
tree5c7ce61f610232da3f07ad370fdb4adbfc848b96 /savevm.c
parentd5f8a5701d3690b5ec0c34b6a5c0b5a24d274540 (diff)
downloadqemu-517a13c91a975987b4c2850c08078bd3cef4dce7.zip
qemu-517a13c91a975987b4c2850c08078bd3cef4dce7.tar.gz
qemu-517a13c91a975987b4c2850c08078bd3cef4dce7.tar.bz2
Add tracepoints for savevm section start/end
This allows to know how long each section takes to save. An awk script like this tells us sections that takes more that 10ms $1 ~ /savevm_state_iterate_end/ { /* Print savevm_section_end line when > 10ms duration */ if ($2 > 10000) { printf("%s times_missing=%u\n", $0, times_missing++); } } Signed-off-by: Juan Quintela <quintela@redhat.com> fix ws tracepoints Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index d1d9020..987c6c0 100644
--- a/savevm.c
+++ b/savevm.c
@@ -85,6 +85,7 @@
#include "cpus.h"
#include "memory.h"
#include "qmp-commands.h"
+#include "trace.h"
#define SELF_ANNOUNCE_ROUNDS 5
@@ -1625,11 +1626,14 @@ int qemu_savevm_state_iterate(QEMUFile *f)
if (se->save_live_state == NULL)
continue;
+ trace_savevm_section_start();
/* Section type */
qemu_put_byte(f, QEMU_VM_SECTION_PART);
qemu_put_be32(f, se->section_id);
ret = se->save_live_state(f, QEMU_VM_SECTION_PART, se->opaque);
+ trace_savevm_section_end(se->section_id);
+
if (ret <= 0) {
/* Do not proceed to the next vmstate before this one reported
completion of the current stage. This serializes the migration
@@ -1659,11 +1663,13 @@ int qemu_savevm_state_complete(QEMUFile *f)
if (se->save_live_state == NULL)
continue;
+ trace_savevm_section_start();
/* Section type */
qemu_put_byte(f, QEMU_VM_SECTION_END);
qemu_put_be32(f, se->section_id);
ret = se->save_live_state(f, QEMU_VM_SECTION_END, se->opaque);
+ trace_savevm_section_end(se->section_id);
if (ret < 0) {
return ret;
}
@@ -1675,6 +1681,7 @@ int qemu_savevm_state_complete(QEMUFile *f)
if (se->save_state == NULL && se->vmsd == NULL)
continue;
+ trace_savevm_section_start();
/* Section type */
qemu_put_byte(f, QEMU_VM_SECTION_FULL);
qemu_put_be32(f, se->section_id);
@@ -1688,6 +1695,7 @@ int qemu_savevm_state_complete(QEMUFile *f)
qemu_put_be32(f, se->version_id);
vmstate_save(f, se);
+ trace_savevm_section_end(se->section_id);
}
qemu_put_byte(f, QEMU_VM_EOF);