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 EPERMor-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-lto 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 π
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms