NFSTEST_FILE(1)
π nfstest_file β bestie, let's go find your file π
okay so. the manual name is nfstest_file, and it's giving "Find all packets for a specific file" energy. periodt. let me walk you through it π«Ά
β¨ NAME β¨
nfstest_file β find all packets for a specific file π¦
β¨ SYNOPSIS β¨
nfstest_file [options] -p <filepath> <trace1.cap> [<trace2.cap> ...]
β¨ DESCRIPTION β¨
So basically, this tool displays all the NFS packets for the path you give it. not some of them. ALL of them. π
It takes a relative path, and then it goes hunting: for each of the directory entries in that path, it searches until it lands the file handle for the directory where your file is actually chilling. Once it's got that directory file handle, it goes looking for a LOOKUP or an OPEN/CREATE for the file name you specified. And if it finds that file lookup or creation? It then searches for all the file handles and state ids associated with that file and displays every packet it found β including their respective replies. no packet left behind fr fr π
There are three levels of verbosity, and you specify them with a bitmap, where the most significant bit gives you the more verbose output. Verbose level 1 is the default, where each packet gets condensed down to one line using the last layer of the packet as the main output. cute and compact, lowkey iconic β¨
The packet trace files get processed either serially or in parallel. Packets are displayed using their timestamps, so they're always shown in the correct order even if the files you handed over are out of order. here's the vibe:
- If the packet traces were captured one after the other, the packets are displayed serially β first the packets of the first file according to their timestamps, then the second, and so forth.
- If the packet traces were captured at the same time on multiple clients, the packets are displayed in parallel β packets are interleaved from all the files when displayed, again according to their timestamps.
π Note: A packet call can be displayed out of order if the call is not matched by any of the file handles, state ids or names β but its reply is matched. In that case, its corresponding call is displayed right before the reply. the way that happens... yeah. just know it's a thing π
β¨ OPTIONS β¨
--versionβ show program's version number and exit-h,--helpβ show this help message and exit-p PATH,--path=PATHβ Path relative to the mount point. the path can be specified by its file handle'FH:0xc3f001b4'. Also, the relative path could start with a directory file handle'DH:0x0c35bb58/file_name'π--stid=STIDβ State id to include in the search-v VERBOSE,--verbose=VERBOSEβ Verbose level bitmask [default: 1].- bitmap
0x01: one line per packet. - bitmap
0x02: one line per layer. - bitmap
0x04: real verbose. π₯
- bitmap
-s START,--start=STARTβ Start index [default: 0]-e END,--end=ENDβ End index [default: 0]-z TZ,--tz=TZβ Time zone to use to display timestamps--progress=PROGRESSβ Display progress bar [default: 1]
πΈ Packet display πΈ
--frame=FRAMEβ Display record frame number [default: 0]--index=INDEXβ Display packet number [default: 1]--crc16=CRC16β Display CRC16 encoded strings [default: True]--crc32=CRC32β Display CRC32 encoded strings [default: True]--strsize=STRSIZEβ Truncate all strings to this size [default: 0]
π§ Debug π§
--enum-check=ENUM_CHECKβ If set to True, enums are strictly enforced [default: False]--enum-repr=ENUM_REPRβ If set to True, enums are displayed as numbers [default: False]--debug-level=DEBUG_LEVELβ Set debug level messages
β¨ EXAMPLES β¨
okay bestie, examples time. these are the receipts, verbatim, no notes π
# Find all packets for relative path:
nfstest_file -p data/name_d_1/name_d_2/name_f_13 nested_dir_v3.cap
# Find all packets for relative path, starting with a directory file handle:
nfstest_file -p DH:0x34ac5f28/name_d_1/name_d_2/name_f_13 nested_dir_v3.cap
# Find all packets for file, starting with a directory file handle:
nfstest_file -p DH:0x0c35bb58/name_f_13 nested_dir_v3.cap
# Find all packets for file handle
nfstest_file -p FH:0xc3f001b4 /tmp/trace.cap
# Find all packets for file, including all operations for the given state id
nfstest_file -p f00000001 --stid 0x0fd4 /tmp/trace.cap
# Display all packets for file (one line per layer)
nfstest_file -p f00000001 -v 2 /tmp/trace.cap
# Display all packets for file
# (real verbose, all items in each layer are displayed)
nfstest_file -p f00000001 -v 4 /tmp/trace.cap
# Display all packets for file (display both verbose level 1 and 2)
nfstest_file -p f00000001 -v 3 /tmp/trace.cap
# Display packets for file between packets 100 through 199
$ nfstest_file -p f00000001 -s 100 -e 200 /tmp/trace.cap
# Display all packets truncating all strings to 100 bytes
# This is useful when some packets are very large and there
# is no need to display all the data
$ nfstest_file -p f00000001 --strsize 100 -v 2 /tmp/trace.cap
# Display packets using India time zone
$ nfstest_file -p f00000001 --tz "UTC-5:30" /tmp/trace.cap
$ nfstest_file -p f00000001 --tz "Asia/Kolkata" /tmp/trace.cap
# Display all packets for file found in all trace files given
# The packets are displayed in order using their timestamps
$ nfstest_file -p f00000001 trace1.cap trace2.cap trace3.cap
β¨ SEE ALSO β¨
formatstr(3), nfstest_alloc(1), nfstest_cache(1), nfstest_delegation(1), nfstest_dio(1), nfstest_fcmp(1), nfstest_interop(1), nfstest_io(1), nfstest_lock(1), nfstest_pkt(1), nfstest_pnfs(1), nfstest_posix(1), nfstest_rdma(1), nfstest_sparse(1), nfstest_ssc(1), nfstest_xattr(1), nfstest_xid(1), packet.nfs.nfs3_const(3), packet.nfs.nfs4_const(3), packet.pktt(3), packet.record(3), packet.utils(3)
go read them too, they're all part of the friend group π
β¨ BUGS β¨
No known bugs. we love a clean slate β¨π
β¨ AUTHOR β¨
Jorge Mora (mora@netapp.com) β thank you for your service π«‘π
okay that's the whole thing, you're basically a nfstest_file expert now, no cap π
and this masterpiece is from NFStest 3.2, dated 21 March 2023. slay, ate, left no crumbs πβπ
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms