1, 内存检测
a, valgrind --tool=memcheck --help
b, valgrind --tool=memcheck --trace-children=yes --leak-check=full --track-origins=yes --show-reachable=yes --log-file=./log.txt ./test
2, 性能检测
a, valgrind --tool=callgrind --help
b, valgrind --tool=callgrind --trace-children=yes --log-file=./log.txt [ --separate-threads=yes ] ./test
c1, python gprof2dot.py --output=valgrind.dot --strip --node-thres=0.5 --edge-thres=0.1 --format=callgrind callgrind.out.pid
d1, dot -Tpng valgrind.dot -o valgrind.png
c2, callgrind_annotate --help (callgrind_control --help)
d2, callgrind_annotate --auto=yes --inclusive=yes --tree=both callgrind.out.pid (callgrind_control -s -b -e)
Valgrind使用指南
最新推荐文章于 2024-03-14 21:12:02 发布