From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USbRz-0005qF-Kk for qemu-devel@nongnu.org; Wed, 17 Apr 2013 19:07:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USbRr-0004y9-FG for qemu-devel@nongnu.org; Wed, 17 Apr 2013 19:07:39 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:46724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USbRr-0004xq-9L for qemu-devel@nongnu.org; Wed, 17 Apr 2013 19:07:31 -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 ; Wed, 17 Apr 2013 19:07:31 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id CF3D36E803A for ; Wed, 17 Apr 2013 19:07:26 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3HN7T7R298898 for ; Wed, 17 Apr 2013 19:07:29 -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 r3HN7TE9022227 for ; Wed, 17 Apr 2013 20:07:29 -0300 From: mrhines@linux.vnet.ibm.com Date: Wed, 17 Apr 2013 19:07:19 -0400 Message-Id: <1366240040-10730-11-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1366240040-10730-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1366240040-10730-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [PULL v4 10/11] rdma: print out 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 2f33914..6dac831 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, @@ -564,8 +567,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