shmsnoop(8)

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

✨ shmsnoop(8) ✨

System Manager's Manual πŸ’… this is the page for shmsnoop, the tool that spies on your System V shared memory syscalls πŸ‘€

πŸ’– NAME

shmsnoop - Trace System V shared memory syscalls. Uses Linux eBPF/bcc. ✨

πŸŽ€ SYNOPSIS

shmsnoop [-h] [-T] [-p] [-t] [-d DURATION] [-n NAME]

πŸ¦‹ DESCRIPTION

okay so shmsnoop traces System V shared memory syscalls: shmget, shmat, shmdt, shmctl πŸ”₯ it's literally watching every shm call go by

πŸ”’ Since this uses BPF, only the root user can use this tool. Not you, not me, only root. Sorry bestie πŸ™ˆ

🌸 REQUIREMENTS

you'll need CONFIG_BPF and bcc 🧚

πŸ‘‘ OPTIONS

  • -h β€” Shows the usage message. Your go-to when you forget what you're doing πŸ’€
  • -T β€” Adds a timestamp column so you know exactly when things happened ⏰
  • -p PID β€” Only traces this process ID. It's filtered in-kernel, so it's fast and focused 🎯
  • -t TID β€” Only traces this thread ID. Same in-kernel filtering energy, just for a thread 🧡
  • -d DURATION β€” How long the trace runs, total, in seconds ⏳
  • -n NAME β€” Only prints command lines matching this command name. It's a regex, so get fancy with it 🌈

πŸ“ EXAMPLES

Trace all shm* syscalls:

# shmsnoop

Trace all shm* syscalls, and include timestamps:

# shmsnoop -T

Only trace shm* syscalls where the process contains "server":

# shmsnoop -n server

πŸ’œ FIELDS

  • TIME(s) β€” When the shm syscall returned, in seconds ⏱️
  • PID β€” Process ID πŸͺͺ
  • COMM β€” Process/command name πŸ’…
  • RET β€” Return value of the shm syscall πŸ”₯
  • ARGS β€” "arg: value" couples showing the syscall arguments, explained on their own manpage 🧠

🌈 SOURCE

this is from bcc 🫢

πŸ”— https://github.com/iovisor/bcc

also look in the bcc distribution for a companion _examples.txt file with example usage, output, and commentary for this tool. Lowkey essential reading ✨

🧚 OS

Linux 🐧

πŸ™ˆ STABILITY

Unstable - in development. Still cooking, so expect some changes 🍳

🫢 AUTHOR

Jiri Olsa πŸ‘‘

πŸ¦‹ SEE ALSO

opensnoop(1) 🌸


ok bestie that's the whole page πŸ’– shmsnoop(8), USER COMMANDS, last updated 2018-09-24, bcc source. Go trace some shm calls and slay 😭✨

πŸ“¦ where this page comes from