|
From: <sv...@va...> - 2007-09-21 23:08:51
|
Author: njn
Date: 2007-09-22 00:08:52 +0100 (Sat, 22 Sep 2007)
New Revision: 6893
Log:
Don't print a summary header if there are no snapshots to follow.
Modified:
branches/MASSIF2/massif/ms_main.c
branches/MASSIF2/massif/ms_print
branches/MASSIF2/massif/tests/alloc-fns-A.post.exp
branches/MASSIF2/massif/tests/alloc-fns-B.post.exp
branches/MASSIF2/massif/tests/thresholds_0_0.post.exp
branches/MASSIF2/massif/tests/thresholds_0_10.post.exp
branches/MASSIF2/massif/tests/thresholds_10_0.post.exp
branches/MASSIF2/massif/tests/thresholds_10_10.post.exp
branches/MASSIF2/massif/tests/thresholds_5_0.post.exp
branches/MASSIF2/massif/tests/thresholds_5_10.post.exp
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/ms_main.c 2007-09-21 23:08:52 UTC (rev 6893)
@@ -33,12 +33,11 @@
// Todo:
// - do a test for realloc -- I think no snapshots are being taken for it.
// - do tests with complicated stack traces -- big ones, ones that require
-// XCon_redo, etc.
+// XCon_redo, ones that exceed --depth, etc.
// - test what happens when alloc-fns cover an entire trace
// - write a good basic test that shows how the tool works, suitable for
// documentation
// - Check MALLOCLIKE_BLOCK works, write regtest
-// - clean up structure of ms_print
// - work out peak-taking
// - make everything configurable, eg. min/max number of snapshots (which
// also determine culling proportion), frequency of detailed snapshots,
Modified: branches/MASSIF2/massif/ms_print
===================================================================
--- branches/MASSIF2/massif/ms_print 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/ms_print 2007-09-21 23:08:52 UTC (rev 6893)
@@ -50,8 +50,8 @@
# Tmp file name.
my $tmp_file = "ms_print.tmp.$$";
-# Version number
-my $version = "XXX";
+# Version number (XXX: change it when I convert this file to ms_print.in)
+my $version = "XXX"; # "@VERSION@";
# Usage message.
my $usage = <<END
@@ -334,19 +334,20 @@
# Read the heap tree, and if it's detailed, print it and a subsequent
# snapshot list header to $tmp_file.
if ($heap_tree eq "empty") {
- # do nothing
+ $line = get_line();
} elsif ($heap_tree eq "...") {
# '1' means it's the top node of the tree.
read_heap_tree(1, "", "", "", $mem_total_B);
- # XXX: don't print the header if there are no more snapshots!
- # (see tests/thresholds.c for an example)
- print(TMPFILE $header);
+ # Print the header, unless there are no more snapshots.
+ $line = get_line();
+ if (defined $line) {
+ print(TMPFILE $header);
+ }
} else {
die("Line $.: expected 'empty' or '...' after 'heap_tree='\n");
}
- $line = get_line();
}
close(INPUTFILE);
Modified: branches/MASSIF2/massif/tests/alloc-fns-A.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/alloc-fns-A.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/alloc-fns-A.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -78,6 +78,3 @@
->11.11% (100B) 0x8048481: c1 (alloc-fns.c:16)
->11.11% (100B) 0x8048539: main (alloc-fns.c:29)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/alloc-fns-B.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/alloc-fns-B.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/alloc-fns-B.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -70,6 +70,3 @@
->11.11% (100B) 0x8048498: d4 (alloc-fns.c:18)
->11.11% (100B) 0x804856D: main (alloc-fns.c:33)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_0_0.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_0_0.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_0_0.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -71,6 +71,3 @@
->00.50% (50B) 0x80483BB: my_malloc3 (thresholds.c:33)
->00.50% (50B) 0x8048477: main (thresholds.c:56)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_0_10.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_0_10.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_0_10.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -57,6 +57,3 @@
|
->00.50% (50B) in 1+ places, all below ms_print's threshold (10.00%)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_10_0.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_10_0.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_10_0.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -57,6 +57,3 @@
|
->00.50% (50B) in 1 place, below massif's threshold (10.00%)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_10_10.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_10_10.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_10_10.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -57,6 +57,3 @@
|
->00.50% (50B) in 1+ places, all below ms_print's threshold (10.00%)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_5_0.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_5_0.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_5_0.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -62,6 +62,3 @@
|
->00.50% (50B) in 1 place, below massif's threshold (05.00%)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/thresholds_5_10.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/thresholds_5_10.post.exp 2007-09-21 22:42:49 UTC (rev 6892)
+++ branches/MASSIF2/massif/tests/thresholds_5_10.post.exp 2007-09-21 23:08:52 UTC (rev 6893)
@@ -57,6 +57,3 @@
|
->00.50% (50B) in 1+ places, all below ms_print's threshold (10.00%)
---------------------------------------------------------------------------------
- n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
---------------------------------------------------------------------------------
|