sofdsnoop(8)

πŸ“¦ version 0.36.1, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

✨ NAME ✨

okay so this is sofdsnoop(8) πŸ’… and it's basically a tool that traces FDs passed through unix sockets πŸ¦‹ it's built on Linux eBPF/bcc, so it's giving low-level and I'm obsessed.

sofdsnoop - Trace FDs passed through unix sockets. Uses Linux eBPF/bcc.

πŸŽ€ SYNOPSIS πŸŽ€

sofdsnoop [-h] [-T] [-p PID] [-t TID] [-n NAME] [-d DURATION]

πŸ’– DESCRIPTION πŸ’–

okay so sofdsnoop traces FDs passed through unix sockets ✨

every single file descriptor that gets passed over a unix socket shows up on its own line, together with process info (the TID and COMM columns) 🫢 you also get the ACTION details (SEND/RECV), the file descriptor number (FD), and its translation to a file if one is available (NAME). main character energy, no cap πŸ‘‘

⚠️ bestie, since this uses BPF, only the root user can use this tool. sorry not sorry 😭

🧚 REQUIREMENTS 🧚

CONFIG_BPF and bcc. that's the whole list, lowkey simple 🌸

πŸ”₯ OPTIONS πŸ”₯

  • -h β€” prints the usage message. the vibe check tool πŸ’…
  • -T β€” adds a timestamp column ⏰
  • -p PID β€” only traces this process ID (filtered in-kernel) 🎯
  • -t TID β€” only traces this thread ID (filtered in-kernel) 🧡
  • -d DURATION β€” the total duration of the trace, in seconds ⏳
  • -n NAME β€” only prints command lines matching this command name (regex) πŸ”

🌈 EXAMPLES 🌈

Trace all sockets:

# sofdsnoop

Trace all sockets, and include timestamps:

# sofdsnoop -T

Only trace sockets where the process contains "server":

# sofdsnoop -n server

πŸ¦‹ FIELDS πŸ¦‹

  • TIME(s) β€” the time of SEND/RECV actions, in seconds ⏱️
  • ACTION β€” the operation on the fd, SEND or RECV πŸ“€πŸ“₯
  • TID β€” the process TID πŸͺͺ
  • COMM β€” the parent process/command name πŸ‘―
  • SOCKET β€” the socket carrier 🚚
  • FD β€” the file descriptor number πŸ”’
  • NAME β€” the file name for SEND lines πŸ“

πŸ’œ SOURCE πŸ’œ

this is from bcc, so go check it out πŸ“

https://github.com/iovisor/bcc

also look in the bcc distribution for a companion _examples.txt file. it has example usage, output, and commentary for this tool, so it's giving tutorial, iykyk πŸ™ˆ

🫧 OS 🫧

Linux 🐧

🌸 STABILITY 🌸

🚧 Unstable - still in development. ngl, expect some drama πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Jiri Olsa 🫢

⭐ SEE ALSO ⭐

opensnoop(1) is the one to check out next πŸ’–


okay bestie that's the whole tea πŸŽ€ this page is from the USER COMMANDS section, dated 2018-11-08, and it's sofdsnoop(8) forever βœ¨πŸ’…

πŸ“¦ where this page comes from