diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-08-07 15:46:56 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-08-07 15:46:56 +0000 |
commit | 2d9e874b7a628ada216f09cc4f065798c65fffa4 (patch) | |
tree | 45c52e1aeab4e31d58691c10773a89ed05930d91 /massif | |
parent | 4d6cb9e7210c65a0963f38727c923847f72bed9c (diff) |
Tidy up of messaging:
* For all tools and the core, don't show statistics when -v is in
effect. Instead, try to restrict -v to mostly user-useful
stuff.
* A new flag --stats=no|yes [no] produces statistics output instead.
* Fix longstanding problem in that Memcheck's leak checker ran after
the core's error manager module shut down, thereby not showing use
counts of leak suppressions. This fixes #186790.
* As a consequence, the leak checker text output of Memcheck has
changed a bit -- leak check is done before the final error
summary is done (much more logical), and the output has been
tidied up a bit.
* Helgrind, Drd and Ptrcheck now also print "For counts of
detected and suppressed errors, rerun with: -v", which makes
them consistent with Memcheck in this regard. These are
filtered out by the regtest filter scripts.
For all tools except Memcheck, the regtests are unchanged. On
Memcheck regtests still fail due to rearrangements of the leak
checker output. This will be fixed by a followup commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10746 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'massif')
-rw-r--r-- | massif/ms_main.c | 46 | ||||
-rw-r--r-- | massif/tests/culling1.vgtest | 2 | ||||
-rw-r--r-- | massif/tests/culling2.vgtest | 2 | ||||
-rw-r--r-- | massif/tests/deep-B.vgtest | 2 | ||||
-rw-r--r-- | massif/tests/deep-C.vgtest | 2 | ||||
-rw-r--r-- | massif/tests/peak2.vgtest | 2 | ||||
-rw-r--r-- | massif/tests/realloc.vgtest | 2 |
7 files changed, 32 insertions, 26 deletions
diff --git a/massif/ms_main.c b/massif/ms_main.c index 585df220..ecfb31c9 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -220,6 +220,12 @@ Number of snapshots: 50 VG_(dmsg)("Massif: " format, ##args); \ } +// Used for printing stats when clo_stats == True. +#define STATS(format, args...) \ + if (VG_(clo_stats)) { \ + VG_(dmsg)("Massif: " format, ##args); \ + } + //------------------------------------------------------------// //--- Statistics ---// //------------------------------------------------------------// @@ -2225,28 +2231,28 @@ static void ms_fini(Int exit_status) // Stats tl_assert(n_xpts > 0); // always have alloc_xpt - VERB(1, "heap allocs: %u\n", n_heap_allocs); - VERB(1, "heap reallocs: %u\n", n_heap_reallocs); - VERB(1, "heap frees: %u\n", n_heap_frees); - VERB(1, "ignored heap allocs: %u\n", n_ignored_heap_allocs); - VERB(1, "ignored heap frees: %u\n", n_ignored_heap_frees); - VERB(1, "ignored heap reallocs: %u\n", n_ignored_heap_reallocs); - VERB(1, "stack allocs: %u\n", n_stack_allocs); - VERB(1, "stack frees: %u\n", n_stack_frees); - VERB(1, "XPts: %u\n", n_xpts); - VERB(1, "top-XPts: %u (%d%%)\n", + STATS("heap allocs: %u\n", n_heap_allocs); + STATS("heap reallocs: %u\n", n_heap_reallocs); + STATS("heap frees: %u\n", n_heap_frees); + STATS("ignored heap allocs: %u\n", n_ignored_heap_allocs); + STATS("ignored heap frees: %u\n", n_ignored_heap_frees); + STATS("ignored heap reallocs: %u\n", n_ignored_heap_reallocs); + STATS("stack allocs: %u\n", n_stack_allocs); + STATS("stack frees: %u\n", n_stack_frees); + STATS("XPts: %u\n", n_xpts); + STATS("top-XPts: %u (%d%%)\n", alloc_xpt->n_children, ( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0)); - VERB(1, "XPt init expansions: %u\n", n_xpt_init_expansions); - VERB(1, "XPt later expansions: %u\n", n_xpt_later_expansions); - VERB(1, "SXPt allocs: %u\n", n_sxpt_allocs); - VERB(1, "SXPt frees: %u\n", n_sxpt_frees); - VERB(1, "skipped snapshots: %u\n", n_skipped_snapshots); - VERB(1, "real snapshots: %u\n", n_real_snapshots); - VERB(1, "detailed snapshots: %u\n", n_detailed_snapshots); - VERB(1, "peak snapshots: %u\n", n_peak_snapshots); - VERB(1, "cullings: %u\n", n_cullings); - VERB(1, "XCon redos: %u\n", n_XCon_redos); + STATS("XPt init expansions: %u\n", n_xpt_init_expansions); + STATS("XPt later expansions: %u\n", n_xpt_later_expansions); + STATS("SXPt allocs: %u\n", n_sxpt_allocs); + STATS("SXPt frees: %u\n", n_sxpt_frees); + STATS("skipped snapshots: %u\n", n_skipped_snapshots); + STATS("real snapshots: %u\n", n_real_snapshots); + STATS("detailed snapshots: %u\n", n_detailed_snapshots); + STATS("peak snapshots: %u\n", n_peak_snapshots); + STATS("cullings: %u\n", n_cullings); + STATS("XCon redos: %u\n", n_XCon_redos); } diff --git a/massif/tests/culling1.vgtest b/massif/tests/culling1.vgtest index c282f9bc..eb5ad2f6 100644 --- a/massif/tests/culling1.vgtest +++ b/massif/tests/culling1.vgtest @@ -1,5 +1,5 @@ prog: culling1 -vgopts: -v -v --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +vgopts: -v -v --stats=yes --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.vgtest b/massif/tests/culling2.vgtest index 9cd6032a..d0b234f2 100644 --- a/massif/tests/culling2.vgtest +++ b/massif/tests/culling2.vgtest @@ -1,5 +1,5 @@ prog: culling2 -vgopts: -v -v --stacks=no --time-unit=B --heap-admin=16 --massif-out-file=massif.out +vgopts: -v -v --stats=yes --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/deep-B.vgtest b/massif/tests/deep-B.vgtest index f6e390d8..ea3a3234 100644 --- a/massif/tests/deep-B.vgtest +++ b/massif/tests/deep-B.vgtest @@ -1,5 +1,5 @@ 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: --stats=yes --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 diff --git a/massif/tests/deep-C.vgtest b/massif/tests/deep-C.vgtest index b40ba36d..34f92cda 100644 --- a/massif/tests/deep-C.vgtest +++ b/massif/tests/deep-C.vgtest @@ -1,5 +1,5 @@ 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: --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 --stats=yes --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 diff --git a/massif/tests/peak2.vgtest b/massif/tests/peak2.vgtest index 91a6e496..79e671ab 100644 --- a/massif/tests/peak2.vgtest +++ b/massif/tests/peak2.vgtest @@ -1,5 +1,5 @@ prog: peak -vgopts: --stacks=no --time-unit=B -v -v --peak-inaccuracy=10.0 --heap-admin=128 --massif-out-file=massif.out +vgopts: --stacks=no --time-unit=B -v -v --stats=yes --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 diff --git a/massif/tests/realloc.vgtest b/massif/tests/realloc.vgtest index 43443289..bdb38d83 100644 --- a/massif/tests/realloc.vgtest +++ b/massif/tests/realloc.vgtest @@ -1,5 +1,5 @@ prog: realloc -vgopts: -v -v --stacks=no --heap-admin=0 --time-unit=B --threshold=0 --massif-out-file=massif.out +vgopts: -v -v --stats=yes --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 |