From patchwork Tue Apr 16 02:44:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mrhines@linux.vnet.ibm.com X-Patchwork-Id: 236822 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 30A242C00F7 for ; Tue, 16 Apr 2013 12:46:04 +1000 (EST) Received: from localhost ([::1]:37229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvuE-0003Tf-Dj for incoming@patchwork.ozlabs.org; Mon, 15 Apr 2013 22:46:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvtQ-0003N1-Q2 for qemu-devel@nongnu.org; Mon, 15 Apr 2013 22:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URvtM-0001Jb-AU for qemu-devel@nongnu.org; Mon, 15 Apr 2013 22:45:12 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:35196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvtM-0001JB-5J for qemu-devel@nongnu.org; Mon, 15 Apr 2013 22:45:08 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Apr 2013 22:45:07 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 15 Apr 2013 22:45:05 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id CEFCE6E804B for ; Mon, 15 Apr 2013 22:45:01 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3G2j4Uj294388 for ; Mon, 15 Apr 2013 22:45:04 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3G2j4Km014926 for ; Mon, 15 Apr 2013 23:45:04 -0300 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3G2j15N014657; Mon, 15 Apr 2013 23:45:04 -0300 From: mrhines@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Mon, 15 Apr 2013 22:44:45 -0400 Message-Id: <1366080286-9288-8-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366080286-9288-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1366080286-9288-1-git-send-email-mrhines@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13041602-5806-0000-0000-000020BE2FAC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.137 Cc: aliguori@us.ibm.com, mst@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PULL 7/8] rdma: print out throughput while debugging 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 From: "Michael R. Hines" It's very helpful when debugging to print out migration throughput after each iteration round to compare the different migration technologies. Signed-off-by: Michael R. Hines --- migration.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 0a428f0..b378313 100644 --- a/migration.c +++ b/migration.c @@ -35,6 +35,9 @@ do { } while (0) #endif +#define MBPS(bytes, time) (time ? ((((double) bytes * 8) \ + / ((double) time / 1000.0)) / 1000.0 / 1000.0) : -1.0) + enum { MIG_STATE_ERROR, MIG_STATE_SETUP, @@ -563,8 +566,9 @@ static void *migration_thread(void *opaque) max_size = bandwidth * migrate_max_downtime() / 1000000; DPRINTF("transferred %" PRIu64 " time_spent %" PRIu64 - " bandwidth %g max_size %" PRId64 "\n", - transferred_bytes, time_spent, bandwidth, max_size); + " bandwidth %g throughput %f max_size %" PRId64 "\n", + transferred_bytes, time_spent, bandwidth, + MBPS(transferred_bytes, time_spent), max_size); /* if we haven't sent anything, we don't want to recalculate 10000 is a small enough number for our purposes */ if (s->dirty_bytes_rate && transferred_bytes > 10000) {