drsnoop(8)

πŸ“¦
version 0.35.0 Β· 2 versions
  • 0.35.0 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.18.0 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

🧚 drsnoop(8) ✨ System Manager's Manual ✨

Okay bestie, this is the manual for drsnoop, a tool for tracing direct reclaim events πŸ’… It's part of Linux eBPF/bcc, so it's giving low-level and I'm obsessed.

πŸŽ€ NAME

drsnoop - Trace direct reclaim events. Uses Linux eBPF/bcc. πŸ’–

πŸ“œ SYNOPSIS

drsnoop [-h] [-T] [-U] [-p PID] [-t TID] [-u UID] [-d DURATION] [-n
name] [-v]

πŸ”₯ DESCRIPTION

Okay so drsnoop traces direct reclaim events and shows you which processes are allocing pages with direct reclaiming. It's lowkey so useful for figuring out why allocstall (/proc/vmstat) keeps climbing, and whether some critical processes are the ones causing it πŸ‘€

It works by tracing the direct reclaim events using kernel tracepoints πŸ¦‹

This makes use of a Linux 4.4 feature (bpf_perf_event_output()). For kernels older than 4.4, check the version under tools/old, which uses an older mechanism 🌸

Since this uses BPF, only the root user can use this tool. No cap, you need to be root πŸ™ˆ

🧰 REQUIREMENTS

You'll need CONFIG_BPF and bcc ✨

🌈 OPTIONS

  • -h β€” the usage message, for when you forget everything πŸ’€
  • -T β€” adds a timestamp column πŸ•
  • -U β€” shows the UID 🫢
  • -p PID β€” traces only this process ID (filtered in-kernel) 🎯
  • -t TID β€” traces only this thread ID (filtered in-kernel) 🧡
  • -u UID β€” traces only this UID (filtered in-kernel) πŸ‘‘
  • -d DURATION β€” how long the trace runs in total, in seconds ⏳
  • -n name β€” only prints processes whose name partially matches name πŸ”
  • -v β€” verbose mode, which also outputs the system memory state 🧠

πŸ’… EXAMPLES

Trace all direct reclaim events:

# drsnoop

Trace all direct reclaim events, for 10 seconds only:

# drsnoop -d 10

Trace all direct reclaim events, and include timestamps:

# drsnoop -T

Show UID:

# drsnoop -U

Trace PID 181 only:

# drsnoop -p 181

Trace UID 1000 only:

# drsnoop -u 1000

Trace all direct reclaim events from processes whose name partially matches 'mond':

# drnsnoop -n mond

πŸ“‹ FIELDS

  • TIME(s) β€” when the call happened, in seconds ⏰
  • UID β€” the User ID πŸͺͺ
  • PID β€” the Process ID πŸ†”
  • TID β€” the Thread ID 🧡
  • COMM β€” the process name 🏷️

🌸 OVERHEAD

This traces the kernel direct reclaim tracepoints and prints output for each event. The rate is generally expected to be low (< 1000/s), so the overhead is also expected to be negligible, which is very chill 😌

πŸ”— SOURCE

This is from bcc 🐝

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion _examples.txt file, which has example usage, output, and commentary for this tool πŸ“–

πŸ’» OS

Linux 🐧

πŸ§ͺ STABILITY

Unstable, still in development 🚧

πŸ‘©β€πŸ’» AUTHOR

Wenbo Zhang 🌟


That's the whole tea, bestie 🫢✨ Man page drsnoop(8), from the User Commands section, dated 2019-02-20 πŸ’œ Go trace something iconic πŸ¦‹πŸ’