Record a specific event

Record only cache-miss events

perf record -e cache-misses ./my_app

tool
perf17 commands
tags
perfprofilingcache

More perf commands

  • perf top

    Show live CPU usage per function, similar to top

  • perf annotate

    Show annotated assembly for the hottest functions

  • perf record -F 99 -ag -- sleep 30 && perf script > out.perf

    Sample all CPUs at 99 Hz for 30 seconds and save the stacks for a flame graph

  • perf stat -e syscalls:sys_enter_read ./my_app

    Count how many read() syscalls the app makes

  • perf record -p 1234 sleep 5

    Profile a process that is already running for 5 seconds

all 17 perf commands