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. πŸ”₯
  • -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 πŸŒˆβ­πŸ’–