From patchwork Fri Dec 30 18:51:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 9492421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09EA962ABB for ; Fri, 30 Dec 2016 18:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF7FA22638 for ; Fri, 30 Dec 2016 18:53:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E43761FF8F; Fri, 30 Dec 2016 18:53:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9881622638 for ; Fri, 30 Dec 2016 18:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbcL3Sw7 (ORCPT ); Fri, 30 Dec 2016 13:52:59 -0500 Received: from mail.kernel.org ([198.145.29.136]:51524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754122AbcL3SvX (ORCPT ); Fri, 30 Dec 2016 13:51:23 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D5C920489; Fri, 30 Dec 2016 18:51:22 +0000 (UTC) Received: from localhost (107-1-141-74-ip-static.hfc.comcastbusiness.net [107.1.141.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 657FC20551; Fri, 30 Dec 2016 18:51:21 +0000 (UTC) From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 03/10] f2fs: add submit_bio tracepoint Date: Fri, 30 Dec 2016 10:51:10 -0800 Message-Id: <20161230185117.3832-3-jaegeuk@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161230185117.3832-1-jaegeuk@kernel.org> References: <20161230185117.3832-1-jaegeuk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds final submit_bio() tracepoint. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 1 + include/trace/events/f2fs.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 2c5df1dc1479..54da4e2f1318 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -175,6 +175,7 @@ static inline void __submit_bio(struct f2fs_sb_info *sbi, current->plug && (type == DATA || type == NODE)) blk_finish_plug(current->plug); } + trace_f2fs_submit_bio(sbi->sb, bio); submit_bio(bio); } diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 4c942599581b..094d92b52450 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -55,6 +55,8 @@ TRACE_DEFINE_ENUM(CP_DISCARD); { IPU, "IN-PLACE" }, \ { OPU, "OUT-OF-PLACE" }) +#define F2FS_OP (REQ_OP_READ | REQ_OP_RAHEAD | REQ_SYNC | REQ_PREFLUSH | REQ_META |\ + REQ_PRIO) #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_PREFLUSH | REQ_META |\ REQ_PRIO) #define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS) @@ -837,6 +839,35 @@ DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio, TP_CONDITION(bio) ); +TRACE_EVENT(f2fs_submit_bio, + + TP_PROTO(struct super_block *sb, struct bio *bio), + + TP_ARGS(sb, bio), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(int, op) + __field(int, op_flags) + __field(sector_t, sector) + __field(unsigned int, size) + ), + + TP_fast_assign( + __entry->dev = sb->s_dev; + __entry->op = bio->bi_opf & REQ_OP_MASK; + __entry->op_flags = bio->bi_opf; + __entry->sector = bio->bi_iter.bi_sector; + __entry->size = bio->bi_iter.bi_size; + ), + + TP_printk("dev = (%d,%d), rw = %s%s, sector = %lld, size = %u", + show_dev(__entry), + show_bio_type(__entry->op, __entry->op_flags), + (unsigned long long)__entry->sector, + __entry->size) +); + TRACE_EVENT(f2fs_write_begin, TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,