perf list

    perf top

    1. perf record -ag -F 97
    2. perf record -p 188 -g -F 97
    3. perf record -g -F 97 -- ./myapp

    -F frequency of samples
    意思是每秒sample多少次,-F 97的意思是,每秒sample 97次,为什么要-F?控制frequency可以控制perf所带来的overhead,因为perf本身也会影响结果,如果97太高,也可以降低frequency

    1. perf report --stdio
    1. perf annotate

    systemctl show

    • perf list shows a list of events
    • perf top dynamically shows profilling information
    • perf stat shows a standard set of statistics after running a command
    • perf record generates the perf data file for further analysis
      • perf record -e instructions sleep 5
      • perf record -p $(pidof xxx) attach to a running process
    • perf report
    • perf sched