Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1904757yba; Mon, 15 Apr 2019 00:23:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2pZruOkzZoMMoFSKumRs8rNE83AjvDZhQwDce7gMVq6pJRkMvKLhWYfBfthcmr3o6iys+ X-Received: by 2002:a62:1c13:: with SMTP id c19mr73203677pfc.11.1555313002093; Mon, 15 Apr 2019 00:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555313002; cv=none; d=google.com; s=arc-20160816; b=bkmPtUgi/FeVtMFOE02J0BJOoLfRqj9qHi8uzAPZovpTo8oib6wtj88R7IemglTst+ kCqNVXTGdrbNMr5VDjUBRDG1t1yJkVNXAQdHzyJBdjIcki2g7zFzqickmE8VPPhvvIti 6QeSYY97VeVzI2RiVNroXPBLu+8lxfpKWDWbDjdV/E9vA0J4rmHxWOUyBnwRufg4Ht5H rJg83Ki9IuLbbzx2+2cH+pB4sr/ItA9mfJ2M0X8XTkzft+nwf+J8hWV0GViTt+TT0iQO JgDfxoYwWAuDT8Ic2p08qysodznwfYpRVFJV9nM2QJ34Mq9xsdyDeV9P80hiW5zZCvMn 1qeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=9uwi7C+1m0GyZl+K2EYr4epV6eiRzvxTbeWBcvvHpvg=; b=VDm1DVAHhX6lYja55HSWtsx/Y1L3jfiEGF+Aq0M89WOzCIKOcAYtg3vKRTKbiL7aiG 6olbeCznRiOiWFe/W2nc/edbkK/XTwmepbMgtuHJDqiSsPxoahC7F5tnx99/C58L3+Fk Py88og7q6IXVIqzaEvbYFKqKOS4e4vNt1yhMf4wMqW18woldyEOjvJUIKKMfvWjjrOcd gtQZXF0prLjvwitTfRSF26gW0tXPvxtwHARzjzrHfg2TwPGZH8lKpyPzHrepxIrHmXCz GJI5KnUqHPwn9edCc6ASXwby4zJyERs1M82dlK4LizXN+TpKCyfwJzR3M5i+07Q/Qnfy NnjA== ARC-Authentication-Results: i=1; mx.google.com; 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 s5si16555578pfm.234.2019.04.15.00.23.05; Mon, 15 Apr 2019 00:23:22 -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; 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 S1726094AbfDOHW1 (ORCPT + 99 others); Mon, 15 Apr 2019 03:22:27 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2479 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725777AbfDOHW1 (ORCPT ); Mon, 15 Apr 2019 03:22:27 -0400 Received: from DGGEMM406-HUB.china.huawei.com (unknown [172.30.72.57]) by Forcepoint Email with ESMTP id 6BB2DC2CCB16E3C2FF16; Mon, 15 Apr 2019 15:22:25 +0800 (CST) Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by DGGEMM406-HUB.china.huawei.com (10.3.20.214) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 15:22:25 +0800 Received: from szvp000201624.huawei.com (10.120.216.130) by dggeme763-chm.china.huawei.com (10.3.19.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 15 Apr 2019 15:22:24 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH v2 4/5] f2fs: add tracepoint for f2fs_filemap_fault() Date: Mon, 15 Apr 2019 15:22:19 +0800 Message-ID: <20190415072219.1613-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-ClientProxiedBy: dggeme710-chm.china.huawei.com (10.1.199.106) To dggeme763-chm.china.huawei.com (10.3.19.109) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds tracepoint for f2fs_filemap_fault(). Signed-off-by: Chao Yu --- v2: - fix wrong type of @ret parameter fs/f2fs/file.c | 2 ++ include/trace/events/f2fs.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 30d49467578e..578486e03427 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -39,6 +39,8 @@ static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf) ret = filemap_fault(vmf); up_read(&F2FS_I(inode)->i_mmap_sem); + trace_f2fs_filemap_fault(inode, vmf->pgoff, ret); + return ret; } diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index a3916b4dd57e..cfa0dcdd1462 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -1253,6 +1253,32 @@ DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page, TP_ARGS(page, type) ); +TRACE_EVENT(f2fs_filemap_fault, + + TP_PROTO(struct inode *inode, pgoff_t index, enum vm_fault_reason ret), + + TP_ARGS(inode, index, ret), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(ino_t, ino) + __field(pgoff_t, index) + __field(enum vm_fault_reason, ret) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->index = index; + __entry->ret = ret; + ), + + TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %u", + show_dev_ino(__entry), + (unsigned long)__entry->index, + ret) +); + TRACE_EVENT(f2fs_writepages, TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type), -- 2.18.0.rc1