|Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications|
by J. Seward, N. Nethercote, J. Weidendorfer and the Valgrind Development Team
Paperback (6"x9"), 164 pages
RRP £12.95 ($19.95)
8.3 Massif Options
Massif-specific options are:
--heap=<yes|no> [default: yes]Specifies whether heap profiling should be done.
--heap-admin=<number> [default: 8]If heap profiling is enabled, gives the number of administrative bytes per block to use. This should be an estimate of the average, since it may vary. For example, the allocator used by ‘glibc’ requires somewhere between 4 to 15 bytes per block, depending on various factors. It also requires admin space for freed blocks, although Massif does not account for this.
--stacks=<yes|no> [default: yes]Specifies whether stack profiling should be done. This option slows Massif down greatly, and so is off by default. Note that Massif assumes that the main stack has size zero at start-up. This is not true, but measuring the actual stack size is not easy, and it reflects the size of the part of the main stack that a user program actually has control over.
--depth=<number> [default: 30]Maximum depth of the allocation trees recorded for detailed snapshots. Increasing it will make Massif run somewhat more slowly, use more memory, and produce bigger output files.
--alloc-fn=<name>Functions specified with this option will be treated as though they were a heap allocation function such as
malloc. This is useful for functions that are wrappers to
new, which can fill up the allocation trees with uninteresting information. This option can be specified multiple times on the command line, to name multiple functions. Note that overloaded C++ names must be written in full. Single quotes may be necessary to prevent the shell from breaking them up. For example:
--alloc-fn='operator new(unsigned, std::nothrow_t const&)'The full list of functions and operators that are by default considered allocation functions is as follows.
malloc calloc realloc memalign __builtin_new __builtin_vec_new operator new(unsigned) operator new(unsigned long) operator new(unsigned) operator new(unsigned long) operator new(unsigned, std::nothrow_t const&) operator new(unsigned, std::nothrow_t const&) operator new(unsigned long, std::nothrow_t const&) operator new(unsigned long, std::nothrow_t const&)
--threshold=<m.n> [default: 1.0]The significance threshold for heap allocations, as a percentage. Allocation tree entries that account for less than this will be aggregated. Note that this should be specified in tandem with ms_print's option of the same name.
--peak-inaccuracy=<m.n> [default: 1.0]Massif does not necessarily record the actual global memory allocation peak; by default it records a peak only when the global memory allocation size exceeds the previous peak by at least 1.0%. This is because there can be many local allocation peaks along the way, and doing a detailed snapshot for every one would be expensive and wasteful, as all but one of them will be later discarded. This inaccuracy can be changed (even to 0.0%) via this option, but Massif will run drastically slower as the number approaches zero.
--time-unit=i|ms|B [default: i]The time unit used for the profiling. There are three possibilities: instructions executed (i), which is good for most cases; real (wallclock) time (ms, i.e. milliseconds), which is sometimes useful; and bytes allocated/deallocated on the heap and/or stack (B), which is useful for very short-run programs, and for testing purposes, because it is the most reproducible across different machines.
--detailed-freq=<n> [default: 10]Frequency of detailed snapshots. With ‘--detailed-freq=1’, every snapshot is detailed.
--max-snapshots=<n> [default: 100]The maximum number of snapshots recorded. If set to N, for all programs except very short-running ones, the final number of snapshots will be between N/2 and N.
--massif-out-file=<file> [default: massif.out.%p]Write the profile data to ‘file’ rather than to the default output file, ‘massif.out.<pid>’. The
%qformat specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
--log-file. See 3.6.2 for details.
--alignment=<n> [default: 1.0]The minimum alignment (and thus size) of heap blocks.
|ISBN 0954612051||Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications||See the print edition|