Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755745AbbLQJR7 (ORCPT ); Thu, 17 Dec 2015 04:17:59 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:37039 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753636AbbLQJRz (ORCPT ); Thu, 17 Dec 2015 04:17:55 -0500 X-AuditID: cbfee61b-f793c6d00000236c-b4-56727dc297ba From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: add a tracepoint for sync_dirty_inodes Date: Thu, 17 Dec 2015 17:17:16 +0800 Message-id: <006e01d138ab$d0c1a610$7244f230$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdE4qyD5rPH5A1naSEmrbxNNf7y4uw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jAd1DtUVhBsdOaVk8WT+L2eLSIneL y7vmsDkwe2xa1cnmsXvBZyaPz5vkApijuGxSUnMyy1KL9O0SuDKm/bjLWLBSqOLgl21MDYxT +bsYOTkkBEwkrv15wQRhi0lcuLeerYuRi0NIYCmjxOnud0wQzitGidmTT7ODVLEJqEgs7/gP 1iECZB9adBkszizgIdHY8Z0VxBYWsJXY2nweaBIHB4uAqsSWBmaQMK+ApcTJT7PYIGxBiR+T 77FAtGpJrN95nAnClpfYvOYtM8RBChI7zr5mhFilJ7F06maoGnGJjUdusUxgFJiFZNQsJKNm IRk1C0nLAkaWVYwSqQXJBcVJ6blGeanlesWJucWleel6yfm5mxjBQfxMegfj4V3uhxgFOBiV eHgF9hWGCbEmlhVX5h5ilOBgVhLh/b4HKMSbklhZlVqUH19UmpNafIhRmoNFSZx336XIMCGB 9MSS1OzU1ILUIpgsEwenVAOjT/mNieulzvgZ5etvZpy24eoEoSUrjQ6HxDX5fpP4tqyQcV2p H9MhrueH1qwxCW9/b+XDG6D99552Rqbem7LU3gfad1kTfnKfzmX7FxXJ+6pF0eTbKdNWgVtr /8gLZx0qWBqa03w8rvorY795EItuXfzzjiO3kz5IzroleS+2LcXcyWzpQmslluKMREMt5qLi RACsGxE6XgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2503 Lines: 92 This patch adds a tracepoint for sync_dirty_inodes. Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 8 ++++++++ include/trace/events/f2fs.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 53044ea..fdd43f7 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -803,6 +803,11 @@ void sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type) struct list_head *head; struct inode *inode; struct f2fs_inode_info *fi; + bool is_dir = (type == DIR_INODE); + + trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, + get_pages(sbi, is_dir ? + F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA)); retry: if (unlikely(f2fs_cp_error(sbi))) return; @@ -812,6 +817,9 @@ retry: head = &sbi->inode_list[type]; if (list_empty(head)) { spin_unlock(&sbi->inode_lock[type]); + trace_f2fs_sync_dirty_inodes_exit(sbi->sb, is_dir, + get_pages(sbi, is_dir ? + F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA)); return; } fi = list_entry(head->next, struct f2fs_inode_info, dirty_list); diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 00b4a63..a1b4888 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -1265,6 +1265,44 @@ TRACE_EVENT(f2fs_destroy_extent_tree, __entry->node_cnt) ); +DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes, + + TP_PROTO(struct super_block *sb, int type, int count), + + TP_ARGS(sb, type, count), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(int, type) + __field(int, count) + ), + + TP_fast_assign( + __entry->dev = sb->s_dev; + __entry->type = type; + __entry->count = count; + ), + + TP_printk("dev = (%d,%d), %s, dirty count = %d", + show_dev(__entry), + show_file_type(__entry->type), + __entry->count) +); + +DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter, + + TP_PROTO(struct super_block *sb, int type, int count), + + TP_ARGS(sb, type, count) +); + +DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit, + + TP_PROTO(struct super_block *sb, int type, int count), + + TP_ARGS(sb, type, count) +); + #endif /* _TRACE_F2FS_H */ /* This part must be outside protection */ -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/