Linux Trace Kernel
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Baolin Liu <liubaolin12138@163.com>
Cc: almaz.alexandrovich@paragon-software.com, mhiramat@kernel.org,
	mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org,
	ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org,
	liubaolin12138@gmail.com, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v2 v2 2/7] ntfs3: add namei tracepoints
Date: Wed, 29 Jul 2026 14:26:22 -0400	[thread overview]
Message-ID: <20260729142622.73d7ef18@gandalf.local.home> (raw)
In-Reply-To: <20260728094426.749482-3-liubaolin12138@163.com>

On Tue, 28 Jul 2026 17:44:21 +0800
Baolin Liu <liubaolin12138@163.com> wrote:

> diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h
> index d00f66e42ba8..041455edec76 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)
>  );
>  
> +TRACE_EVENT(ntfs3_lookup,
> +	TP_PROTO(struct inode *dir, struct dentry *dentry),
> +	TP_ARGS(dir, dentry),
> +	TP_STRUCT__entry(
> +		__field(dev_t, dev)

dev_t is 4 bytes, you should move it after parent_ino as on 64 bit
machines, it will waste 4 bytes of space here.

> +		__field(unsigned long, parent_ino)
> +		__string(name, dentry->d_name.name)
> +	),
> +	TP_fast_assign(
> +		__entry->dev = dir->i_sb->s_dev;
> +		__entry->parent_ino = dir->i_ino;
> +		__assign_str(name);
> +	),
> +	TP_printk("dev=(%d,%d) parent=%lu name=%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(dev_t, dev)

Same here.

In fact, you should audit the rest of your tracepoints to see where you can
make the sizes more condensed.

~# cat /sys/kernel/tracing/events/ntfs3/ntfs3_rename/format 
name: ntfs3_rename
ID: 1923
format:
        field:unsigned short common_type;       offset:0;       size:2; signed:0;
        field:unsigned char common_flags;       offset:2;       size:1; signed:0;
        field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
        field:int common_pid;   offset:4;       size:4; signed:1;

        field:dev_t dev;        offset:8;       size:4; signed:0;
        field:unsigned long dir_ino;    offset:16;      size:8; signed:0;
        field:unsigned long new_dir_ino;        offset:24;      size:8; signed:0;
        field:unsigned long ino;        offset:32;      size:8; signed:0;
        field:__data_loc char[] old_name;       offset:40;      size:4; signed:0;
        field:__data_loc char[] new_name;       offset:44;      size:4; signed:0;


Notice that dev is at offset 8 and size 4, where as dir_ino is at offset
16. That means there's 4 bytes between dev and dir_ino.

Please look at your other trace events and see if there are other gaps you
can close. I'm not going to audit all your tracepoints.

Note that __string() is a 4 byte meta data, so have them act like 4 byte
fields.

-- Steve



> +		__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 = dir->i_sb->s_dev;
> +		__entry->dir_ino = dir->i_ino;
> +		__entry->new_dir_ino = new_dir->i_ino;
> +		__entry->ino = d_inode(dentry)->i_ino;
> +		__assign_str(old_name);
> +		__assign_str(new_name);
> +	),
> +	TP_printk("dev=(%d,%d) dir=%lu new_dir=%lu ino=%lu old=%s new=%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 */
>  

  reply	other threads:[~2026-07-29 18:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  9:44 [PATCH v2 v2 0/7] ntfs3: add tracepoints for core filesystem paths Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 1/7] ntfs3: add mount and log replay tracepoints Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 2/7] ntfs3: add namei tracepoints Baolin Liu
2026-07-29 18:26   ` Steven Rostedt [this message]
2026-07-28  9:44 ` [PATCH v2 v2 3/7] ntfs3: add create inode tracepoint Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 4/7] ntfs3: add directory index tracepoints Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 5/7] ntfs3: add allocation tracepoints Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 6/7] ntfs3: add iomap tracepoints Baolin Liu
2026-07-28  9:44 ` [PATCH v2 v2 7/7] ntfs3: add file I/O tracepoints Baolin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729142622.73d7ef18@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=liubaolin12138@163.com \
    --cc=liubaolin12138@gmail.com \
    --cc=liubaolin@kylinos.cn \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox