perf
perf
https://man7.org/linux/man-pages/man1/perf.1.html
wiki:https://perf.wiki.kernel.org/index.php/Main_Page
perf Examples:https://www.brendangregg.com/perf.html
https://github.com/brendangregg/FlameGraph
https://man7.org/linux/man-pages/man2/perf_event_open.2.html
reference:
perf基本使用方法:https://blog.csdn.net/jasonactions/article/details/109332167
【性能】perf + 火焰图分析软件性能瓶颈:https://blog.csdn.net/bandaoyu/article/details/108765693
perf性能分析工具使用分享:https://zhuanlan.zhihu.com/p/498100484
linux perf工具的使用与原理浅析:https://zhuanlan.zhihu.com/p/545372697
系统级性能分析工具perf的介绍与使用:https://www.cnblogs.com/arnoldlu/p/6241297.html
手把手教你系统级性能分析工具perf的介绍与使用(超详细):https://zhuanlan.zhihu.com/p/471379451
【性能】perf工具简介:https://blog.csdn.net/bandaoyu/article/details/120702893
Linux 性能分析|perf 源码实现:https://mp.weixin.qq.com/s/9LDP8wxi_fEBoAOPOTYFSA
perf 编译:
cd kernel/tools/
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- perf
cd kernel/tools/
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=aarch64-linux-gnu-gcc perf_clean
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=aarch64-linux-gnu-gcc perf
reference:
性能问题perf工具的编译:https://zhuanlan.zhihu.com/p/398653329
开发工具】【perf】性能分析工具perf的编译和使用说明:https://blog.csdn.net/Ivan804638781/article/details/122700909
perf编译和使用:https://blog.csdn.net/aalace/article/details/103176340
git clone https://github.com/brendangregg/FlameGraph.git
perf record -F 99 -a --call-graph dwarf -p 1505 sleep 10
perf script -i perf.data > perf.script.data
cat perf.script.data | ../FlameGraph/stackcollapse-perf.pl > out.perf-folded
../FlameGraph/flamegraph.pl out.perf-folded > perf.svg
../../FlameGraph/stackcollapse-perf.pl 1-app.perf.unfold | ../../FlameGraph/flamegraph.pl > 1-app.svg
Counting Syscalls
# Count syscalls per-second system-wide:
perf stat -e raw_syscalls:sys_enter -I 1000 -a
# Count system calls by type for the specified PID, until Ctrl-C:
perf stat -e 'syscalls:sys_enter_*' -p PID
# Count system calls by type for the entire system, for 5 seconds:
perf stat -e 'syscalls:sys_enter_*' -a sleep 5
perf stat -e 'syscalls:sys_enter_*' sleep 1 2>&1 | awk '$1 != 0'
perf trace -s sleep 1
perf record -e syscalls:sys_enter_gettid -p XX -ag sleep 1
perf report --stdio
perf app
P=top-app && \
perf record -F 99 -a -g -p $(pidof $P) -o $P.perf.data sleep 5 && \
perf report --stdio -i $P.perf.data > $P.perf.stdio.report.txt && \
perf script -i $P.perf.data > $P.perf.data.unfold && \
sz $P.perf.data && \
sz $P.perf.data.unfold && \
sz $P.perf.stdio.report.txt
writeen by wangyangkai.