sofdsnoop(8)
β¨ 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
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- fedora 43: bcc-tools 0.35.0-2.fc43 Β· Apache-2.0
- fedora 44: bcc-tools 0.35.0-5.fc44 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms