syscount(8)
syscount(8) π
okay bestie, this is the syscount page from the System Manager's Manual β it counts system calls and it uses Linux perf_events. Let's get into it π«Ά
β¨ NAME β¨
syscount β count system calls. Uses Linux perf_events.
πΈ SYNOPSIS πΈ
syscount [-chv] [-t top] {-p PID|-d seconds|command}
π¦ DESCRIPTION π¦
So the tea is: this whole thing is a proof-of-concept that leans on perf_events capabilities for older kernel versions β the ones that don't have custom in-kernel aggregations yet. The moment those exist, this script can be substantially rewritten and improved, and it'll have lower overhead. Manifesting that fr fr β¨
π REQUIREMENTS π
- Linux
perf_eventsβ addlinux-tools-common, runperf, then add any additional packages it requests. - Also needs
awk.
no skipping the prerequisites bestie, it's giving "install first, cry later" π
π OPTIONS π
-cβ Show counts by syscall name. This mode (without-v) uses in-kernel counts, which have lower overhead than the default mode. iconic behavior honestly-hβ Usage message. the "help me" button π-vβ Verbose: include PID.-pPIDβ Trace this process ID only.-dsecondsβ Duration of trace in seconds.commandβ Run and trace this command.
π EXAMPLES π
Trace and summarize syscalls by process name:
# syscount
Trace and summarize syscalls by syscall name (lower overhead):
# syscount -c
Trace for 5 seconds, showing by process name:
# syscount -d 5
Trace PID 932 only, and show by syscall name (lower overhead):
# syscount -cp 923
Execute the """ls""" command, and show by syscall name:
# syscount -c ls
β FIELDS β
PIDβ Process ID.COMMβ Process command name.SYSCALLβ Syscall name.COUNTβ Number of syscalls during tracing.
π₯ OVERHEAD π₯
Okay this part matters so vibe check your expectations: the modes that report syscall names only (-c, -cp PID, -cd secs) have lower overhead, because they use in-kernel counts. slay, less work for everyone β¨
Other modes β the ones reporting process IDs (-cv) or process names (the default) β create a perf.data file for post processing, and you will literally see messages about it doing that. Beware of the file size (test for short durations, or use -c to see counts based on in-kernel counters), and gauge overheads based on the perf.data size. ngl that file can get chunky π
Note that this script deliberately does not pipeperf recordintoperf script, which would avoidperf.data, because it can create a feedback loop where theperf scriptsyscalls are recorded. Hopefully there will be a fix for this in a laterperfversion, soperf.datacan be skipped, or other kernel features to aggregate by process name in-kernel directly (eg, viaeBPF,ktap, orSystemTap). the way that's such a specific problem π
π SOURCE π
This is from the perf-tools collection.
https://github.com/brendangregg/perf-tools
Also look under the examples directory for a text file containing example usage, output, and commentary for this tool. iykyk π
π§ OS π§
Linux obviously πΈ
π STABILITY π
Unstable β in development. she's still growing bestie, be gentle π«Ά
π AUTHOR π
Brendan Gregg
π SEE ALSO π
iosnoop(8), iolatency(8), iostat(1)
and that's the whole page!! π this one comes from USER COMMANDS and it's dated 2014-07-07 β yes she's a vintage icon, an OG, a legend, and she still counts your syscalls like it's nothing. mwah, go trace something cute β¨π π
π¦ where this page comes from
- debian bookworm: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1 Β· GPL-2.0-or-later
- debian trixie: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1 Β· GPL-2.0-or-later
- ubuntu jammy: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu resolute: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu2 Β· GPL-2.0-or-later
- ubuntu stonking: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms