Page MenuHomeFreeBSD

Implement DDB show vpath
ClosedPublic

Authored by bz on Mar 29 2018, 5:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 9 2024, 6:40 AM
Unknown Object (File)
Apr 30 2024, 12:50 AM
Unknown Object (File)
Mar 16 2024, 8:58 AM
Unknown Object (File)
Feb 28 2024, 12:30 PM
Unknown Object (File)
Jan 27 2024, 12:41 AM
Unknown Object (File)
Jan 8 2024, 10:34 PM
Unknown Object (File)
Dec 28 2023, 1:55 AM
Unknown Object (File)
Dec 20 2023, 6:22 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.