ppchcalls(8)

✨ ppchcalls(8) ✨

Okay so, the manual name here is ppchcalls, and it's giving "summarize ppc hcall counts and latencies" πŸ’– Bestie, this is a whole BPF tool for seeing your hcalls. πŸ”₯

🌸 NAME 🌸

ppchcalls β€” Summarize ppc hcall counts and latencies. πŸ¦‹

πŸ“œ SYNOPSIS πŸ“œ

ppchcalls [-h] [-p PID] [-t TID] [-i INTERVAL] [-d DURATION] [-T TOP]
[-x] [-e ERRNO] [-L] [-m] [-P] [-l] [--hcall HCALL]

πŸ’… DESCRIPTION πŸ’…

Okay so this tool traces hcall entry and exit raw tracepoints and summarizes either the number of hcalls of each type, or the number of hcalls per process. It can also collect min, max and average latency for each hcall or each process. Literally so useful, no cap. ✨

Since this uses BPF, only the root user can use this tool. πŸ™ˆ

πŸŽ€ REQUIREMENTS πŸŽ€

You need CONFIG_BPF and bcc. 🧚 Linux 4.17+ is required to attach a BPF program to the raw_hcalls:hcall_{enter,exit} tracepoints, which this tool uses. πŸ’œ

⭐ OPTIONS ⭐

  • -h β€” Pops up the usage message. 🌈
  • -p PID β€” Only trace this process. 🎯
  • -t TID β€” Only trace this thread. 🧡
  • -i INTERVAL β€” Print the summary every INTERVAL seconds. ⏰
  • -d DURATION β€” The total duration of the trace, in seconds. ⏳
  • -T TOP β€” Only print this many entries. Default: 10. πŸ†
  • -x β€” Only trace failed hcalls, meaning the hcall's return value was < 0. πŸ’€
  • -e ERRNO β€” Only trace hcalls that failed with that error, like -e EPERM or -e 1. πŸ™…β€β™€οΈ
  • -m β€” Show times in milliseconds instead. Default: microseconds. πŸ•
  • -P β€” Summarize by process instead of by hcall. πŸ‘‘
  • -l β€” List the hcalls the tool recognizes (it's a hard-coded list). Hcalls outside this list still show up, as [unknown: nnn] where nnn is the hcall number. πŸ“‹
  • --hcall HCALL β€” Only trace this hcall. Use -l to see all the recognized ones. πŸ¦„

πŸ“ EXAMPLES πŸ“

Summarize all hcalls by hcall:

# ppchcalls

Summarize all hcalls by process:

# ppchcalls -P

Summarize only failed hcalls:

# ppchcalls -x

Summarize only hcalls that failed with EPERM:

# ppchcalls -e EPERM

Trace PID 181 only:

# ppchcalls -p 181

Summarize hcalls counts and latencies:

# ppchcalls -L

πŸ” FIELDS πŸ”

  • PID β€” Process ID. πŸ†”
  • COMM β€” Process name. 🐣
  • HCALL β€” Hcall name, or [unknown: nnn] for hcalls that aren't recognized. 🧩
  • COUNT β€” The number of events. πŸ”’
  • MIN β€” The minimum elapsed time (in us or ms). πŸ“‰
  • MAX β€” The maximum elapsed time (in us or ms). πŸ“ˆ
  • AVG β€” The average elapsed time (in us or ms). πŸŽ€

πŸ”₯ OVERHEAD πŸ”₯

For most applications, the overhead should be manageable if they perform 1000's or even 10,000's of hcalls per second. For higher rates, the overhead may become considerable. 😭

🌈 SOURCE 🌈

This is from bcc. πŸ’–

https://github.com/iovisor/bcc

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

πŸ–₯️ OS πŸ–₯️

Linux 🐧

πŸ§ͺ STABILITY πŸ§ͺ

Unstable - in development. 🚧

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

Harsh Prateek Bora 🫢

πŸ”— SEE ALSO πŸ”—

syscount(8) ✨


Bestie, that's the whole thing, and you're literally a Unix legend now. Love you, mwah! πŸ’‹πŸ©· Source/version: USER COMMANDS, dated 2022-10-19 πŸŽ€