valgrind

来源:互联网 发布:中国陆军战斗力 知乎 编辑:程序博客网 时间:2024/05/29 16:11
http://valgrind.org/info/tools.html

检查内存泄露?
valgrind --tool=memcheck --leak-check=full --show-possibly-lost=no --log-file=./temp.txt ovs-vswitchd
启动之后就好像gdb中运行,运行之后会打印出必然泄露与可能泄露。

cachegrind/callgrind?
统计cache miss的地方。

missif?
用于统计heap信息的。

helgrind?
用于查找对于同一块内存线程可能会data race的地方,非常有用。
例如某一块代码或者内存变量没有使用锁保护,同时多个线程访问了这个data,那么就会产生data race。

DRD?
用于多线程的locking oder错误的查找。
例如多次锁某个mutex,或者加锁之后没有解锁等。
0 0
原创粉丝点击