From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL02J-0005Uy-D2 for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL02I-0005Ua-TX for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:19 -0500 Received: from [199.232.76.173] (port=56732 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL02I-0005UV-Qn for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:18 -0500 Received: from mx2.redhat.com ([66.187.237.31]:40395) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LL02I-0007uh-9M for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:18 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n08ItH2k010583 for ; Thu, 8 Jan 2009 13:55:17 -0500 Message-ID: <49664C13.2060905@redhat.com> Date: Thu, 08 Jan 2009 20:55:15 +0200 From: Uri Lublin MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 3/3] info blockstats: show highest_allocated if exists Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin From: Uri Lublin Using bdrv_get_info() to 1. get more interesting stats later 2. print the info only for block formats that support it. Signed-off-by: Uri Lublin --- block.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 82959d6..5305b27 100644 --- a/block.c +++ b/block.c @@ -1124,6 +1124,7 @@ void bdrv_info(void) void bdrv_info_stats (void) { BlockDriverState *bs; + BlockDriverInfo bdi; for (bs = bdrv_first; bs != NULL; bs = bs->next) { term_printf ("%s:" @@ -1131,10 +1132,14 @@ void bdrv_info_stats (void) " wr_bytes=%" PRIu64 " rd_operations=%" PRIu64 " wr_operations=%" PRIu64 - "\n", + , bs->device_name, bs->rd_bytes, bs->wr_bytes, bs->rd_ops, bs->wr_ops); + if (bdrv_get_info(bs, &bdi) == 0) + term_printf(" high=%" PRIu64, + bdi.highest_alloc); + term_printf("\n"); } } -- 1.6.0.6