From: Nicholas Nethercote Date: Wed, 5 Aug 2009 02:02:31 +0000 (+0000) Subject: Comment and docs wibbles. X-Git-Tag: svn/VALGRIND_3_5_0~140 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e16d2be3f409da6d915cd46098c3d039f4b75a70;p=thirdparty%2Fvalgrind.git Comment and docs wibbles. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10710 --- diff --git a/massif/docs/ms-manual.xml b/massif/docs/ms-manual.xml index 9e77eb0630..50b4584321 100644 --- a/massif/docs/ms-manual.xml +++ b/massif/docs/ms-manual.xml @@ -645,7 +645,20 @@ in a particular column, which makes following the allocation chains easier. 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 the named function will only be treated this way if it is + the top entry in a stack trace, or just below another function treated + this way. For example, if you have a function + malloc1 that wraps malloc, + and malloc2 that wraps + malloc1, just specifying + will have no effect. You need to + specify as well. This is a little + inconvenient, but the reason is that checking for allocation functions + is slow, and it saves a lot of time if Massif can stop looking through + the stack trace entries as soon as it finds one that doesn't match + rather than having to continue through all the entries. + Note that C++ names are demangled. Note also that overloaded C++ names must be written in full. Single quotes may be necessary to prevent the shell from breaking them up. For example: diff --git a/massif/ms_main.c b/massif/ms_main.c index ff4ace5953..585df2208b 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -871,14 +871,11 @@ Int get_IPs( ThreadId tid, Bool is_custom_alloc, Addr ips[]) // If the original stack trace is smaller than asked-for, redo=False. if (n_ips < clo_depth + overestimate) { redo = False; } - // If it's a non-custom block, we will always remove the first stack - // trace entry (which will be one of malloc, __builtin_new, etc). - n_alloc_fns_removed = ( is_custom_alloc ? 0 : 1 ); - // Filter out alloc fns. If it's a non-custom block, we remove the // first entry (which will be one of malloc, __builtin_new, etc) // without looking at it, because VG_(get_fnname) is expensive (it // involves calls to VG_(malloc)/VG_(free)). + n_alloc_fns_removed = ( is_custom_alloc ? 0 : 1 ); for (i = n_alloc_fns_removed; i < n_ips; i++) { if (VG_(get_fnname)(ips[i], buf, BUF_LEN)) { if (is_member_fn(alloc_fns, buf)) {