From nobody Sat Jul 25 06:09:49 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 3A6A9379991; Fri, 17 Jul 2026 03:23:38 +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=1784258631; cv=none; b=fMaE2MkWTzVAGTB54F/9etUCYEw9AirvZ6g0G4OoTMxIcxnOHcPD1oGZS4qnUoR/vEeRfBr6CNVudyUQyLhaG1YFhAQ4TW94K55rJ0QuTdv1YKBTVKxHAd2ax302v+yXAiR4B/YYNvQykfsUNrhDtVdznceobf8us9JkfB0Xb1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258631; c=relaxed/simple; bh=8IjNPX3b9oDtA7ccWW/FuqBcdCMi6fZbSFVSS8ClaG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rfUltyovV42rwuaWchJ59uzviHuikqeNBTd/4yVz1Ecbbv//qZtUU2I4D+bLd9BoQYaLwjSs4VMPn0gQtT9NmOoTYZBEzhphe/tqa451rwbZswYG41LFjoImuY+cQuGta90DNzWiFdb2GWAnwI8K9si4S+Mk7Sb+WcpW0s4Znl0= 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=W+VP+lgH; 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="W+VP+lgH" 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=V2 K8udpr/JM17a3K/bdp2bYKyLJGsmIq/DwkSIsPTHc=; b=W+VP+lgH9FcndozWgF PnFOHRIB6liqjcNUR1gf/NQ30dU1EejyjfFk3VFNnu6Gt94uhTQP1ZmFkkN86WlB sYsmoiPNtKUJrcPV5rh8Y97vyMnCFE4BnC9ig2C3f6Uqqom47utUwmsidZalYm+g wlRDM7Q746iA9oWeA0t08jEAA= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S3; Fri, 17 Jul 2026 11:23:01 +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 v1 v1 1/7] ntfs3: add mount and log replay tracepoints Date: Fri, 17 Jul 2026 11:22:42 +0800 Message-ID: <20260717032248.3318208-2-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S3 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF4xAF4ktw4fury7ur4DJwb_yoWxJryrpF nrAFs3G3yktrWj9ws3tw1Sqr4rZa48uF4Utry3W347Ars7tr1kJr4DtrW8CFZ5ArZ0k3sa q3Z0v390kw15Wr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zNhFcUUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwRce6GpZoBf30QAA3C 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..d00f66e42ba8 --- /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(bool, ro) + __field(u32, cluster_size) + __field(u32, record_size) + __field(u32, index_size) + __field(int, err) + ), + TP_fast_assign( + __entry->dev =3D sb->s_bdev->bd_dev; + __entry->ro =3D ro; + __entry->cluster_size =3D cluster_size; + __entry->record_size =3D record_size; + __entry->index_size =3D index_size; + __entry->err =3D err; + ), + 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(bool, used_alt_boot) + __field(int, err) + ), + 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->used_alt_boot =3D used_alt_boot; + __entry->err =3D err; + ), + 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(dev_t, dev) + __field(unsigned long, ino) + __field(loff_t, size) + __field(bool, initialized) + __field(int, err) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->size =3D i_size_read(inode); + __entry->initialized =3D initialized; + __entry->err =3D err; + ), + 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 Sat Jul 25 06:09:49 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.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 9F45C3750A9; Fri, 17 Jul 2026 03:23:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258630; cv=none; b=UX63w4/7GYAeI0XW6cBMmxImi93+/kQohX5QsC0UKUZBIXoRV/w5AwFIgj2YI4P/skLrU5HlfLoxQCvh5OvK8yV30BQTQLe71Gle90YEjTzYVs5RKcklptVyZ7jFFUnfs2C7XBvyOhtLizVE/gqtmiV8LTWphxGdlEM1wGPcG/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258630; c=relaxed/simple; bh=ubvnS3Ql2bDgP+1CJqKyu3NeaOYzMTX/ijM6tFkgNWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TlCGNAwcQ18Qmr/7E1eewqIuXzzk4HRbePQ2qasPXPOC650mbzn/BMc9a971E0S0g3LmWLg9U3ifgXgf8zUN9nlO/WxghcHZxsbkqADEAlVS0/9r8+z9RJpgHqNiqBIb2eEX5J1VLan/GpLlVR+NMQxE82gOetT0xtLoOZ0KRhI= 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=fOXJQ4yE; arc=none smtp.client-ip=117.135.210.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="fOXJQ4yE" 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=8Q zKyCA7OlNu1azMJphNZAjrJDG7Q8vI0xHLuGubLZ8=; b=fOXJQ4yEbrrGKLCN6m 2ikYP+AqLbNx8kgAJjXeD8r+OUlGYLa4EiNv8isEs0oc2RJa4dcJKMafR4oRft/W UqhRUNg5o1Ip78Wa9j+W8T41sA4VEPxIH6ePe3TfDFHdJatmb+G6JR2FvRLD2Jt0 60L2FCt+CnfumdgCPQeuXFhzI= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S4; Fri, 17 Jul 2026 11:23:08 +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 v1 v1 2/7] ntfs3: add namei tracepoints Date: Fri, 17 Jul 2026 11:22:43 +0800 Message-ID: <20260717032248.3318208-3-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18Aw4xZF4fJw4UKw15Arb_yoW5Zr1fpF nFyFy5K393JrsrKwnavw4rZr4rZay8ur17try2g347Ar4IqF1xtrs2qr4qyr95AFWFk343 XFWYv3s8Gw15Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRbo7_UUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6hwg6mpZoBxItwAA3M 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 | 47 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 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 d00f66e42ba8..ba27531d889e 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -80,6 +80,53 @@ 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(dev_t, dev) + __field(unsigned long, parent_ino) + __string(name, dentry->d_name.name) + __field(unsigned int, name_len) + ), + TP_fast_assign( + __entry->dev =3D dir->i_sb->s_dev; + __entry->parent_ino =3D dir->i_ino; + __assign_str(name); + __entry->name_len =3D dentry->d_name.len; + ), + TP_printk("dev=3D(%d,%d) parent=3D%lu name=3D%s len=3D%u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->parent_ino, __get_str(name), + __entry->name_len) +); + +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(dev_t, dev) + __field(unsigned long, dir_ino) + __field(unsigned long, new_dir_ino) + __field(unsigned long, ino) + __string(old_name, dentry->d_name.name) + __string(new_name, new_dentry->d_name.name) + ), + TP_fast_assign( + __entry->dev =3D dir->i_sb->s_dev; + __entry->dir_ino =3D dir->i_ino; + __entry->new_dir_ino =3D new_dir->i_ino; + __entry->ino =3D d_inode(dentry)->i_ino; + __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 Sat Jul 25 06:09:49 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 3EFCA375F96; Fri, 17 Jul 2026 03:24:01 +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=1784258644; cv=none; b=IMZwVsHsSDnAzTfV+dUXfXaBZaWPn73tFXiC6qSofgJXe1engV8bjP/w2++JUgLPWPJVPKDk9Xs0W3jENOjpP+rqxjwPYLL03+/wquoMMMIx4C+raJjSVGN7l3k/QxnwjAmBv79FKKlj/0ZPYM/UEPEEMORrGPsqc7kD3npz7WI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258644; c=relaxed/simple; bh=754wFdUHYSNM26KA2NQyt+lr1EipOG2WDyhORK9v3bg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EytFGRH7/GzZdpvDOBNL/vlPIqwgtUtIGca4xshmMJ7exjdJ6tOAzH3GOiw3cXbps3fvogOLczBQFDrYpJI7jn/oj0quiZheceue4eD0G4bD8ZYcCQBRttHH+LlyyWnMgTxY4HHZa6y0PWjfLNjOFhkWLNrVfgOzkskzpe7RPy0= 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=LK6U9pjz; 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="LK6U9pjz" 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=Eq 5D+FOUwr21J0LHbkK7uJXTLpBprdy0vcdNNsc4w4w=; b=LK6U9pjzz5o0QfwidW M7DLmYYChWdqOH7XRkby/r9JIJFXOVSYS40negneEGJS1mw/T7LDzDoODP/WFW/6 ysHri1853sms9sZBqOgzeZeYLpsxdJbUJp8Fi1uj6zuJ27ILkdaBBIPVvvjym83a KkeYmHWpwUIvwjDBzAiF5DsC8= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S5; Fri, 17 Jul 2026 11:23: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 v1 v1 3/7] ntfs3: add create inode tracepoint Date: Fri, 17 Jul 2026 11:22:44 +0800 Message-ID: <20260717032248.3318208-4-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr45GFykJF1rCrWrCrWfXwb_yoW8Zr43pF nrAFs3Kws7Jry7Kwsavr4UXFySvay8Gr4Utry7u34xAr1SqF1xtrsFgw1DZFn5ArWvy343 WF1a9ry5Gr17XaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRYXdbUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwQAh62pZoCD45wAA3n 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 | 21 +++++++++++++++++++++ 2 files changed, 24 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 ba27531d889e..cc9f4fee9ff8 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -127,6 +127,27 @@ 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(dev_t, dev) + __field(unsigned long, parent_ino) + __string(name, dentry->d_name.name) + __field(unsigned int, name_len) + ), + TP_fast_assign( + __entry->dev =3D dir->i_sb->s_dev; + __entry->parent_ino =3D dir->i_ino; + __assign_str(name); + __entry->name_len =3D dentry->d_name.len; + ), + TP_printk("dev=3D(%d,%d) parent=3D%lu name=3D%s len=3D%u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->parent_ino, __get_str(name), + __entry->name_len) +); + #endif /* _TRACE_NTFS3_H */ =20 #include --=20 2.51.0 From nobody Sat Jul 25 06:09:49 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 E02E6375ADF; Fri, 17 Jul 2026 03:24:01 +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=1784258644; cv=none; b=ksHwMfuE3jKYuguM3XsMbrWkmNilS7XMPOX2UNml4nmDUNwdOTql3w78MGGecat8NQDwl6mEWipK8SJCHHaTL8GWSYFyR1pxp4lBcfDNb3NIDTh7fALX7wjyuCofES4werhQud951iwKEbQvTH7ZTmnI86n1J8JTIsV2RJ43aI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258644; c=relaxed/simple; bh=RxCvF/EOmxo96olAf5bP8X9sXbls4wWW6I4H9grysbA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pj0Z0da71dC6LBkvSHYLK3omLNiK8PfMlfkMHBiq7uG1KKkikPWrQXlYqIP4Uk2ir4ZkDSxqGnpC3JiFWc9pY05L3iVmrZ/WWT51zDFDZwKlkbsb1Z9lrFF70ZoOgp0maU8Ib8gq2IwTEuVp5bIe3Nky84WTIAcn6yQ4h17VYms= 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=LEG5Kdul; 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="LEG5Kdul" 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=dQ qvor9rAOCOzxolK5A4ZGR9hBbzgCsM66H7Wr4/EUE=; b=LEG5KdulevymIAmCWk hEhlwSfGy4q0lDuDOhwjJWQrPM4h5yahz8Wlp2v7rMVsDX6aBTbbuxW0ZQEyImLW gGbX5Pbq2L7HZ6CNgjk2zcNgMn/IK41iDNfuN0+SZ2WazRgCQaWS4RtA2pIsM3yV OjaEnie1YX7pBUO8C79t9+Db8= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S6; Fri, 17 Jul 2026 11:23:14 +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 v1 v1 4/7] ntfs3: add directory index tracepoints Date: Fri, 17 Jul 2026 11:22:45 +0800 Message-ID: <20260717032248.3318208-5-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S6 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF47WF47Aw4UJFW3Jw1rXrb_yoW7Gw4DpF nrCrZxK397JrZFkwsaya1Fyr4avayrur4Dtry3W342yw4Iqr18tF4DKr1jvr95ArWF9Fy3 WF45ua4DG3WUXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pE_-PUUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6QMh62pZoCM3kAAA33 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 cc9f4fee9ff8..f9d7051cd14b 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -148,6 +148,87 @@ TRACE_EVENT(ntfs3_create_inode, __entry->name_len) ); =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(dev_t, dev) + __field(unsigned long, dir_ino) + __field(unsigned int, name_len) + ), + TP_fast_assign( + __entry->dev =3D dir->i_sb->s_dev; + __entry->dir_ino =3D dir->i_ino; + __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(dev_t, dev) + __field(unsigned long, ino) + __field(u8, type) + __field(size_t, key_len) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->type =3D type; + __entry->key_len =3D key_len; + ), + 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(dev_t, dev) + __field(unsigned long, ino) + __field(u8, type) + __field(u16, key_len) + __field(bool, undo) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->type =3D type; + __entry->key_len =3D key_len; + __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(dev_t, dev) + __field(unsigned long, ino) + __field(u8, type) + __field(u32, key_len) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->type =3D type; + __entry->key_len =3D key_len; + ), + 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 Sat Jul 25 06:09:49 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 363EC3750CF; Fri, 17 Jul 2026 03:23:57 +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=1784258641; cv=none; b=QQnbBUU3ECju5tlim92pafbk+0nC3R0Mv2CsB2XJzOl5N9tVFr/vqO7YS6kxqTHVRfrkG/448yDaLuiOw2/utfSwzUUM6LTHNnNWhhfLEiZJXY6W9PFGjCMwzPDyT3lhKe7EXn3qAhw2afCvbfTtlA3Lmv7qoUo98ic+cALGG94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258641; c=relaxed/simple; bh=c7WP7ukR1/rN9Y/3mD9/hRkCThhIgLN3Fks/fPopmwU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TRK5Wv/iUwvUNyqRtSs/zFAd1hJubQCXBb6VGqS+DpUmtCAIdDJaMIAkJruG42lygUnhl2vI4TaCRoMezgRsRRES9PMqaG+OyQIC1sVAWiseTJxvOaGFmUp9U8WQfgoiq+hpbIX5Lc7hnAQahNU7uzuZ05ahBcJxmvcY18v82QQ= 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=O6D8t0aP; 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="O6D8t0aP" 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=tr UE+C7LIXR6xvRMtU0vcwmgjJOBy1VduslJRYyuQo4=; b=O6D8t0aPnSaHsQl/wt 06F80FgpJhQ1FvDnk8hVjgK9GQohNSGCp6dquDfK++r/2jwItwgiqoW+Zb3RZfoK EIXyryinRreUB/yd0FBNTunGMDKBP4zdQ2EBmZGlXIi5tZtpdduZfa3xvSfbygxq F6LWuo35eW17M1BTKEMhsIHc0= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S7; Fri, 17 Jul 2026 11:23: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 v1 v1 5/7] ntfs3: add allocation tracepoints Date: Fri, 17 Jul 2026 11:22:46 +0800 Message-ID: <20260717032248.3318208-6-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S7 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr15AFy5ZF48JrWfurWkCrg_yoWrtF4DpF 1DAFy3Ww4rJrZFkwsavw48tw45uay8ur4UKry7Wry2yrn2qrn7tr4Utr1jvFyvkr1vkrnx WFyj93s8G3WUWr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBBTnUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwQUi7GpZoCX5qAAA3t 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 f9d7051cd14b..552f991b5257 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -229,6 +229,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(dev_t, dev) + __field(u64, vcn) + __field(u64, lcn) + __field(u64, len) + __field(u32, opt) + ), + TP_fast_assign( + __entry->dev =3D sb->s_dev; + __entry->vcn =3D vcn; + __entry->lcn =3D lcn; + __entry->len =3D len; + __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(dev_t, dev) + __field(unsigned long, ino) + __field(u32, type) + __field(loff_t, old_size) + __field(u64, new_size) + __field(bool, keep_prealloc) + __field(bool, no_da) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->type =3D type; + __entry->old_size =3D i_size_read(inode); + __entry->new_size =3D new_size; + __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(dev_t, dev) + __field(unsigned long, ino) + __field(u64, vcn) + __field(u64, clen) + __field(bool, create) + __field(bool, zero) + __field(bool, no_da) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->vcn =3D vcn; + __entry->clen =3D clen; + __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 Sat Jul 25 06:09:49 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 BF74F376A12; Fri, 17 Jul 2026 03:23:59 +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=1784258644; cv=none; b=jEzsomLgsAAlkjRn2Y6/QWhZJBV+ctdpXMG17mdbEGSJYXur1s6cREKBDWzihKm51eNc6k3Fve9i68jVYYCDRW5UmihMdouEl+HHBV4/udLxZlHux//Ba+tyRCm3j2Ti9nl0K2vlLKnFPWdP6Xg37u6IEjpVnLlr8x5PUoz7svw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258644; c=relaxed/simple; bh=FQKaSxhLSaUJixAnulKwFsuSp2AwAKOMM8MfnmgoIJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YEExyBOoFmFO+oUA51gAcHwFeCgW5GY50wkxn3DQAsR3n4ritgziuRSvmxHf4/ZDoomtkNQea5IUh9s0h+Zr0FOtDWmXIDYZuW8BV/rDWR6HPts9khulqSexlIRaixCEyJSAgi6afvkc9mq3+wtS4fjaq/WMxoHw9bTukUBZcDs= 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=nq/yL+j/; 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="nq/yL+j/" 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=SO M4C9GmnczKsAnjpNRI6HBAPSGvqdSmbUd2Vp5zEQE=; b=nq/yL+j/SXvO8TBDwM 18GXWPQayxtobPFsFUCT4hUcck03fK5lueOWiDNOMjVFDRiCUP3EFWyGJ5LckFUO o2CVrOqSfl/gy7XSf2MGP3xVfi/7BCS4A8eyz+e4yxaMCweycdvNrQ6ucEF0QS3Z b5DT7mBG4Y7D4pOK01kO731Us= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S8; Fri, 17 Jul 2026 11:23:19 +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 v1 v1 6/7] ntfs3: add iomap tracepoints Date: Fri, 17 Jul 2026 11:22:47 +0800 Message-ID: <20260717032248.3318208-7-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S8 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1rWF4DtF1rAryxXwb_yoW5CFWxp3 ZFyFZxGa97JrW29wsayw4FqF4ava4xur4Utr17Wryaya1xt3WxKF4vgFyjvw18AF1jkr1I gF90vryUG3WUXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6gci7GpZoCdKQgAA3f 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 552f991b5257..a846aa61153c 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -307,6 +307,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(dev_t, dev) + __field(unsigned long, ino) + __field(loff_t, offset) + __field(loff_t, length) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->offset =3D offset; + __entry->length =3D length; + __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(dev_t, dev) + __field(unsigned long, ino) + __field(loff_t, pos) + __field(loff_t, length) + __field(ssize_t, written) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->dev =3D inode->i_sb->s_dev; + __entry->ino =3D inode->i_ino; + __entry->pos =3D pos; + __entry->length =3D length; + __entry->written =3D written; + __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 Sat Jul 25 06:09:49 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 B87B53750CB; Fri, 17 Jul 2026 03:24:01 +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=1784258644; cv=none; b=qLL3ob96Q2/zz7GoiipgkT7bkTS00SWW+fbcbfzGysJ5Ga5SaSkiWyisajDk+R/WxHdi4W0zZrPgX7VLFkPJuE5Gh/aCdmribvymumRx7j1njPwe50o0ZmRpJtRNK4o3FSaJj1xdeqIQTXLMqNnZso5z+D+9hTEzp+ceJAZE80Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784258644; c=relaxed/simple; bh=A4sYQA408h4URz/Abt26UL3lN5sE9vFiSWwiFxL1wjY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rhUptPWtD2REWupkPQN3hU+vknFg7O90xrVPgjuQj33+rWCqPD3URgGzAUKriNsN6LZdKKxSZmi3Id0Q/4p3fndoZbWESxWbnx4qayxCt0EGrResqRVTEA4ZZ54NFyyMq9pVTe+W71+2AWT8iIVx3kOU6gwPuy+rleDIiMiIP1w= 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=IeMeMH8z; 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="IeMeMH8z" 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=aN KxlLnvAsjvdFyYFGpQjrI2XF282/VaGnvSfEvwl0I=; b=IeMeMH8zizhJv8E+lI LqFqJFMVf80hMrx3xV/+HTyzSy05wNlFVNrrktmvkNME2AbktjaQ//4tDsBvvQl4 D4XbFfILWKyzLzPDYpPTR1C6J1Rav4HOtYZ/gTlSfWU1fZfAkwlzZJx+UEtAAe6a 1BQ1B+OTbdoDlomvRzImf2T64= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wD3twcPoFlqvNaLJg--.4501S9; Fri, 17 Jul 2026 11:23:21 +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 v1 v1 7/7] ntfs3: add file I/O tracepoints Date: Fri, 17 Jul 2026 11:22:48 +0800 Message-ID: <20260717032248.3318208-8-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260717032248.3318208-1-liubaolin12138@163.com> References: <20260717032248.3318208-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: _____wD3twcPoFlqvNaLJg--.4501S9 X-Coremail-Antispam: 1Uf129KBjvJXoWxGr18XF1ktw1kJr45ZFy3twb_yoW5XF47pF nIyasxWrWxJw47Kws3JF4DXa1rua1xCrWUJry7W3W3Ar1xtrn3JanFgF1jk3Z5ArWqyw12 g3Z0934DG34UXr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBMKZUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6gkj7WpZoClKigAA3X 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 a846aa61153c..595314c09e43 100644 --- a/include/trace/events/ntfs3.h +++ b/include/trace/events/ntfs3.h @@ -357,6 +357,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(dev_t, dev) + __field(unsigned long, ino) + __field(loff_t, size) + __field(loff_t, offset) + __field(size_t, count) + ), + TP_fast_assign( + __entry->dev =3D file_inode(iocb->ki_filp)->i_sb->s_dev; + __entry->ino =3D file_inode(iocb->ki_filp)->i_ino; + __entry->size =3D i_size_read(file_inode(iocb->ki_filp)); + __entry->offset =3D iocb->ki_pos; + __entry->count =3D iov_iter_count(iter); + ), + 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