简介Valgrind工具包功能

简介: 我就不班门弄斧了。不过呢,有可能有些同学可能不知道Valgrind有哪些功能,那么我就从Valgrind的官方网站处,摘几段文字吧。MemcheckMemcheck detects memory-management problems, and is aimed primarily at C and C++ programs.
我就不班门弄斧了。不过呢,有可能有些同学可能不知道Valgrind有哪些功能,那么我就从Valgrind的官方网站处,摘几段文字吧。

Memcheck

Memcheck detects memory-management problems, and is aimed primarily at C and C++ programs. When a program is run under Memcheck's supervision, all reads and writes of memory are checked, and calls to malloc/new/free/delete are intercepted. As a result, Memcheck can detect if your program:

  • Accesses memory it shouldn't (areas not yet allocated, areas that have been freed, areas past the end of heap blocks, inaccessible areas of the stack).
  • Uses uninitialised values in dangerous ways.
  • Leaks memory.
  • Does bad frees of heap blocks (double frees, mismatched frees).
  • Passes overlapping source and destination memory blocks to memcpy() and related functions.

Memcheck reports these errors as soon as they occur, giving the source line number at which it occurred, and also a stack trace of the functions called to reach that line. Memcheck tracks addressability at the byte-level, and initialisation of values at the bit-level. As a result, it can detect the use of single uninitialised bits, and does not report spurious errors on bitfield operations. Memcheck runs programs about 10--30x slower than normal.

Cachegrind

Cachegrind is a cache profiler. It performs detailed simulation of the I1, D1 and L2 caches in your CPU and so can accurately pinpoint the sources of cache misses in your code. It identifies the number of cache misses, memory references and instructions executed for each line of source code, with per-function, per-module and whole-program summaries. It is useful with programs written in any language. Cachegrind runs programs about 20--100x slower than normal.

Callgrind Callgrind, by Josef Weidendorfer, is an extension to  Cachegrind . It provides all the information that Cachegrind does, plus extra information about callgraphs. It was folded into the main Valgrind distribution in version 3.2.0. Available separately is an amazing visualisation tool,  KCachegrind , which gives a much better overview of the data that Callgrind collects; it can also be used to visualise Cachegrind's output.

Massif

Massif is a heap profiler. It performs detailed heap profiling by taking regular snapshots of a program's heap. It produces a graph showing heap usage over time, including information about which parts of the program are responsible for the most memory allocations. The graph is supplemented by a text or HTML file that includes more information for determining where the most memory is being allocated. Massif runs programs about 20x slower than normal.

Helgrind

Helgrind is a thread debugger which finds data races in multithreaded programs. It looks for memory locations which are accessed by more than one (POSIX p-)thread, but for which no consistently used (pthread_mutex_) lock can be found. Such locations are indicative of missing synchronisation between threads, and could cause hard-to-find timing-dependent problems. It is useful for any program that uses pthreads. It is a somewhat experimental tool, so your feedback is especially welcome here.

DRD

DRD is a tool for detecting errors in multithreaded C and C++ programs. The tool works for any program that uses the POSIX threading primitives or that uses threading concepts built on top of the POSIX threading primitives. While Helgrind can detect locking order violations, for most programs DRD needs less memory to perform its analysis.



目录
相关文章
|
8月前
|
安全 Linux 测试技术
1.1 Metasploit 工具简介
Metasploit 简称(MSF)是一款流行的开源渗透测试框架,由`Rapid7`公司开发,可以帮助安全和IT专业人士识别安全性问题,验证漏洞的缓解措施,并管理专家驱动的安全性进行评估,提供真正的安全风险情报。并且该框架还提供了一系列攻击模块和`Payload`工具,可用于漏洞利用、及漏洞攻击。同时软件自身支持多种操作系统平台,包括`Windows、Linux、MacOS`等。直到今天`Metasploit`已成为众多黑客手中渗透攻击的利器,并在安全领域大展身手。
149 1
|
30天前
|
缓存 Linux iOS开发
【C/C++ 集成内存调试、内存泄漏检测和性能分析的工具 Valgrind 】Linux 下 Valgrind 工具的全面使用指南
【C/C++ 集成内存调试、内存泄漏检测和性能分析的工具 Valgrind 】Linux 下 Valgrind 工具的全面使用指南
65 1
|
1月前
|
Java Scala Maven
性能工具之 Gatling 开发环境搭建
编写 Gatling 脚本需要搭建脚本开发环境,下面演示使用 IDEA 开发环境搭建脚本开发环境。
26 2
性能工具之 Gatling 开发环境搭建
|
5月前
|
监控 Unix Linux
[linux性能优化]python第三方库-PSUtil库
PSUtil库是Python的一个第三方库,它可以访问各种系统信息和资源利用率,如CPU,内存,磁盘,网络接口,进程等。在Linux、Windows、Mac OS X、FreeBSD等操作系统中,PSUtil提供了一致的接口,这使得它成为了Python系统管理和监控的有力工具。
An工具介绍之3D工具
An工具介绍之3D工具
371 0
An工具介绍之3D工具
|
JSON NoSQL Linux
VS2022OpenCV跨平台Linux CMake项目搭建过程(Jetson nano测试)
VS2022OpenCV跨平台Linux CMake项目搭建过程(Jetson nano测试)
672 0
VS2022OpenCV跨平台Linux CMake项目搭建过程(Jetson nano测试)
|
运维 Kubernetes Go
|
C语言 Linux
SystemTap工具的使用基础
systemtap工具的安装 准备工作 uname -a 查看当前内核版本是哪一个,然后使用 yum install kernel-devel 安装kernel debuginfo包 rpm -qi kernel-devel 找到内核构建的详细信息,然后去对应发布网站上找kernel-debuginfo和kernel-debuginfo-common包。
1984 0
|
安全 物联网 Linux
官方简要解读 LinuxKit 工具包
LinuxKit是一个开源项目,可以允许用户构建自定义的Linux子系统。
2162 0

热门文章

最新文章