From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJrh-0000bn-OQ for qemu-devel@nongnu.org; Wed, 17 Apr 2013 00:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USJrX-0001wm-96 for qemu-devel@nongnu.org; Wed, 17 Apr 2013 00:21:01 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:54673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJrW-0001wb-S9 for qemu-devel@nongnu.org; Wed, 17 Apr 2013 00:20:50 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Apr 2013 00:20:50 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 09CEDC9001D for ; Wed, 17 Apr 2013 00:20:47 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3H4KlVL33030180 for ; Wed, 17 Apr 2013 00:20:47 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3H4KjS6003629 for ; Wed, 17 Apr 2013 00:20:46 -0400 From: mrhines@linux.vnet.ibm.com Date: Wed, 17 Apr 2013 00:20:17 -0400 Message-Id: <1366172418-8729-7-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1366172418-8729-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1366172418-8729-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [PULL v3 6/7] rdma: print throughput while debugging List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com, quintela@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com 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 0ee36a0..db9fa48 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) { -- 1.7.10.4