f2fsslower(8)

πŸ’– f2fsslower(8) πŸ’–

System Manager's Manual ✨

✨ NAME ✨

okay so f2fsslower is the tool that spots slow f2fs file operations and tells you everything about each one πŸ” πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

f2fsslower [-h] [-s] [-p PID] [min_ms]

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, this tool traces the common f2fs file operations: reads, writes, opens, and syncs ✨ It measures how long each one takes, and prints the details for any that went over a threshold 🫢

WARNING: see the OVERHEAD section, seriously 😭

By default the minimum threshold is 10 milliseconds 🌸 If you set the threshold to 0, every single event gets printed (warning: it's very verbose, like a chatty group chat πŸ’€).

Since this works by tracing the f2fs_file_operations interface functions, it's going to need updating whenever those functions change πŸ”§

Since this uses BPF, only the root user can run it πŸ‘‘

🌈 REQUIREMENTS 🌈

CONFIG_BPF and bcc are needed πŸ’œ

✨ OPTIONS ✨

  • -p PID β€” only trace this PID 🎯
  • min_ms β€” the minimum I/O latency (duration) to trace, in milliseconds ⏱️ The default is 10 ms 🌷

πŸ“ EXAMPLES πŸ“

Trace synchronous file reads and writes that are slower than 10 ms:

# f2fsslower

Trace anything slower than 1 ms:

# f2fsslower 1

Trace slower than 1 ms, and output just the fields in parsable format (csv) πŸ“Š:

# f2fsslower -s 1

Trace all file reads and writes (warning: the output will be verbose πŸ™ˆ):

# f2fsslower 0

Trace slower than 1 ms, for PID 181 only 🧚:

# f2fsslower -p 181 1

πŸ’… FIELDS πŸ’…

  • TIME(s) β€” when the I/O completed, counted in seconds from the first I/O seen ⏰
  • COMM β€” the process name πŸ§‘β€πŸ’»
  • PID β€” the process ID πŸ†”
  • T β€” the type of operation. R == read, W == write, O == open, S == fsync πŸ”€
  • OFF_KB β€” the file offset for the I/O, in Kbytes πŸ“
  • BYTES β€” the size of the I/O, in bytes πŸ“¦
  • LAT(ms) β€” the latency (duration) of the I/O, measured from when VFS issued it to the filesystem, until it completed πŸ•°οΈ This time includes block device I/O, file system CPU cycles, file system locks, run queue latency, and so on πŸ”’ It's a more accurate picture of the latency that applications actually feel when doing file system I/O, compared to measuring down at the block device interface πŸŽ€
  • FILENAME β€” a cached kernel file name (it comes from dentry->d_name.name) πŸ“„
  • ENDTIME_us β€” the completion timestamp, in microseconds (-s only) ⭐
  • OFFSET_b β€” the file offset, in bytes (-s only) 🫧
  • LATENCY_us β€” the latency (duration) of the I/O, in microseconds (-s only) ⚑

πŸ™ˆ OVERHEAD πŸ™ˆ

okay, real talk: this adds low-overhead instrumentation to these f2fs operations, including reads and writes from the file system cache 🧠 Those reads and writes can be super frequent (it depends on the workload, eg, 1M/sec 😳), and at that point the overhead of this tool can start to become significant, even if it prints no "slower" events πŸ“‰ Measure and quantify before you use it πŸ“ If it keeps being a problem, consider switching to a tool that only prints in-kernel summaries πŸ”

Also, the overhead of this tool should be less than fileslower(8), because this one only targets f2fs functions and not every file read/write path (which can include socket I/O) πŸ¦‹

🌸 SOURCE 🌸

This comes from bcc 🫢

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion _examples.txt file, which has example usage, output, and commentary for this tool πŸ“š

πŸ–₯️ OS πŸ–₯️

Linux 🐧

πŸ§ͺ STABILITY πŸ§ͺ

Unstable, still in development 🚧

πŸ‘©β€πŸ’» AUTHOR πŸ‘©β€πŸ’»

Ting Zhang πŸ’œ

πŸ”— SEE ALSO πŸ”—

biosnoop(8), funccount(8), fileslower(8) ✨


That's the whole page, bestie! 🌈 It was from the USER COMMANDS section, dated 2022-08-15, and it's the f2fsslower(8) manual, forever iconic πŸ‘‘πŸ’–πŸ¦‹

πŸ“¦ where this page comes from