We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Valgrind 工具套件 [ Linux 和 OS/X ]
我使用过 Memcheck,它的工作原理正如广告中所宣传的那样。不过我还没有使用过可视化工具。不确定 Helgrind 的输出是否适合使用 kCachegrind 查看。
Valgrind 发行版包括四个[原文如此]有用的调试和分析工具:
Memcheck 检测内存管理问题,主要针对 C 和C++ 程序。当程序在 Memcheck 的监督下运行时,所有内存的读写都会被检查,并且对 malloc/new/free/delete 的调用都会被拦截。因此,Memcheck 可以检测您的程序是否:
访问不应该访问的内存...
以危险的方式使用未初始化的值。
泄漏内存。
堆块释放错误(双重释放、不匹配释放)。
将重叠的源和目标内存块传递给 memcpy() 和相关函数。
Memcheck 在这些错误发生时立即报告这些错误,并给出发生错误的源代码行号...
Cachegrind 是一个缓存分析器。它对 CPU 中的 I1、D1 和 L2 缓存进行详细模拟,因此可以准确地查明代码中缓存未命中的来源...
Callgrind 由 Josef Weidendorfer 开发,是 Cachegrind 的扩展。它提供了 Cachegrind 所做的所有信息,以及有关调用图的额外信息。它在 3.2.0 版本中被合并到主要的 Valgrind 发行版中。单独提供的是一个令人惊叹的可视化工具,KCachegrind,它可以更好地概述 Callgrind 收集的数据;它还可以用于可视化 Cachegrind 的输出。
Massif 是一个堆分析器。它通过定期拍摄程序堆快照来执行详细的堆分析。它生成一个图表,显示堆随时间的使用情况,包括程序的哪些部分负责最多内存分配的信息...
Helgrind 是一个线程调试器,可以查找多线程程序中的数据争用。它查找由多个 (POSIX p-) 线程访问的内存位置,但找不到一致使用的 (pthread_mutex_) 锁。这些位置表明线程之间缺少同步,并且可能导致难以发现的与时间相关的问题。它对于任何使用 pthread 的程序都很有用。这是一个有点实验性的工具,因此特别欢迎您提供反馈。
Valgrind's Tool Suite [ Linux and OS/X ]
I've used Memcheck and it works as advertised. I haven't used the visualization tools yet however. Not sure if the output of Helgrind can be adapted for viewing with kCachegrind.
The Valgrind distribution includes four [sic] useful debugging and profiling tools:
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 ...
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...
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...
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 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...
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.
检查这个
http://lttng.org/ (Linux 跟踪工具包)
HTH
check this
http://lttng.org/ (Linux Trace Toolkit)
HTH
DIVINE 可以绘制状态空间图并检查违反了主张。
DIVINE can draw a graph of the state space and check for violated assertions.