bps(8)

✨ bps β€” bestie's guide to peeking at your BPF programs ✨

okay so like. this is bps(8), living in the System Manager's Manual, and it's literally ps but for BPF programs. that's the whole vibe. πŸ¦‹


πŸ’– NAME πŸ’–

bps β€” List all BPF programs. it's 'ps' for BPF programs. no cap, that's the official tagline and it ate. πŸ‘‘


🌸 SYNOPSIS 🌸

bps [bpf-prog-id]

πŸŽ€ DESCRIPTION πŸŽ€

so bps lists, like, every single BPF program that's loaded into the kernel. it's similar to the ps command bestie, except instead of processes it's BPF programs. same energy, different species. πŸ’…

each loaded bpf program gets its own unique integer, and that's the bpf-prog-id, or just BID for short (iykyk). and here's the cute part: if you pass a bpf-prog-id, the maps that bpf-prog-id uses will also get listed. two for one. slay. ✨


🌈 EXAMPLES 🌈

list every BPF program that's loaded into the kernel:

bps

show the details <and> the maps of BID 6:

bps 6

πŸ‘‘ BPF PROGRAM FIELDS πŸ‘‘

these are the columns you're gonna see, and yes we're going through all of them:

  • BID β€” the BPF program ID. lowkey important detail: it ends with a - if it is not jitted. so if you see that little dash, that's what's up.
  • TYPE β€” the type of a BPF program. e.g. kprobe, tracepoint, xdp...etc.
  • UID β€” the user ID that loaded the BPF program. who did this. πŸ•΅οΈ
  • #MAPS β€” total number of maps used by a BPF program.
  • LoadTime β€” when was the BPF program loaded? like, timestamps bestie.
  • NAME β€” the name of a BPF program. the user space library (like bcc) usually uses the C function name of the original BPF's source code as the program name. and it could be empty if the user space did not provide a name. not its fault. πŸ™ˆ

πŸ¦‹ BPF MAP FIELDS πŸ¦‹

and now the map side of things, all of it, no skipping:

  • MID β€” BPF map ID.
  • TYPE β€” the type of a BPF map. e.g. hash, array, stack trace...etc.
  • FLAGS β€” the flags used to create the BP map.
  • KeySz β€” the key size of a BPF map.
  • ValueSz β€” the value size of a BPF map.
  • MaxEnts β€” the maximum number of entries of a map.
  • NAME β€” the name of a BPF map. the user space library (like bcc) usually uses the C variable name of the BPF map as its name. and it could be empty if the user space did not provide a name. again, not its fault. 🫢

πŸ’œ SOURCE πŸ’œ

this is from bcc. periodt.

https://github.com/iovisor/bcc

⭐ OS ⭐

Linux. obviously. 🐧


πŸ’€ STABILITY πŸ’€

Unstable - in development. so like, it's giving "we're still cooking" energy. use it, love it, but know it's a work in progress bestie. 😭


🌸 AUTHOR 🌸

Martin Lau


okay and for the cute sign-off: this whole thing comes from the USER COMMANDS section, dated 2017-10-19, and it's filed under bps(8) β€” that's the manual page name, the one and only, the main character. πŸ’–βœ¨πŸŽ€