Re: [PATCH 03/61] trace: update VFS-layer trace events for u64 i_ino

Steven Rostedt
2026-02-26T17:49:35Z

On Thu, 26 Feb 2026 10:55:05 -0500
Jeff Layton <jlayton@kernel.org> wrote:

> Update trace event definitions in VFS-layer trace headers to use u64
> instead of ino_t/unsigned long for inode number fields, and change
> format strings from %lu/%lx to %llu/%llx to match.
>
> This is needed because i_ino is now u64. Changing trace event field
> types changes the binary trace format, but the self-describing format
> metadata handles this transparently for modern trace-cmd and perf.
>
> Files updated:
> - cachefiles.h, filelock.h, filemap.h, fs_dax.h, fsverity.h,
> hugetlbfs.h, netfs.h, readahead.h, timestamp.h, writeback.h
>

Hmm, on 32 bit systems, this will likely cause "holes" in a lot of these
events.

> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> include/trace/events/cachefiles.h | 18 ++---
> include/trace/events/filelock.h | 16 ++---
> include/trace/events/filemap.h | 20 +++---
> include/trace/events/fs_dax.h | 20 +++---
> include/trace/events/fsverity.h | 30 ++++----
> include/trace/events/hugetlbfs.h | 28 ++++----
> include/trace/events/netfs.h | 4 +-
> include/trace/events/readahead.h | 12 ++--
> include/trace/events/timestamp.h | 12 ++--
> include/trace/events/writeback.h | 148 +++++++++++++++++++-------------------
> 10 files changed, 154 insertions(+), 154 deletions(-)
>
> diff --git a/include/trace/events/cachefiles.h b/include/trace/events/cachefiles.h
> index a743b2a35ea7001447b3e05d41539cb88013bc7f..f967027711ee823f224abc1b8ab03f63da06ae6f 100644
> --- a/include/trace/events/cachefiles.h
> +++ b/include/trace/events/cachefiles.h
> @@ -251,8 +251,8 @@ TRACE_EVENT(cachefiles_lookup,
> TP_STRUCT__entry(
> __field(unsigned int, obj)
> __field(short, error)

There was already a 2 byte hole here, but that's not a big deal.

> - __field(unsigned long, dino)
> - __field(unsigned long, ino)
> + __field(u64, dino)
> + __field(u64, ino)
> ),
>
> TP_fast_assign(
> @@ -263,7 +263,7 @@ TRACE_EVENT(cachefiles_lookup,
> __entry->error = IS_ERR(de) ? PTR_ERR(de) : 0;
> ),
>
> - TP_printk("o=%08x dB=%lx B=%lx e=%d",
> + TP_printk("o=%08x dB=%llx B=%llx e=%d",
> __entry->obj, __entry->dino, __entry->ino, __entry->error)
> );
>
> @@ -579,7 +579,7 @@ TRACE_EVENT(cachefiles_mark_active,
> /* Note that obj may be NULL */
> TP_STRUCT__entry(
> __field(unsigned int, obj)
> - __field(ino_t, inode)
> + __field(u64, inode)

Might be better to reorder any of these that have int first.

u64 inode;
int obj;

Will be packed tighter than:

int obj
u64 inode;

Probably should have changed that before anyway.

> ),
>
> TP_fast_assign(
> @@ -587,7 +587,7 @@ TRACE_EVENT(cachefiles_mark_active,
> __entry->inode = inode->i_ino;
> ),
>
> - TP_printk("o=%08x B=%lx",
> + TP_printk("o=%08x B=%llx",
> __entry->obj, __entry->inode)
> );
>
> @@ -600,7 +600,7 @@ TRACE_EVENT(cachefiles_mark_failed,
> /* Note that obj may be NULL */
> TP_STRUCT__entry(
> __field(unsigned int, obj)
> - __field(ino_t, inode)
> + __field(u64, inode)

Is ino_t being changed? Why the update here?

> ),
>
> TP_fast_assign(
> @@ -608,7 +608,7 @@ TRACE_EVENT(cachefiles_mark_failed,
> __entry->inode = inode->i_ino;
> ),
>
> - TP_printk("o=%08x B=%lx",
> + TP_printk("o=%08x B=%llx",
> __entry->obj, __entry->inode)
> );
>
> @@ -621,7 +621,7 @@ TRACE_EVENT(cachefiles_mark_inactive,
> /* Note that obj may be NULL */
> TP_STRUCT__entry(
> __field(unsigned int, obj)
> - __field(ino_t, inode)
> + __field(u64, inode)

Ditto.

> ),
>
> TP_fast_assign(
> @@ -629,7 +629,7 @@ TRACE_EVENT(cachefiles_mark_inactive,
> __entry->inode = inode->i_ino;
> ),
>
> - TP_printk("o=%08x B=%lx",
> + TP_printk("o=%08x B=%llx",
> __entry->obj, __entry->inode)
> );
>
> diff --git a/include/trace/events/filelock.h b/include/trace/events/filelock.h
> index 370016c38a5bbc07d5ba6c102030b49c9eb6424d..41bc752616b25d6cd7955203e2c604029d0b440c 100644
> --- a/include/trace/events/filelock.h
> +++ b/include/trace/events/filelock.h
> @@ -42,7 +42,7 @@ TRACE_EVENT(locks_get_lock_context,
> TP_ARGS(inode, type, ctx),
>
> TP_STRUCT__entry(
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)
> __field(dev_t, s_dev)
> __field(unsigned char, type)
> __field(struct file_lock_context *, ctx)
> @@ -55,7 +55,7 @@ TRACE_EVENT(locks_get_lock_context,
> __entry->ctx = ctx;
> ),
>
> - TP_printk("dev=0x%x:0x%x ino=0x%lx type=%s ctx=%p",
> + TP_printk("dev=0x%x:0x%x ino=0x%llx type=%s ctx=%p",
> MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino, show_fl_type(__entry->type), __entry->ctx)
> );
> @@ -67,7 +67,7 @@ DECLARE_EVENT_CLASS(filelock_lock,
>
> TP_STRUCT__entry(
> __field(struct file_lock *, fl)
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)

Having u64 before a pointer would be tighter on 32 bit systems, and leaves
out any holes in the trace.

> __field(dev_t, s_dev)
> __field(struct file_lock_core *, blocker)
> __field(fl_owner_t, owner)
> @@ -93,7 +93,7 @@ DECLARE_EVENT_CLASS(filelock_lock,
> __entry->ret = ret;
> ),
>
> - TP_printk("fl=%p dev=0x%x:0x%x ino=0x%lx fl_blocker=%p fl_owner=%p fl_pid=%u fl_flags=%s fl_type=%s fl_start=%lld fl_end=%lld ret=%d",
> + TP_printk("fl=%p dev=0x%x:0x%x ino=0x%llx fl_blocker=%p fl_owner=%p fl_pid=%u fl_flags=%s fl_type=%s fl_start=%lld fl_end=%lld ret=%d",
> __entry->fl, MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino, __entry->blocker, __entry->owner,
> __entry->pid, show_fl_flags(__entry->flags),
> @@ -124,7 +124,7 @@ DECLARE_EVENT_CLASS(filelock_lease,
>
> TP_STRUCT__entry(
> __field(struct file_lease *, fl)
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)

Same here.

> __field(dev_t, s_dev)
> __field(struct file_lock_core *, blocker)
> __field(fl_owner_t, owner)
> @@ -146,7 +146,7 @@ DECLARE_EVENT_CLASS(filelock_lease,
> __entry->downgrade_time = fl ? fl->fl_downgrade_time : 0;
> ),
>
> - TP_printk("fl=%p dev=0x%x:0x%x ino=0x%lx fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%lu fl_downgrade_time=%lu",
> + TP_printk("fl=%p dev=0x%x:0x%x ino=0x%llx fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%lu fl_downgrade_time=%lu",
> __entry->fl, MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino, __entry->blocker, __entry->owner,
> show_fl_flags(__entry->flags),
> @@ -175,7 +175,7 @@ TRACE_EVENT(generic_add_lease,
> TP_ARGS(inode, fl),
>
> TP_STRUCT__entry(
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)
> __field(int, wcount)
> __field(int, rcount)
> __field(int, icount)
> @@ -196,7 +196,7 @@ TRACE_EVENT(generic_add_lease,
> __entry->type = fl->c.flc_type;
> ),
>
> - TP_printk("dev=0x%x:0x%x ino=0x%lx wcount=%d rcount=%d icount=%d fl_owner=%p fl_flags=%s fl_type=%s",
> + TP_printk("dev=0x%x:0x%x ino=0x%llx wcount=%d rcount=%d icount=%d fl_owner=%p fl_flags=%s fl_type=%s",
> MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino, __entry->wcount, __entry->rcount,
> __entry->icount, __entry->owner,
> diff --git a/include/trace/events/filemap.h b/include/trace/events/filemap.h
> index f48fe637bfd25885dc6daaf09336ab60626b4944..153491e57cce6df73e30ddee60a52ed7d8923c24 100644
> --- a/include/trace/events/filemap.h
> +++ b/include/trace/events/filemap.h
> @@ -21,7 +21,7 @@ DECLARE_EVENT_CLASS(mm_filemap_op_page_cache,
>
> TP_STRUCT__entry(
> __field(unsigned long, pfn)
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)

Again, this would cause a 32 bit hole.

> __field(unsigned long, index)
> __field(dev_t, s_dev)
> __field(unsigned char, order)
> @@ -38,7 +38,7 @@ DECLARE_EVENT_CLASS(mm_filemap_op_page_cache,
> __entry->order = folio_order(folio);
> ),
>
> - TP_printk("dev %d:%d ino %lx pfn=0x%lx ofs=%lu order=%u",
> + TP_printk("dev %d:%d ino %llx pfn=0x%lx ofs=%lu order=%u",
> MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino,
> __entry->pfn,
> @@ -67,7 +67,7 @@ DECLARE_EVENT_CLASS(mm_filemap_op_page_cache_range,
> TP_ARGS(mapping, index, last_index),
>
> TP_STRUCT__entry(
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)
> __field(dev_t, s_dev)
> __field(unsigned long, index)
> __field(unsigned long, last_index)
> @@ -85,7 +85,7 @@ DECLARE_EVENT_CLASS(mm_filemap_op_page_cache_range,
> ),
>
> TP_printk(
> - "dev=%d:%d ino=%lx ofs=%lld-%lld",
> + "dev=%d:%d ino=%llx ofs=%lld-%lld",
> MAJOR(__entry->s_dev),
> MINOR(__entry->s_dev), __entry->i_ino,
> ((loff_t)__entry->index) << PAGE_SHIFT,
> @@ -117,7 +117,7 @@ TRACE_EVENT(mm_filemap_fault,
> TP_ARGS(mapping, index),
>
> TP_STRUCT__entry(
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)
> __field(dev_t, s_dev)
> __field(unsigned long, index)
> ),
> @@ -133,7 +133,7 @@ TRACE_EVENT(mm_filemap_fault,
> ),
>
> TP_printk(
> - "dev=%d:%d ino=%lx ofs=%lld",
> + "dev=%d:%d ino=%llx ofs=%lld",
> MAJOR(__entry->s_dev),
> MINOR(__entry->s_dev), __entry->i_ino,
> ((loff_t)__entry->index) << PAGE_SHIFT
> @@ -146,7 +146,7 @@ TRACE_EVENT(filemap_set_wb_err,
> TP_ARGS(mapping, eseq),
>
> TP_STRUCT__entry(
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)
> __field(dev_t, s_dev)
> __field(errseq_t, errseq)
> ),
> @@ -160,7 +160,7 @@ TRACE_EVENT(filemap_set_wb_err,
> __entry->s_dev = mapping->host->i_rdev;
> ),
>
> - TP_printk("dev=%d:%d ino=0x%lx errseq=0x%x",
> + TP_printk("dev=%d:%d ino=0x%llx errseq=0x%x",
> MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
> __entry->i_ino, __entry->errseq)
> );
> @@ -172,7 +172,7 @@ TRACE_EVENT(file_check_and_advance_wb_err,
>
> TP_STRUCT__entry(
> __field(struct file *, file)
> - __field(unsigned long, i_ino)
> + __field(u64, i_ino)

Having a pointer after the u64 is better.

> __field(dev_t, s_dev)
> __field(errseq_t, old)
> __field(errseq_t, new)
> @@ -191,7 +191,7 @@ TRACE_EVENT(file_check_and_advance_wb_err,
> __entry->new = file->f_wb_err;
> ),
>
> - TP_printk("file=%p dev=%d:%d ino=0x%lx old=0x%x new=0x%x",
> + TP_printk("file=%p dev=%d:%d ino=0x%llx old=0x%x new=0x%x",
> __entry->file, MAJOR(__entry->s_dev),
> MINOR(__entry->s_dev), __entry->i_ino, __entry->old,
> __entry->new)
> diff --git a/include/trace/events/fs_dax.h b/include/trace/events/fs_dax.h
> index 50ebc1290ab062a9c30ab00049fb96691f9a0f23..11121baa8ece7928c653b4f874fb10ffbdd02fd0 100644
> --- a/include/trace/events/fs_dax.h
> +++ b/include/trace/events/fs_dax.h
> @@ -12,7 +12,7 @@ DECLARE_EVENT_CLASS(dax_pmd_fault_class,
> pgoff_t max_pgoff, int result),
> TP_ARGS(inode, vmf, max_pgoff, result),
> TP_STRUCT__entry(
> - __field(unsigned long, ino)
> + __field(u64, ino)
> __field(unsigned long, vm_start)
> __field(unsigned long, vm_end)
> __field(vm_flags_t, vm_flags)
> @@ -35,7 +35,7 @@ DECLARE_EVENT_CLASS(dax_pmd_fault_class,
> __entry->max_pgoff = max_pgoff;
> __entry->result = result;
> ),
> - TP_printk("dev %d:%d ino %#lx %s %s address %#lx vm_start "
> + TP_printk("dev %d:%d ino %#llx %s %s address %#lx vm_start "
> "%#lx vm_end %#lx pgoff %#lx max_pgoff %#lx %s",
> MAJOR(__entry->dev),
> MINOR(__entry->dev),
> @@ -66,7 +66,7 @@ DECLARE_EVENT_CLASS(dax_pmd_load_hole_class,
> void *radix_entry),
> TP_ARGS(inode, vmf, zero_folio, radix_entry),
> TP_STRUCT__entry(
> - __field(unsigned long, ino)
> + __field(u64, ino)
> __field(vm_flags_t, vm_flags)
> __field(unsigned long, address)
> __field(struct folio *, zero_folio)
> @@ -81,7 +81,7 @@ DECLARE_EVENT_CLASS(dax_pmd_load_hole_class,
> __entry->zero_folio = zero_folio;
> __entry->radix_entry = radix_entry;
> ),
> - TP_printk("dev %d:%d ino %#lx %s address %#lx zero_folio %p "
> + TP_printk("dev %d:%d ino %#llx %s address %#lx zero_folio %p "
> "radix_entry %#lx",
> MAJOR(__entry->dev),
> MINOR(__entry->dev),
> @@ -106,7 +106,7 @@ DECLARE_EVENT_CLASS(dax_pte_fault_class,
> TP_PROTO(struct inode *inode, struct vm_fault *vmf, int result),
> TP_ARGS(inode, vmf, result),
> TP_STRUCT__entry(
> - __field(unsigned long, ino)
> + __field(u64, ino)
> __field(vm_flags_t, vm_flags)
> __field(unsigned long, address)
> __field(pgoff_t, pgoff)
> @@ -123,7 +123,7 @@ DECLARE_EVENT_CLASS(dax_pte_fault_class,
> __entry->pgoff = vmf->pgoff;
> __entry->result = result;
> ),
> - TP_printk("dev %d:%d ino %#lx %s %s address %#lx pgoff %#lx %s",
> + TP_printk("dev %d:%d ino %#llx %s %s address %#lx pgoff %#lx %s",
> MAJOR(__entry->dev),
> MINOR(__entry->dev),
> __entry->ino,
> @@ -150,7 +150,7 @@ DECLARE_EVENT_CLASS(dax_writeback_range_class,
> TP_PROTO(struct inode *inode, pgoff_t start_index, pgoff_t end_index),
> TP_ARGS(inode, start_index, end_index),
> TP_STRUCT__entry(
> - __field(unsigned long, ino)
> + __field(u64, ino)
> __field(pgoff_t, start_index)
> __field(pgoff_t, end_index)
> __field(dev_t, dev)
> @@ -161,7 +161,7 @@ DECLARE_EVENT_CLASS(dax_writeback_range_class,
> __entry->start_index = start_index;
> __entry->end_index = end_index;
> ),
> - TP_printk("dev %d:%d ino %#lx pgoff %#lx-%#lx",
> + TP_printk("dev %d:%d ino %#llx pgoff %#lx-%#lx",
> MAJOR(__entry->dev),
> MINOR(__entry->dev),
> __entry->ino,
> @@ -182,7 +182,7 @@ TRACE_EVENT(dax_writeback_one,
> TP_PROTO(struct inode *inode, pgoff_t pgoff, pgoff_t pglen),
> TP_ARGS(inode, pgoff, pglen),
> TP_STRUCT__entry(
> - __field(unsigned long, ino)
> + __field(u64, ino)
> __field(pgoff_t, pgoff)
> __field(pgoff_t, pglen)
> __field(dev_t, dev)
> @@ -193,7 +193,7 @@ TRACE_EVENT(dax_writeback_one,
> __entry->pgoff = pgoff;
> __entry->pglen = pglen;
> ),
> - TP_printk("dev %d:%d ino %#lx pgoff %#lx pglen %#lx",
> + TP_printk("dev %d:%d ino %#llx pgoff %#lx pglen %#lx",
> MAJOR(__entry->dev),
> MINOR(__entry->dev),
> __entry->ino,
> diff --git a/include/trace/events/fsverity.h b/include/trace/events/fsverity.h
> index a8c52f21cbd5eb010c7e7b2fdb8f9de49c8ea326..4477c17e05748360965c4e1840590efe96d6335e 100644
> --- a/include/trace/events/fsverity.h
> +++ b/include/trace/events/fsverity.h
> @@ -16,7 +16,7 @@ TRACE_EVENT(fsverity_enable,
> const struct merkle_tree_params *params),
> TP_ARGS(inode, params),
> TP_STRUCT__entry(
> - __field(ino_t, ino)
> + __field(u64, ino)

Do you need to convert all these ino_t's?

> __field(u64, data_size)
> __field(u64, tree_size)
> __field(unsigned int, merkle_block)
> @@ -29,8 +29,8 @@ TRACE_EVENT(fsverity_enable,
> __entry->merkle_block = params->block_size;
> __entry->num_levels = params->num_levels;
> ),
> - TP_printk("ino %lu data_size %llu tree_size %llu merkle_block %u levels %u",
> - (unsigned long) __entry->ino,
> + TP_printk("ino %llu data_size %llu tree_size %llu merkle_block %u levels %u",
> + __entry->ino,
> __entry->data_size,
> __entry->tree_size,
> __entry->merkle_block,
> @@ -42,7 +42,7 @@ TRACE_EVENT(fsverity_tree_done,
> const struct merkle_tree_params *params),
> TP_ARGS(inode, vi, params),
> TP_STRUCT__entry(
> - __field(ino_t, ino)
> + __field(u64, ino)
> __field(u64, data_size)
> __field(u64, tree_size)
> __field(unsigned int, merkle_block)
> @@ -59,8 +59,8 @@ TRACE_EVENT(fsverity_tree_done,
> memcpy(__get_dynamic_array(root_hash), vi->root_hash, __get_dynamic_array_len(root_hash));
> memcpy(__get_dynamic_array(file_digest), vi->file_digest, __get_dynamic_array_len(file_digest));
> ),
> - TP_printk("ino %lu data_size %llu tree_size %lld merkle_block %u levels %u root_hash %s digest %s",
> - (unsigned long) __entry->ino,
> + TP_printk("ino %llu data_size %llu tree_size %lld merkle_block %u levels %u root_hash %s digest %s",
> + __entry->ino,
> __entry->data_size,
> __entry->tree_size,
> __entry->merkle_block,
> @@ -75,7 +75,7 @@ TRACE_EVENT(fsverity_verify_data_block,
> u64 data_pos),
> TP_ARGS(inode, params, data_pos),
> TP_STRUCT__entry(
> - __field(ino_t, ino)
> + __field(u64, ino)
> __field(u64, data_pos)
> __field(unsigned int, merkle_block)
> ),
> @@ -84,8 +84,8 @@ TRACE_EVENT(fsverity_verify_data_block,
> __entry->data_pos = data_pos;
> __entry->merkle_block = params->block_size;
> ),
> - TP_printk("ino %lu data_pos %llu merkle_block %u",
> - (unsigned long) __entry->ino,
> + TP_printk("ino %llu data_pos %llu merkle_block %u",
> + __entry->ino,
> __entry->data_pos,
> __entry->merkle_block)
> );
> @@ -96,7 +96,7 @@ TRACE_EVENT(fsverity_merkle_hit,
> unsigned int hidx),
> TP_ARGS(inode, data_pos, hblock_idx, level, hidx),
> TP_STRUCT__entry(
> - __field(ino_t, ino)
> + __field(u64, ino)
> __field(u64, data_pos)

Heh, this actually removed a hole, but again, why convert ino_t?

Anyway, I stopped here. But you get the idea.

-- Steve

> __field(unsigned long, hblock_idx)
> __field(unsigned int, level)