一、使用方法
usage: valgrind [options] prog-and-args
使用方法:valgrind [参数选项] 程序和参数
二、选择工具
tool-selection option, with default in [ ]:
工具选择选项,默认值在[]中:
–tool= use the Valgrind tool named [memcheck]
name取值如下:
1、memcheck:检查程序中的内存问题,如泄漏、越界、非法指针等。
2、callgrind:检测程序代码覆盖,以及分析程序性能。
3、cachegrind:分析CPU的cache命中率、丢失率,用于进行代码优化。
4、helgrind:用于检查多线程程序的竞态条件。
5、massif:堆栈分析器,指示程序中使用了多少堆内存等信息。
6、lackey:Lackey是小型工具,很少用到
7、nulgrind:Nulgrind只是为开发者展示如何创建一个工具
三、工具集基本选项
basic user options for all Valgrind tools, with defaults in [ ]:
针对Valgrind工具集的基本选项,默认值在[]中:
-h --help show this message
–help-debug show this message, plus debugging options
–version show version
-q --quiet run silently; only print error ms