shmsnoop(8)
β¨ 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
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms