VALGRIND(1) Release 3.8.0 VALGRIND(1)
NAME
valgrind - a suite of tools for debugging and profiling programs
SYNOPSIS
valgrind [valgrind-options] [your-program] [your-program-options]
DESCRIPTION
Valgrind is a flexible program for debugging and profiling Linux executables. It
consists of a core, which provides a synthetic CPU in software, and a series of
debugging and profiling tools. The architecture is modular, so that new tools
can be created easily and without disturbing the existing structure.
Some of the options described below work with all Valgrind tools, and some only
work with a few or one. The section MEMCHECK OPTIONS and those below it describe
tool-specific options.
This manual page covers only basic usage and options. For more comprehensive
information, please see the HTML documentation on your system:
$INSTALL/share/doc/valgrind/html/index.html, or online:
http://www.valgrind.org/docs/manual/index.html.
TOOL SELECTION OPTIONS
The single most important option.
--tool=<toolname> [default: memcheck]
Run the Valgrind tool called toolname, e.g. Memcheck, Cachegrind, etc.
BASIC OPTIONS
These options work with all tools.
-h --help
Show help for all options, both for the core and for the selected tool. If
the option is repeated it is equivalent to giving --help-debug.
--help-debug
Same as --help, but also lists debugging options which usually are only of
use to Valgrind's developers.
--version
Show the version number of the Valgrind core. Tools can have their own
version numbers. There is a scheme in place to ensure that tools only
execute when the core version is one they are known to work with. This was
done to minimise the chances of strange problems arising from tool-vs-core
version incompatibilities.
-q, --quiet
Run silently, and only print error messages. Useful if you are running
regression tests or have some other automated test machinery.
-v, --verbose
Be more verbose. Gives extra information on various aspects of your program,
such as: the shared objects loaded, the suppressions used, the progress of
the instrumentation and execution engines, and warnings about unusual
behaviour. Repeating the option increases the verbosity level.
--trace-children=<yes|no> [default: no]
When enabled, Valgrind will trace into sub-processes initiated via the exec
system call. This is necessary for multi-process programs.
Note that Valgrind does trace into the child of a fork (it would be
difficult not to, since fork makes an identical copy of a process), so this
option is arguably badly named. However, most children of fork calls
immediately call exec anyway.
--trace-children-skip=patt1,patt2,...
This option only has an effect when --trace-children=yes is specified. It
allows for some children to be skipped. The option takes a comma separated
list of patterns for the names of child executables that Valgrind should not
trace into. Patterns may include the metacharacters ? and *, which have the
usual meaning.
This can be useful for pruning uninteresting branches from a tree of
processes being run on Valgrind. But you should be careful when using it.
When Valgrind skips tracing into an executable, it doesn't just skip tracing
that executable, it also skips tracing any of that executable's child
processes. In other words, the flag doesn't merely cause tracing to stop at
the specified executables -- it skips tracing of entire process subtrees
rooted at any of the specified executables.
--trace-children-skip-by-arg=patt1,patt2,...
This is the same as --trace-children-skip, with one difference: the decision
as to whether to trace into a child process is made by examining the
arguments to the child process, rather than the name of its executable.
--child-silent-after-fork=<yes|no> [default: no]
When enabled, Valgrind will not show any debugging or logging output for the
child process resulting from a fork call. This can make the output less
confusing (although more misleading) when dealing with processes that create
children. It is particularly useful in conjunction with --trace-children=.
Use of this option is also strongly recommended if you are requesting XML
output (--xml=yes), since otherwise the XML from child and parent may become
mixed up, which usually makes it useless.
--vgdb=<no|yes|full> [default: yes]
Valgrind will provide "gdbserver" functionality when --vgdb=yes or
--vgdb=full is specified. This allows an external GNU GDB debugger to
control and debug your program when it runs on Valgrind. --vgdb=full incurs
significant performance overheads, but provides more precise breakpoints and
watchpoints. See ??? for a detailed description.
If the embedded gdbserver is enabled but no gdb is currently being used, the
??? command line utility can send "monitor commands" to Valgrind from a
shell. The Valgrind core provides a set of ???. A tool can optionally
provide tool specific monitor commands, which are documented in the tool
specific chapter.
--vgdb-error=<number> [default: 999999999]
Use this option when the Valgrind gdbserver is enabled with --vgdb=yes or
--vgdb=full. Tools that report errors will wait for "number" errors to be
reported before freezing the program and waiting for you to connect with
GDB. It follows that a value of zero will cause the gdbserver to be started
before your program is executed. This is typically used to insert GDB
breakpoints before execution, and also works with tools that do not report
errors, such as Massif.
--track-fds=<yes|no> [default: no]
When enabled, Valgrind will print out a list of open file descriptors on
exit. Along with each file descriptor is printed a stack backtrace of where
the file was opened and any details relating to the file descriptor such as
the file name or socket details.
--time-stamp=<yes|no> [default: no]
When enabled, each message is preceded with an indication of the elapsed
wallclock time since startup, expressed as days, hours, minutes, seconds and
milliseconds.
--log-fd=<number> [default: 2, stderr]