Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7946595ybn; Tue, 1 Oct 2019 00:16:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8YHO8+7cBmMxBmKbcpQcn9p7xcFT3/CD+dgB60wgdj2B76OaAOs3bKJLv+6zGa2X8jmBG X-Received: by 2002:a50:d808:: with SMTP id o8mr23873066edj.74.1569914216116; Tue, 01 Oct 2019 00:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569914216; cv=none; d=google.com; s=arc-20160816; b=ZaRgTvP7JZaJlxMdZ1lwsbKW/3dUgTk+9sAsKiXmdmKMcPbtRX4EIDkVfc5xckb8KR xpmvCZluy8tc/sq+CJckbpBPkro/VAcM+5aqJ3nWPfloioxSFC4uR4g0/7mX6GguOPQE /zemEI7QAs1DQrtXA38S6MqxiGnDqX4hIMZ7iHi8B7do/Rc/TlKUH56NBbnPZVEJSU1Y vzCDSj3BaHnIXcjg9lZSyRLXWr7VoseJ3hSgsGIszNFKES9Yc2QxahF+BZftHxeewid8 29QamMlkhOQxjetrX/aGzQmvAw65ZskXKeQLPprHi3kRJeCsIPtXk3eOFC2Kh1b0L1xm eAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6kERW7jgpP3mjKJHjYK3lGhnHgcsnWdX2je3JExn10M=; b=ptm42OR/UVzefZAS9ZaZLxI/0cWT9L5QzXvQouaJ9G6+4c55r8MH2d8S8P1o4aAdSd y1axGoHFj10zpRQKw1Gjd5taglCZt170ue42Hsnz8lSw5rN/BNQM2vWUyLmHuO4o+HR3 hGMfObGZJvyz/cxhWl+wgAGBT1KTMuI2oB01BuvgR5vG8KrcDpu2M78lIoOhtzNbsAor 60mzR/wjr6yoprbRFwVRkdLNOe1o9OD2XxSsxk5Ufe3t4QhLnNBuKyNP6Mya0IrlPp/x +7KcC9FervfNzlE5zXH5jX5mrVM8VMBekEFJmgjt9NdKaqCeogTpi5YAY3jsDryB3UX1 Cz3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="mbKG/sQy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m33si8673960edc.94.2019.10.01.00.16.31; Tue, 01 Oct 2019 00:16:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="mbKG/sQy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732887AbfJAHQU (ORCPT + 99 others); Tue, 1 Oct 2019 03:16:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45466 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbfJAHQU (ORCPT ); Tue, 1 Oct 2019 03:16:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6kERW7jgpP3mjKJHjYK3lGhnHgcsnWdX2je3JExn10M=; b=mbKG/sQyOFWkrXQCtKwcWjtKEO eVfkzAGs739ybPi2AYcCHxliXaAExCEP3ryUAJQonIOGCVZLiE6sI5O64oVyTabJJ77P+tHdZtuNs ygzfW8tQg/RrKaBTk7lo8PsO4OSB4bpDMA+7fJMuH5Xou4eIIqIegapxQVsMmBVV+B9Hg1mzB6bwF fse0M49ySGd8CBLTmyu5UJPKcJSczKPpXWNqiWhuy4lPRYZG4G5TbdKhrkXARAAYU2DCBVfQFgEGQ fNGHE99Ze3wxu96PjRnhWcmqNiU8ZT+86QbOcd9yGaGEmAehP6B40m5gj4fbjkDxW1HvEmYvX+emt K5dKb/+A==; Received: from 089144211233.atnat0020.highway.a1.net ([89.144.211.233] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFCOP-0001PO-0t; Tue, 01 Oct 2019 07:16:17 +0000 From: Christoph Hellwig To: "Darrick J . Wong" Cc: Damien Le Moal , Andreas Gruenbacher , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] iomap: add tracing for the readpage / readpages Date: Tue, 1 Oct 2019 09:11:42 +0200 Message-Id: <20191001071152.24403-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001071152.24403-1-hch@lst.de> References: <20191001071152.24403-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lift the xfs code for tracing address space operations to the iomap layer. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 7 +++++++ include/trace/events/iomap.h | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 include/trace/events/iomap.h diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index e25901ae3ff4..099daf0c09b8 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -19,6 +19,9 @@ #include "../internal.h" +#define CREATE_TRACE_POINTS +#include + static struct iomap_page * iomap_page_create(struct inode *inode, struct page *page) { @@ -293,6 +296,8 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops) unsigned poff; loff_t ret; + trace_iomap_readpage(page->mapping->host, 1); + for (poff = 0; poff < PAGE_SIZE; poff += ret) { ret = iomap_apply(inode, page_offset(page) + poff, PAGE_SIZE - poff, 0, ops, &ctx, @@ -389,6 +394,8 @@ iomap_readpages(struct address_space *mapping, struct list_head *pages, loff_t last = page_offset(list_entry(pages->next, struct page, lru)); loff_t length = last - pos + PAGE_SIZE, ret = 0; + trace_iomap_readpages(mapping->host, nr_pages); + while (length > 0) { ret = iomap_apply(mapping->host, pos, length, 0, ops, &ctx, iomap_readpages_actor); diff --git a/include/trace/events/iomap.h b/include/trace/events/iomap.h new file mode 100644 index 000000000000..7d2fe2c773f3 --- /dev/null +++ b/include/trace/events/iomap.h @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2009-2019, Christoph Hellwig + * All Rights Reserved. + * + * NOTE: none of these tracepoints shall be consider a stable kernel ABI + * as they can change at any time. + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM iomap + +#if !defined(_TRACE_IOMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_IOMAP_H + +#include + +#define DEFINE_READPAGE_EVENT(name) \ +DEFINE_EVENT(iomap_readpage_class, name, \ + TP_PROTO(struct inode *inode, int nr_pages), \ + TP_ARGS(inode, nr_pages)) +DEFINE_READPAGE_EVENT(iomap_readpage); +DEFINE_READPAGE_EVENT(iomap_readpages); + +#endif /* _TRACE_IOMAP_H */ + +/* This part must be outside protection */ +#include -- 2.20.1