All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 14/14] migration: print times for end phase
Date: Fri, 21 Sep 2012 17:13:23 +0200	[thread overview]
Message-ID: <505C8413.5030702@redhat.com> (raw)
In-Reply-To: <1348236500-2565-15-git-send-email-quintela@redhat.com>

Not sure you want these in master. :)

Paolo

Il 21/09/2012 16:08, Juan Quintela ha scritto:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  block.c     |  6 ++++++
>  cpus.c      | 17 +++++++++++++++++
>  migration.c | 10 +++++++++-
>  savevm.c    | 13 +++++++++++++
>  4 files changed, 45 insertions(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index e78039b..d6e7a59 100644
> --- a/block.c
> +++ b/block.c
> @@ -2269,9 +2269,15 @@ int bdrv_get_flags(BlockDriverState *bs)
>  void bdrv_flush_all(void)
>  {
>      BlockDriverState *bs;
> +    int64_t start_time, end_time;
> +
> +    start_time = qemu_get_clock_ms(rt_clock);
> 
>      QTAILQ_FOREACH(bs, &bdrv_states, list) {
>          bdrv_flush(bs);
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time flush device %s: %ld\n", bs->filename,
> +               end_time - start_time);
>      }
>  }
> 
> diff --git a/cpus.c b/cpus.c
> index 1b7061a..0ccc1e0 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -439,14 +439,31 @@ int cpu_is_stopped(CPUArchState *env)
> 
>  static void do_vm_stop(RunState state)
>  {
> +    int64_t start_time, end_time;
> +
>      if (runstate_is_running()) {
> +        start_time = qemu_get_clock_ms(rt_clock);
>          cpu_disable_ticks();
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time cpu_disable_ticks %ld\n", end_time - start_time);
>          pause_all_vcpus();
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time pause_all_vcpus %ld\n", end_time - start_time);
>          runstate_set(state);
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time runstate_set %ld\n", end_time - start_time);
>          vm_state_notify(0, state);
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time vmstate_notify %ld\n", end_time - start_time);
>          bdrv_drain_all();
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time bdrv_drain_all %ld\n", end_time - start_time);
>          bdrv_flush_all();
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time bdrv_flush_all %ld\n", end_time - start_time);
>          monitor_protocol_event(QEVENT_STOP, NULL);
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("time monitor_protocol_event %ld\n", end_time - start_time);
>      }
>  }
> 
> diff --git a/migration.c b/migration.c
> index 8054a77..9c62614 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -340,18 +340,24 @@ bool migrate_fd_put_ready(MigrationState *s, uint64_t max_size)
>          DPRINTF("done iterating\n");
>          start_time = qemu_get_clock_ms(rt_clock);
>          qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER);
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("wakeup_request %ld\n", end_time - start_time);
>          if (old_vm_running) {
>              vm_stop(RUN_STATE_FINISH_MIGRATE);
>          } else {
>              vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
>          }
> -
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("vm_stop 2 %ld\n", end_time - start_time);
>          if (qemu_savevm_state_complete(s->file) < 0) {
>              migrate_fd_error(s);
>          } else {
> +            end_time = qemu_get_clock_ms(rt_clock);
> +            printf("complete without error 3a %ld\n", end_time - start_time);
>              migrate_fd_completed(s);
>          }
>          end_time = qemu_get_clock_ms(rt_clock);
> +        printf("completed %ld\n", end_time - start_time);
>          s->total_time = end_time - s->total_time;
>          s->downtime = end_time - start_time;
>          if (s->state != MIG_STATE_COMPLETED) {
> @@ -359,6 +365,8 @@ bool migrate_fd_put_ready(MigrationState *s, uint64_t max_size)
>                  vm_start();
>              }
>          }
> +        end_time = qemu_get_clock_ms(rt_clock);
> +        printf("end completed stage %ld\n", end_time - start_time);
>          last_round = true;
>      }
>      qemu_mutex_unlock_iothread();
> diff --git a/savevm.c b/savevm.c
> index bdc70c2..ba399f1 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1629,9 +1629,14 @@ int qemu_savevm_state_complete(QEMUFile *f)
>  {
>      SaveStateEntry *se;
>      int ret;
> +    int64_t t1;
> +    int64_t t0 = qemu_get_clock_ms(rt_clock);
> 
>      cpu_synchronize_all_states();
> +    t1 = qemu_get_clock_ms(rt_clock);
> +    printf("synchronize_all_states %ld\n", t1 - t0);
> 
> +    t0 = t1;
>      QTAILQ_FOREACH(se, &savevm_handlers, entry) {
>          if (!se->ops || !se->ops->save_live_complete) {
>              continue;
> @@ -1652,6 +1657,11 @@ int qemu_savevm_state_complete(QEMUFile *f)
>              return ret;
>          }
>      }
> +    t1 = qemu_get_clock_ms(rt_clock);
> +
> +    printf("migrate RAM %ld\n", t1 - t0);
> +
> +    t0 = t1;
> 
>      QTAILQ_FOREACH(se, &savevm_handlers, entry) {
>          int len;
> @@ -1676,6 +1686,9 @@ int qemu_savevm_state_complete(QEMUFile *f)
>          trace_savevm_section_end(se->section_id);
>      }
> 
> +    t1 = qemu_get_clock_ms(rt_clock);
> +
> +    printf("migrate rest devices %ld\n", t1 - t0);
>      qemu_put_byte(f, QEMU_VM_EOF);
> 
>      return qemu_file_get_error(f);
> 

  reply	other threads:[~2012-09-21 15:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 14:08 [Qemu-devel] [RFC 00/14] Migration thread Juan Quintela
2012-09-21 14:08 ` [Qemu-devel] [PATCH 01/14] split MRU ram list Juan Quintela
2012-09-21 14:38   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 02/14] add a version number to ram_list Juan Quintela
2012-09-21 14:42   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 03/14] protect the ramlist with a separate mutex Juan Quintela
2012-09-21 14:44   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 04/14] buffered_file: Move from using a timer to use a thread Juan Quintela
2012-09-21 15:29   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 05/14] migration: make qemu_fopen_ops_buffered() return void Juan Quintela
2012-09-21 14:57   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 06/14] migration: stop all cpus correctly Juan Quintela
2012-09-21 15:20   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 07/14] migration: make writes blocking Juan Quintela
2012-09-21 15:31   ` Paolo Bonzini
2012-12-14 12:40     ` Juan Quintela
2012-09-21 14:08 ` [Qemu-devel] [PATCH 08/14] migration: remove unfreeze logic Juan Quintela
2012-09-21 14:58   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 09/14] migration: take finer locking Juan Quintela
2012-09-21 15:33   ` Paolo Bonzini
2012-12-14 12:44     ` Juan Quintela
2012-09-21 14:08 ` [Qemu-devel] [PATCH 10/14] buffered_file: Unfold the trick to restart generating migration data Juan Quintela
2012-09-21 15:00   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 11/14] buffered_file: don't flush on put buffer Juan Quintela
2012-09-21 15:34   ` Paolo Bonzini
2012-09-21 21:12     ` Eric Blake
2012-09-21 14:08 ` [Qemu-devel] [PATCH 12/14] buffered_file: unfold buffered_append in buffered_put_buffer Juan Quintela
2012-09-21 17:07   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 13/14] savevm: New save live migration method: pending Juan Quintela
2012-09-21 15:11   ` Paolo Bonzini
2012-09-21 14:08 ` [Qemu-devel] [PATCH 14/14] migration: print times for end phase Juan Quintela
2012-09-21 15:13   ` Paolo Bonzini [this message]
2012-09-21 15:27     ` Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505C8413.5030702@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.