Re: [PATCH v3 v3 5/7] ntfs3: add allocation tracepoints

liubaolin <[email protected]>
Newsgroups dev.linux.lists.ntfs3,org.kernel.vger.linux-kernel,org.kernel.vger.linux-trace-kernel
Message-ID <[email protected]>
Dear Steven,
    Thanks for your review. You are right, I will fix it as suggested in v4.


Thanks,
Baolin

在 2026/8/12 04:04, Steven Rostedt 写道:
> On Fri,  7 Aug 2026 09:03:52 +0800
> Baolin Liu <[email protected]> wrote:
> 
>> @@ -960,6 +966,9 @@ int attr_data_get_block(struct ntfs_inode *ni, CLST vcn, CLST clen, CLST *lcn,
>>   	if (res)
>>   		*res = NULL;
>>   
>> +	trace_ntfs3_attr_data_get_block(&ni->vfs_inode, vcn, clen,
>> +					 new != NULL, zero, no_da);
> 
> Hmm, why not just pass new in. It looks like this is the only place that
> calls this tracepoint, right?
> 
> 
>> +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 = vcn;
>> +		__entry->clen = clen;
>> +		__entry->ino = inode->i_ino;
>> +		__entry->dev = inode->i_sb->s_dev;
>> +		__entry->create = create;
> 
> Then you can have this be:
> 
> 		__entry->create = new != NULL;
> 
> and keep that logic out of the code and out of line in the trace event.
> 
> -- Steve
> 
>> +		__entry->zero = zero;
>> +		__entry->no_da = no_da;
>> +	),
>> +	TP_printk("dev=(%d,%d) ino=%lu vcn=%llu clen=%llu create=%d zero=%d no_da=%d",
>> +		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
>> +		  __entry->vcn, __entry->clen, __entry->create,
>> +		  __entry->zero, __entry->no_da)
>> +);
>> +
>>   #endif /* _TRACE_NTFS3_H */
>>   
>>   #include <trace/define_trace.h>
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.