使用perf工具分析性能
可分析到驱动内部。请参考 https://blog.youkuaiyun.com/u014608280/article/details/80265718
使用gperf工具分析性能
这是Google工具 依赖于libunwind。需要先编译libunwind
#!/bin/bash
set -x
pushd libunwind-1.3.1
./configure --host=aarch64-linux-gnu --build=aarch64 --disable-static CFLAGS=-U_FORTRIFY_SOURCE --prefix=/my/install
if [ $? -ne 0 ]; then
echo "configure failed"
popd
exit -1
fi
make -j4
if [ $? -ne 0 ]; then
echo "make failed"
popd
exit -1
fi
make install
if [ $? -ne 0 ]; then
echo "install failed"
popd
exit -1
fi
make clean
popd
再安装gperf
#!/bin/bash
set -x
pushd gperftools-2.7
install_path='/my/install'
./configure --host=aarch64-lin

本文介绍了在Linux系统中进行代码性能分析的两种工具——perf和gperf。perf工具能够深入到驱动内部进行分析,详细参考链接。而gperf是Google提供的工具,依赖libunwind库,用于性能分析。另外,还提到了valgrind工具,通过特定脚本编译后,能有效发现内存泄漏问题。
最低0.47元/天 解锁文章
5828

被折叠的 条评论
为什么被折叠?



