Thread (6 messages) 6 messages, 5 authors, 2022-05-27

Re: [PATCH] procfs: add syscall statistics

From: Alexei Starovoitov <hidden>
Date: 2022-05-27 14:14:21
Also in: bpf, linux-arm-kernel, linux-doc, linux-fsdevel, linux-s390, lkml

On Fri, May 27, 2022 at 4:10 AM Zhang Yuchen
[off-list ref] wrote:
Add /proc/syscalls to display percpu syscall count.
I second Peter's nack.
We don't add debug features to the production kernel.
We need a less resource-intensive way to count syscall per cpu
for system problem location.

There is a similar utility syscount in the BCC project, but syscount
has a high performance cost.
There are two syscount tools in BCC:
tools/syscount
libbpf-tools/syscount

Which one has this 42% overhead?

The former tool is obsolete though.
It was written in the days when bpf had 1/10 of
the features it has today.
Both tools can be optimized.
They attach to raw_syscalls tracepoint.
tracepoints are not cheap.
In terms of overhead:
tracepoint > raw_tracepoint > fentry.
bpf can attach to all three.

Please profile libbpf-tools/syscount tool
with perf and unixbench, understand where overhead
comes from and then optimize the tool.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help