Count syscalls

Count specific syscall events

perf stat -e syscalls:sys_enter_read ./my_app

tool
perf17 commands
tags
perfprofilingsyscalls

More perf commands

  • perf record -p 1234 sleep 5

    Profile an already-running process for 5 seconds

  • perf top -g --call-graph dwarf

    Live top hot functions with caller chains; dwarf unwind works without frame pointers

  • perf record -F 99 -a -g -- sleep 30 && perf report --stdio

    Sample whole machine at 99Hz for 30s, then print collapsed report; 99Hz dodges lockstep aliasing

  • perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg

    Turn perf.data into an interactive flame graph SVG (Brendan Gregg FlameGraph tools)

  • perf stat -d -d -d -- ./app

    Run with three -d for L1/LLC/TLB and stalled-cycle detail; reveals memory-bound vs CPU-bound

all 17 perf commands