From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf7nO-00011l-1h for qemu-devel@nongnu.org; Thu, 14 Jun 2012 07:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sf7nH-00040Q-MR for qemu-devel@nongnu.org; Thu, 14 Jun 2012 07:00:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf7nH-000403-D1 for qemu-devel@nongnu.org; Thu, 14 Jun 2012 07:00:51 -0400 Message-ID: <4FD9C460.30205@redhat.com> Date: Thu, 14 Jun 2012 14:00:48 +0300 From: Orit Wasserman MIME-Version: 1.0 References: <69aa628549030e86fa083ce801d26c3c4e7c9092.1337710679.git.quintela@redhat.com> In-Reply-To: <69aa628549030e86fa083ce801d26c3c4e7c9092.1337710679.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/7] Add tracepoints for savevm section start/end List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: chegu_vinod@hp.com, qemu-devel@nongnu.org On 05/22/2012 09:32 PM, Juan Quintela wrote: > 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 > --- > savevm.c | 8 ++++++++ > trace-events | 6 ++++++ > 2 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/savevm.c b/savevm.c > index 2d18bab..779bd22 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 > > @@ -1624,11 +1625,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 > @@ -1658,11 +1662,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; > } > @@ -1674,6 +1680,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); > @@ -1687,6 +1694,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); > diff --git a/trace-events b/trace-events > index 87cb96c..73d5f81 100644 > --- a/trace-events > +++ b/trace-events > @@ -741,6 +741,11 @@ displaysurface_resize(void *display_state, void *display_surface, int width, int > # vga.c > ppm_save(const char *filename, void *display_surface) "%s surface=%p" > > +# savevm.c > + > +savevm_section_start(void) "" > +savevm_section_end(unsigned int section_id) "section_id %u" > + > # 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" > @@ -805,3 +810,4 @@ qxl_render_blit_guest_primary_initialized(void) "" > qxl_render_blit(int32_t stride, int32_t left, int32_t right, int32_t top, int32_t bottom) "stride=%d [%d, %d, %d, %d]" > qxl_render_guest_primary_resized(int32_t width, int32_t height, int32_t stride, int32_t bytes_pp, int32_t bits_pp) "%dx%d, stride %d, bpp %d, depth %d" > qxl_render_update_area_done(void *cookie) "%p" > + extra ws Reviewed-by: Orit Wasserman