Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6516175rdb; Tue, 2 Jan 2024 04:52:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5MUx0Vm3f33kO5u3dShJ5bLuvfM9timYWJ2p5P8Ig9glLnDUiCrgSGuBYvgrdpQ+m6YlF X-Received: by 2002:a50:a6d3:0:b0:553:5978:dac5 with SMTP id f19-20020a50a6d3000000b005535978dac5mr10595192edc.67.1704199930035; Tue, 02 Jan 2024 04:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704199930; cv=none; d=google.com; s=arc-20160816; b=y24GBX4AVMft1/hWgY/XQIzesWTMqQb7qyakm2RHSwtrvq+zKNfsKcQzbnGL4EEEa1 K0b5vdzmiCOjg+TEC9XS+T4DTNleD6jeNq/ck65nuYFHqzR3uVkyUNGE408G8nO3A1VR x3tFaxx6vPWIc89SUGJxU/zKhM00Xln3IZItZmACy5Q3z679hLRtOJ7Kp5dmRv+Qf+NJ Pq//Um+bPKQQ/144gqSHBIE6b9BHAvCPDSI460uVpncj2ZVrLWAtxuPYCFFNXzeuauV4 oL/QPftPFXH0u8jSotO6+ZEvmPxxgWEptTUNww64TkM3BTYhPRNQETR6Qn8ytewWMvPL mYZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=V0qs2sfGjb3HJcRyZ237DDz9BizXbFM9H23xF3VpHM8=; fh=yWWoL3IRufgA/+2kSpO6uyfw9eN3ZOO7zvul0qbDPkA=; b=ymISznEleLyiSF/hHk0JcEpnRntwXDQZ4P8qLIBKZZJv+EYStVBpgp+JCsyq9Cbajq F7jDr6S19IyhVsHuAMNL3/eyJPxb4+SWctwDTzefNEfXuRnTp1SX63CtW5rObigcVJZX YGuwc+xvpLuuEM6nQ/xRpMjviCvQy31bOylpRvofLm4f948B6HwzWyATeWAgUWihazuP Yg/gT/ye2G+w83GEeBglfTdxcACjFs0q2RDed59wZ3ArV3qmmQEtvJTe0iUMIB8Ivyhd uz0i3zu4P3h3+ZfxE78Lj/Td+s1UBo5/gnm4nccNw88KfcR+mBVaZMI4Z6XqDBF5n03b yEWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-602-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f18-20020a0564021e9200b0055418b1f9d3si11326995edf.514.2024.01.02.04.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 04:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-602-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 175A61F237AF for ; Tue, 2 Jan 2024 12:43:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5B0C12E5D; Tue, 2 Jan 2024 12:42:14 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07A57111A5; Tue, 2 Jan 2024 12:42:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4T4CD0068yz4f3lXQ; Tue, 2 Jan 2024 20:42:08 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id B3B2E1A07DF; Tue, 2 Jan 2024 20:42:09 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgBnwUGUBJRl+EvDFQ--.31823S12; Tue, 02 Jan 2024 20:42:09 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, ritesh.list@gmail.com, hch@infradead.org, djwong@kernel.org, willy@infradead.org, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com, wangkefeng.wang@huawei.com Subject: [RFC PATCH v2 08/25] iomap: add pos and dirty_len into trace_iomap_writepage_map Date: Tue, 2 Jan 2024 20:39:01 +0800 Message-Id: <20240102123918.799062-9-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240102123918.799062-1-yi.zhang@huaweicloud.com> References: <20240102123918.799062-1-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:gCh0CgBnwUGUBJRl+EvDFQ--.31823S12 X-Coremail-Antispam: 1UD129KBjvJXoWxGw4xZF18Cw4Ut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enderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ From: Zhang Yi Since commit "iomap: map multiple blocks at a time", we could map multi-blocks once a time, and the dirty_len indicates the expected map length, map_len won't large than it. The pos and dirty_len means the dirty range that should be mapped to write, add them into trace_iomap_writepage_map() could be more useful for debug. Signed-off-by: Zhang Yi --- fs/iomap/buffered-io.c | 2 +- fs/iomap/trace.h | 43 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 293ba00e4bc0..46675f51d9c9 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1787,7 +1787,7 @@ static int iomap_writepage_map_blocks(struct iomap_writepage_ctx *wpc, error = wpc->ops->map_blocks(wpc, inode, pos, dirty_len); if (error) break; - trace_iomap_writepage_map(inode, &wpc->iomap); + trace_iomap_writepage_map(inode, pos, dirty_len, &wpc->iomap); map_len = min_t(u64, dirty_len, wpc->iomap.offset + wpc->iomap.length - pos); diff --git a/fs/iomap/trace.h b/fs/iomap/trace.h index c16fd55f5595..3ef694f9489f 100644 --- a/fs/iomap/trace.h +++ b/fs/iomap/trace.h @@ -154,7 +154,48 @@ DEFINE_EVENT(iomap_class, name, \ TP_ARGS(inode, iomap)) DEFINE_IOMAP_EVENT(iomap_iter_dstmap); DEFINE_IOMAP_EVENT(iomap_iter_srcmap); -DEFINE_IOMAP_EVENT(iomap_writepage_map); + +TRACE_EVENT(iomap_writepage_map, + TP_PROTO(struct inode *inode, u64 pos, unsigned int dirty_len, + struct iomap *iomap), + TP_ARGS(inode, pos, dirty_len, iomap), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(u64, ino) + __field(u64, pos) + __field(u64, dirty_len) + __field(u64, addr) + __field(loff_t, offset) + __field(u64, length) + __field(u16, type) + __field(u16, flags) + __field(dev_t, bdev) + ), + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->pos = pos; + __entry->dirty_len = dirty_len; + __entry->addr = iomap->addr; + __entry->offset = iomap->offset; + __entry->length = iomap->length; + __entry->type = iomap->type; + __entry->flags = iomap->flags; + __entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0; + ), + TP_printk("dev %d:%d ino 0x%llx bdev %d:%d pos 0x%llx dirty len 0x%llx " + "addr 0x%llx offset 0x%llx length 0x%llx type %s flags %s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + MAJOR(__entry->bdev), MINOR(__entry->bdev), + __entry->pos, + __entry->dirty_len, + __entry->addr, + __entry->offset, + __entry->length, + __print_symbolic(__entry->type, IOMAP_TYPE_STRINGS), + __print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS)) +); TRACE_EVENT(iomap_iter, TP_PROTO(struct iomap_iter *iter, const void *ops, -- 2.39.2