Re: [PATCH v1 v1 2/7] ntfs3: add namei tracepoints

liubaolin <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,dev.linux.lists.ntfs3,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Dear Steve,
    dentry->d_name.len is the qstr length and does not include the 
trailing NUL, so it corresponds to strlen(dentry->d_name.name), rather 
than strlen(dentry->d_name.name) + 1.
If you think the extra name_len field here is unnecessary, I can submit 
a v2 patch to drop it. Looking forward to your feedback.

Best regards,
Baolin


在 2026/7/22 05:09, Steven Rostedt 写道:
> On Fri, 17 Jul 2026 11:22:43 +0800
> Baolin Liu <[email protected]> wrote:
> 
>> +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 = dir->i_sb->s_dev;
>> +		__entry->parent_ino = dir->i_ino;
>> +		__assign_str(name);
>> +		__entry->name_len = dentry->d_name.len;
> 
> Is dentry->d_name.len not equal to strlen(dentry->d_name.name) + 1 ?
> 
> -- Steve
> 
> 
>> +	),
>> +	TP_printk("dev=(%d,%d) parent=%lu name=%s len=%u",
>> +		  MAJOR(__entry->dev), MINOR(__entry->dev),
>> +		  __entry->parent_ino, __get_str(name),
>> +		  __entry->name_len)
>> +);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.