Patchwork [13/41] ram: create trace event for migration sync bitmap

login
register
mail settings
Submitter Juan Quintela
Date Oct. 2, 2012, 11:33 a.m.
Message ID <1349177616-5341-14-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/188484/
State New
Headers show

Comments

Juan Quintela - Oct. 2, 2012, 11:33 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch_init.c  | 6 ++++++
 trace-events | 4 ++++
 2 files changed, 10 insertions(+)

Patch

diff --git a/arch_init.c b/arch_init.c
index 3a5fecc..cec3ead 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -45,6 +45,7 @@ 
 #include "hw/pcspk.h"
 #include "qemu/page_cache.h"
 #include "qmp-commands.h"
+#include "trace.h"

 #ifdef DEBUG_ARCH_INIT
 #define DPRINTF(fmt, ...) \
@@ -358,7 +359,12 @@  static inline void migration_bitmap_set_dirty(MemoryRegion *mr, int length)

 static void migration_bitmap_sync(void)
 {
+    uint64_t num_dirty_pages_init = ram_list.dirty_pages;
+
+    trace_migration_bitmap_sync_start();
     memory_global_sync_dirty_bitmap(get_system_memory());
+    trace_migration_bitmap_sync_end(ram_list.dirty_pages
+                                    - num_dirty_pages_init);
 }


diff --git a/trace-events b/trace-events
index f5b5097..818b261 100644
--- a/trace-events
+++ b/trace-events
@@ -917,6 +917,10 @@  ppm_save(const char *filename, void *display_surface) "%s surface=%p"
 savevm_section_start(void) ""
 savevm_section_end(unsigned int section_id) "section_id %u"

+# arch_init.c
+migration_bitmap_sync_start(void) ""
+migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64""
+
 # hw/qxl.c
 disable qxl_interface_set_mm_time(int qid, uint32_t mm_time) "%d %d"
 disable qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_t val) "%d %s addr=%u val=%u"