From: Nicholas Nethercote Date: Tue, 4 Dec 2007 21:35:55 +0000 (+0000) Subject: Minor Massif docs clarifications. X-Git-Tag: svn/VALGRIND_3_3_0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d603809d626f0b540516f9fff407598ccd1c8ecd;p=thirdparty%2Fvalgrind.git Minor Massif docs clarifications. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7276 --- diff --git a/massif/docs/ms-manual.xml b/massif/docs/ms-manual.xml index 8e9892991a..ec5c58d254 100644 --- a/massif/docs/ms-manual.xml +++ b/massif/docs/ms-manual.xml @@ -427,7 +427,36 @@ of the 8,000B asked for by line 5, half of it was due to a call from line point in the program into a single tree, which gives a complete picture of how and why all heap memory was allocated. -The final part of the output is similar: +Note that the tree entries correspond not to functions, but to +individual code locations. For example, if function A +calls malloc, and function B calls +A twice, once on line 10 and once on line 11, then +the two calls will result in two distinct stack traces in the tree. In +contrast, if B calls A repeatedly +from line 15 (e.g. due to a loop), then each of those calls will be +represented by the same stack trace in the tree. + +Note also that tree entry with children in the example satisfies an +invariant: the entry's size is equal to the sum of its children's sizes. +For example, the first entry has size 20,000B, and its children have sizes +10,000B, 8,000B, and 2,000B. In general, this invariant almost always +holds. However, in rare circumstances stack traces can be malformed, in +which case a stack trace can be a sub-trace of another stack trace. This +means that some entries in the tree may not satisfy the invariant -- the +entry's size will be greater than the sum of its children's sizes. Massif +can sometimes detect when this happens; if it does, it issues a +warning: + + + +However, Massif does not detect and warn about every such occurrence. +Fortunately, malformed stack traces are rare in practice. + +Returning now to ms_print's output, the final part is similar: