Tool for tracing and visualisation of pthread behaviour in Linux [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionI am eager to find a tool that allows me to trace the behaviour of the pthreads in a program I am working on. I am aware that there where similar questions asked before, see here and here .
As it turns out, the tools that are recommended are not what I need or it seems impossible to get them to to work on my machine. It is Debian 6, 32-bit all over on x86 architecture.
EZtrace in combination with ViTE seems to be what I am looking for. But unfortunately I cannot get it to work. (Tools wont compile in some versions, other versions crash, never really saw it work. Different Computer (Ubuntu 10.04 x64) shows other bugs)
Is there a tracing solution that is capable of visualizing the behavior of a pthreaded program on Linux, that is actually known to work?
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.
check this
http://lttng.org/ (Linux Trace Toolkit)
HTH
DIVINE can draw a graph of the state space and check for violated assertions.
精彩评论