From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0CB83DDAFC; Thu, 20 Aug 2026 09:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; cv=none; b=tKchCDSQJuxdT8aRCUEXw+R2ni1Uib3bMFJeFL9ANW7b3VziuPdB8rOE9QdIbCDl0Lki0YljGDqlt+cWUG6s+nuuTrgi/EMvZsU53mlWVCUGT7R3URKUme3E17w38QfnMnD2w/WMfksw86C2recs3LcudYa9iHBGMlo86E+DRN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; c=relaxed/simple; bh=6yp289RtcU/XbDUzoDTS662XLebClI9tKnKjC6GKHuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICulRxOOb9GaLFWP1Hg1eL0ndXFOBxj3rY8z9SyXcMhj3EssYKDY9qc3jMTTsy/nDM9B9fWtnee5AJvWPUne4M2NntnUPRBUk4sfJQEIPGVX13+3muPQ2CqhT9wctEXNJgo9R1Z+9fbyspU6V1yfujadTQlSLGz3y4Z0VUa2r8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=iESbqebf; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="iESbqebf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=ea lyBtV4M6sFpTJmr7xiHwVQ/Aim1DAJvRk46lsItAw=; b=iESbqebfflVKgT21JE vj5bRRENUJee0E2KhBJ/lBAwXKalCFNoSKI8vC2QG4vI2V+9pMVonsXLbfcrBNS5 wEHvkDg7zL9eQn0M+glcv8Ut+W6BXZ+sxpebid/TiqExM5tPgDenqEVDgTzJz2dH /dH/mavSx5hvxUrombVigZJ3E= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S3; Thu, 20 Aug 2026 17:06:17 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 1/7] ntfs3: add mount and log replay tracepoints Date: Thu, 20 Aug 2026 17:04:58 +0800 Message-ID: <20260820090504.950475-2-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S3 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF4xAF4ktw4fury7ur4DJwb_yoWxJryrpF nrAFs3G3yktrWj9ws3tw1Sqr4Fva48uF4Utry3W347Ars7tr1kJr4DtrW8CFZ5ArZ0k3sa q3Z0v39Ykw1rWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zN4E_UUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6gtPGmqGw4tzdgAA3V Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for mount and log replay paths. This adds trace events for ntfs_fill_super(), ntfs_init_from_boot(), and log_replay() to help observe mount setup, boot sector parsing, and $LogFile replay results. Signed-off-by: Baolin Liu --- MAINTAINERS | 1 + fs/ntfs3/fslog.c | 3 ++ fs/ntfs3/super.c | 11 ++++- include/trace/events/ntfs3.h | 85 ++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 include/trace/events/ntfs3.h diff --git a/MAINTAINERS b/MAINTAINERS index 8014b9f8253e..a8e2ea4acef8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19296,6 +19296,7 @@ W: http://www.paragon-software.com/ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git F: Documentation/filesystems/ntfs3.rst F: fs/ntfs3/ +F: include/trace/events/ntfs3.h =20 NTSYNC SYNCHRONIZATION PRIMITIVE DRIVER M: Elizabeth Figura diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index f038c799e7ac..5020da7e72f1 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -13,6 +13,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* * LOG FILE structs @@ -5362,6 +5363,8 @@ int log_replay(struct ntfs_inode *ni, bool *initializ= ed) else if (log->set_dirty) ntfs_set_state(sbi, NTFS_DIRTY_ERROR); =20 + trace_ntfs3_log_replay(&ni->vfs_inode, *initialized, err); + kfree(log); =20 return err; diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 3305fe406cb2..7034ef257452 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -76,6 +76,9 @@ #include "lib/lib.h" #endif =20 +#define CREATE_TRACE_POINTS +#include + #ifdef CONFIG_PRINTK /* * ntfs_printk - Trace warnings/notices/errors. @@ -956,7 +959,7 @@ static int ntfs_init_from_boot(struct super_block *sb, = u32 sector_size, { struct ntfs_sb_info *sbi =3D sb->s_fs_info; int err; - u32 mb, gb, boot_sector_size, sct_per_clst, record_size; + u32 mb, gb, boot_sector_size =3D 0, sct_per_clst, record_size; u64 sectors, clusters, mlcn, mlcn2, dev_size0; struct NTFS_BOOT *boot; struct buffer_head *bh; @@ -1216,6 +1219,8 @@ static int ntfs_init_from_boot(struct super_block *sb= , u32 sector_size, } =20 out: + trace_ntfs3_init_from_boot(sb, sector_size, boot_sector_size, + !!boot_block, err); brelse(bh); =20 if (err =3D=3D -EINVAL && !boot_block && dev_size0 > PAGE_SHIFT) { @@ -1731,12 +1736,16 @@ static int ntfs_fill_super(struct super_block *sb, = struct fs_context *fc) } =20 ntfs_create_procdir(sb); + trace_ntfs3_fill_super(sb, ro, sbi->cluster_size, sbi->record_size, + sbi->index_size, 0); =20 return 0; =20 put_inode_out: iput(inode); out: + trace_ntfs3_fill_super(sb, ro, sbi->cluster_size, sbi->record_size, + sbi->index_size, err); /* sbi->options =3D=3D options */ if (options) { put_mount_options(sbi->options); diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h new file mode 100644 index 000000000000..a45f919cb33e --- /dev/null +++ b/include/trace/events/ntfs3.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM ntfs3 + +#if !defined(_TRACE_NTFS3_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_NTFS3_H + +#include +#include + +TRACE_EVENT(ntfs3_fill_super, + TP_PROTO(struct super_block *sb, bool ro, u32 cluster_size, + u32 record_size, u32 index_size, int err), + TP_ARGS(sb, ro, cluster_size, record_size, index_size, err), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(u32, cluster_size) + __field(u32, record_size) + __field(u32, index_size) + __field(int, err) + __field(bool, ro) + ), + TP_fast_assign( + __entry->dev =3D sb->s_bdev->bd_dev; + __entry->cluster_size =3D cluster_size; + __entry->record_size =3D record_size; + __entry->index_size =3D index_size; + __entry->err =3D err; + __entry->ro =3D ro; + ), + TP_printk("dev=3D(%d,%d) ro=3D%d cluster=3D%u record=3D%u index=3D%u err= =3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ro, + __entry->cluster_size, __entry->record_size, + __entry->index_size, __entry->err) +); + +TRACE_EVENT(ntfs3_init_from_boot, + TP_PROTO(struct super_block *sb, u32 media_sector_size, + u32 boot_sector_size, bool used_alt_boot, int err), + TP_ARGS(sb, media_sector_size, boot_sector_size, used_alt_boot, err), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(u32, media_sector_size) + __field(u32, boot_sector_size) + __field(int, err) + __field(bool, used_alt_boot) + ), + TP_fast_assign( + __entry->dev =3D sb->s_bdev->bd_dev; + __entry->media_sector_size =3D media_sector_size; + __entry->boot_sector_size =3D boot_sector_size; + __entry->err =3D err; + __entry->used_alt_boot =3D used_alt_boot; + ), + TP_printk("dev=3D(%d,%d) media_sector=3D%u boot_sector=3D%u alt_boot=3D%d= err=3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->media_sector_size, __entry->boot_sector_size, + __entry->used_alt_boot, __entry->err) +); + +TRACE_EVENT(ntfs3_log_replay, + TP_PROTO(struct inode *inode, bool initialized, int err), + TP_ARGS(inode, initialized, err), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(loff_t, size) + __field(dev_t, dev) + __field(int, err) + __field(bool, initialized) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->size =3D i_size_read(inode); + __entry->dev =3D inode->i_sb->s_dev; + __entry->err =3D err; + __entry->initialized =3D initialized; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu size=3D%lld initialized=3D%d err=3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, + __entry->size, __entry->initialized, __entry->err) +); + +#endif /* _TRACE_NTFS3_H */ + +#include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FC833DDB09; Thu, 20 Aug 2026 09:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216834; cv=none; b=NwNuL/v44SZIkQB74qqx2tJBbv+L0QniYAhHIb+YZDlqNUn/+uL5hlwAfj/n+6Yfw9KEAPPTSOfsQi1oY+CXzE6J3jzKoRKnLUXevXyeaoksnh/mr+3dvn0lOpxryazs35/MfBs7XUnQ/7P7jCIxVc0Zc2SioHRYgvH0tZV4Cbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216834; c=relaxed/simple; bh=3YrGN2r3o4zxkKUcthMdwznjPnpl3mbm4YiZNIESras=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g0mz2Pi8LHJmXSIzK1XG9DE76p9Gu5U/K6Z7u5iyLn6rITLlb992N/yQhj/1PGhOHyaDB0FePQUPucL7i77kZ6IwKpyrSzeoPwnYZkgjL2Ds04an7EqiRPv5B+cmKabAa5XsNRBTg3pYy1DlTHIgo6fpz4Ue2/umyn9h36w7hnE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=qGSCN5CD; arc=none smtp.client-ip=220.197.31.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="qGSCN5CD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=iG om8Epilwi6V2126R3wVx/l/gkYFTDyDJNaMaHfR+M=; b=qGSCN5CDbI9SY5Ts8W 1G2x+prduxUqt9WcZx+zfWxh0q0ogbizoM/jVPC3Bn917FiRNFlvj5h9awmZL6GJ Cp+3LEoKKSpv/2A/w0FvquKLOF6VQl2O0pUYdFnwcvIGRvAC8RZhpyjxsADkR932 iDKoMjMa/W/nbPeYem8HNc7K8= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S4; Thu, 20 Aug 2026 17:06:22 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 2/7] ntfs3: add namei tracepoints Date: Thu, 20 Aug 2026 17:04:59 +0800 Message-ID: <20260820090504.950475-3-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18Aw4xZF15uw18JrWUArb_yoW5Cr47pF nFyFZ8W393JrsxKwnava15Zr4rZay8ur1Utry29347Ar1IqF1xtrs2gr4DAr95AFWFk347 WFWYv3s8Cw15Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRbo7_UUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwg5QG2qGw447iQAA3U Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for namei operations. This adds trace events for ntfs_lookup() and ntfs_rename() to help observe directory lookup and rename activity. Signed-off-by: Baolin Liu --- fs/ntfs3/namei.c | 5 ++++ include/trace/events/ntfs3.h | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index c59de5f2fa97..c1523decee32 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -13,6 +13,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* * fill_name_de - Format NTFS_DE in @buf. @@ -72,6 +73,8 @@ static struct dentry *ntfs_lookup(struct inode *dir, stru= ct dentry *dentry, struct inode *inode; int err; =20 + trace_ntfs3_lookup(dir, dentry); + if (!uni) inode =3D ERR_PTR(-ENOMEM); else { @@ -275,6 +278,8 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct = inode *dir, if (unlikely(ntfs3_forced_shutdown(sb))) return -EIO; =20 + trace_ntfs3_rename(dir, dentry, new_dir, new_dentry); + if (flags & ~RENAME_NOREPLACE) return -EINVAL; =20 diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index a45f919cb33e..a1e4bdb6ec59 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -80,6 +80,50 @@ TRACE_EVENT(ntfs3_log_replay, __entry->size, __entry->initialized, __entry->err) ); =20 +TRACE_EVENT(ntfs3_lookup, + TP_PROTO(struct inode *dir, struct dentry *dentry), + TP_ARGS(dir, dentry), + TP_STRUCT__entry( + __field(unsigned long, parent_ino) + __field(dev_t, dev) + __string(name, dentry->d_name.name) + ), + TP_fast_assign( + __entry->parent_ino =3D dir->i_ino; + __entry->dev =3D dir->i_sb->s_dev; + __assign_str(name); + ), + TP_printk("dev=3D(%d,%d) parent=3D%lu name=3D%s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->parent_ino, __get_str(name)) +); + +TRACE_EVENT(ntfs3_rename, + TP_PROTO(struct inode *dir, struct dentry *dentry, + struct inode *new_dir, struct dentry *new_dentry), + TP_ARGS(dir, dentry, new_dir, new_dentry), + TP_STRUCT__entry( + __field(unsigned long, dir_ino) + __field(unsigned long, new_dir_ino) + __field(unsigned long, ino) + __field(dev_t, dev) + __string(old_name, dentry->d_name.name) + __string(new_name, new_dentry->d_name.name) + ), + TP_fast_assign( + __entry->dir_ino =3D dir->i_ino; + __entry->new_dir_ino =3D new_dir->i_ino; + __entry->ino =3D d_inode(dentry)->i_ino; + __entry->dev =3D dir->i_sb->s_dev; + __assign_str(old_name); + __assign_str(new_name); + ), + TP_printk("dev=3D(%d,%d) dir=3D%lu new_dir=3D%lu ino=3D%lu old=3D%s new= =3D%s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->dir_ino, __entry->new_dir_ino, __entry->ino, + __get_str(old_name), __get_str(new_name)) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD9753E168F; Thu, 20 Aug 2026 09:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216833; cv=none; b=CnIrT5r5C0/xpBA5Gmh3ddgUSGRIozMiFEJGEmhTdNU5wxUuY4KQdGmFRucXZRzppnLeLuTVWJ5P0gYgi6TqLlT5QXzPEWfKwvpdyEeaiX7wD6/T0Vz0/fVF68xGpnrnH9qJfnzExmZjo6tmnCLjpgsLmEe4mwIamq1LhFqgToM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216833; c=relaxed/simple; bh=pDelcQJI6zs/4fXiYR2BoxfOsKnccf3Ziql5TZm5ALY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qgapAPOK5htBhKOhbQJAysglTJllf654PCNreX/bxhoA+XMP4HCm7GOQFa4zXYGXRHpq0xBRaNwvM6BAicd55LpK25Kunf5c8HFUuTwihtRJ/HJpNGgdJmvVbnknSQP7LNFnR+EkfGv5XnzsKQWU+Txiaa/1R3YK7M6K0X7qRRI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=RZnM8hFF; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="RZnM8hFF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=lc UEyHtMELt33ScppFTkDDJGZPRMBcMBOEQbPSQ+qwU=; b=RZnM8hFF0w/qn1cszm b4evbUrjAdEvYyMqw96S/+2bs+U4pwn6k68PkIiD6P96Oqo9Qm+k66szVijJWoZ3 3DqhajnlZeZX9VDLmjiwfPU1kDcqGCkEulv7dLWXBx6fMgjdmRFljJ5TnfrWPFEd Q685mtp5xuBkdoCMFnuBbOyBE= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S5; Thu, 20 Aug 2026 17:06:24 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 3/7] ntfs3: add create inode tracepoint Date: Thu, 20 Aug 2026 17:05:00 +0800 Message-ID: <20260820090504.950475-4-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr45GFykJF1rCrWrCrWfXwb_yoW8CryUpF nrAFs3Gws7J347Kwsavr4UXF1Svay8GrWUtFy8u34xArn3XFn7trsFgr1DZ3Z5CFW0y343 WFnI9ry5Gr1UXw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRYXdbUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwRFRHGqGw5EqjgAA3H Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add an ntfs3 tracepoint for inode creation. This adds a trace event for ntfs_create_inode() to help observe inode creation activity. Signed-off-by: Baolin Liu --- fs/ntfs3/inode.c | 3 +++ include/trace/events/ntfs3.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 0c9bd669117d..4c427ed69272 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -17,6 +17,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* * ntfs_read_mft - Read record and parse MFT. @@ -1203,6 +1204,8 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct= inode *dir, /* New file will be resident or non resident. */ const bool new_file_resident =3D 1; =20 + trace_ntfs3_create_inode(dir, dentry); + if (!fnd) ni_lock_dir(dir_ni); =20 diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index a1e4bdb6ec59..67a2bde0266d 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -124,6 +124,24 @@ TRACE_EVENT(ntfs3_rename, __get_str(old_name), __get_str(new_name)) ); =20 +TRACE_EVENT(ntfs3_create_inode, + TP_PROTO(struct inode *dir, struct dentry *dentry), + TP_ARGS(dir, dentry), + TP_STRUCT__entry( + __field(unsigned long, parent_ino) + __field(dev_t, dev) + __string(name, dentry->d_name.name) + ), + TP_fast_assign( + __entry->parent_ino =3D dir->i_ino; + __entry->dev =3D dir->i_sb->s_dev; + __assign_str(name); + ), + TP_printk("dev=3D(%d,%d) parent=3D%lu name=3D%s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->parent_ino, __get_str(name)) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B25DC3DE45B; Thu, 20 Aug 2026 09:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; cv=none; b=SwWoTjfnP1h8a9qDP6imHL2r0B3onlolYo3imP4Yli9ccZFDP66R8fzbS4czKeWzuQ8kEkKqN2gVn13+5UMHCc2puBZ5djCRPVZ9svzvykk3dwKz4gcUfh8BO02KGVoplq3MAfGjajnUogZKw1pwXVd6b5ElWRwAkrwX42mIVSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; c=relaxed/simple; bh=ipFRiEZb3eOzbms77cPdggMuTdTP/tuAsuPcoOcd3hw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xl4yv/sr70107oRP84wWPaKyCRHCVS9jueQ5NgyY4WQIhyVY4OiSpOBi4iq/lYucfQaPaP5v5d2ds3rkJk2bTJU4wYEtacmSeTOhKwsEvI2Nf0nJHThVREHp7AygDrJMmQn5Gu1k8v3Xg55lJDWrK1BR+JWd2Mvxl19tPVxKc9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=qX8sEPoW; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="qX8sEPoW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=UV C2ktW37UcDCI11yFCHJYewa7WGv3t7Z5otXeKijXo=; b=qX8sEPoWvA6rbPvnEN ZCycdtjYYCXfCiV44NwLtjx8vEwFAOoD5ENrQQ5ieiBvf+DQz4pcTlVugPIGekPQ 6SF0RaDBDrh0slWgRDduUZ27fANVzFqVBcj+ykobrvpOwdqAZMEzHoStRZI75Jza tgQ3zEAb6sDOSUmnGxH8wJssU= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S6; Thu, 20 Aug 2026 17:06:26 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 4/7] ntfs3: add directory index tracepoints Date: Thu, 20 Aug 2026 17:05:01 +0800 Message-ID: <20260820090504.950475-5-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S6 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF47WF47Aw4UJFW3Jw1rXrb_yoW7Xr43pF nrCrZxK397JrZFkwsaya1Fyr4ava95ur4Dtry3W342yw4Iqr18tF4DKr1jvr95ArWF9ryf WF4Y9a4DG3WUWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pE_-PUUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwhNRHGqGw5M8EAAA3M Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for directory index operations. This adds trace events for dir_search_u(), indx_find(), indx_insert_entry(), and indx_delete_entry() to help observe directory index lookup, insert, and delete activity. Signed-off-by: Baolin Liu --- fs/ntfs3/dir.c | 3 ++ fs/ntfs3/index.c | 8 ++++ include/trace/events/ntfs3.h | 81 ++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/fs/ntfs3/dir.c b/fs/ntfs3/dir.c index 873d52233003..eb10e7ff45bc 100644 --- a/fs/ntfs3/dir.c +++ b/fs/ntfs3/dir.c @@ -14,6 +14,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* Convert little endian UTF-16 to NLS string. */ int ntfs_utf16_to_nls(struct ntfs_sb_info *sbi, const __le16 *name, u32 le= n, @@ -243,6 +244,8 @@ struct inode *dir_search_u(struct inode *dir, const str= uct cpu_str *uni, struct inode *inode =3D NULL; struct ntfs_fnd *fnd_a =3D NULL; =20 + trace_ntfs3_dir_search_u(dir, uni ? uni->len : 0); + if (!fnd) { fnd_a =3D fnd_get(); if (!fnd_a) { diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index 2b439ac04356..d4ca7b1bb524 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -13,6 +13,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 static const struct INDEX_NAMES { const __le16 *name; @@ -1179,6 +1180,8 @@ int indx_find(struct ntfs_index *indx, struct ntfs_in= ode *ni, if (!root) root =3D indx_get_root(&ni->dir, ni, NULL, NULL); =20 + trace_ntfs3_indx_find(&ni->vfs_inode, indx->type, key_len); + if (!root) { /* Should not happen. */ return -EINVAL; @@ -2051,6 +2054,9 @@ int indx_insert_entry(struct ntfs_index *indx, struct= ntfs_inode *ni, return -EINVAL; } =20 + trace_ntfs3_indx_insert_entry(&ni->vfs_inode, indx->type, + le16_to_cpu(new_de->key_size), undo); + if (fnd_is_empty(fnd)) { /* * Find the spot the tree where we want to @@ -2409,6 +2415,8 @@ int indx_delete_entry(struct ntfs_index *indx, struct= ntfs_inode *ni, return -EINVAL; } =20 + trace_ntfs3_indx_delete_entry(&ni->vfs_inode, indx->type, key_len); + /* Locate the entry to remove. */ err =3D indx_find(indx, ni, root, key, key_len, ctx, &diff, &e, fnd); if (err) diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index 67a2bde0266d..4ac05ed29e49 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -142,6 +142,87 @@ TRACE_EVENT(ntfs3_create_inode, __entry->parent_ino, __get_str(name)) ); =20 +TRACE_EVENT(ntfs3_dir_search_u, + TP_PROTO(struct inode *dir, unsigned int name_len), + TP_ARGS(dir, name_len), + TP_STRUCT__entry( + __field(unsigned long, dir_ino) + __field(dev_t, dev) + __field(unsigned int, name_len) + ), + TP_fast_assign( + __entry->dir_ino =3D dir->i_ino; + __entry->dev =3D dir->i_sb->s_dev; + __entry->name_len =3D name_len; + ), + TP_printk("dev=3D(%d,%d) dir=3D%lu name_len=3D%u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->dir_ino, __entry->name_len) +); + +TRACE_EVENT(ntfs3_indx_find, + TP_PROTO(struct inode *inode, u8 type, size_t key_len), + TP_ARGS(inode, type, key_len), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(size_t, key_len) + __field(dev_t, dev) + __field(u8, type) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->key_len =3D key_len; + __entry->dev =3D inode->i_sb->s_dev; + __entry->type =3D type; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu type=3D%u key_len=3D%zu", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->type, __entry->key_len) +); + +TRACE_EVENT(ntfs3_indx_insert_entry, + TP_PROTO(struct inode *inode, u8 type, u16 key_len, bool undo), + TP_ARGS(inode, type, key_len, undo), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(dev_t, dev) + __field(u16, key_len) + __field(u8, type) + __field(bool, undo) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->dev =3D inode->i_sb->s_dev; + __entry->key_len =3D key_len; + __entry->type =3D type; + __entry->undo =3D undo; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu type=3D%u key_len=3D%u undo=3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->type, __entry->key_len, + __entry->undo) +); + +TRACE_EVENT(ntfs3_indx_delete_entry, + TP_PROTO(struct inode *inode, u8 type, u32 key_len), + TP_ARGS(inode, type, key_len), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(u32, key_len) + __field(dev_t, dev) + __field(u8, type) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->key_len =3D key_len; + __entry->dev =3D inode->i_sb->s_dev; + __entry->type =3D type; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu type=3D%u key_len=3D%u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->type, __entry->key_len) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B266F3E0096; Thu, 20 Aug 2026 09:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; cv=none; b=Us32Rzp/HFCSXTX2zumZEnw8mb5p0ZwOSIl0Pqm8iDDdgSTfpIYfoJyR/01OYSyfAHFOvg7cgi1Y8pv8lUfWH9ynqE0zrpVThbsYkrabJ8+KOyX7r5tj7I+ljZcubHZCdBbGpN5V8OYcocukDobwUXW2Ql1K3zcWUCymaxIHG24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216825; c=relaxed/simple; bh=+IL4wbv74qFenbTgX7qYFcnfF+40cGsRn+Ujo8vRI/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RJiGbYFvuUyUlL4ABByI0dTXN9FOsZDh0zUXTW0eJvEQTCJ3kGrS3gwidBm0btASDixp/u1YiJwT74AVAzbtHwY49kzrJuXnPX1pCzi4n+CLAKfJ0TcaFdXj6yDP2cuIWBQL3ZP5iiU+/Kqn80WRIouPBZYd9s7I/fdvfLWP33A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=UzTtX4/+; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="UzTtX4/+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=tC vmRUjaZXMsQNbw9VGNSXcVV+yZ6GD/EQLcsG9+HzE=; b=UzTtX4/+mrIH+O4x7T T92uCdKVjGl34SX+XkZlkizQebaxdNhzlvWff80vRpGF1T1ydCgYwmejDVirnlJ6 PiaZCWHd5G6+cAjNp7vlvJzvMH6pDwyIkmZCOFfkBNLo0HBMx6wZkOF/U+zYfIHG skgGlqhhYLchysq7fTcjoy1RM= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S7; Thu, 20 Aug 2026 17:06:30 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 5/7] ntfs3: add allocation tracepoints Date: Thu, 20 Aug 2026 17:05:02 +0800 Message-ID: <20260820090504.950475-6-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S7 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr15AFy5ZF48Gr4xJFW5Jrb_yoWrKw4fpF 1DAFy3Ww48JrZFkwsavw18tw45uay8ur4UKry3Wry2yrn2qFn7tr4DtryqvFyvkrnYkrnI gFyq93s8W3WUWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwRZSHWqGw5YrLAAA3m Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for allocation operations. This adds trace events for attr_allocate_clusters(), attr_set_size_ex(), and attr_data_get_block() to help observe cluster allocation, size changes, and block mapping activity. Signed-off-by: Baolin Liu --- fs/ntfs3/attrib.c | 12 ++++++ include/trace/events/ntfs3.h | 78 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index c621a4c582f9..8c4a14a87721 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -13,6 +13,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* * You can set external NTFS_MIN_LOG2_OF_CLUMP/NTFS_MAX_LOG2_OF_CLUMP to m= anage @@ -167,6 +168,8 @@ int attr_allocate_clusters(struct ntfs_sb_info *sbi, st= ruct runs_tree *run, CLST flen, vcn0 =3D vcn, pre =3D pre_alloc ? *pre_alloc : 0; size_t cnt =3D run->count; =20 + trace_ntfs3_attr_allocate_clusters(sbi->sb, vcn, lcn, len, opt); + for (;;) { err =3D ntfs_look_for_free_space(sbi, lcn, len + pre, &lcn, &flen, opt); @@ -462,6 +465,12 @@ int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_= TYPE type, goto bad_inode; } =20 + trace_ntfs3_attr_set_size_ex(&ni->vfs_inode, le32_to_cpu(type), + attr_b->non_res ? + le64_to_cpu(attr_b->nres.data_size) : + le32_to_cpu(attr_b->res.data_size), + new_size, keep_prealloc, no_da); + if (!attr_b->non_res) { err =3D attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run, &attr_b); @@ -960,6 +969,9 @@ int attr_data_get_block(struct ntfs_inode *ni, CLST vcn= , CLST clen, CLST *lcn, if (res) *res =3D NULL; =20 + trace_ntfs3_attr_data_get_block(&ni->vfs_inode, vcn, clen, new, zero, + no_da); + /* Try to find in cache. */ down_read(&ni->file.run_lock); if (run_lookup_entry_da(&ni->file.run, !no_da ? &ni->file.run_da : NULL, diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index 4ac05ed29e49..e39765bc062f 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -223,6 +223,84 @@ TRACE_EVENT(ntfs3_indx_delete_entry, __entry->ino, __entry->type, __entry->key_len) ); =20 +TRACE_EVENT(ntfs3_attr_allocate_clusters, + TP_PROTO(struct super_block *sb, u64 vcn, u64 lcn, u64 len, u32 opt), + TP_ARGS(sb, vcn, lcn, len, opt), + TP_STRUCT__entry( + __field(u64, vcn) + __field(u64, lcn) + __field(u64, len) + __field(dev_t, dev) + __field(u32, opt) + ), + TP_fast_assign( + __entry->vcn =3D vcn; + __entry->lcn =3D lcn; + __entry->len =3D len; + __entry->dev =3D sb->s_dev; + __entry->opt =3D opt; + ), + TP_printk("dev=3D(%d,%d) vcn=3D%llu lcn=3D%llu len=3D%llu opt=3D0x%x", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->vcn, __entry->lcn, __entry->len, __entry->opt) +); + +TRACE_EVENT(ntfs3_attr_set_size_ex, + TP_PROTO(struct inode *inode, u32 type, u64 old_size, u64 new_size, + bool keep_prealloc, bool no_da), + TP_ARGS(inode, type, old_size, new_size, keep_prealloc, no_da), + TP_STRUCT__entry( + __field(u64, old_size) + __field(u64, new_size) + __field(unsigned long, ino) + __field(dev_t, dev) + __field(u32, type) + __field(bool, keep_prealloc) + __field(bool, no_da) + ), + TP_fast_assign( + __entry->old_size =3D old_size; + __entry->new_size =3D new_size; + __entry->ino =3D inode->i_ino; + __entry->dev =3D inode->i_sb->s_dev; + __entry->type =3D type; + __entry->keep_prealloc =3D keep_prealloc; + __entry->no_da =3D no_da; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu type=3D0x%x old_size=3D%llu new_size= =3D%llu keep_prealloc=3D%d no_da=3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, + __entry->type, __entry->old_size, __entry->new_size, + __entry->keep_prealloc, __entry->no_da) +); + +TRACE_EVENT(ntfs3_attr_data_get_block, + TP_PROTO(struct inode *inode, u64 vcn, u64 clen, bool *new, + bool zero, bool no_da), + TP_ARGS(inode, vcn, clen, new, zero, no_da), + TP_STRUCT__entry( + __field(u64, vcn) + __field(u64, clen) + __field(unsigned long, ino) + __field(dev_t, dev) + __field(bool, create) + __field(bool, zero) + __field(bool, no_da) + ), + TP_fast_assign( + __entry->vcn =3D vcn; + __entry->clen =3D clen; + __entry->ino =3D inode->i_ino; + __entry->dev =3D inode->i_sb->s_dev; + __entry->create =3D !!new; + __entry->zero =3D zero; + __entry->no_da =3D no_da; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu vcn=3D%llu clen=3D%llu create=3D%d zer= o=3D%d no_da=3D%d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, + __entry->vcn, __entry->clen, __entry->create, + __entry->zero, __entry->no_da) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E62AA3E0C55; Thu, 20 Aug 2026 09:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216832; cv=none; b=jQPRpfwpDPQC8Mg6bIJ0Y96x5Xaqyd6O0zxNxlTsbuiArJvvjZQOhTxtYqc/7iGdaTMx3at/NDumEn8n1564fxHsQy/wcC9IaBGvclSBsKf02M+pt7Gd2qbhtRWDzHpT6B7IlqyKuse5+uikaC3hd4B5VAcoo/0kQ7LCPlDSGXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216832; c=relaxed/simple; bh=FH77Z4Tyi6l79sLP04scPPmahnqB8vKdTTxzhy1lFBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NMw8K8Sr19iu0wXdEy+cmFb8et0YlEzwcJTnupo0WdjSe4NVXba6P/jns2QhNyI0IWTN+sF4MR0lBQUOWi0bjWgMfSeuUJAEyOebN3kPYdytS4k/J9cQqHyqXCwMrwewbfdAyukQaEXpU0aKL1ZvNKWs4Gj/nEoZUOLFSBuczBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=bcGejpP6; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="bcGejpP6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=ET 9N/9vZDeZEA2twROTaEvCeOy2JTOq+VTonny2bnZQ=; b=bcGejpP67eF/odowCS Mhyo+nsBoNTegsUAs8SqlzrhElVuBN2G/32G0pfD364wNe3j6cQQVFGREwfDjFGv fyrzQ9aNTIM9OU+YraUqO7Zj2NSWwf4KyORa/l+tKSy+aTX0HLMUark/kJnMS706 7YPPfa/7Vtv61HTAuIEYEGAG8= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S8; Thu, 20 Aug 2026 17:06:33 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 6/7] ntfs3: add iomap tracepoints Date: Thu, 20 Aug 2026 17:05:03 +0800 Message-ID: <20260820090504.950475-7-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S8 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1rWF4DtF1rAryxXwb_yoW5CFWxpa sFyFZxGa97JrW29wsayw4FqF4ava4xur4UKr17Wryay3Wxt3W7KF4vgFyjvw18AF1jkr1I gF90vryUG3WUXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwhlTHmqGw5k8ygAA3W Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for iomap operations. This adds trace events for ntfs_iomap_begin() and ntfs_iomap_end() to help observe iomap mapping activity. Signed-off-by: Baolin Liu --- fs/ntfs3/inode.c | 4 +++ include/trace/events/ntfs3.h | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 4c427ed69272..54bf5225fa47 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -741,6 +741,8 @@ static int ntfs_iomap_begin(struct inode *inode, loff_t= offset, loff_t length, bool new_clst =3D false; bool no_da; bool zero =3D false; + + trace_ntfs3_iomap_begin(inode, offset, length, flags); if (unlikely(ntfs3_forced_shutdown(sbi->sb))) return -EIO; =20 @@ -879,6 +881,8 @@ static int ntfs_iomap_end(struct inode *inode, loff_t p= os, loff_t length, struct ntfs_inode *ni =3D ntfs_i(inode); loff_t endbyte =3D pos + written; =20 + trace_ntfs3_iomap_end(inode, pos, length, written, flags); + if ((flags & IOMAP_WRITE) || (flags & IOMAP_ZERO)) { if (iomap->type =3D=3D IOMAP_INLINE) { u32 data_size; diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index e39765bc062f..e0c0c44ce318 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -301,6 +301,56 @@ TRACE_EVENT(ntfs3_attr_data_get_block, __entry->zero, __entry->no_da) ); =20 +TRACE_EVENT(ntfs3_iomap_begin, + TP_PROTO(struct inode *inode, loff_t offset, loff_t length, + unsigned int flags), + TP_ARGS(inode, offset, length, flags), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(loff_t, offset) + __field(loff_t, length) + __field(dev_t, dev) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->offset =3D offset; + __entry->length =3D length; + __entry->dev =3D inode->i_sb->s_dev; + __entry->flags =3D flags; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu offset=3D%lld length=3D%lld flags=3D0x= %x", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->offset, __entry->length, + __entry->flags) +); + +TRACE_EVENT(ntfs3_iomap_end, + TP_PROTO(struct inode *inode, loff_t pos, loff_t length, + ssize_t written, unsigned int flags), + TP_ARGS(inode, pos, length, written, flags), + TP_STRUCT__entry( + __field(unsigned long, ino) + __field(loff_t, pos) + __field(loff_t, length) + __field(ssize_t, written) + __field(dev_t, dev) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->ino =3D inode->i_ino; + __entry->pos =3D pos; + __entry->length =3D length; + __entry->written =3D written; + __entry->dev =3D inode->i_sb->s_dev; + __entry->flags =3D flags; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu pos=3D%lld length=3D%lld written=3D%zd= flags=3D0x%x", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->pos, __entry->length, + __entry->written, __entry->flags) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Mon Sep 28 16:21:59 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E2C53E0C75; Thu, 20 Aug 2026 09:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216833; cv=none; b=ZfzDOEcE/dYGwrEbf5ANYI408gO/OqB6lyMIOeReyI11zpG4vBLHJoNwJ+Vw6sbsDzmbePHnGvhNuDk6shuBOG2+kQwJC67nCIhtn2PSgke3+tGhZbnV8dcBFiMMXYXcTgnB4VkhAa83W2QDHtfpDBa6WEHfPDxgCC/eswvw7go= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216833; c=relaxed/simple; bh=kE07+3FrjG/f4QgPwya8iFimstZ6XTrjDf/FRCnDtw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pPMCERrgU8RWOMqYqHW1jz3zxswI4bOdvpQYdSR1b9F7wUrDE4aufEVJPAlU9yL6Y4LmRnFQ7Bv5x7J4Z5NVzGQdylJxqAiu9nDRa+mfOuU4v/9wmHASQufNS5vvFy5f46Vc8hZ2/cESomVKI4xUAslO2y2a+vGKfFN3/RPgphY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=kn9uj1z/; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="kn9uj1z/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=zv 25wQESxnTXv+VplXCMpYdVf6Py4StgSKQIpJ5dTsg=; b=kn9uj1z/4A1DLwGA8L rbt9Dh3nkPSAs6ygAucYn4HsAewN/b5Zhmi7AhmTgc6LCk38TywgQhEmOl/Meleh wc19HflYJJ7n9qOVbRJshFwP9VSHVEyb1Ziw1UDv24N5A2ihGOPM++uDB5eDg5F3 m0Qqdn3S12AlIt6WyEHEv9Z0c= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wAHFld6w4ZqIRluPA--.45482S9; Thu, 20 Aug 2026 17:06:39 +0800 (CST) From: Baolin Liu To: almaz.alexandrovich@paragon-software.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org, liubaolin12138@163.com, liubaolin12138@gmail.com, Baolin Liu Subject: [PATCH v4 7/7] ntfs3: add file I/O tracepoints Date: Thu, 20 Aug 2026 17:05:04 +0800 Message-ID: <20260820090504.950475-8-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260820090504.950475-1-liubaolin12138@163.com> References: <20260820090504.950475-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAHFld6w4ZqIRluPA--.45482S9 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1ktw1kJr45ZFy3twb_yoW5XF47pF nIyasxurZ7J3y7Kws3CF4DXa1rua1xCrWUJry7W3W3Ar1xtrn3JanFgF1jk3Z5ArWqyw1a g3Z093s8G34UXw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6h9UH2qGw591wQAA36 Content-Type: text/plain; charset="utf-8" From: Baolin Liu Add ntfs3 tracepoints for file I/O operations. This adds trace events for ntfs_file_read_iter() and ntfs_file_write_iter() to help observe file read and write activity. Signed-off-by: Baolin Liu --- fs/ntfs3/file.c | 5 +++++ include/trace/events/ntfs3.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index d601f088618c..a260a57ebd65 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -20,6 +20,7 @@ #include "debug.h" #include "ntfs.h" #include "ntfs_fs.h" +#include =20 /* * cifx, btrfs, exfat, ext4, f2fs use this constant. @@ -822,6 +823,8 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, = struct iov_iter *iter) unsigned int dio_flags; ssize_t err; =20 + trace_ntfs3_file_read_iter(iocb, iter); + err =3D check_read_restriction(inode); if (err) return err; @@ -1225,6 +1228,8 @@ static ssize_t ntfs_file_write_iter(struct kiocb *ioc= b, struct iov_iter *from) loff_t vbo, endbyte; ssize_t ret, err; =20 + trace_ntfs3_file_write_iter(iocb, from); + if (!inode_trylock(inode)) { if (iocb->ki_flags & IOCB_NOWAIT) return -EAGAIN; diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h index e0c0c44ce318..750300068984 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -351,6 +351,39 @@ TRACE_EVENT(ntfs3_iomap_end, __entry->written, __entry->flags) ); =20 +DECLARE_EVENT_CLASS(ntfs3_file_class, + TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), + TP_ARGS(iocb, iter), + TP_STRUCT__entry( + __field(loff_t, size) + __field(loff_t, offset) + __field(size_t, count) + __field(unsigned long, ino) + __field(dev_t, dev) + ), + TP_fast_assign( + __entry->size =3D i_size_read(file_inode(iocb->ki_filp)); + __entry->offset =3D iocb->ki_pos; + __entry->count =3D iov_iter_count(iter); + __entry->ino =3D file_inode(iocb->ki_filp)->i_ino; + __entry->dev =3D file_inode(iocb->ki_filp)->i_sb->s_dev; + ), + TP_printk("dev=3D(%d,%d) ino=3D%lu size=3D%lld pos=3D%lld bytecount=3D%zu= ", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __entry->size, __entry->offset, + __entry->count) +); + +DEFINE_EVENT(ntfs3_file_class, ntfs3_file_read_iter, + TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), + TP_ARGS(iocb, iter) +); + +DEFINE_EVENT(ntfs3_file_class, ntfs3_file_write_iter, + TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), + TP_ARGS(iocb, iter) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0