From patchwork Mon Nov 19 12:55:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 199997 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A68972C00A4 for ; Mon, 19 Nov 2012 23:42:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778Ab2KSMmx (ORCPT ); Mon, 19 Nov 2012 07:42:53 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:40976 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776Ab2KSMmx (ORCPT ); Mon, 19 Nov 2012 07:42:53 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so430130pad.19 for ; Mon, 19 Nov 2012 04:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=MUA4qFr22pNbK0Iej1Kk87HRcJN6XOkFrdDUPkSUSL8=; b=RNs9Xz5fmNzeeZYqma+Mxvg/o6cpAHUGQM1LmLqqeB0fZJX/zTTSSbpt9A8jDn9Xfe WpZlW4mfsWQF0GYNX5luDr3Wf/avHYbqGKluVAfQzqXne2/rgsVXRzoZqMTT8gI5oPM5 9UspnSjg+ECbvdbkN5YBupADOivu+VbyfGHm1SGqiI0OQyyChhafrNcseJdiI0gJx8+3 qee4j826+oZmvvAdqdzVM9syU/lM5+uSZPtYtB97hIJWCSOGpvT9lNVTWm+p1AmVg6mA hIuVymM/cIcj28Kc75wBGkAt5gDlcerNwXmm6D1H4E7BGZE2i80A9HUD7PChFTU5uNYW c4SA== Received: by 10.66.77.74 with SMTP id q10mr35124306paw.81.1353328972968; Mon, 19 Nov 2012 04:42:52 -0800 (PST) Received: from lz-desktop.taobao.ali.com ([182.92.247.2]) by mx.google.com with ESMTPS id jw10sm6180435pbb.20.2012.11.19.04.42.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 04:42:52 -0800 (PST) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Zheng Liu Subject: [PATCH 3/3 v2] ext4: add tracepoint for punching hole Date: Mon, 19 Nov 2012 20:55:18 +0800 Message-Id: <1353329718-2075-4-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <1353329718-2075-1-git-send-email-wenqing.lz@taobao.com> References: <1353329718-2075-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zheng Liu This patch adds a tracepoint in ext4_punch_hole. Signed-off-by: Zheng Liu --- fs/ext4/inode.c | 2 ++ include/trace/events/ext4.h | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 733ed5b..f850ea6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3478,6 +3478,8 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) if (!S_ISREG(inode->i_mode)) return -EOPNOTSUPP; + trace_ext4_punch_hole(inode, offset, length); + if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) return ext4_ind_punch_hole(file, offset, length); diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index d49b285..476c7d3 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -1311,6 +1311,31 @@ TRACE_EVENT(ext4_fallocate_exit, __entry->ret) ); +TRACE_EVENT(ext4_punch_hole, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len), + + TP_ARGS(inode, offset, len), + + TP_STRUCT__entry( + __field( dev_t, dev ) + __field( ino_t, ino ) + __field( loff_t, offset ) + __field( loff_t, len ) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->offset = offset; + __entry->len = len; + ), + + TP_printk("dev %d,%d ino %lu offset %lld len %lld", + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long)__entry->ino, + __entry->offset, __entry->len) +); + TRACE_EVENT(ext4_unlink_enter, TP_PROTO(struct inode *parent, struct dentry *dentry),