From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQlfP-0004xv-71 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 17:37:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQlfM-0002wz-M0 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 17:37:55 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:54178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQlfM-0002wt-D8 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 17:37:52 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Apr 2013 15:37:51 -0600 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id C107C38C8056 for ; Fri, 12 Apr 2013 17:37:45 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3CLbiV332899104 for ; Fri, 12 Apr 2013 17:37:45 -0400 Received: from d01av05.pok.ibm.com (loopback [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3CLbitq027158 for ; Fri, 12 Apr 2013 17:37:44 -0400 From: mrhines@linux.vnet.ibm.com Date: Fri, 12 Apr 2013 17:37:17 -0400 Message-Id: <1365802638-8478-8-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1365802638-8478-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1365802638-8478-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 7/8] 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, 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 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) { -- 1.7.10.4