现在已移动到 `GitHub.com/inspektor-gadget/inspektor-gadget/pkg/gadget-collection/gadgets/traceloop`。使用 BPF 和可覆盖的方式在 cgroups 中跟踪系统调用。
现在已移动到 `GitHub.com/inspektor-gadget/inspektor-gadget/pkg/gadget-collection/gadgets/traceloop`。使用 BPF 和可覆盖的方式在 cgroups 中跟踪系统调用。
traceloop is a command line tool to trace system calls in a similar way to strace but with some differences:
traceloop can be used directly on the command line or via an HTTP interface.
traceloop has been written to trace Kubernetes Pods with Inspektor
Gadget, but it can as easily be
used with systemd services that are in their own control groups (look for
.service and .scope directories inside /sys/fs/cgroup/unified/).
Example with an existing systemd service:
sudo -E ./traceloop cgroups /sys/fs/cgroup/unified/system.slice/sshd.serviceExample with a custom command:
…docker run --rm -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/fs/bpf:/sys/fs/bpf -v /run:/run --privileged kinvolk/traceloopsudo -E ./traceloop serve
...
$ sudo curl --unix-socket /run/traceloop.socket 'http://localhost/add?name=sshd&cgrouppath=/sys/fs/cgroup/unified/system.slice/sshd.service'
added as id 0
$ sudo curl --unix-socket /run/traceloop.socket 'http://localhost/list'
0: [sshd] /sys/fs/cgroup/unified/system.slice/sshd.service
$ sudo curl --unix-socket /run/traceloop.socket 'http://localhost/dump-by-cgroup?cgroup=/sys/fs/cgroup/unified/system.slice/sshd.service'
...
A comprehensive presentation was held at LPC 2020 in the Networking and BPF Summit. See the slides here.
After feedback to include a comparison to perf trace we reran the benchmark but omitted the synchronous write syscall case that logs the buffer contents because dumping the buffers is not implemented in perf trace. Here the results:
暂无开放 Issues,或尚未同步最近议题。