diff mbox

[2/2] migration: Extra tracing

Message ID 20170426183721.7482-3-dgilbert@redhat.com
State New
Headers show

Commit Message

Dr. David Alan Gilbert April 26, 2017, 6:37 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

A couple more traces that would have made fixing that postcopy
bug a bit easier.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/ram.c        | 2 ++
 migration/trace-events | 2 ++
 2 files changed, 4 insertions(+)

Comments

Christian Borntraeger April 26, 2017, 6:48 p.m. UTC | #1
On 04/26/2017 08:37 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> A couple more traces that would have made fixing that postcopy
> bug a bit easier.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>

> ---
>  migration/ram.c        | 2 ++
>  migration/trace-events | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index b4ed41c725..3ac41ccaba 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -812,6 +812,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
>      ram_addr_t offset = pss->page << TARGET_PAGE_BITS;
> 
>      p = block->host + offset;
> +    trace_ram_save_page(block->idstr, (uint64_t)offset, p);
> 
>      /* In doubt sent page as normal */
>      bytes_xmit = 0;
> @@ -2614,6 +2615,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
>                  ret = -EINVAL;
>                  break;
>              }
> +            trace_ram_load_loop(block->idstr, (uint64_t)addr, flags, host);
>          }
> 
>          switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
> diff --git a/migration/trace-events b/migration/trace-events
> index b8f01a218c..5b8ccf301c 100644
> --- a/migration/trace-events
> +++ b/migration/trace-events
> @@ -69,8 +69,10 @@ migration_bitmap_sync_start(void) ""
>  migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64
>  migration_throttle(void) ""
>  ram_discard_range(const char *rbname, uint64_t start, size_t len) "%s: start: %" PRIx64 " %zx"
> +ram_load_loop(const char *rbname, uint64_t addr, int flags, void *host) "%s: addr: %" PRIx64 " flags: %x host: %p"
>  ram_load_postcopy_loop(uint64_t addr, int flags) "@%" PRIx64 " %x"
>  ram_postcopy_send_discard_bitmap(void) ""
> +ram_save_page(const char *rbname, uint64_t offset, void *host) "%s: offset: %" PRIx64 " host: %p"
>  ram_save_queue_pages(const char *rbname, size_t start, size_t len) "%s: start: %zx len: %zx"
> 
>  # migration/migration.c
>
Philippe Mathieu-Daudé May 2, 2017, 1:17 p.m. UTC | #2
On 04/26/2017 03:37 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> A couple more traces that would have made fixing that postcopy
> bug a bit easier.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  migration/ram.c        | 2 ++
>  migration/trace-events | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index b4ed41c725..3ac41ccaba 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -812,6 +812,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
>      ram_addr_t offset = pss->page << TARGET_PAGE_BITS;
>
>      p = block->host + offset;
> +    trace_ram_save_page(block->idstr, (uint64_t)offset, p);
>
>      /* In doubt sent page as normal */
>      bytes_xmit = 0;
> @@ -2614,6 +2615,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
>                  ret = -EINVAL;
>                  break;
>              }
> +            trace_ram_load_loop(block->idstr, (uint64_t)addr, flags, host);
>          }
>
>          switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
> diff --git a/migration/trace-events b/migration/trace-events
> index b8f01a218c..5b8ccf301c 100644
> --- a/migration/trace-events
> +++ b/migration/trace-events
> @@ -69,8 +69,10 @@ migration_bitmap_sync_start(void) ""
>  migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64
>  migration_throttle(void) ""
>  ram_discard_range(const char *rbname, uint64_t start, size_t len) "%s: start: %" PRIx64 " %zx"
> +ram_load_loop(const char *rbname, uint64_t addr, int flags, void *host) "%s: addr: %" PRIx64 " flags: %x host: %p"
>  ram_load_postcopy_loop(uint64_t addr, int flags) "@%" PRIx64 " %x"
>  ram_postcopy_send_discard_bitmap(void) ""
> +ram_save_page(const char *rbname, uint64_t offset, void *host) "%s: offset: %" PRIx64 " host: %p"
>  ram_save_queue_pages(const char *rbname, size_t start, size_t len) "%s: start: %zx len: %zx"
>
>  # migration/migration.c
>
Juan Quintela May 4, 2017, 8:40 a.m. UTC | #3
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> A couple more traces that would have made fixing that postcopy
> bug a bit easier.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Pulled.
diff mbox

Patch

diff --git a/migration/ram.c b/migration/ram.c
index b4ed41c725..3ac41ccaba 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -812,6 +812,7 @@  static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
     ram_addr_t offset = pss->page << TARGET_PAGE_BITS;
 
     p = block->host + offset;
+    trace_ram_save_page(block->idstr, (uint64_t)offset, p);
 
     /* In doubt sent page as normal */
     bytes_xmit = 0;
@@ -2614,6 +2615,7 @@  static int ram_load(QEMUFile *f, void *opaque, int version_id)
                 ret = -EINVAL;
                 break;
             }
+            trace_ram_load_loop(block->idstr, (uint64_t)addr, flags, host);
         }
 
         switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
diff --git a/migration/trace-events b/migration/trace-events
index b8f01a218c..5b8ccf301c 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -69,8 +69,10 @@  migration_bitmap_sync_start(void) ""
 migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64
 migration_throttle(void) ""
 ram_discard_range(const char *rbname, uint64_t start, size_t len) "%s: start: %" PRIx64 " %zx"
+ram_load_loop(const char *rbname, uint64_t addr, int flags, void *host) "%s: addr: %" PRIx64 " flags: %x host: %p"
 ram_load_postcopy_loop(uint64_t addr, int flags) "@%" PRIx64 " %x"
 ram_postcopy_send_discard_bitmap(void) ""
+ram_save_page(const char *rbname, uint64_t offset, void *host) "%s: offset: %" PRIx64 " host: %p"
 ram_save_queue_pages(const char *rbname, size_t start, size_t len) "%s: start: %zx len: %zx"
 
 # migration/migration.c