From patchwork Thu May 30 10:00:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 247519 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 30E532C007B for ; Thu, 30 May 2013 20:04:29 +1000 (EST) Received: from localhost ([::1]:43533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhzid-0000zF-5V for incoming@patchwork.ozlabs.org; Thu, 30 May 2013 06:04:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhzfX-0004TD-KW for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhzfT-0007bg-0M for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:15 -0400 Received: from mail-gg0-x22a.google.com ([2607:f8b0:4002:c02::22a]:52066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhzfS-0007ba-TY for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:10 -0400 Received: by mail-gg0-f170.google.com with SMTP id s5so5454ggc.1 for ; Thu, 30 May 2013 03:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ux55YWbRLLv58XtQG8JP7Vb5OQJmv4SHGHlnC9UK/Ys=; b=vzA6oRBSDCp3n3UHicYyGbWphKF2vkFwja/2XIE8VX4XAvI1sPfl0KDkMgWTeVwzy1 QkhGk3RWvEe4u4WNg7BnqUEWtmPXWEdxcMG4D50q+zSoAlZlIMptUatJoPhmerU/Z2Pi TKvbpSrJUfqkz0UPO/ClFpCfLokaXrovo+okuEZXneJPZ9Rz/x1Iz/+w5/vEiiazycgv yjYQydGfYb3L4UBzi9Fwf/JHC30m3zEZ5hKO4PDmRTHUunA8jRT6tJa1NqxFb7HEsWE8 WSBUo1/vDWjG6K64f51Gqaimr1AyZGpltMdbngXp8mi/Yf9X1mj3kYZ6xopPci6DT+Rm 4gLA== X-Received: by 10.236.169.132 with SMTP id n4mr3092059yhl.173.1369908070457; Thu, 30 May 2013 03:01:10 -0700 (PDT) Received: from 11.wdongxu.kvm58 ([202.108.130.153]) by mx.google.com with ESMTPSA id j64sm58764867yhj.25.2013.05.30.03.01.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 30 May 2013 03:01:09 -0700 (PDT) From: Dongxu Wang To: qemu-devel@nongnu.org Date: Thu, 30 May 2013 18:00:23 +0800 Message-Id: <1369908025-9556-7-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1369908025-9556-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1369908025-9556-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c02::22a Cc: kwolf@redhat.com, Dong Xu Wang , wdongxu@cn.ibm.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH V19 6/8] add debug event for add-cow 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: Dong Xu Wang Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- block/blkdebug.c | 3 +++ block/block-cache.c | 4 ++-- include/block/block.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 71f99e4..2bd6a53 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -182,6 +182,9 @@ static const char *event_names[BLKDBG_EVENT_MAX] = { [BLKDBG_CLUSTER_ALLOC] = "cluster_alloc", [BLKDBG_CLUSTER_ALLOC_BYTES] = "cluster_alloc_bytes", [BLKDBG_CLUSTER_FREE] = "cluster_free", + + [BLKDBG_ADDCOW_READ] = "add_cow_read", + [BLKDBG_ADDCOW_WRITE] = "add_cow_write", }; static int get_event_by_name(const char *name, BlkDebugEvent *event) diff --git a/block/block-cache.c b/block/block-cache.c index f5d75d1..454269c 100644 --- a/block/block-cache.c +++ b/block/block-cache.c @@ -125,7 +125,7 @@ static int block_cache_entry_flush(BlockDriverState *bs, BlockCache *c, int i) } else if (c->table_type == BLOCK_TABLE_L2) { BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE); } else if (c->table_type == BLOCK_TABLE_BITMAP) { - BLKDBG_EVENT(bs->file, BLKDBG_COW_WRITE); + BLKDBG_EVENT(bs->file, BLKDBG_ADDCOW_WRITE); } ret = bdrv_pwrite(bs->file, c->entries[i].offset, @@ -260,7 +260,7 @@ static int block_cache_do_get(BlockDriverState *bs, BlockCache *c, if (c->table_type == BLOCK_TABLE_L2) { BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD); } else if (c->table_type == BLOCK_TABLE_BITMAP) { - BLKDBG_EVENT(bs->file, BLKDBG_COW_READ); + BLKDBG_EVENT(bs->file, BLKDBG_ADDCOW_READ); } ret = bdrv_pread(bs->file, offset, c->entries[i].table, diff --git a/include/block/block.h b/include/block/block.h index 2989da6..3573e3e 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -451,6 +451,9 @@ typedef enum { BLKDBG_CLUSTER_ALLOC_BYTES, BLKDBG_CLUSTER_FREE, + BLKDBG_ADDCOW_READ, + BLKDBG_ADDCOW_WRITE, + BLKDBG_EVENT_MAX, } BlkDebugEvent;