PSTAT(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’– PSTAT(8) πŸ’– β€” display system data structures

okay bestie, welcome to pstat (and its little sibling swapinfo), the manual page you didn't know you needed. this is system data structure central, and honestly? it's giving backstage pass to the kernel. πŸŽ€


✨ NAME ✨

pstat, swapinfo β€” display system data structures πŸ’…


🌸 SYNOPSIS 🌸

pstat [-Tfghkmnst] [-M core [-N system]]
swapinfo [-ghkm] [-M core [-N system]]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, the pstat utility displays open file entry, swap space utilization, terminal state, and vnode data structures. it's a whole little tour of what your system is up to. literally the gossip column of data structures. no cap.

if you invoke it as swapinfo, the -s option is implied, and only the -k, -m, -g, and -h options are legal. that's the rule, bestie, don't fight it.

if the -M option is not specified, information is obtained from the currently running kernel via the sysctl(3) interface. otherwise, information is read from the specified core file, using the name list from the specified kernel image (or from the default image). iykyk. πŸ’«

the following options are available:


πŸ’… OPTIONS πŸ’…

  • -n β€” print devices out by major/minor instead of name. numbers > names, sometimes.
  • -h β€” β€œHuman-readable” output. use unit suffixes when printing swap partition sizes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte. so your brain doesn't have to do math at 2am 🧠✨
  • -k β€” print sizes in kilobytes, regardless of the setting of the BLOCKSIZE environment variable. we simply do not care what BLOCKSIZE thinks.
  • -m β€” print sizes in megabytes, regardless of the setting of the BLOCKSIZE environment variable. again: BLOCKSIZE, stay in your lane.
  • -g β€” print sizes in gigabytes, regardless of the setting of the BLOCKSIZE environment variable. big numbers for big vibes.
  • -T β€” print the number of used and free slots in several system tables. this is useful for checking to see how large system tables have become if the system is under heavy load. very much a "how full is the club" situation, and the club is your kernel. πŸ”₯
  • -f β€” print the open file table with these headings:
    • LOC β€” the core location of this table entry.
    • TYPE β€” the type of object the file table entry points to.
    • FLG β€” miscellaneous state variables encoded thus:
      • R β€” open for reading
      • W β€” open for writing
      • A β€” open for appending
      • I β€” signal pgrp when data ready
    • CNT β€” number of processes that know this open file.
    • MSG β€” number of messages outstanding for this file.
    • DATA β€” the location of the vnode table entry or socket structure for this file.
    • OFFSET β€” the file offset (see lseek(2)).

okay the legend alone is a whole personality test honestly. πŸ’€

  • -s β€” print information about swap space usage on all the swap areas compiled into the kernel. the first column is the device name of the partition. the next column is the total space available in the partition. the Used column indicates the total blocks used so far; the Available column indicates how much space is remaining on each partition. the Capacity reports the percentage of space used.

if more than one partition is configured into the system, totals for all of the statistics will be reported in the final line of the report. the grand finale, if you will. πŸ‘‘

  • -t β€” print table for terminals with these headings:
    • LINE β€” device name.
    • INQ β€” number of characters that can be stored in the input queue.
    • CAN β€” number of characters in the input queue which can be read.
    • LIN β€” number of characters in the input queue which cannot be read yet.
    • LOW β€” low water mark for input.
    • OUTQ β€” number of characters that can be stored in the output queue.
    • USE β€” number of bytes in the output queue.
    • LOW β€” low water mark for output.
    • COL β€” calculated column position of terminal.
    • SESS β€” process ID of the session leader.
    • PGID β€” process group for which this is the controlling terminal.
    • STATE β€” miscellaneous state variables encoded thus:
      • I β€” init/lock-state device nodes present
      • C β€” callout device nodes present
      • O β€” opened
      • c β€” console in use
      • G β€” gone
      • B β€” busy in open(2)
      • Y β€” send SIGIO for input events
      • L β€” next character is literal
      • H β€” high watermark reached
      • X β€” open for exclusive use
      • S β€” output stopped (ixon flow control)
      • l β€” block mode input routine in use
      • Z β€” connection lost
      • s β€” i/o being snooped
      • b β€” busy in read(2) or write(2)

the β€˜i’ and β€˜o’ characters refer to the previous character, to differentiate between input and output. tiny detail, huge importance, we love a clarifying note. 🫢

also yes, LOW shows up twice on purpose β€” once for input, once for output. not a typo, bestie, it's just living its double-life truth. 🌈
  • -M β€” extract values associated with the name list from the specified core.
  • -N β€” if -M is also specified, extract the name list from the specified system instead of the default, which is the kernel image the system has booted from.

πŸ“ ENVIRONMENT πŸ“

  • BLOCKSIZE β€” if the environment variable BLOCKSIZE is set, and the -h, -k, or -m options are not specified, the block counts will be displayed in units of that block size. if BLOCKSIZE is not set, and the -h, -k, or -m options are not specified, the block counts will be displayed in 512-byte blocks. so it's either your vibe or the classic 512. πŸ’œ

⭐ SEE ALSO ⭐

ps(1), systat(1), stat(2), fs(5), iostat(8), vmstat(8)

K. Thompson, UNIX Implementation.

the reading list is stacked, ngl. πŸ“š


🧚 HISTORY 🧚

the pstat utility appeared in 4.0BSD. an icon, a legend, a moment in time. ✨


πŸ’€ BUGS πŸ’€

does not understand NFS swap servers. that's it, that's the whole bug. it simply refuses to comprehend them. πŸ™ˆ


okay that's the whole page, bestie β€” go forth and inspect those structures. this was the Debian edition, dated July 8, 2022, and honestly? iconic of it. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms