From: Nicholas Nethercote Date: Fri, 17 Apr 2009 04:26:41 +0000 (+0000) Subject: Merge r9103 and r9105 (add --ignore-fn to Massif) from the Darwin branch. X-Git-Tag: svn/VALGRIND_3_5_0~808 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52cf1f5f0569193b1afd055b222b6d8f04d3be12;p=thirdparty%2Fvalgrind.git Merge r9103 and r9105 (add --ignore-fn to Massif) from the Darwin branch. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9567 --- diff --git a/massif/docs/ms-manual.xml b/massif/docs/ms-manual.xml index 81a066eece..7637e47e5a 100644 --- a/massif/docs/ms-manual.xml +++ b/massif/docs/ms-manual.xml @@ -614,6 +614,33 @@ operator new[](unsigned long, std::nothrow_t const&) + + + + + + Any direct heap allocation (i.e. a call to + malloc, new, etc, or a call + to a function name in a --alloc-fn + option) that occurs in a function specified by this option will be + ignored. This is mostly useful for testing purposes. This option can + be specified multiple times on the command line, to name multiple + functions. + + + Any realloc of an ignored block will + also be ignored, even if the realloc call does + not occur in an ignored function. This avoids the possibility of + negative heap sizes if ignored blocks are shrunk with + realloc. + + + Note that overloaded C++ names must be written in full, as for + --alloc-fn above. + + + + diff --git a/massif/ms_main.c b/massif/ms_main.c index ee8590857a..7cd2603f4a 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -233,22 +233,25 @@ Number of snapshots: 50 // - 15,000 XPts 800,000 XPts // - 1,800 top-XPts -static UInt n_heap_allocs = 0; -static UInt n_heap_reallocs = 0; -static UInt n_heap_frees = 0; -static UInt n_stack_allocs = 0; -static UInt n_stack_frees = 0; -static UInt n_xpts = 0; -static UInt n_xpt_init_expansions = 0; -static UInt n_xpt_later_expansions = 0; -static UInt n_sxpt_allocs = 0; -static UInt n_sxpt_frees = 0; -static UInt n_skipped_snapshots = 0; -static UInt n_real_snapshots = 0; -static UInt n_detailed_snapshots = 0; -static UInt n_peak_snapshots = 0; -static UInt n_cullings = 0; -static UInt n_XCon_redos = 0; +static UInt n_heap_allocs = 0; +static UInt n_heap_reallocs = 0; +static UInt n_heap_frees = 0; +static UInt n_ignored_heap_allocs = 0; +static UInt n_ignored_heap_frees = 0; +static UInt n_ignored_heap_reallocs = 0; +static UInt n_stack_allocs = 0; +static UInt n_stack_frees = 0; +static UInt n_xpts = 0; +static UInt n_xpt_init_expansions = 0; +static UInt n_xpt_later_expansions = 0; +static UInt n_sxpt_allocs = 0; +static UInt n_sxpt_frees = 0; +static UInt n_skipped_snapshots = 0; +static UInt n_real_snapshots = 0; +static UInt n_detailed_snapshots = 0; +static UInt n_peak_snapshots = 0; +static UInt n_cullings = 0; +static UInt n_XCon_redos = 0; //------------------------------------------------------------// //--- Globals ---// @@ -286,6 +289,7 @@ static Bool have_started_executing_code = False; //------------------------------------------------------------// static XArray* alloc_fns; +static XArray* ignore_fns; static void init_alloc_fns(void) { @@ -315,18 +319,26 @@ static void init_alloc_fns(void) DO("operator new[](unsigned long, std::nothrow_t const&)"); } -static Bool is_alloc_fn(Char* fnname) +static void init_ignore_fns(void) { - Char** alloc_fn_ptr; + // Create the (empty) list. + ignore_fns = VG_(newXA)(VG_(malloc), "ms.main.iif.1", + VG_(free), sizeof(Char*)); +} + +// Determines if the named function is a member of the XArray. +static Bool is_member_fn(XArray* fns, Char* fnname) +{ + Char** fn_ptr; Int i; // Nb: It's a linear search through the list, because we're comparing // strings rather than pointers to strings. // Nb: This gets called a lot. It was an OSet, but they're quite slow to // iterate through so it wasn't a good choice. - for (i = 0; i < VG_(sizeXA)(alloc_fns); i++) { - alloc_fn_ptr = VG_(indexXA)(alloc_fns, i); - if (VG_STREQ(fnname, *alloc_fn_ptr)) + for (i = 0; i < VG_(sizeXA)(fns); i++) { + fn_ptr = VG_(indexXA)(fns, i); + if (VG_STREQ(fnname, *fn_ptr)) return True; } return False; @@ -395,7 +407,9 @@ static Bool ms_process_cmd_line_option(Char* arg) else if VG_STR_CLO(arg, "--alloc-fn", tmp_str) { VG_(addToXA)(alloc_fns, &tmp_str); } - + else if VG_STR_CLO(arg, "--ignore-fn", tmp_str) { + VG_(addToXA)(ignore_fns, &tmp_str); + } else if VG_STR_CLO(arg, "--massif-out-file", clo_massif_out_file) {} else @@ -412,7 +426,8 @@ static void ms_print_usage(void) " ignored if --heap=no [8]\n" " --stacks=no|yes profile stack(s) [no]\n" " --depth= depth of contexts [30]\n" -" --alloc-fn= specify as an alloc function [empty]\n" +" --alloc-fn= specify as an alloc function [empty]\n" +" --ignore-fn= ignore heap allocations within [empty]\n" " --threshold= significance threshold, as a percentage [1.0]\n" " --peak-inaccuracy= maximum peak inaccuracy, as a percentage [1.0]\n" " --time-unit=i|ms|B time unit: instructions executed, milliseconds\n" @@ -780,6 +795,15 @@ static void sanity_check_SXTree(SXPt* sxpt) // enough. #define BUF_LEN 2048 +// Determine if the given IP belongs to a function that should be ignored. +static Bool fn_should_be_ignored(Addr ip) +{ + static Char buf[BUF_LEN]; + return + ( VG_(get_fnname)(ip, buf, BUF_LEN) && is_member_fn(ignore_fns, buf) + ? True : False ); +} + // Get the stack trace for an XCon, filtering out uninteresting entries: // alloc-fns and entries above alloc-fns, and entries below main-or-below-main. // Eg: alloc-fn1 / alloc-fn2 / a / b / main / (below main) / c @@ -789,7 +813,7 @@ static void sanity_check_SXTree(SXPt* sxpt) static Int get_IPs( ThreadId tid, Bool is_custom_alloc, Addr ips[]) { - Char buf[BUF_LEN]; + static Char buf[BUF_LEN]; Int n_ips, i, n_alloc_fns_removed; Int overestimate; Bool redo; @@ -832,7 +856,7 @@ Int get_IPs( ThreadId tid, Bool is_custom_alloc, Addr ips[]) // involves calls to VG_(malloc)/VG_(free)). for (i = n_alloc_fns_removed; i < n_ips; i++) { if (VG_(get_fnname)(ips[i], buf, BUF_LEN)) { - if (is_alloc_fn(buf)) { + if (is_member_fn(alloc_fns, buf)) { n_alloc_fns_removed++; } else { break; @@ -859,15 +883,22 @@ Int get_IPs( ThreadId tid, Bool is_custom_alloc, Addr ips[]) } // Gets an XCon and puts it in the tree. Returns the XCon's bottom-XPt. +// Unless the allocation should be ignored, in which case we return NULL. static XPt* get_XCon( ThreadId tid, Bool is_custom_alloc ) { - Addr ips[MAX_IPS]; + static Addr ips[MAX_IPS]; Int i; XPt* xpt = alloc_xpt; // After this call, the IPs we want are in ips[0]..ips[n_ips-1]. Int n_ips = get_IPs(tid, is_custom_alloc, ips); + // Should we ignore this allocation? (Nb: n_ips can be zero, eg. if + // 'main' is marked as an alloc-fn.) + if (n_ips > 0 && fn_should_be_ignored(ips[0])) { + return NULL; + } + // Now do the search/insertion of the XCon. for (i = 0; i < n_ips; i++) { Addr ip = ips[i]; @@ -1489,18 +1520,27 @@ void* new_block ( ThreadId tid, void* p, SizeT req_szB, SizeT req_alignB, if (clo_heap) { VERB(3, "<<< new_mem_heap (%lu, %lu)", req_szB, slop_szB); - // Update statistics. - n_heap_allocs++; + hc->where = get_XCon( tid, is_custom_alloc ); - // Update heap stats. - update_heap_stats(req_szB, clo_heap_admin + slop_szB); + if (hc->where) { + // Update statistics. + n_heap_allocs++; - // Update XTree. - hc->where = get_XCon( tid, is_custom_alloc ); - update_XCon(hc->where, req_szB); + // Update heap stats. + update_heap_stats(req_szB, clo_heap_admin + slop_szB); + + // Update XTree. + update_XCon(hc->where, req_szB); + + // Maybe take a snapshot. + maybe_take_snapshot(Normal, " alloc"); + + } else { + // Ignored allocation. + n_ignored_heap_allocs++; - // Maybe take a snapshot. - maybe_take_snapshot(Normal, " alloc"); + VERB(3, "(ignored)"); + } VERB(3, ">>>"); } @@ -1522,20 +1562,27 @@ void die_block ( void* p, Bool custom_free ) if (clo_heap) { VERB(3, "<<< die_mem_heap"); - // Update statistics - n_heap_frees++; + if (hc->where) { + // Update statistics. + n_heap_frees++; - // Maybe take a peak snapshot, since it's a deallocation. - maybe_take_snapshot(Peak, "de-PEAK"); + // Maybe take a peak snapshot, since it's a deallocation. + maybe_take_snapshot(Peak, "de-PEAK"); - // Update heap stats. - update_heap_stats(-hc->req_szB, -clo_heap_admin - hc->slop_szB); + // Update heap stats. + update_heap_stats(-hc->req_szB, -clo_heap_admin - hc->slop_szB); - // Update XTree. - update_XCon(hc->where, -hc->req_szB); + // Update XTree. + update_XCon(hc->where, -hc->req_szB); - // Maybe take a snapshot. - maybe_take_snapshot(Normal, "dealloc"); + // Maybe take a snapshot. + maybe_take_snapshot(Normal, "dealloc"); + + } else { + n_ignored_heap_frees++; + + VERB(3, "(ignored)"); + } VERB(3, ">>> (-%lu, -%lu)", hc->req_szB, hc->slop_szB); } @@ -1546,6 +1593,12 @@ void die_block ( void* p, Bool custom_free ) VG_(cli_free)( p ); } +// Nb: --ignore-fn is tricky for realloc. If the block's original alloc was +// ignored, but the realloc is not requested to be ignored, and we are +// shrinking the block, then we have to ignore the realloc -- otherwise we +// could end up with negative heap sizes. This isn't a danger if we are +// growing such a block, but for consistency (it also simplifies things) we +// ignore such reallocs as well. static __inline__ void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB ) { @@ -1553,6 +1606,7 @@ void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB ) void* p_new; SizeT old_req_szB, old_slop_szB, new_slop_szB, new_actual_szB; XPt *old_where, *new_where; + Bool is_ignored = False; // Remove the old block hc = VG_(HT_remove)(malloc_list, (UWord)p_old); @@ -1566,12 +1620,18 @@ void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB ) if (clo_heap) { VERB(3, "<<< renew_mem_heap (%lu)", new_req_szB); - // Update statistics - n_heap_reallocs++; + if (hc->where) { + // Update statistics. + n_heap_reallocs++; - // Maybe take a peak snapshot, if it's (effectively) a deallocation. - if (new_req_szB < old_req_szB) { - maybe_take_snapshot(Peak, "re-PEAK"); + // Maybe take a peak snapshot, if it's (effectively) a deallocation. + if (new_req_szB < old_req_szB) { + maybe_take_snapshot(Peak, "re-PEAK"); + } + } else { + // The original malloc was ignored, so we have to ignore the + // realloc as well. + is_ignored = True; } } @@ -1607,9 +1667,17 @@ void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB ) // Update XTree. if (clo_heap) { new_where = get_XCon( tid, /*custom_malloc*/False); - hc->where = new_where; - update_XCon(old_where, -old_req_szB); - update_XCon(new_where, new_req_szB); + if (!is_ignored && new_where) { + hc->where = new_where; + update_XCon(old_where, -old_req_szB); + update_XCon(new_where, new_req_szB); + } else { + // The realloc itself is ignored. + is_ignored = True; + + // Update statistics. + n_ignored_heap_reallocs++; + } } } @@ -1621,11 +1689,17 @@ void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB ) VG_(HT_add_node)(malloc_list, hc); if (clo_heap) { - // Update heap stats. - update_heap_stats(new_req_szB - old_req_szB, new_slop_szB - old_slop_szB); + if (!is_ignored) { + // Update heap stats. + update_heap_stats(new_req_szB - old_req_szB, + new_slop_szB - old_slop_szB); + + // Maybe take a snapshot. + maybe_take_snapshot(Normal, "realloc"); + } else { - // Maybe take a snapshot. - maybe_take_snapshot(Normal, "realloc"); + VERB(3, "(ignored)"); + } VERB(3, ">>> (%ld, %ld)", new_req_szB - old_req_szB, new_slop_szB - old_slop_szB); @@ -2125,25 +2199,28 @@ static void ms_fini(Int exit_status) // Stats tl_assert(n_xpts > 0); // always have alloc_xpt - VERB(1, "heap allocs: %u", n_heap_allocs); - VERB(1, "heap reallocs: %u", n_heap_reallocs); - VERB(1, "heap frees: %u", n_heap_frees); - VERB(1, "stack allocs: %u", n_stack_allocs); - VERB(1, "stack frees: %u", n_stack_frees); - VERB(1, "XPts: %u", n_xpts); - VERB(1, "top-XPts: %u (%d%%)", + VERB(1, "heap allocs: %u", n_heap_allocs); + VERB(1, "heap reallocs: %u", n_heap_reallocs); + VERB(1, "heap frees: %u", n_heap_frees); + VERB(1, "ignored heap allocs: %u", n_ignored_heap_allocs); + VERB(1, "ignored heap frees: %u", n_ignored_heap_frees); + VERB(1, "ignored heap reallocs: %u", n_ignored_heap_reallocs); + VERB(1, "stack allocs: %u", n_stack_allocs); + VERB(1, "stack frees: %u", n_stack_frees); + VERB(1, "XPts: %u", n_xpts); + VERB(1, "top-XPts: %u (%d%%)", alloc_xpt->n_children, ( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0)); - VERB(1, "XPt init expansions: %u", n_xpt_init_expansions); - VERB(1, "XPt later expansions: %u", n_xpt_later_expansions); - VERB(1, "SXPt allocs: %u", n_sxpt_allocs); - VERB(1, "SXPt frees: %u", n_sxpt_frees); - VERB(1, "skipped snapshots: %u", n_skipped_snapshots); - VERB(1, "real snapshots: %u", n_real_snapshots); - VERB(1, "detailed snapshots: %u", n_detailed_snapshots); - VERB(1, "peak snapshots: %u", n_peak_snapshots); - VERB(1, "cullings: %u", n_cullings); - VERB(1, "XCon redos: %u", n_XCon_redos); + VERB(1, "XPt init expansions: %u", n_xpt_init_expansions); + VERB(1, "XPt later expansions: %u", n_xpt_later_expansions); + VERB(1, "SXPt allocs: %u", n_sxpt_allocs); + VERB(1, "SXPt frees: %u", n_sxpt_frees); + VERB(1, "skipped snapshots: %u", n_skipped_snapshots); + VERB(1, "real snapshots: %u", n_real_snapshots); + VERB(1, "detailed snapshots: %u", n_detailed_snapshots); + VERB(1, "peak snapshots: %u", n_peak_snapshots); + VERB(1, "cullings: %u", n_cullings); + VERB(1, "XCon redos: %u", n_XCon_redos); } @@ -2167,12 +2244,21 @@ static void ms_post_clo_init(void) clo_heap_admin = 0; } - // Print alloc-fns, if necessary. + // Print alloc-fns and ignore-fns, if necessary. if (VG_(clo_verbosity) > 1) { VERB(1, "alloc-fns:"); for (i = 0; i < VG_(sizeXA)(alloc_fns); i++) { - Char** alloc_fn_ptr = VG_(indexXA)(alloc_fns, i); - VERB(1, " %d: %s", i, *alloc_fn_ptr); + Char** fn_ptr = VG_(indexXA)(alloc_fns, i); + VERB(1, " %d: %s", i, *fn_ptr); + } + + VERB(1, "ignore-fns:"); + if (0 == VG_(sizeXA)(ignore_fns)) { + VERB(1, " "); + } + for (i = 0; i < VG_(sizeXA)(ignore_fns); i++) { + Char** fn_ptr = VG_(indexXA)(ignore_fns, i); + VERB(1, " %d: %s", i, *fn_ptr); } } @@ -2204,12 +2290,12 @@ static void ms_pre_clo_init(void) "Copyright (C) 2003-2009, and GNU GPL'd, by Nicholas Nethercote"); VG_(details_bug_reports_to) (VG_BUGS_TO); - // Basic functions + // Basic functions. VG_(basic_tool_funcs) (ms_post_clo_init, ms_instrument, ms_fini); - // Needs + // Needs. VG_(needs_libc_freeres)(); VG_(needs_command_line_options)(ms_process_cmd_line_option, ms_print_usage, @@ -2229,14 +2315,15 @@ static void ms_pre_clo_init(void) ms_malloc_usable_size, 0 ); - // HP_Chunks + // HP_Chunks. malloc_list = VG_(HT_construct)( "Massif's malloc list" ); // Dummy node at top of the context structure. alloc_xpt = new_XPt(/*ip*/0, /*parent*/NULL); - // Initialise alloc_fns. + // Initialise alloc_fns and ignore_fns. init_alloc_fns(); + init_ignore_fns(); // Initialise args_for_massif. args_for_massif = VG_(newXA)(VG_(malloc), "ms.main.mprci.1", diff --git a/massif/tests/Makefile.am b/massif/tests/Makefile.am index 7fffa0fc9d..b966a6c3a1 100644 --- a/massif/tests/Makefile.am +++ b/massif/tests/Makefile.am @@ -8,7 +8,6 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ alloc-fns-B.post.exp alloc-fns-B.stderr.exp alloc-fns-B.vgtest \ basic.post.exp basic.stderr.exp basic.vgtest \ basic2.post.exp basic2.stderr.exp basic2.vgtest \ - insig.post.exp insig.stderr.exp insig.vgtest \ big-alloc.post.exp big-alloc.stderr.exp big-alloc.vgtest \ deep-A.post.exp deep-A.stderr.exp deep-A.vgtest \ deep-B.post.exp deep-B.stderr.exp deep-B.vgtest \ @@ -17,7 +16,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ culling1.stderr.exp culling1.vgtest \ culling2.stderr.exp culling2.vgtest \ custom_alloc.post.exp custom_alloc.stderr.exp custom_alloc.vgtest \ + ignored.post.exp ignored.stderr.exp ignored.vgtest \ ignoring.post.exp ignoring.stderr.exp ignoring.vgtest \ + insig.post.exp insig.stderr.exp insig.vgtest \ long-names.post.exp long-names.stderr.exp long-names.vgtest \ long-time.post.exp long-time.stderr.exp long-time.vgtest \ malloc_usable.stderr.exp malloc_usable.vgtest \ @@ -45,6 +46,7 @@ check_PROGRAMS = \ culling1 culling2 \ custom_alloc \ deep \ + ignored \ ignoring \ insig \ long-names \ diff --git a/massif/tests/alloc-fns-A.post.exp b/massif/tests/alloc-fns-A.post.exp index 447f2c9130..55783899fb 100644 --- a/massif/tests/alloc-fns-A.post.exp +++ b/massif/tests/alloc-fns-A.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./alloc-fns -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/alloc-fns-A.vgtest b/massif/tests/alloc-fns-A.vgtest index ab6615aa4e..99cd1c8f42 100644 --- a/massif/tests/alloc-fns-A.vgtest +++ b/massif/tests/alloc-fns-A.vgtest @@ -1,4 +1,5 @@ prog: alloc-fns vgopts: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/alloc-fns-B.post.exp b/massif/tests/alloc-fns-B.post.exp index 372cd61beb..5dd3c79f7b 100644 --- a/massif/tests/alloc-fns-B.post.exp +++ b/massif/tests/alloc-fns-B.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./alloc-fns -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --alloc-fn=a4 --alloc-fn=b4 --alloc-fn=b3 --alloc-fn=c4 --alloc-fn=c3 --alloc-fn=c2 --alloc-fn=d4 --alloc-fn=d3 --alloc-fn=d2 --alloc-fn=d1 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --alloc-fn=a4 --alloc-fn=b4 --alloc-fn=b3 --alloc-fn=c4 --alloc-fn=c3 --alloc-fn=c2 --alloc-fn=d4 --alloc-fn=d3 --alloc-fn=d2 --alloc-fn=d1 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/alloc-fns-B.vgtest b/massif/tests/alloc-fns-B.vgtest index 44a6b60a2a..dd25f56b1d 100644 --- a/massif/tests/alloc-fns-B.vgtest +++ b/massif/tests/alloc-fns-B.vgtest @@ -1,4 +1,5 @@ prog: alloc-fns vgopts: --stacks=no --time-unit=B --heap-admin=0 --alloc-fn=a4 --alloc-fn=b4 --alloc-fn=b3 --alloc-fn=c4 --alloc-fn=c3 --alloc-fn=c2 --alloc-fn=d4 --alloc-fn=d3 --alloc-fn=d2 --alloc-fn=d1 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/basic.post.exp b/massif/tests/basic.post.exp index e2b8d06360..db309fa439 100644 --- a/massif/tests/basic.post.exp +++ b/massif/tests/basic.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./basic -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/basic.vgtest b/massif/tests/basic.vgtest index a4f52a7b50..bfe7cd8275 100644 --- a/massif/tests/basic.vgtest +++ b/massif/tests/basic.vgtest @@ -1,4 +1,5 @@ prog: basic vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/basic2.post.exp b/massif/tests/basic2.post.exp index 7b617d0e1e..753761b5a4 100644 --- a/massif/tests/basic2.post.exp +++ b/massif/tests/basic2.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./basic -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --detailed-freq=1 --max-snapshots=10 +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --detailed-freq=1 --max-snapshots=10 --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/basic2.vgtest b/massif/tests/basic2.vgtest index e9d1de43ac..baa43aacfe 100644 --- a/massif/tests/basic2.vgtest +++ b/massif/tests/basic2.vgtest @@ -1,4 +1,5 @@ prog: basic vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out --detailed-freq=1 --max-snapshots=10 +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/big-alloc.post.exp b/massif/tests/big-alloc.post.exp index 29a40f7a24..dc9a980728 100644 --- a/massif/tests/big-alloc.post.exp +++ b/massif/tests/big-alloc.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./big-alloc -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/big-alloc.vgtest b/massif/tests/big-alloc.vgtest index abdefddde3..2937f37881 100644 --- a/massif/tests/big-alloc.vgtest +++ b/massif/tests/big-alloc.vgtest @@ -1,4 +1,5 @@ prog: big-alloc vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/culling1.stderr.exp b/massif/tests/culling1.stderr.exp index 2faf8ae46b..566b130a12 100644 --- a/massif/tests/culling1.stderr.exp +++ b/massif/tests/culling1.stderr.exp @@ -13,6 +13,11 @@ Massif: 10: operator new(unsigned, std::nothrow_t const&) Massif: 11: operator new[](unsigned, std::nothrow_t const&) Massif: 12: operator new(unsigned long, std::nothrow_t const&) Massif: 13: operator new[](unsigned long, std::nothrow_t const&) +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:32, hp:16, ex:16, st:0) Massif: alloc S. 2 (t:64, hp:32, ex:32, st:0) @@ -419,20 +424,23 @@ Massif: post-cull S. 47 (t:6112, hp:3056, ex:3056, st:0) Massif: post-cull S. 48 (t:6240, hp:3120, ex:3120, st:0) Massif: post-cull Sd 49 (t:6368, hp:3184, ex:3184, st:0) Massif: New time interval = 128 (between snapshots 0 and 1) -Massif: heap allocs: 200 -Massif: heap reallocs: 0 -Massif: heap frees: 0 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 200 +Massif: heap reallocs: 0 +Massif: heap frees: 0 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 51 -Massif: real snapshots: 150 -Massif: detailed snapshots: 15 -Massif: peak snapshots: 0 -Massif: cullings: 2 +Massif: skipped snapshots: 51 +Massif: real snapshots: 150 +Massif: detailed snapshots: 15 +Massif: peak snapshots: 0 +Massif: cullings: 2 Massif: XCon redos: ... diff --git a/massif/tests/culling1.vgtest b/massif/tests/culling1.vgtest index b675857cfd..c282f9bc81 100644 --- a/massif/tests/culling1.vgtest +++ b/massif/tests/culling1.vgtest @@ -1,4 +1,5 @@ prog: culling1 vgopts: -v -v --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose cleanup: rm massif.out diff --git a/massif/tests/culling2.stderr.exp b/massif/tests/culling2.stderr.exp index 3f58e13ed8..a928a135d7 100644 --- a/massif/tests/culling2.stderr.exp +++ b/massif/tests/culling2.stderr.exp @@ -13,6 +13,11 @@ Massif: 10: operator new(unsigned, std::nothrow_t const&) Massif: 11: operator new[](unsigned, std::nothrow_t const&) Massif: 12: operator new(unsigned long, std::nothrow_t const&) Massif: 13: operator new[](unsigned long, std::nothrow_t const&) +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:16, hp:0, ex:16, st:0) Massif: alloc S. 2 (t:432, hp:400, ex:32, st:0) @@ -522,20 +527,23 @@ Massif: post-cull S. 47 (t:7491504, hp:7488400, ex:3104, st:0) Massif: post-cull S. 48 (t:7647136, hp:7644000, ex:3136, st:0) Massif: post-cull Sd 49 (t:7883584, hp:7880400, ex:3184, st:0) Massif: New time interval = 113728 (between snapshots 1 and 2) -Massif: heap allocs: 200 -Massif: heap reallocs: 0 -Massif: heap frees: 0 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 200 +Massif: heap reallocs: 0 +Massif: heap frees: 0 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 1 -Massif: real snapshots: 200 -Massif: detailed snapshots: 20 -Massif: peak snapshots: 0 -Massif: cullings: 3 +Massif: skipped snapshots: 1 +Massif: real snapshots: 200 +Massif: detailed snapshots: 20 +Massif: peak snapshots: 0 +Massif: cullings: 3 Massif: XCon redos: ... diff --git a/massif/tests/culling2.vgtest b/massif/tests/culling2.vgtest index 3e8fa0ce02..9cd6032ae4 100644 --- a/massif/tests/culling2.vgtest +++ b/massif/tests/culling2.vgtest @@ -1,4 +1,5 @@ prog: culling2 vgopts: -v -v --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose cleanup: rm massif.out diff --git a/massif/tests/custom_alloc.post.exp b/massif/tests/custom_alloc.post.exp index 57d57012fa..a1c0ee091b 100644 --- a/massif/tests/custom_alloc.post.exp +++ b/massif/tests/custom_alloc.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./custom_alloc -Massif arguments: --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/custom_alloc.vgtest b/massif/tests/custom_alloc.vgtest index 429f77beac..3d5e916dd9 100644 --- a/massif/tests/custom_alloc.vgtest +++ b/massif/tests/custom_alloc.vgtest @@ -1,4 +1,5 @@ prog: custom_alloc vgopts: --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/deep-A.post.exp b/massif/tests/deep-A.post.exp index 57da33513d..84eaf568cd 100644 --- a/massif/tests/deep-A.post.exp +++ b/massif/tests/deep-A.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./deep -Massif arguments: --stacks=no --time-unit=B --depth=8 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --depth=8 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/deep-A.vgtest b/massif/tests/deep-A.vgtest index 20a81a7727..840aae67f5 100644 --- a/massif/tests/deep-A.vgtest +++ b/massif/tests/deep-A.vgtest @@ -1,4 +1,5 @@ prog: deep vgopts: --stacks=no --time-unit=B --depth=8 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/deep-B.post.exp b/massif/tests/deep-B.post.exp index 66b9aba5dd..c1a164d347 100644 --- a/massif/tests/deep-B.post.exp +++ b/massif/tests/deep-B.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./deep -Massif arguments: --stacks=no --time-unit=B --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --depth=8 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --depth=8 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/deep-B.stderr.exp b/massif/tests/deep-B.stderr.exp index 0723baa2a4..59fe6eec1f 100644 --- a/massif/tests/deep-B.stderr.exp +++ b/massif/tests/deep-B.stderr.exp @@ -20,6 +20,11 @@ Massif: 17: a9 Massif: 18: a10 Massif: 19: a11 Massif: 20: a12 +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:408, hp:400, ex:8, st:0) Massif: alloc S. 2 (t:816, hp:800, ex:16, st:0) @@ -31,20 +36,23 @@ Massif: alloc S. 7 (t:2856, hp:2800, ex:56, st:0) Massif: alloc S. 8 (t:3264, hp:3200, ex:64, st:0) Massif: alloc Sd 9 (t:3672, hp:3600, ex:72, st:0) Massif: alloc S. 10 (t:4080, hp:4000, ex:80, st:0) -Massif: heap allocs: 10 -Massif: heap reallocs: 0 -Massif: heap frees: 0 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 10 +Massif: heap reallocs: 0 +Massif: heap frees: 0 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 0 -Massif: real snapshots: 11 -Massif: detailed snapshots: 1 -Massif: peak snapshots: 0 -Massif: cullings: 0 +Massif: skipped snapshots: 0 +Massif: real snapshots: 11 +Massif: detailed snapshots: 1 +Massif: peak snapshots: 0 +Massif: cullings: 0 Massif: XCon redos: ... diff --git a/massif/tests/deep-B.vgtest b/massif/tests/deep-B.vgtest index 46c305e7f6..f6e390d833 100644 --- a/massif/tests/deep-B.vgtest +++ b/massif/tests/deep-B.vgtest @@ -1,5 +1,6 @@ prog: deep vgopts: --stacks=no --time-unit=B --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 -v -v --depth=8 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/deep-C.post.exp b/massif/tests/deep-C.post.exp index 59f6ea38e3..c36054eae9 100644 --- a/massif/tests/deep-C.post.exp +++ b/massif/tests/deep-C.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./deep -Massif arguments: --stacks=no --time-unit=B --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --depth=8 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --depth=8 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/deep-C.stderr.exp b/massif/tests/deep-C.stderr.exp index 457d170113..3577914505 100644 --- a/massif/tests/deep-C.stderr.exp +++ b/massif/tests/deep-C.stderr.exp @@ -23,6 +23,11 @@ Massif: 20: a9 Massif: 21: a10 Massif: 22: a11 Massif: 23: a12 +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:408, hp:400, ex:8, st:0) Massif: alloc S. 2 (t:816, hp:800, ex:16, st:0) @@ -34,20 +39,23 @@ Massif: alloc S. 7 (t:2856, hp:2800, ex:56, st:0) Massif: alloc S. 8 (t:3264, hp:3200, ex:64, st:0) Massif: alloc Sd 9 (t:3672, hp:3600, ex:72, st:0) Massif: alloc S. 10 (t:4080, hp:4000, ex:80, st:0) -Massif: heap allocs: 10 -Massif: heap reallocs: 0 -Massif: heap frees: 0 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 10 +Massif: heap reallocs: 0 +Massif: heap frees: 0 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 0 -Massif: real snapshots: 11 -Massif: detailed snapshots: 1 -Massif: peak snapshots: 0 -Massif: cullings: 0 +Massif: skipped snapshots: 0 +Massif: real snapshots: 11 +Massif: detailed snapshots: 1 +Massif: peak snapshots: 0 +Massif: cullings: 0 Massif: XCon redos: ... diff --git a/massif/tests/deep-C.vgtest b/massif/tests/deep-C.vgtest index 9cda9ed441..b40ba36da3 100644 --- a/massif/tests/deep-C.vgtest +++ b/massif/tests/deep-C.vgtest @@ -1,5 +1,6 @@ prog: deep vgopts: --stacks=no --time-unit=B --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 -v -v --depth=8 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/deep-D.post.exp b/massif/tests/deep-D.post.exp index 78ea7c29ff..cdecf89c08 100644 --- a/massif/tests/deep-D.post.exp +++ b/massif/tests/deep-D.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./deep -Massif arguments: --stacks=no --time-unit=B --alloc-fn=a1 --alloc-fn=a2 --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --alloc-fn=main --depth=20 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --alloc-fn=a1 --alloc-fn=a2 --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --alloc-fn=main --depth=20 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/deep-D.vgtest b/massif/tests/deep-D.vgtest index 27b92adb37..7e10dbfc8a 100644 --- a/massif/tests/deep-D.vgtest +++ b/massif/tests/deep-D.vgtest @@ -1,4 +1,5 @@ prog: deep vgopts: --stacks=no --time-unit=B --alloc-fn=a1 --alloc-fn=a2 --alloc-fn=a3 --alloc-fn=a4 --alloc-fn=a5 --alloc-fn=a6 --alloc-fn=a7 --alloc-fn=a8 --alloc-fn=a9 --alloc-fn=a10 --alloc-fn=a11 --alloc-fn=a12 --alloc-fn=main --depth=20 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses | ../../tests/filter_libc cleanup: rm massif.out diff --git a/massif/tests/filter_verbose b/massif/tests/filter_verbose index e972c69887..5f159c3ab9 100755 --- a/massif/tests/filter_verbose +++ b/massif/tests/filter_verbose @@ -11,6 +11,11 @@ $dir/filter_stderr | # lines by default, and the 'p' means do print those that match the pattern. sed -n "/Massif:/p" | +# These ignored heap counts could vary from machine to machine. +sed "s/\(Massif: ignored heap allocs:\).*/\1 .../" | +sed "s/\(Massif: ignored heap frees:\).*/\1 .../" | +sed "s/\(Massif: ignored heap reallocs:\).*/\1 .../" | + # These XPt counts vary from machine to machine, because the size of the # stack trace can vary -- eg. some machines have more stack frames below # zero than other machines. So filter them out. diff --git a/massif/tests/ignored.c b/massif/tests/ignored.c new file mode 100644 index 0000000000..be16f69c5d --- /dev/null +++ b/massif/tests/ignored.c @@ -0,0 +1,49 @@ +#include + +// All sizes are divisible by 16 -- no slop. + +int* ignore1(void) +{ + // Allocating/freeing in an ignored function: ignored. + int* ignored_x1 = malloc(400); + int* ignored_x2 = malloc(400); + free(ignored_x2); + return ignored_x1; +} + +void ignore2(int* x, int* ignored_x) +{ + // Growing/shrinking a non-ignored block in an ignored function: ignored. + x = realloc(x, 800); + x = realloc(x, 400); + + // Growing/shrinking an ignored block in an ignored function: ignored. + ignored_x = realloc(ignored_x, 800); + ignored_x = realloc(ignored_x, 400); +} + +int main(void) +{ + int* x; + int* ignored_x; + + // Not ignored. + x = malloc(400); + + // Get an ignored block. + ignored_x = ignore1(); + + // Growing/shrinking a non-ignored block in a non-ignored function: + // not ignored. + x = realloc(x, 800); + x = realloc(x, 400); + + // Growing/shrinking an ignored block in a non-ignored function: ignored. + ignored_x = realloc(ignored_x, 800); + ignored_x = realloc(ignored_x, 400); + + ignore2(x, ignored_x); + + x = realloc(ignored_x, 0); // equivalent to 'free(ignored_x)'. +} + diff --git a/massif/tests/ignored.post.exp b/massif/tests/ignored.post.exp new file mode 100644 index 0000000000..b1e3492341 --- /dev/null +++ b/massif/tests/ignored.post.exp @@ -0,0 +1,50 @@ +-------------------------------------------------------------------------------- +Command: ./ignored +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --ignore-fn=ignore1 --ignore-fn=ignore2 --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element +ms_print arguments: massif.out +-------------------------------------------------------------------------------- + + + B + 800^ # + | # + | # + | # + | # + | # + | # + | # + | # + | # + | : # + | : # + | : # + | : # + | : # + | : # + | : # + | : # + | : # + | : # + 0 +----------------------------------------------------------------------->B + 0 800 + +Number of snapshots: 5 + Detailed snapshots: [3 (peak)] + +-------------------------------------------------------------------------------- + n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) +-------------------------------------------------------------------------------- + 0 0 0 0 0 0 + 1 400 400 400 0 0 + 2 800 800 800 0 0 + 3 800 800 800 0 0 +100.00% (800B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. +->100.00% (800B) 0x........: main (ignored.c:38) +| +->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%) + +-------------------------------------------------------------------------------- + n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) +-------------------------------------------------------------------------------- + 4 800 800 400 400 0 diff --git a/massif/tests/ignored.stderr.exp b/massif/tests/ignored.stderr.exp new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/massif/tests/ignored.stderr.exp @@ -0,0 +1,2 @@ + + diff --git a/massif/tests/ignored.vgtest b/massif/tests/ignored.vgtest new file mode 100644 index 0000000000..fed7c26df7 --- /dev/null +++ b/massif/tests/ignored.vgtest @@ -0,0 +1,6 @@ +prog: ignored +vgopts: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +vgopts: --ignore-fn=ignore1 --ignore-fn=ignore2 +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element +post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses +cleanup: rm massif.out diff --git a/massif/tests/ignoring.post.exp b/massif/tests/ignoring.post.exp index efe7c09214..04eaf846e6 100644 --- a/massif/tests/ignoring.post.exp +++ b/massif/tests/ignoring.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./ignoring -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/ignoring.vgtest b/massif/tests/ignoring.vgtest index 0a22e40c74..9bcb8bd4bb 100644 --- a/massif/tests/ignoring.vgtest +++ b/massif/tests/ignoring.vgtest @@ -1,4 +1,5 @@ prog: ignoring vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/insig.post.exp b/massif/tests/insig.post.exp index 177dcf9baa..3c187ead35 100644 --- a/massif/tests/insig.post.exp +++ b/massif/tests/insig.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./insig -Massif arguments: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/insig.vgtest b/massif/tests/insig.vgtest index 16857af390..cb167dfa83 100644 --- a/massif/tests/insig.vgtest +++ b/massif/tests/insig.vgtest @@ -1,4 +1,5 @@ prog: insig vgopts: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/long-names.post.exp b/massif/tests/long-names.post.exp index a425c0efa4..1a5dc37143 100644 --- a/massif/tests/long-names.post.exp +++ b/massif/tests/long-names.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./long-names -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --detailed-freq=3 +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --detailed-freq=3 --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/long-names.vgtest b/massif/tests/long-names.vgtest index f071366978..38d8d6d1f8 100644 --- a/massif/tests/long-names.vgtest +++ b/massif/tests/long-names.vgtest @@ -1,4 +1,5 @@ prog: long-names vgopts: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --detailed-freq=3 +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/long-time.post.exp b/massif/tests/long-time.post.exp index 79f4e3d4af..1388d282e4 100644 --- a/massif/tests/long-time.post.exp +++ b/massif/tests/long-time.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./long-time -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/long-time.vgtest b/massif/tests/long-time.vgtest index 83757eea51..5c80658a3b 100644 --- a/massif/tests/long-time.vgtest +++ b/massif/tests/long-time.vgtest @@ -1,4 +1,5 @@ prog: long-time vgopts: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/new-cpp.post.exp b/massif/tests/new-cpp.post.exp index fec6638863..dd33ddf1b6 100644 --- a/massif/tests/new-cpp.post.exp +++ b/massif/tests/new-cpp.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./new-cpp -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/new-cpp.vgtest b/massif/tests/new-cpp.vgtest index 72471d4d20..df2d3aa102 100644 --- a/massif/tests/new-cpp.vgtest +++ b/massif/tests/new-cpp.vgtest @@ -1,4 +1,5 @@ prog: new-cpp vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/no-stack-no-heap.post.exp b/massif/tests/no-stack-no-heap.post.exp index b8caf841a4..1f3d27ec43 100644 --- a/massif/tests/no-stack-no-heap.post.exp +++ b/massif/tests/no-stack-no-heap.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./basic -Massif arguments: --stacks=no --heap=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --heap=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/no-stack-no-heap.vgtest b/massif/tests/no-stack-no-heap.vgtest index 17308b1e6a..b984fc0604 100644 --- a/massif/tests/no-stack-no-heap.vgtest +++ b/massif/tests/no-stack-no-heap.vgtest @@ -1,4 +1,5 @@ prog: basic vgopts: --stacks=no --heap=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/null.post.exp b/massif/tests/null.post.exp index b02f5e7c7d..e81091a0f0 100644 --- a/massif/tests/null.post.exp +++ b/massif/tests/null.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./null -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/null.vgtest b/massif/tests/null.vgtest index 72ac65cc22..5063f8eeb8 100644 --- a/massif/tests/null.vgtest +++ b/massif/tests/null.vgtest @@ -1,4 +1,5 @@ prog: null vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/one.post.exp b/massif/tests/one.post.exp index 6b7fec26ff..989c85dc89 100644 --- a/massif/tests/one.post.exp +++ b/massif/tests/one.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./one -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/one.vgtest b/massif/tests/one.vgtest index 38e0f7f5f7..9a15467715 100644 --- a/massif/tests/one.vgtest +++ b/massif/tests/one.vgtest @@ -1,4 +1,5 @@ prog: one vgopts: --stacks=no --time-unit=B --heap-admin=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/overloaded-new.post.exp b/massif/tests/overloaded-new.post.exp index fdae0221b2..698dc8e6e3 100644 --- a/massif/tests/overloaded-new.post.exp +++ b/massif/tests/overloaded-new.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./overloaded-new -Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/overloaded-new.vgtest b/massif/tests/overloaded-new.vgtest index 50d2ad0300..b35673b903 100644 --- a/massif/tests/overloaded-new.vgtest +++ b/massif/tests/overloaded-new.vgtest @@ -1,4 +1,5 @@ prog: overloaded-new vgopts: --stacks=no --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/peak.post.exp b/massif/tests/peak.post.exp index ad7afae6e1..1cbb8b4eef 100644 --- a/massif/tests/peak.post.exp +++ b/massif/tests/peak.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./peak -Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=0 --heap-admin=128 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=0 --heap-admin=128 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/peak.vgtest b/massif/tests/peak.vgtest index f30efe80ba..5cc22559e9 100644 --- a/massif/tests/peak.vgtest +++ b/massif/tests/peak.vgtest @@ -1,4 +1,5 @@ prog: peak vgopts: --stacks=no --time-unit=B --peak-inaccuracy=0 --heap-admin=128 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/peak2.post.exp b/massif/tests/peak2.post.exp index af8946d102..2dd12754c6 100644 --- a/massif/tests/peak2.post.exp +++ b/massif/tests/peak2.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./peak -Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=10.0 --heap-admin=128 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=10.0 --heap-admin=128 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/peak2.stderr.exp b/massif/tests/peak2.stderr.exp index fd1b97266c..39527b0ca1 100644 --- a/massif/tests/peak2.stderr.exp +++ b/massif/tests/peak2.stderr.exp @@ -13,6 +13,11 @@ Massif: 10: operator new(unsigned, std::nothrow_t const&) Massif: 11: operator new[](unsigned, std::nothrow_t const&) Massif: 12: operator new(unsigned long, std::nothrow_t const&) Massif: 13: operator new[](unsigned long, std::nothrow_t const&) +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:1728, hp:1600, ex:128, st:0) Massif: alloc S. 2 (t:1872, hp:1616, ex:256, st:0) @@ -89,20 +94,23 @@ Massif: alloc S. 72 (t:40032, hp:32000, ex:2560, st:0) Massif: alloc S. 73 (t:40176, hp:32016, ex:2688, st:0) Massif: de-PEAK Sp 74 (t:40176, hp:32016, ex:2688, st:0) Massif: dealloc S. 75 (t:40320, hp:32000, ex:2560, st:0) -Massif: heap allocs: 40 -Massif: heap reallocs: 0 -Massif: heap frees: 20 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 40 +Massif: heap reallocs: 0 +Massif: heap frees: 20 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 0 -Massif: real snapshots: 76 -Massif: detailed snapshots: 15 -Massif: peak snapshots: 15 -Massif: cullings: 0 +Massif: skipped snapshots: 0 +Massif: real snapshots: 76 +Massif: detailed snapshots: 15 +Massif: peak snapshots: 15 +Massif: cullings: 0 Massif: XCon redos: ... diff --git a/massif/tests/peak2.vgtest b/massif/tests/peak2.vgtest index 0ea5926cf4..91a6e49642 100644 --- a/massif/tests/peak2.vgtest +++ b/massif/tests/peak2.vgtest @@ -1,5 +1,6 @@ prog: peak vgopts: --stacks=no --time-unit=B -v -v --peak-inaccuracy=10.0 --heap-admin=128 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/realloc.post.exp b/massif/tests/realloc.post.exp index 3dd24d5cb0..3298d7d157 100644 --- a/massif/tests/realloc.post.exp +++ b/massif/tests/realloc.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./realloc -Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --threshold=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --threshold=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: --threshold=0 massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/realloc.stderr.exp b/massif/tests/realloc.stderr.exp index f802dd5d92..d8fcf7ef17 100644 --- a/massif/tests/realloc.stderr.exp +++ b/massif/tests/realloc.stderr.exp @@ -13,6 +13,11 @@ Massif: 10: operator new(unsigned, std::nothrow_t const&) Massif: 11: operator new[](unsigned, std::nothrow_t const&) Massif: 12: operator new(unsigned long, std::nothrow_t const&) Massif: 13: operator new[](unsigned long, std::nothrow_t const&) +Massif: ignore-fns: +Massif: 0: __part_load_locale +Massif: 1: __time_load_locale +Massif: 2: dwarf2_unwind_dyld_add_image_hook +Massif: 3: get_or_create_key_element Massif: startup S. 0 (t:0, hp:0, ex:0, st:0) Massif: alloc S. 1 (t:800, hp:800, ex:0, st:0) Massif: realloc S. 2 (t:800, hp:800, ex:0, st:0) @@ -21,20 +26,23 @@ Massif: realloc S. 4 (t:800, hp:400, ex:400, st:0) Massif: realloc S. 5 (t:1200, hp:1200, ex:0, st:0) Massif: de-PEAK Sp 6 (t:1200, hp:1200, ex:0, st:0) Massif: dealloc S. 7 (t:2400, hp:0, ex:0, st:0) -Massif: heap allocs: 1 -Massif: heap reallocs: 3 -Massif: heap frees: 1 -Massif: stack allocs: 0 -Massif: stack frees: 0 +Massif: heap allocs: 1 +Massif: heap reallocs: 3 +Massif: heap frees: 1 +Massif: ignored heap allocs: ... +Massif: ignored heap frees: ... +Massif: ignored heap reallocs: ... +Massif: stack allocs: 0 +Massif: stack frees: 0 Massif: XPts: ... Massif: top-XPts: ... Massif: XPt init expansions: ... Massif: XPt later expansions: ... Massif: SXPt allocs: ... Massif: SXPt frees: ... -Massif: skipped snapshots: 0 -Massif: real snapshots: 8 -Massif: detailed snapshots: 2 -Massif: peak snapshots: 2 -Massif: cullings: 0 +Massif: skipped snapshots: 0 +Massif: real snapshots: 8 +Massif: detailed snapshots: 2 +Massif: peak snapshots: 2 +Massif: cullings: 0 Massif: XCon redos: ... diff --git a/massif/tests/realloc.vgtest b/massif/tests/realloc.vgtest index c50bad1a51..4344328979 100644 --- a/massif/tests/realloc.vgtest +++ b/massif/tests/realloc.vgtest @@ -1,5 +1,6 @@ prog: realloc vgopts: -v -v --stacks=no --heap-admin=0 --time-unit=B --threshold=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element stderr_filter: filter_verbose post: perl ../../massif/ms_print --threshold=0 massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_0_0.post.exp b/massif/tests/thresholds_0_0.post.exp index 5bdcc595d3..0d1b86e91e 100644 --- a/massif/tests/thresholds_0_0.post.exp +++ b/massif/tests/thresholds_0_0.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=0 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_0_0.vgtest b/massif/tests/thresholds_0_0.vgtest index 5b9f7c6850..f848c3eb21 100644 --- a/massif/tests/thresholds_0_0.vgtest +++ b/massif/tests/thresholds_0_0.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=0 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_0_10.post.exp b/massif/tests/thresholds_0_10.post.exp index 9d9b3e4bc9..cefc5d06a8 100644 --- a/massif/tests/thresholds_0_10.post.exp +++ b/massif/tests/thresholds_0_10.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=10 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_0_10.vgtest b/massif/tests/thresholds_0_10.vgtest index 58f2a94823..bca31081b6 100644 --- a/massif/tests/thresholds_0_10.vgtest +++ b/massif/tests/thresholds_0_10.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=0 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=10 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_10_0.post.exp b/massif/tests/thresholds_10_0.post.exp index e5823f8c10..981f08cb4c 100644 --- a/massif/tests/thresholds_10_0.post.exp +++ b/massif/tests/thresholds_10_0.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=0 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_10_0.vgtest b/massif/tests/thresholds_10_0.vgtest index 8c9dd13dda..cc8f09af55 100644 --- a/massif/tests/thresholds_10_0.vgtest +++ b/massif/tests/thresholds_10_0.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=0 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_10_10.post.exp b/massif/tests/thresholds_10_10.post.exp index 1374375909..948b71f407 100644 --- a/massif/tests/thresholds_10_10.post.exp +++ b/massif/tests/thresholds_10_10.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=10 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_10_10.vgtest b/massif/tests/thresholds_10_10.vgtest index 0b9083b00a..5dd37299be 100644 --- a/massif/tests/thresholds_10_10.vgtest +++ b/massif/tests/thresholds_10_10.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=10 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=10 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_5_0.post.exp b/massif/tests/thresholds_5_0.post.exp index 911225d99a..7da2416d3f 100644 --- a/massif/tests/thresholds_5_0.post.exp +++ b/massif/tests/thresholds_5_0.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=0 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_5_0.vgtest b/massif/tests/thresholds_5_0.vgtest index cb5f4457b2..08500c281c 100644 --- a/massif/tests/thresholds_5_0.vgtest +++ b/massif/tests/thresholds_5_0.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=0 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/thresholds_5_10.post.exp b/massif/tests/thresholds_5_10.post.exp index 4be87b19af..ee79ee391b 100644 --- a/massif/tests/thresholds_5_10.post.exp +++ b/massif/tests/thresholds_5_10.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./thresholds -Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out +Massif arguments: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out --threshold=10 -------------------------------------------------------------------------------- diff --git a/massif/tests/thresholds_5_10.vgtest b/massif/tests/thresholds_5_10.vgtest index 86a0781032..4a61ba8811 100644 --- a/massif/tests/thresholds_5_10.vgtest +++ b/massif/tests/thresholds_5_10.vgtest @@ -1,4 +1,5 @@ prog: thresholds vgopts: --stacks=no --time-unit=B --heap-admin=0 --threshold=5 --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out --threshold=10 | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/zero1.post.exp b/massif/tests/zero1.post.exp index faffb80962..db640cb679 100644 --- a/massif/tests/zero1.post.exp +++ b/massif/tests/zero1.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./zero -Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: --threshold=0 massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/zero1.vgtest b/massif/tests/zero1.vgtest index 95641db144..56835e828a 100644 --- a/massif/tests/zero1.vgtest +++ b/massif/tests/zero1.vgtest @@ -1,4 +1,5 @@ prog: zero vgopts: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print --threshold=0 massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/massif/tests/zero2.post.exp b/massif/tests/zero2.post.exp index 75d8e7d031..1a8b5aed83 100644 --- a/massif/tests/zero2.post.exp +++ b/massif/tests/zero2.post.exp @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- Command: ./zero -Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out +Massif arguments: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element ms_print arguments: massif.out -------------------------------------------------------------------------------- diff --git a/massif/tests/zero2.vgtest b/massif/tests/zero2.vgtest index 0549a5aa68..8c422246c0 100644 --- a/massif/tests/zero2.vgtest +++ b/massif/tests/zero2.vgtest @@ -1,4 +1,5 @@ prog: zero vgopts: --stacks=no --heap-admin=0 --time-unit=B --massif-out-file=massif.out +vgopts: --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element post: perl ../../massif/ms_print massif.out | ../../tests/filter_addresses cleanup: rm massif.out diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in index 8bcb050de2..15c53f14a5 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -51,7 +51,8 @@ # following lines, in any order: # - prog: (compulsory) # - args: (default: none) -# - vgopts: (default: none) +# - vgopts: (default: none; +# multiple are allowed) # - stdout_filter: (default: none) # - stderr_filter: (default: ./filter_stderr) # - prereq: (default: none) @@ -216,7 +217,7 @@ sub read_vgtest_file($) if ($line =~ /^\s*#/ || $line =~ /^\s*$/) { next; } elsif ($line =~ /^\s*vgopts:\s*(.*)$/) { - $vgopts = $1; + $vgopts = $vgopts . " " . $1; # Nb: Make sure there's a space! } elsif ($line =~ /^\s*prog:\s*(.*)$/) { $prog = validate_program(".", $1, 0, 0); } elsif ($line =~ /^\s*args:\s*(.*)$/) {