From patchwork Fri Jun 29 16:43:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 168220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 50A43B6F5A for ; Sat, 30 Jun 2012 03:14:43 +1000 (EST) Received: from localhost ([::1]:56283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkeJU-0006dV-0S for incoming@patchwork.ozlabs.org; Fri, 29 Jun 2012 12:44:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkeIu-0005CF-J3 for qemu-devel@nongnu.org; Fri, 29 Jun 2012 12:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkeIs-00057g-LX for qemu-devel@nongnu.org; Fri, 29 Jun 2012 12:44:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkeIs-00056i-DU for qemu-devel@nongnu.org; Fri, 29 Jun 2012 12:44:18 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5TGiGeJ002775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 29 Jun 2012 12:44:17 -0400 Received: from trasno.mitica (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5TGi4Fm027488; Fri, 29 Jun 2012 12:44:16 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 29 Jun 2012 18:43:58 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 07/13] Add tracepoints for savevm section start/end X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 fix ws tracepoints Signed-off-by: Juan Quintela --- savevm.c | 8 ++++++++ trace-events | 5 +++++ 2 files changed, 13 insertions(+) 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); diff --git a/trace-events b/trace-events index c935ba2..d671118 100644 --- a/trace-events +++ b/trace-events @@ -783,6 +783,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"