Syscall trace via perf

strace-like syscall trace with -s summary; lower overhead, no ptrace stop-the-world

perf trace -s -p <pid>

tool
perf17 commands
tags
perfdebugperformancetroubleshooting

More perf commands

  • perf probe --add 'tcp_sendmsg size' && perf record -e probe:tcp_sendmsg -a -- sleep 5

    Add a kprobe with an argument, then record it; inspect kernel internals without rebuilding

  • perf record -g ./my_app

    Record performance data with call-graph info

  • perf report

    Interactive display of recorded perf data

  • perf list

    List all supported perf events on current system

  • perf stat ls -la

    Show hardware counters for a command

all 17 perf commands