From nobody Wed Sep 30 16:19:36 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 73BC91DE894; Fri, 7 Aug 2026 01:04:39 +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=1786064681; cv=none; b=rGXZjd/wZLu7bn7lYJLXp/IoDOClIC5gBv00og6WzwLH/l+9FHSSH3VDV6qZvh1rrmfgBUvkqHWYNiQA1IQ+Srtisa3Dyn/DGXMgbEwuKWUKa9LADW1OnKbCTvzUY5nWGAW5L8tC03CLHN+KIecWxGkaRCXsBLWQp1+74ZhrELM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064681; c=relaxed/simple; bh=0/ZSoNy1k+rFbDsUyDKoAIOrpgg8Ac+kDGlKNaKjWlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ODLUh0yK+PRoVwq0U/Djk6FEtbbeMCr1JgeUNNbncc/oQtqG/VnRQJhjAkjv+HkolNuoi/4pThGp8L7A8/SndNQMJAjtsTADVYyJtSDwpJyWjUkosZ9aBq65P94t5hKsF5ujyvsOtFjo6VbWmBOYGMUJSVkPiJe2ZP75WXpSN9o= 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=JkIyew2L; 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="JkIyew2L" 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=f3 KMjrmBRLGyvebv3Bnny7P8yVVf4Nllbl/4/Q0Lb8k=; b=JkIyew2LB5y5jGCjOZ p4AJ668qK3BWxORMpsmfOBurXoNkfUfhLfoRvWrg/6j3AipTHO98EGi23FVtyY5+ M3+PiWyo6JXvDwJx6O0Idn91Om7SZ6IwasFlSLpABBjWWiDtTEL135WqSHSjhIU+ 7obgFSRCDX1tfQgIkPqhz4yjs= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S3; Fri, 07 Aug 2026 09:04:02 +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 v3 v3 1/7] ntfs3: add mount and log replay tracepoints Date: Fri, 7 Aug 2026 09:03:48 +0800 Message-ID: <20260807010354.2277156-2-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S3 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF4xAF4ktw4fury7ur4DJwb_yoWxJryrpF 17AFs3G3yktrWj9ws3tw1Sqr4rZa48uF4Utry3W347Ars7tr1kJr4DtrW8CFZ5ArZ0k3sa q3Z0v395Cw15Wr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zNhFcUUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6QTEj2p1LwTlAgAA31 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 15011f5752a9..05d815243cb8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19293,6 +19293,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 Wed Sep 30 16:19:36 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.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 76101274641; Fri, 7 Aug 2026 01:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064687; cv=none; b=pl7TYJDXO+wgnk4Bj8wZVOrpNWoEMQPikX1/lkV3D6FZ8PyEkXE3+tJbF6AiXE1bu3FxOIcTyt+pSQztqLWq9+Z4m98KOOdP24+FQuSFaSZkJyjDpNFAgzZZHGSlxCcZxRWkuIMond8L9nE3KJUc97mEcDj7AA3oxw7mdZ+/6OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064687; c=relaxed/simple; bh=3YrGN2r3o4zxkKUcthMdwznjPnpl3mbm4YiZNIESras=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoqZtcVGnQHPZac3t0wTUS1AheQTcDBryFpFb84uUsz9ETWZdfbmKJgk1RM4cenXGP/4uPPLpZ0YL7Kem+qwCV9Ath2QqyRY8ZLZpdyw907PwRv+ZtOHCHTfQflX9fwxy+LLm/QXmZobvm9RZKjfk8ZSCiBfz2HR26KaHG1IprA= 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=MgPNRM6w; arc=none smtp.client-ip=220.197.31.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="MgPNRM6w" 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=MgPNRM6wFH2C82JFep mw9QOjcBeVd/s7T3FMUkDxBcX9cAJvAgHvUCOvTO3qHv49TKntnACmNDPkCN8yUj OkZOQ+7A+XTGXTnZcP96E0F3C4Vc3prjv+cw/53zwUAdxsVcySwvnhTbx17YqVO4 Pxom57yF4tSxp8OgZ+yhO7v6M= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S4; Fri, 07 Aug 2026 09:04:07 +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 v3 v3 2/7] ntfs3: add namei tracepoints Date: Fri, 7 Aug 2026 09:03:49 +0800 Message-ID: <20260807010354.2277156-3-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18Aw4xZF15uw18JrWUArb_yoW5Cr47pF nFyFZ8W393JrsxKwnava15Zr4rZay8ur1Utry29347Ar1IqF1xtrs2gr4DAr95AFWFk347 WFWYv3s8Cw15Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRbo7_UUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwQfEj2p1LwdoywAA3Z 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 Wed Sep 30 16:19:36 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 C120D1F91E3; Fri, 7 Aug 2026 01:04:39 +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=1786064681; cv=none; b=Gla09L6RWlH7LLW8ZPf/4nls3bbnB4SpYHFoo2zdr2cY4hzsCol7rTiMh70cyuVEVDm9chcsbtvzzbSq4DehqDWMwKpJX0IvKp6MhB9v4lKWP345oWqobsImI1/IxWTeIyWWHC/RIDyg4mRRvfV2+A1c5rqv3kBeE/HytL6Ceys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064681; c=relaxed/simple; bh=Bu2vSu3DwMTZYlUvJN1sp50MCL0Vfz9Lx4mxay5YC6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bCFYBdcD1Mr9BvU2/0SdcEWrqd8X7GCEgQ8l6CEpzEtjNG1JhZcn2Q03vK2/tYLaSbPA3OqaAaBOTaBrde/aD9n0y2R9ejq/3dK6w08tOeuKl9fE4XyeDdge7sH1wVjBeh4BMuOVBQ/XZvELnRncsQp/WUnCKAUgk0i6dHRynJw= 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=gqhU6lIr; 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="gqhU6lIr" 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=mE 8FbL0Y9igfRnF4YHueX6o/QSzO9T6fzQHIuuBtbcw=; b=gqhU6lIrUTKKWuc17O imYFDDgiYKMJlYJ4ayc7rOGt8rMmmBf5oIjBHHOebtQPo7PL1GqHs5VYL3K6J/xt bxuGj82Pby7b2mauuoH2nqLIU3I26oO1uJh59F48I4txow8OV43Pp5mdtStyPUK2 Kkd4uA6eIrB4BXCvlbgoe2bNk= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S5; Fri, 07 Aug 2026 09:04:09 +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 v3 v3 3/7] ntfs3: add create inode tracepoint Date: Fri, 7 Aug 2026 09:03:50 +0800 Message-ID: <20260807010354.2277156-4-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr45GFykJF1rCrWrCrWfXwb_yoW8CryUpF nrAFs3Gws7J347KwsavF4UXFySvay8Gr4DJFyUu34xArnaqFn7trsFgw1DZ3Z5ArWFy343 WFnI9ry5Cr12qw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRYXdbUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwQrFkGp1LwppFAAA3Z 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 c43101cc064d..2bc4ce2ee8d8 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. @@ -1206,6 +1207,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 Wed Sep 30 16:19:36 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 5CBCC233943; Fri, 7 Aug 2026 01:04:40 +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=1786064682; cv=none; b=nC56iJGFr7fc7oZfLkqtp5Ia3wbAdlPlaBZdsStPM4mQsbLVvDfRpemoCLb8pID3ff0DmN7W/1luZN4JkBhEcNxF2mijKS6IxKePRieeeK8buqkuAwDqDAgksLcnaxiCvgQVCE3fNuabagffc0D5CvaFjj4Sx8hGDtC1gJvS334= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064682; c=relaxed/simple; bh=ipFRiEZb3eOzbms77cPdggMuTdTP/tuAsuPcoOcd3hw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o1xUTaGhjDwc5I2of6VGyUTgyii56VNv6Zi1r8hjN22SuwYb4V/NZsGKjKI4gZyPZ3I03RSyJw9qkgdA0XLjOUfdbohakba2QOVQAEOCs7bIx55Znh94nhsq8L41gIEpr2KvNkfXIooBWzNuGZ5kBwhHHPpuq1ljw3SmLrquNGs= 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=GRtvyrGv; 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="GRtvyrGv" 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=GRtvyrGvepRYtG/sLq zcpWHyGADt4klLVB9FrUlI3711XJNgiiHYSNRC1iSepNmOp1LUxDQh8BrJTgCBpM vvzSlSiA2r4O/AlM+eCoDJucxy2SQkBc0FPPRr7OGpJ4Yp/8XA6nZ29/+7MeD0z/ jBTsYpifmUwVbdGbPg0IUdj2g= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S6; Fri, 07 Aug 2026 09:04:11 +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 v3 v3 4/7] ntfs3: add directory index tracepoints Date: Fri, 7 Aug 2026 09:03:51 +0800 Message-ID: <20260807010354.2277156-5-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S6 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF47WF47Aw4UJFW3Jw1rXrb_yoW7Xr43pF nrCrZxK397JrZFkwsaya1Fyr4ava95ur4Dtry3W342yw4Iqr18tF4DKr1jvr95ArWF9ryf WF4Y9a4DG3WUWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pE_-PUUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6QvFkGp1Lwvl5gAA3P 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 Wed Sep 30 16:19:36 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.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 1C2B2282F24; Fri, 7 Aug 2026 01:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064695; cv=none; b=e5DjCaMwSMxQ1+4CL2JRZ5Eif4aFgwSx/b3fkSolJyui5mOupoQDhyMX131uFQ+gneOFw4Fiuv2HT5rqbNtEEnXtWyJjjss9CzcF/xe3WM4aq7UzcQANTyPs1ZrouZgcWHKCRLKjiUq9aLPCqGB0gH/NibAQVNxRZGxV0joQOKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064695; c=relaxed/simple; bh=WJ2EZd+tslyCXF4VijVQs5/B9ognZg5bGw1YxDvatiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uc2VVgsVA4M2cgM4qQuy84zVvxErBb27xYeeNEiWJeh1Np2rPqm2W3MoCXELKB1X3lud1AbnaYlVaC24dPUH1eGllT8dRAWsba4hLAmum6zRA7KDGBxXiIGQCMMP1kSG/EgtmSRBKW5uNPG46TE5LAvMUXGbF6bdf6rYbdGmhqY= 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=W5aUwXv0; arc=none smtp.client-ip=220.197.31.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="W5aUwXv0" 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=pE X/r2AQmnAgIls5Qm8ZlDT1RfDE4/tNoliJXxnVjyg=; b=W5aUwXv0j2IyJxkdL2 2r+mzW7HzHDM3dcjzljVXY5MtzmlzSb7KG41xMX2TB6lQcGbNvolQqbO7G3ThixZ 3L0rvmsaUq4TqSuUPHdVtqGNNdYYiYs5UPbiM+roa0g/Mi6liOagpF2kayEOJOBH ycaFQtLdZCezK9Ab9aJISo0ps= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S7; Fri, 07 Aug 2026 09:04:13 +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 v3 v3 5/7] ntfs3: add allocation tracepoints Date: Fri, 7 Aug 2026 09:03:52 +0800 Message-ID: <20260807010354.2277156-6-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S7 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr15AFy5ZF48JrWfurWkCrg_yoWrtF4DpF 1DAFy3Ww4rJrZFkwsavw48tw45uay8ur4UKry7W34jyr1Iqrn7tr4Utr1jvFyvkFyvkrnx WFyq93s8G3WUWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6Q3GkWp1Lw3mLQAA3F 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 | 9 +++++ include/trace/events/ntfs3.h | 78 ++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index c621a4c582f9..a793f17b6bb4 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); @@ -452,6 +455,9 @@ int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_T= YPE type, u32 align; struct MFT_REC *rec; =20 + trace_ntfs3_attr_set_size_ex(&ni->vfs_inode, le32_to_cpu(type), new_size, + keep_prealloc, no_da); + again: alen =3D 0; le_b =3D NULL; @@ -960,6 +966,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 !=3D NULL, 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..d16dd127ff2e 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 new_size, bool keep_prealloc, + bool no_da), + TP_ARGS(inode, type, new_size, keep_prealloc, no_da), + TP_STRUCT__entry( + __field(loff_t, 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 i_size_read(inode); + __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%lld 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 create, + bool zero, bool no_da), + TP_ARGS(inode, vcn, clen, create, 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 create; + __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 Wed Sep 30 16:19:36 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 8BB71277CA5; Fri, 7 Aug 2026 01:04:43 +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=1786064685; cv=none; b=Ywkwp+TaRrmpnX7M5PKQIfVUMzMpgXZJvdzggvisbkLBwmV0U0u7LcZQwMl4lt0XfYxGivSnhvYLmXWq5ZgPsPpFxM7JUuJnZCeWDXEoH6yCl/qTD9+hzVojewEhU0X0t15g7FXVIArgOzJEiIi0hPK1kMveiKLVO0rBhtEZ9cM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064685; c=relaxed/simple; bh=r+//4nJAx+/mmAFhPfYqS+Iv4YKZASAUHrrj1+AQkeA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WY1b318ueTENMUa2Kfhbu2k63B6//uVKYjAq+rSK8aDXs/HhKiUBYSSqNaEZqIYHQNjY3GIpcu/i0LHYr1wd8wmDEVQ5Oxu4hijr+JDCfc64OnwwowWmxoF8xGTcKpnNEYz2s74yAuZ9dop0dajtSLlqWM4PQ+lvf5YvJv74AO4= 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=P3caOou2; 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="P3caOou2" 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=3i BqW6JxL70woVpgpOeiUfzP47o+FOY2Gk0gHWKBLo4=; b=P3caOou2d7MCn9Qhca u7r9AEPLsVYYB6tGbxNqhH+5no/mu5vAoXW0shSTOfP9Z0HohTEdMygdMqWkcmZ7 0g9Y9ZT2zk6Lzi+zWux32BZ6XCMTYQyBSENDPXW4efg3t0EA7Q36MnG452ixuXYD 2+MpTg/4JTiPQBRdWfhxzKWBc= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S8; Fri, 07 Aug 2026 09:04:15 +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 v3 v3 6/7] ntfs3: add iomap tracepoints Date: Fri, 7 Aug 2026 09:03:53 +0800 Message-ID: <20260807010354.2277156-7-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S8 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1rWF4DtF1rAryxXwb_yoW5CFWxpa 4qyFZxGa97JrW29wsayw4FqF4ava4xur4Utr17Wry3t3W8t3WxKF4vgFyjvw18A3Wjkr1I gF90vryUG3WUXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwg-GkWp1Lw902wAA3K 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 2bc4ce2ee8d8..bccb3feb5f3b 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -744,6 +744,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 @@ -882,6 +884,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 d16dd127ff2e..7a94c2788295 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 Wed Sep 30 16:19:36 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 EE388282F34; Fri, 7 Aug 2026 01:04:44 +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=1786064687; cv=none; b=QfiaC+hg91bSd0uIHKIVVWKbPL0l1zh9gX/Bj+gZ5B/OaGJBy/jbl1ox1S0oOxOLWDJpyUZCB4i/aAsfdMIiOD5vBsJGAR9P/wHyVXow7BZPGWFq8R3aySkRpm1Sqbf8KyI878wzl6q1r4fL5i5EU3oQJUx7wiZXFiQP9JJfAvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786064687; c=relaxed/simple; bh=Yfao+oSjMPGe4+QuHnl5HAxHcnC/rs73XaioxJf/86s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L9Thi7spKfw+nlQR6bT+17rGmtxV9sdC1b1iztk3sEXByrCKhcaUkqqNQ/E13p6nBbnAXAL2RhygRH88AkIeRWQ+cDw42HY/wDM9mrdv1hPHYatvWF79FTU5TlHUyQTNehKXCRyzOFrPL4hvQt19z3xoNTNgJm9pzE3xwfu6fnM= 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=fzsECu6f; 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="fzsECu6f" 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=E0 b/N/mkFze6dmVbf5O0lbNgI3WDQMXE76TxPFcP1Kw=; b=fzsECu6fKNMc55xQhl 7d9FTqytcCs92M+wMRJ3+GFX6t9yjbiEzlL4pKhOXeRpIAJc3Mlz53NKLztt7J3R 0xr9oP4MARAZ+W9QgwIgUXrh83E1cUeJIOUV+SxK73P1Dlh63Ar9fd35AeBTxy+D W/V3LzPti7sfRrHdFNWlaRino= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wAnpYn9LnVqp7BkOQ--.32974S9; Fri, 07 Aug 2026 09:04: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 v3 v3 7/7] ntfs3: add file I/O tracepoints Date: Fri, 7 Aug 2026 09:03:54 +0800 Message-ID: <20260807010354.2277156-8-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260807010354.2277156-1-liubaolin12138@163.com> References: <20260807010354.2277156-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: _____wAnpYn9LnVqp7BkOQ--.32974S9 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1ktw1kJr45ZFy3twb_yoW5XF47pF nIyasxWrWxJ3y7Kws3CF4DXa1rua1xCrWUJry7W3W3Ar1xJrn7JanFgF1jk3Z5ArWqyw1a g3Z093s8G34UXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6hHHkmp1LxG+gQAA3w 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 7a94c2788295..c76fe265fb79 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