|
From: <sv...@va...> - 2011-01-27 23:18:08
|
Author: njn
Date: 2011-01-27 23:17:58 +0000 (Thu, 27 Jan 2011)
New Revision: 11512
Log:
Merge from trunk, r11511 (fix threshold printing in Massif).
Modified:
branches/VALGRIND_3_6_BRANCH/massif/ms_main.c
branches/VALGRIND_3_6_BRANCH/massif/tests/insig.post.exp
branches/VALGRIND_3_6_BRANCH/massif/tests/insig.vgtest
Modified: branches/VALGRIND_3_6_BRANCH/massif/ms_main.c
===================================================================
--- branches/VALGRIND_3_6_BRANCH/massif/ms_main.c 2011-01-27 23:07:56 UTC (rev 11511)
+++ branches/VALGRIND_3_6_BRANCH/massif/ms_main.c 2011-01-27 23:17:58 UTC (rev 11512)
@@ -2106,14 +2106,11 @@
})
// Nb: uses a static buffer, each call trashes the last string returned.
-static Char* make_perc(ULong x, ULong y)
+static Char* make_perc(double x)
{
static Char mbuf[32];
-// tl_assert(x <= y); XXX; put back in later...
-
- // XXX: I'm not confident that VG_(percentify) works as it should...
- VG_(percentify)(x, y, 2, 6, mbuf);
+ VG_(percentify)((ULong)(x * 100), 10000, 2, 6, mbuf);
// XXX: this is bogus if the denominator was zero -- resulting string is
// something like "0 --%")
if (' ' == mbuf[0]) mbuf[0] = '0';
@@ -2239,7 +2236,7 @@
Char* s = ( 1 == sxpt->Insig.n_xpts ? "," : "s, all" );
FP("%sn0: %lu in %d place%s below massif's threshold (%s)\n",
depth_str, sxpt->szB, sxpt->Insig.n_xpts, s,
- make_perc((ULong)clo_threshold, 100));
+ make_perc(clo_threshold));
break;
}
Modified: branches/VALGRIND_3_6_BRANCH/massif/tests/insig.post.exp
===================================================================
--- branches/VALGRIND_3_6_BRANCH/massif/tests/insig.post.exp 2011-01-27 23:07:56 UTC (rev 11511)
+++ branches/VALGRIND_3_6_BRANCH/massif/tests/insig.post.exp 2011-01-27 23:17:58 UTC (rev 11512)
@@ -1,6 +1,6 @@
--------------------------------------------------------------------------------
Command: ./insig
-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
+Massif arguments: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out --threshold=0.99 --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
--------------------------------------------------------------------------------
@@ -70,7 +70,7 @@
87.28% (16,688B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->83.68% (16,000B) 0x........: main (insig.c:8)
|
-->01.34% (256B) in 16 places, all below massif's threshold (01.00%)
+->01.34% (256B) in 16 places, all below massif's threshold (00.99%)
|
->01.26% (240B) 0x........: main (insig.c:9)
|
Modified: branches/VALGRIND_3_6_BRANCH/massif/tests/insig.vgtest
===================================================================
--- branches/VALGRIND_3_6_BRANCH/massif/tests/insig.vgtest 2011-01-27 23:07:56 UTC (rev 11511)
+++ branches/VALGRIND_3_6_BRANCH/massif/tests/insig.vgtest 2011-01-27 23:17:58 UTC (rev 11512)
@@ -1,5 +1,6 @@
+# At one point, thresholds less than 1.0% were misprinted as 00.00%, so test that here.
prog: insig
-vgopts: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out
+vgopts: --stacks=no --time-unit=B --heap-admin=128 --massif-out-file=massif.out --threshold=0.99
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
|