Skip to content

Commit f6e70c5

Browse files
jtlaytonamschuma-ntap
authored andcommitted
nfs: print fileid in lookup tracepoints
With this we can see the dentry -> inode linkage that's being revalidated. A fileid of 0 means "negative dentry". Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 310b1f8 commit f6e70c5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

fs/nfs/nfstrace.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,23 +400,26 @@ DECLARE_EVENT_CLASS(nfs_lookup_event,
400400
__field(unsigned long, flags)
401401
__field(dev_t, dev)
402402
__field(u64, dir)
403+
__field(u64, fileid)
403404
__string(name, dentry->d_name.name)
404405
),
405406

406407
TP_fast_assign(
407408
__entry->dev = dir->i_sb->s_dev;
408409
__entry->dir = NFS_FILEID(dir);
409410
__entry->flags = flags;
411+
__entry->fileid = d_is_negative(dentry) ? 0 : NFS_FILEID(d_inode(dentry));
410412
__assign_str(name, dentry->d_name.name);
411413
),
412414

413415
TP_printk(
414-
"flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
416+
"flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu",
415417
__entry->flags,
416418
show_fs_lookup_flags(__entry->flags),
417419
MAJOR(__entry->dev), MINOR(__entry->dev),
418420
(unsigned long long)__entry->dir,
419-
__get_str(name)
421+
__get_str(name),
422+
__entry->fileid
420423
)
421424
);
422425

@@ -444,6 +447,7 @@ DECLARE_EVENT_CLASS(nfs_lookup_event_done,
444447
__field(unsigned long, flags)
445448
__field(dev_t, dev)
446449
__field(u64, dir)
450+
__field(u64, fileid)
447451
__string(name, dentry->d_name.name)
448452
),
449453

@@ -452,17 +456,19 @@ DECLARE_EVENT_CLASS(nfs_lookup_event_done,
452456
__entry->dir = NFS_FILEID(dir);
453457
__entry->error = error < 0 ? -error : 0;
454458
__entry->flags = flags;
459+
__entry->fileid = d_is_negative(dentry) ? 0 : NFS_FILEID(d_inode(dentry));
455460
__assign_str(name, dentry->d_name.name);
456461
),
457462

458463
TP_printk(
459-
"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
464+
"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu",
460465
-__entry->error, show_nfs_status(__entry->error),
461466
__entry->flags,
462467
show_fs_lookup_flags(__entry->flags),
463468
MAJOR(__entry->dev), MINOR(__entry->dev),
464469
(unsigned long long)__entry->dir,
465-
__get_str(name)
470+
__get_str(name),
471+
__entry->fileid
466472
)
467473
);
468474

0 commit comments

Comments
 (0)