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, Jan 15, 3:08 AM
Unknown Object (File)
Dec 3 2024, 1:14 AM
Unknown Object (File)
Dec 3 2024, 1:01 AM
Unknown Object (File)
Nov 18 2024, 4:39 PM
Unknown Object (File)
Nov 18 2024, 4:01 PM
Unknown Object (File)
Nov 17 2024, 3:22 AM
Unknown Object (File)
Nov 15 2024, 1:59 AM
Unknown Object (File)
Nov 8 2024, 5:03 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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #40889)

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 ↗(On Diff #40889)

@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 ↗(On Diff #40889)

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 ↗(On Diff #41290)

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.