syscount: Summarize syscall counts and latencies
authorSasha Goldshtein <goldshtn@gmail.com>
Thu, 9 Feb 2017 15:11:50 +0000 (10:11 -0500)
committerSasha Goldshtein <goldshtn@gmail.com>
Thu, 16 Feb 2017 09:19:21 +0000 (09:19 +0000)
commit8e583cca87fc3af895b0e7540fb5919891f1f8f6
treeae1952b095ac25092bfccf8db3be7ee49ab79c00
parent5f354e5a4246390682c626dacc9f92cf30203711
syscount: Summarize syscall counts and latencies

This new tool attaches to the raw_syscalls:sys_enter and sys_exit
tracepoints, and collects frequency counts and optionally latencies
of syscalls (aggregated by syscall or by process). It is a fairly
natural and efficient extension of Brendan Gregg's syscount from
perf-tools. Options include latency tracing, interval printouts,
process filtering, summarizing only failed syscalls, and more.

NOTE:
The translation of syscall numbers to names is performed using a
static list, borrowed from strace sources. It is accurate up to
syscall 313, and does not include the bpf() syscall, for example.
Also, it is only relevant for x86_64.

Basic example:

```
$ syscount -P
Tracing syscalls, printing top 10... Ctrl+C to quit.
[10:13:21]
PID    COMM               COUNT
30216  sshd                 533
31391  vi                   494
25188  screen               134
25776  mysqld                24
31394  python                10
494    systemd-journal        5
^C

$ syscount -L
Tracing syscalls, printing top 10... Ctrl+C to quit.
[10:13:34]
SYSCALL                   COUNT        TIME (us)
select                      132      1902458.009
nanosleep                   166        11136.305
write                        89           41.308
ftruncate                     1           33.217
stat                          1           22.117
fstat                         1            6.134
[unknown: 321]               28            4.553
ioctl                         7            4.544
wait4                       166            3.962
timerfd_settime               1            3.786
^C
```

Related: #786
README.md
man/man8/syscount.8 [new file with mode: 0644]
tools/syscount.py [new file with mode: 0755]
tools/syscount_example.txt [new file with mode: 0644]