Page MenuHomeFreeBSD

Implement DDB show vpath
ClosedPublic

Authored by bz on Mar 29 2018, 5:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 1, 7:34 AM
Unknown Object (File)
Wed, Sep 24, 6:37 AM
Unknown Object (File)
Sun, Sep 14, 5:20 AM
Unknown Object (File)
Sun, Sep 14, 12:57 AM
Unknown Object (File)
Sat, Sep 13, 6:47 AM
Unknown Object (File)
Aug 23 2025, 1:48 PM
Unknown Object (File)
Aug 17 2025, 10:00 AM
Unknown Object (File)
Aug 8 2025, 11:05 AM
Subscribers

Details

Summary

Sometimes it is helpful to get the path for a vnode.
Implement a ddb function to do this.

Based on: jhb gdb macro (updated)
Sponsored by: iXsystems, Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 16074

Event Timeline

mjg requested changes to this revision.Mar 29 2018, 10:03 PM

I would add a message that there were not enough entries to reconstruct the full path.

sys/kern/vfs_cache.c
2547

this part makes no sense - you are back to what ncp was prior to the assignment

This revision now requires changes to proceed.Mar 29 2018, 10:03 PM
sys/kern/vfs_cache.c
2547

@mjg Hmm, so we don't actually need any &TS checks anymore?

And looking at the data structures, I am not exactly clear how this is the same as before (as the pointers should be different) but I have to admit I started off from jhb's gdb macros and not from your rewrite.

sys/kern/vfs_cache.c
2547

The primitive has to accept ncp as found in the hash or vnode lists. This will be the very same pointer for 'regular' entries and one offset by a little bit for TS ones.

ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc);

this grabs ncp and subtracts the offset of nc_nc, thus:

ncp = &ncp_ts->nc_nc;

this assigns ncp to what it already is

Fix the _ts stuff by not doing it anymore.

bz marked 3 inline comments as done.Apr 11 2018, 5:21 PM
This revision is now accepted and ready to land.Apr 11 2018, 6:18 PM

There is also ddb.4 though many commands are not documented in it.

sys/kern/vfs_cache.c
2577

s/strcut/struct/

I thought we already had a DDB command that would show a path, but I am perhaps remembering wrong as I can't find one.

This revision was automatically updated to reflect the committed changes.