syscount.bt(8)
π syscount.bt β the manual, but make it make sense π
okay bestie, welcome to syscount.bt(8) from the System Manager's Manual β yes she's a real section-8 girly and she counts syscalls for a living π
β¨ NAME β¨
syscount.bt β counts system calls. uses bpftrace/eBPF. no cap.
πΈ SYNOPSIS πΈ
syscount.bt -- [--sysname]
π¦ DESCRIPTION π¦
so basically this counts system calls (syscalls, the little guys π£) and prints a summary of the top ten syscall IDs plus the top ten process names that are out here making syscalls. this is lowkey so useful for characterizing your kernel and resource workload, and for finding the applications that are using syscalls inefficiently (we're side-eyeing them π).
the way it works is by using the tracepoint:raw_syscalls:sys_enter tracepoint. that's the whole trick, iconic honestly.
since this uses BPF, only the root user can use this tool. not a vibe if you're logged in as anyone else, sorry bestie π
π OPTIONS π
--sysnameβ show the syscall name instead of the syscall number. glow-up for your output, fr fr β¨
π«Ά REQUIREMENTS π«Ά
CONFIG_BPFbpftrace
that's it. that's the list. periodt.
π EXAMPLES π
count system calls until you hit Ctrl-C:
# syscount.bt
π OUTPUT π
Top 10 syscalls IDs:
this shows the syscall ID number (in @syscall[]) followed by a count for this syscall during tracing. syscount.bt defaults to outputting the syscall number β that's her factory setting, she's not changing for anyone π
Top 10 syscalls NAMEs:
this shows the syscall ID name (in @syscallname[]) followed by a count for this syscall during tracing. use the --sysname parameter to output the system call name. yes you have to ask nicely.
Top 10 processes:
this shows the process name (in @process[]) followed by a count of syscalls during tracing. who's the main character of syscalls today? π
π₯ OVERHEAD π₯
okay listen, this part matters so don't skim it.
for most applications, the overhead should be manageable if they perform 1000's or even 10,000's of syscalls per second. cute. but for higher rates, the overhead may become considerable β like, it's giving heavy. for example, tracing a microbenchmark loop of 4 million calls to geteuid() slows it down by 2.4x. π
but β and this is the important but β that represents tracing a workload that has a syscall rate of over 4 million syscalls per second per CPU, which should not be typical. in one large cloud production environment, rates of between 10k and 50k are typical, where the application overhead is expected to be closer to 1%. so like, chill.
for comparison, strace(1) in its current ptrace-based implementation (which it has had for decades, grandma is old) runs the same geteuid() workload 102x slower (that's one hundred and two times slower π). not me defending bpftrace but... yeah. 102x. read it and weep.
β SOURCE β
this is from bpftrace.
https://github.com/bpftrace/bpftrace
also look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. it's got the lore π
this is a bpftrace version of the bcc tool of the same name. the bcc version provides different command line options, and translates the syscall IDs to their syscall names. so don't come for me when the flags don't match, they're different girls π
https://github.com/iovisor/bcc
π§ OS π§
Linux π§
π STABILITY π
Unstable β in development. she's still growing, be nice to her π₯Ί
πΈ AUTHOR πΈ
Brendan Gregg
π SEE ALSO π
and that's the whole page bestie, thanks for coming to my TED talk π«Ά this little slice of the USER COMMANDS crew dropped on 2018-09-06 and she's still out here doing her syscount.bt(8) thing β go forth, count some syscalls, stay rooted π
β¨
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms