You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(10) |
2
(8) |
3
(17) |
4
(28) |
5
(22) |
6
(8) |
|
7
(8) |
8
(22) |
9
(12) |
10
(17) |
11
(14) |
12
(15) |
13
(6) |
|
14
(9) |
15
(9) |
16
(16) |
17
(13) |
18
(18) |
19
(7) |
20
(5) |
|
21
(6) |
22
(5) |
23
(11) |
24
(5) |
25
(11) |
26
(7) |
27
(15) |
|
28
(11) |
29
(12) |
30
(12) |
31
(15) |
|
|
|
|
From: <sv...@va...> - 2007-10-17 22:29:07
|
Author: njn Date: 2007-10-17 23:29:08 +0100 (Wed, 17 Oct 2007) New Revision: 7015 Log: clarify a paragraph Modified: trunk/docs/xml/manual-core.xml Modified: trunk/docs/xml/manual-core.xml =================================================================== --- trunk/docs/xml/manual-core.xml 2007-10-17 11:04:21 UTC (rev 7014) +++ trunk/docs/xml/manual-core.xml 2007-10-17 22:29:08 UTC (rev 7015) @@ -105,18 +105,19 @@ already, if you intended to debug your program with GNU gdb, or some other debugger.</para> -<para>This paragraph applies only if you plan to use Memcheck: On rare -occasions, optimisation levels at <computeroutput>-O2</computeroutput> -and above have been observed to generate code which fools Memcheck into -wrongly reporting uninitialised value errors. We have looked in detail -into fixing this, and unfortunately the result is that doing so would -give a further significant slowdown in what is already a slow tool. So -the best solution is to turn off optimisation altogether. Since this -often makes things unmanagably slow, a reasonable compromise is to use +<para>If you are planning to use Memcheck: On rare +occasions, compiler optimisations (at <computeroutput>-O2</computeroutput> +and above, and sometimes <computeroutput>-O1</computeroutput>) have been +observed to generate code which fools Memcheck into wrongly reporting +uninitialised value errors, or missing uninitialised value errors. We have +looked in detail into fixing this, and unfortunately the result is that +doing so would give a further significant slowdown in what is already a slow +tool. So the best solution is to turn off optimisation altogether. Since +this often makes things unmanagably slow, a reasonable compromise is to use <computeroutput>-O</computeroutput>. This gets you the majority of the -benefits of higher optimisation levels whilst keeping relatively small -the chances of false complaints from Memcheck. All other tools (as far -as we know) are unaffected by optimisation level.</para> +benefits of higher optimisation levels whilst keeping relatively small the +chances of false positives or false negatives from Memcheck. All other +tools (as far as we know) are unaffected by optimisation level.</para> <para>Valgrind understands both the older "stabs" debugging format, used by gcc versions prior to 3.1, and the newer DWARF2 and DWARF3 formats |
|
From: Rich C. <Ric...@me...> - 2007-10-17 17:50:51
|
On Wed, 17 Oct 2007 12:52:51 +0200 Julian Seward <js...@ac...> wrote: > On Friday 12 October 2007 22:02, Rich Coe wrote: > > As a first step, maybe you could prepare a version of Omega which compiles > against the current svn trunk? > Sounds great. I'll start on it right away. R. |
|
From: <sv...@va...> - 2007-10-17 11:04:26
|
Author: sewardj
Date: 2007-10-17 12:04:21 +0100 (Wed, 17 Oct 2007)
New Revision: 7014
Log:
Try to make the "Required order was established by .." parts of
lock-order error messages somewhat less bogus.
Modified:
branches/THRCHECK/thrcheck/tc_main.c
Modified: branches/THRCHECK/thrcheck/tc_main.c
===================================================================
--- branches/THRCHECK/thrcheck/tc_main.c 2007-10-17 06:01:21 UTC (rev 7013)
+++ branches/THRCHECK/thrcheck/tc_main.c 2007-10-17 11:04:21 UTC (rev 7014)
@@ -251,7 +251,8 @@
/* Place where lock first came to the attention of Thrcheck. */
ExeContext* appeared_at;
/* Place where the lock was first locked. */
- ExeContext* first_locked_at;
+ ExeContext* acquired_at;
+ ExeContext* acquired_at_laog;
/* USEFUL-STATIC */
Addr guestaddr; /* Guest address of lock */
LockKind kind; /* what kind of lock this is */
@@ -492,6 +493,10 @@
/*--- Simple helpers for the data structures ---*/
/*----------------------------------------------------------------*/
+static UWord stats__lockN_acquires = 0;
+static UWord stats__lockN_releases = 0;
+static UWord stats__lockN_acquires_w_ExeContext = 0;
+
static ThreadId map_threads_maybe_reverse_lookup_SLOW ( Thread* ); /*fwds*/
#define Thread_MAGIC 0x504fc5e5
@@ -523,18 +528,19 @@
// Make a new lock which is unlocked (hence ownerless)
static Lock* mk_LockN ( LockKind kind, Addr guestaddr ) {
static ULong unique = 0;
- Lock* lock = tc_zalloc( sizeof(Lock) );
- lock->admin = admin_locks;
- lock->unique = unique++;
- lock->magic = LockN_MAGIC;
- lock->appeared_at = NULL;
- lock->first_locked_at = NULL;
- lock->guestaddr = guestaddr;
- lock->kind = kind;
- lock->heldW = False;
- lock->heldBy = NULL;
+ Lock* lock = tc_zalloc( sizeof(Lock) );
+ lock->admin = admin_locks;
+ lock->unique = unique++;
+ lock->magic = LockN_MAGIC;
+ lock->appeared_at = NULL;
+ lock->acquired_at = NULL;
+ lock->acquired_at_laog = NULL;
+ lock->guestaddr = guestaddr;
+ lock->kind = kind;
+ lock->heldW = False;
+ lock->heldBy = NULL;
tl_assert(is_sane_LockN(lock));
- admin_locks = lock;
+ admin_locks = lock;
return lock;
}
static Segment* mk_Segment ( Thread* thr, Segment* prev, Segment* other ) {
@@ -636,16 +642,24 @@
tl_assert(is_sane_LockN(lk));
tl_assert(is_sane_Thread(thr));
- /* If it's never been locked before, note the first person to lock
- it. This is so as to produce better lock-order error
- messages. */
- if (lk->first_locked_at == NULL) {
+ stats__lockN_acquires++;
+
+ /* EXPOSITION only */
+ /* We need to keep recording snapshots of where the lock was
+ acquired, up till the point that the lock gets incorporated into
+ LAOG. Before that point, .first_locked_laog is NULL. When the
+ lock is incorporated into LAOG, .first_locked is copied into
+ .first_locked_laog and we stop snapshotting it after that. it.
+ This is so as to produce better lock-order error messages. */
+ if (lk->acquired_at_laog == NULL) {
ThreadId tid = map_threads_maybe_reverse_lookup_SLOW(thr);
if (tid != VG_INVALID_THREADID) {
- lk->first_locked_at
+ stats__lockN_acquires_w_ExeContext++;
+ lk->acquired_at
= VG_(record_ExeContext(tid, 0/*first_ip_delta*/));
}
}
+ /* end EXPOSITION only */
switch (lk->kind) {
case LK_nonRec:
@@ -687,16 +701,24 @@
tl_assert(lk->heldBy == NULL
|| (lk->heldBy != NULL && !lk->heldW));
- /* If it's never been locked before, note the first person to lock
- it. This is so as to produce better lock-order error
- messages. */
- if (lk->first_locked_at == NULL) {
+ stats__lockN_acquires++;
+
+ /* EXPOSITION only */
+ /* We need to keep recording snapshots of where the lock was
+ acquired, up till the point that the lock gets incorporated into
+ LAOG. Before that point, .first_locked_laog is NULL. When the
+ lock is incorporated into LAOG, .first_locked is copied into
+ .first_locked_laog and we stop snapshotting it after that. it.
+ This is so as to produce better lock-order error messages. */
+ if (lk->acquired_at_laog == NULL) {
ThreadId tid = map_threads_maybe_reverse_lookup_SLOW(thr);
if (tid != VG_INVALID_THREADID) {
- lk->first_locked_at
+ stats__lockN_acquires_w_ExeContext++;
+ lk->acquired_at
= VG_(record_ExeContext(tid, 0/*first_ip_delta*/));
}
}
+ /* end EXPOSITION only */
if (lk->heldBy) {
TC_(addToBag)(lk->heldBy, (Word)thr);
@@ -720,6 +742,7 @@
tl_assert(is_sane_Thread(thr));
/* lock must be held by someone */
tl_assert(lk->heldBy);
+ stats__lockN_releases++;
/* Remove it from the holder set */
b = TC_(delFromBag)(lk->heldBy, (Word)thr);
/* thr must actually have been a holder of lk */
@@ -2242,7 +2265,8 @@
static void record_error_UnlockForeign ( Thread*, Thread*, Lock* );
static void record_error_UnlockBogus ( Thread*, Addr );
static void record_error_PthAPIerror ( Thread*, HChar*, Word, HChar* );
-static void record_error_LockOrder ( Thread*, Lock*, Lock* );
+static void record_error_LockOrder ( Thread*, Addr, Addr,
+ ExeContext*, ExeContext* );
static void record_error_Misc ( Thread*, HChar* );
@@ -5230,6 +5254,18 @@
Word keyW;
LAOGLinks* links;
if (0) VG_(printf)("laog__add_edge %p %p\n", src, dst);
+
+ /* EXPOSITION only: update the execontext snapshots */
+ if (src->acquired_at_laog == NULL) {
+ src->acquired_at_laog = src->acquired_at;
+ src->acquired_at = NULL;
+ }
+ if (dst->acquired_at_laog == NULL) {
+ dst->acquired_at_laog = dst->acquired_at;
+ dst->acquired_at = NULL;
+ }
+ /* end EXPOSITION only */
+
/* Update the out edges for src */
keyW = 0;
links = NULL;
@@ -5442,7 +5478,9 @@
'other' but is in fact being acquired afterwards. We present
the lk/other arguments to record_error_LockOrder in the order
in which they should have been acquired. */
- record_error_LockOrder( thr, lk, other );
+ record_error_LockOrder( thr,
+ lk->guestaddr, other->guestaddr,
+ lk->acquired_at_laog, other->acquired_at_laog );
}
/* Second, add to laog the pairs
@@ -6263,9 +6301,11 @@
HChar* errstr; /* persistent, in tool-arena */
} PthAPIerror;
struct {
- Thread* thr;
- Lock* before; /* always locked first in prog. history */
- Lock* after; /* was erroneously locked before 'before' */
+ Thread* thr;
+ Addr before_ga; /* always locked first in prog. history */
+ Addr after_ga;
+ ExeContext* before_ec;
+ ExeContext* after_ec;
} LockOrder;
struct {
Thread* thr;
@@ -6382,16 +6422,17 @@
}
static
-void record_error_LockOrder ( Thread* thr, Lock* before, Lock* after ) {
+void record_error_LockOrder ( Thread* thr, Addr before_ga, Addr after_ga,
+ ExeContext* before_ec, ExeContext* after_ec ) {
XError xe;
tl_assert( is_sane_Thread(thr) );
- tl_assert( is_sane_LockN(after) );
- tl_assert( is_sane_LockN(before) );
init_XError(&xe);
xe.tag = XE_LockOrder;
- xe.XE.LockOrder.thr = thr;
- xe.XE.LockOrder.before = mk_LockP_from_LockN(before);
- xe.XE.LockOrder.after = mk_LockP_from_LockN(after);
+ xe.XE.LockOrder.thr = thr;
+ xe.XE.LockOrder.before_ga = before_ga;
+ xe.XE.LockOrder.before_ec = before_ec;
+ xe.XE.LockOrder.after_ga = after_ga;
+ xe.XE.LockOrder.after_ec = after_ec;
// FIXME: tid vs thr
VG_(maybe_record_error)( map_threads_reverse_lookup_SLOW(thr),
XE_LockOrder, 0, NULL, &xe );
@@ -6576,25 +6617,22 @@
case XE_LockOrder: {
tl_assert(xe);
tl_assert( is_sane_Thread( xe->XE.LockOrder.thr ) );
- tl_assert( is_sane_LockP( xe->XE.LockOrder.after ) );
- tl_assert( is_sane_LockP( xe->XE.LockOrder.before ) );
announce_one_thread( xe->XE.LockOrder.thr );
VG_(message)(Vg_UserMsg,
"Thread #%d: lock order \"%p before %p\" violated",
(Int)xe->XE.LockOrder.thr->errmsg_index,
- (void*)xe->XE.LockOrder.before->guestaddr,
- (void*)xe->XE.LockOrder.after->guestaddr);
+ (void*)xe->XE.LockOrder.before_ga,
+ (void*)xe->XE.LockOrder.after_ga);
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
- if (xe->XE.LockOrder.before->first_locked_at
- && xe->XE.LockOrder.after->first_locked_at) {
+ if (xe->XE.LockOrder.before_ec && xe->XE.LockOrder.after_ec) {
VG_(message)(Vg_UserMsg,
" Required order was established by acquisition of lock at %p",
- (void*)xe->XE.LockOrder.before->guestaddr);
- VG_(pp_ExeContext)( xe->XE.LockOrder.before->first_locked_at );
+ (void*)xe->XE.LockOrder.before_ga);
+ VG_(pp_ExeContext)( xe->XE.LockOrder.before_ec );
VG_(message)(Vg_UserMsg,
" followed by a later acquisition of lock at %p",
- (void*)xe->XE.LockOrder.after->guestaddr);
- VG_(pp_ExeContext)( xe->XE.LockOrder.after->first_locked_at );
+ (void*)xe->XE.LockOrder.after_ga);
+ VG_(pp_ExeContext)( xe->XE.LockOrder.after_ec );
}
break;
}
@@ -6978,6 +7016,13 @@
stats__string_table_queries,
(Int)(string_table ? TC_(sizeFM)( string_table ) : 0) );
+ VG_(printf)(" locks: %,lu acquires (%,lu w/ExeContext), "
+ "%,lu releases\n",
+ stats__lockN_acquires,
+ stats__lockN_acquires_w_ExeContext,
+ stats__lockN_releases
+ );
+
VG_(printf)("\n");
VG_(printf)(" msm: %,12lu %,12lu rd/wr_Excl_nochange\n",
stats__msm_r32_Excl_nochange, stats__msm_w32_Excl_nochange);
@@ -7010,11 +7055,11 @@
VG_(printf)("\n");
VG_(printf)(" cache: %,lu totrefs (%,lu misses)\n",
stats__cache_totrefs, stats__cache_totmisses );
- VG_(printf)(" cache: %,10lu Z-fetch, %,10lu F-fetch\n",
+ VG_(printf)(" cache: %,12lu Z-fetch, %,12lu F-fetch\n",
stats__cache_Z_fetches, stats__cache_F_fetches );
- VG_(printf)(" cache: %,10lu Z-wback, %,10lu F-wback\n",
+ VG_(printf)(" cache: %,12lu Z-wback, %,12lu F-wback\n",
stats__cache_Z_wbacks, stats__cache_F_wbacks );
- VG_(printf)(" cache: %,10lu invals, %,10lu flushes\n",
+ VG_(printf)(" cache: %,12lu invals, %,12lu flushes\n",
stats__cache_invals, stats__cache_flushes );
VG_(printf)("\n");
|
|
From: Julian S. <js...@ac...> - 2007-10-17 11:02:38
|
On Friday 12 October 2007 22:02, Rich Coe wrote: > I'd like to volunteer to maintain Omega. > > Rich Good. Thanks. As you may know, we are trying to set up a structure so that Omega and other experimental tools can exist inside the existing tree. See discussion at http://sourceforge.net/mailarchive/message.php?msg_name=Pine.GSO.4.61.0710051046050.18928%40mulga.csse.unimelb.edu.au That should get actioned in the next week or two weeks. As a first step, maybe you could prepare a version of Omega which compiles against the current svn trunk? J |
|
From: <sv...@va...> - 2007-10-17 06:01:21
|
Author: njn
Date: 2007-10-17 07:01:21 +0100 (Wed, 17 Oct 2007)
New Revision: 7013
Log:
Add --peak-inaccuracy option. Shaves about 6s off konqueror startup, now
down to 21s (user). Added a test for it, too.
Added:
branches/MASSIF2/massif/tests/peak2.post.exp
branches/MASSIF2/massif/tests/peak2.stderr.exp
branches/MASSIF2/massif/tests/peak2.vgtest
Modified:
branches/MASSIF2/massif/ms_main.c
branches/MASSIF2/massif/tests/Makefile.am
branches/MASSIF2/massif/tests/peak.c
branches/MASSIF2/massif/tests/peak.post.exp
branches/MASSIF2/massif/tests/peak.vgtest
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-17 05:10:26 UTC (rev 7012)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-17 06:01:21 UTC (rev 7013)
@@ -95,6 +95,13 @@
// many-xpts 0.10s ma: 2.2s (22.1x, -----)
// konqueror 37.7s real 0:29.5s user
//
+// By default, only snapshot a peak if it's 1% larger than the previous peak,
+// rather than snapshotting every peak. Greatly reduces the number of peak
+// snapshots taken for larger programs like konqueror.
+// heap 0.53s ma:12.4s (23.5x, -----)
+// tinycc 0.46s ma: 4.9s (10.7x, -----)
+// many-xpts 0.08s ma: 2.0s (25.0x, -----)
+// konqueror 29.6s real 0:21.0s user
//
// Todo:
// - for regtests, need to filter out code addresses in *.post.* files
@@ -400,14 +407,15 @@
}
}
-static Bool clo_heap = True;
-static UInt clo_heap_admin = 8;
-static Bool clo_stacks = False;
-static UInt clo_depth = 8; // XXX: too low?
-static UInt clo_threshold = 100; // 100 == 1%
-static UInt clo_time_unit = TimeMS;
-static UInt clo_detailed_freq = 10;
-static UInt clo_max_snapshots = 100;
+static Bool clo_heap = True;
+static UInt clo_heap_admin = 8;
+static Bool clo_stacks = False;
+static UInt clo_depth = 8; // XXX: too low?
+static UInt clo_threshold = 100; // 100 == 1%
+static UInt clo_peak_inaccuracy = 100; // 100 == 1%
+static UInt clo_time_unit = TimeMS;
+static UInt clo_detailed_freq = 10;
+static UInt clo_max_snapshots = 100;
static XArray* args_for_massif;
@@ -425,6 +433,10 @@
// XXX: use a fractional number, so no division by 100
else VG_NUM_CLO(arg, "--threshold", clo_threshold)
+
+ // XXX: use a fractional number, so no division by 100
+ else VG_NUM_CLO(arg, "--peak-inaccuracy", clo_peak_inaccuracy)
+
else VG_NUM_CLO(arg, "--detailed-freq", clo_detailed_freq)
else VG_NUM_CLO(arg, "--max-snapshots", clo_max_snapshots)
@@ -454,6 +466,8 @@
" --threshold=<n> significance threshold, in 100ths of a percent\n"
" (eg. <n>=100 shows nodes covering >= 1%% of\n"
" total size, <n>=0 shows all nodes) [100]\n"
+" --peak-inaccuracy=<n> closeness of recorded peak to true peak,\n"
+" in 100ths of a percent\n"
" --time-unit=ms|B time unit, milliseconds or bytes\n"
" alloc'd/dealloc'd on the heap [ms]\n"
" --detailed-freq=<N> every Nth snapshot should be detailed [10]\n"
@@ -1326,11 +1340,12 @@
// Because we're about to do a deallocation, we're coming down from a
// local peak. If it is (a) actually a global peak, and (b) a certain
// amount bigger than the previous peak, then we take a peak snapshot.
- //
- // XXX: make the percentage configurable
+ // By not taking a snapshot for every peak, we save a lot of effort --
+ // because many peaks remain peak only for a short time.
SizeT total_szB = heap_szB + clo_heap_admin*n_heap_blocks + stacks_szB;
- double excess_over_previous_peak = 1.00;
- if (total_szB <= peak_snapshot_total_szB * excess_over_previous_peak) {
+ SizeT excess_szB_for_new_peak =
+ (((ULong)peak_snapshot_total_szB) * clo_peak_inaccuracy) / 10000ULL;
+ if (total_szB <= peak_snapshot_total_szB + excess_szB_for_new_peak) {
return;
}
is_detailed = True;
Modified: branches/MASSIF2/massif/tests/Makefile.am
===================================================================
--- branches/MASSIF2/massif/tests/Makefile.am 2007-10-17 05:10:26 UTC (rev 7012)
+++ branches/MASSIF2/massif/tests/Makefile.am 2007-10-17 06:01:21 UTC (rev 7013)
@@ -24,6 +24,7 @@
one.post.exp one.stderr.exp one.vgtest \
params.post.exp params.stderr.exp params.vgtest \
peak.post.exp peak.stderr.exp peak.vgtest \
+ peak2.post.exp peak2.stderr.exp peak2.vgtest \
realloc.post.exp realloc.stderr.exp realloc.vgtest \
thresholds_0_0.post.exp thresholds_0_0.stderr.exp thresholds_0_0.vgtest \
thresholds_0_10.post.exp thresholds_0_10.stderr.exp thresholds_0_10.vgtest \
Modified: branches/MASSIF2/massif/tests/peak.c
===================================================================
--- branches/MASSIF2/massif/tests/peak.c 2007-10-17 05:10:26 UTC (rev 7012)
+++ branches/MASSIF2/massif/tests/peak.c 2007-10-17 06:01:21 UTC (rev 7013)
@@ -5,9 +5,9 @@
int i;
for (i = 0; i < 20; i++) {
int* p;
- p = malloc(100);
- p = malloc(100);
- free(p);
+ p = malloc(100); // With --peak-inaccuracy=1000, the first 10 of
+ p = malloc(1); // 'free' calls result in peaks, but after that,
+ free(p); // only every second one does.
}
return 0;
}
Modified: branches/MASSIF2/massif/tests/peak.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/peak.post.exp 2007-10-17 05:10:26 UTC (rev 7012)
+++ branches/MASSIF2/massif/tests/peak.post.exp 2007-10-17 06:01:21 UTC (rev 7013)
@@ -1,33 +1,33 @@
--------------------------------------------------------------------------------
Command: ./peak
-Massif arguments: --stacks=no --time-unit=B
+Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=0
ms_print arguments: massif.out
--------------------------------------------------------------------------------
KB
-2.215^ #
- | @ :#:
- | @ : @::#:
- | @ :@:: @::#:
- | @ :@ ::@:: @::#:
- | @ :@::@ ::@:: @::#:
- | @ :@: :@::@ ::@:: @::#:
- | @ : @::@: :@::@ ::@:: @::#:
- | @ :@:: @::@: :@::@ ::@:: @::#:
- | @ :@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@. :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . . @.:@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@.: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@ .:@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@.:@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@. :@::@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . . @.:@: :@::@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@.: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | . .@ .:@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- | .@.:@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::@: :@::@ ::@:: @::#:
- 0 +--@--@---@---@--@---@--@---@---@--@---@--@---@---@--@---@--@---@---@--#>KB
- 0 6.328
+2.118^ #
+ | .@ #
+ | @ :@ #
+ | @. @ :@ #
+ | @ @: @ :@ #
+ | @ @ @: @ :@ #
+ | .@ @ @ @: @ :@ #
+ | @ :@ @ @ @: @ :@ #
+ | @. @ :@ @ @ @: @ :@ #
+ | @ @: @ :@ @ @ @: @ :@ #
+ | @ @ @: @ :@ @ @ @: @ :@ #
+ | .@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @. @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @ @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | .@ @ @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @ :@ @ @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @. @ :@ @ @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ | @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ @ @ @: @ :@ #
+ 0 +---@--@---@---@--@---@--@---@---@--@---@--@---@---@--@---@--@---@---@--#KB
+ 0 2.461
Number of snapshots: 81
Detailed snapshots: [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79 (peak)]
@@ -36,242 +36,242 @@
--------------------------------------------------------------------------------
0 0 0 0 0 0
1 108 108 100 8 0
- 2 216 216 200 16 0
- 3 216 216 200 16 0
-92.59% (200B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->46.30% (100B) 0x80483DE: main (peak.c:8)
+ 2 117 117 101 16 0
+ 3 117 117 101 16 0
+86.32% (101B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->85.47% (100B) 0x80483DE: main (peak.c:8)
|
-->46.30% (100B) 0x80483EE: main (peak.c:9)
-
+->00.85% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 4 324 108 100 8 0
- 5 432 216 200 16 0
- 6 540 324 300 24 0
- 7 540 324 300 24 0
-92.59% (300B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->61.73% (200B) 0x80483DE: main (peak.c:8)
+ 4 126 108 100 8 0
+ 5 234 216 200 16 0
+ 6 243 225 201 24 0
+ 7 243 225 201 24 0
+89.33% (201B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->88.89% (200B) 0x80483DE: main (peak.c:8)
|
-->30.86% (100B) 0x80483EE: main (peak.c:9)
-
+->00.44% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 8 648 216 200 16 0
- 9 756 324 300 24 0
- 10 864 432 400 32 0
- 11 864 432 400 32 0
-92.59% (400B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->69.44% (300B) 0x80483DE: main (peak.c:8)
+ 8 252 216 200 16 0
+ 9 360 324 300 24 0
+ 10 369 333 301 32 0
+ 11 369 333 301 32 0
+90.39% (301B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.09% (300B) 0x80483DE: main (peak.c:8)
|
-->23.15% (100B) 0x80483EE: main (peak.c:9)
-
+->00.30% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 12 972 324 300 24 0
- 13 1,080 432 400 32 0
- 14 1,188 540 500 40 0
- 15 1,188 540 500 40 0
-92.59% (500B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->74.07% (400B) 0x80483DE: main (peak.c:8)
+ 12 378 324 300 24 0
+ 13 486 432 400 32 0
+ 14 495 441 401 40 0
+ 15 495 441 401 40 0
+90.93% (401B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.70% (400B) 0x80483DE: main (peak.c:8)
|
-->18.52% (100B) 0x80483EE: main (peak.c:9)
-
+->00.23% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 16 1,296 432 400 32 0
- 17 1,404 540 500 40 0
- 18 1,512 648 600 48 0
- 19 1,512 648 600 48 0
-92.59% (600B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->77.16% (500B) 0x80483DE: main (peak.c:8)
+ 16 504 432 400 32 0
+ 17 612 540 500 40 0
+ 18 621 549 501 48 0
+ 19 621 549 501 48 0
+91.26% (501B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.07% (500B) 0x80483DE: main (peak.c:8)
|
-->15.43% (100B) 0x80483EE: main (peak.c:9)
-
+->00.18% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 20 1,620 540 500 40 0
- 21 1,728 648 600 48 0
- 22 1,836 756 700 56 0
- 23 1,836 756 700 56 0
-92.59% (700B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->79.37% (600B) 0x80483DE: main (peak.c:8)
+ 20 630 540 500 40 0
+ 21 738 648 600 48 0
+ 22 747 657 601 56 0
+ 23 747 657 601 56 0
+91.48% (601B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.32% (600B) 0x80483DE: main (peak.c:8)
|
-->13.23% (100B) 0x80483EE: main (peak.c:9)
-
+->00.15% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 24 1,944 648 600 48 0
- 25 2,052 756 700 56 0
- 26 2,160 864 800 64 0
- 27 2,160 864 800 64 0
-92.59% (800B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->81.02% (700B) 0x80483DE: main (peak.c:8)
+ 24 756 648 600 48 0
+ 25 864 756 700 56 0
+ 26 873 765 701 64 0
+ 27 873 765 701 64 0
+91.63% (701B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.50% (700B) 0x80483DE: main (peak.c:8)
|
-->11.57% (100B) 0x80483EE: main (peak.c:9)
-
+->00.13% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 28 2,268 756 700 56 0
- 29 2,376 864 800 64 0
- 30 2,484 972 900 72 0
- 31 2,484 972 900 72 0
-92.59% (900B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->82.30% (800B) 0x80483DE: main (peak.c:8)
+ 28 882 756 700 56 0
+ 29 990 864 800 64 0
+ 30 999 873 801 72 0
+ 31 999 873 801 72 0
+91.75% (801B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.64% (800B) 0x80483DE: main (peak.c:8)
|
-->10.29% (100B) 0x80483EE: main (peak.c:9)
-
+->00.11% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 32 2,592 864 800 64 0
- 33 2,700 972 900 72 0
- 34 2,808 1,080 1,000 80 0
- 35 2,808 1,080 1,000 80 0
-92.59% (1000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->83.33% (900B) 0x80483DE: main (peak.c:8)
+ 32 1,008 864 800 64 0
+ 33 1,116 972 900 72 0
+ 34 1,125 981 901 80 0
+ 35 1,125 981 901 80 0
+91.85% (901B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.74% (900B) 0x80483DE: main (peak.c:8)
|
-->09.26% (100B) 0x80483EE: main (peak.c:9)
-
+->00.10% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 36 2,916 972 900 72 0
- 37 3,024 1,080 1,000 80 0
- 38 3,132 1,188 1,100 88 0
- 39 3,132 1,188 1,100 88 0
-92.59% (1100B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->84.18% (1000B) 0x80483DE: main (peak.c:8)
+ 36 1,134 972 900 72 0
+ 37 1,242 1,080 1,000 80 0
+ 38 1,251 1,089 1,001 88 0
+ 39 1,251 1,089 1,001 88 0
+91.92% (1001B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.83% (1000B) 0x80483DE: main (peak.c:8)
|
-->08.42% (100B) 0x80483EE: main (peak.c:9)
-
+->00.09% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 40 3,240 1,080 1,000 80 0
- 41 3,348 1,188 1,100 88 0
- 42 3,456 1,296 1,200 96 0
- 43 3,456 1,296 1,200 96 0
-92.59% (1200B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->84.88% (1100B) 0x80483DE: main (peak.c:8)
+ 40 1,260 1,080 1,000 80 0
+ 41 1,368 1,188 1,100 88 0
+ 42 1,377 1,197 1,101 96 0
+ 43 1,377 1,197 1,101 96 0
+91.98% (1101B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.90% (1100B) 0x80483DE: main (peak.c:8)
|
-->07.72% (100B) 0x80483EE: main (peak.c:9)
-
+->00.08% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 44 3,564 1,188 1,100 88 0
- 45 3,672 1,296 1,200 96 0
- 46 3,780 1,404 1,300 104 0
- 47 3,780 1,404 1,300 104 0
-92.59% (1300B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->85.47% (1200B) 0x80483DE: main (peak.c:8)
+ 44 1,386 1,188 1,100 88 0
+ 45 1,494 1,296 1,200 96 0
+ 46 1,503 1,305 1,201 104 0
+ 47 1,503 1,305 1,201 104 0
+92.03% (1201B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.95% (1200B) 0x80483DE: main (peak.c:8)
|
-->07.12% (100B) 0x80483EE: main (peak.c:9)
-
+->00.08% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 48 3,888 1,296 1,200 96 0
- 49 3,996 1,404 1,300 104 0
- 50 4,104 1,512 1,400 112 0
- 51 4,104 1,512 1,400 112 0
-92.59% (1400B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->85.98% (1300B) 0x80483DE: main (peak.c:8)
+ 48 1,512 1,296 1,200 96 0
+ 49 1,620 1,404 1,300 104 0
+ 50 1,629 1,413 1,301 112 0
+ 51 1,629 1,413 1,301 112 0
+92.07% (1301B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.00% (1300B) 0x80483DE: main (peak.c:8)
|
-->06.61% (100B) 0x80483EE: main (peak.c:9)
-
+->00.07% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 52 4,212 1,404 1,300 104 0
- 53 4,320 1,512 1,400 112 0
- 54 4,428 1,620 1,500 120 0
- 55 4,428 1,620 1,500 120 0
-92.59% (1500B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->86.42% (1400B) 0x80483DE: main (peak.c:8)
+ 52 1,638 1,404 1,300 104 0
+ 53 1,746 1,512 1,400 112 0
+ 54 1,755 1,521 1,401 120 0
+ 55 1,755 1,521 1,401 120 0
+92.11% (1401B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.04% (1400B) 0x80483DE: main (peak.c:8)
|
-->06.17% (100B) 0x80483EE: main (peak.c:9)
-
+->00.07% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 56 4,536 1,512 1,400 112 0
- 57 4,644 1,620 1,500 120 0
- 58 4,752 1,728 1,600 128 0
- 59 4,752 1,728 1,600 128 0
-92.59% (1600B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->86.81% (1500B) 0x80483DE: main (peak.c:8)
+ 56 1,764 1,512 1,400 112 0
+ 57 1,872 1,620 1,500 120 0
+ 58 1,881 1,629 1,501 128 0
+ 59 1,881 1,629 1,501 128 0
+92.14% (1501B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.08% (1500B) 0x80483DE: main (peak.c:8)
|
-->05.79% (100B) 0x80483EE: main (peak.c:9)
-
+->00.06% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 60 4,860 1,620 1,500 120 0
- 61 4,968 1,728 1,600 128 0
- 62 5,076 1,836 1,700 136 0
- 63 5,076 1,836 1,700 136 0
-92.59% (1700B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->87.15% (1600B) 0x80483DE: main (peak.c:8)
+ 60 1,890 1,620 1,500 120 0
+ 61 1,998 1,728 1,600 128 0
+ 62 2,007 1,737 1,601 136 0
+ 63 2,007 1,737 1,601 136 0
+92.17% (1601B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.11% (1600B) 0x80483DE: main (peak.c:8)
|
-->05.45% (100B) 0x80483EE: main (peak.c:9)
-
+->00.06% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 64 5,184 1,728 1,600 128 0
- 65 5,292 1,836 1,700 136 0
- 66 5,400 1,944 1,800 144 0
- 67 5,400 1,944 1,800 144 0
-92.59% (1800B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->87.45% (1700B) 0x80483DE: main (peak.c:8)
+ 64 2,016 1,728 1,600 128 0
+ 65 2,124 1,836 1,700 136 0
+ 66 2,133 1,845 1,701 144 0
+ 67 2,133 1,845 1,701 144 0
+92.20% (1701B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.14% (1700B) 0x80483DE: main (peak.c:8)
|
-->05.14% (100B) 0x80483EE: main (peak.c:9)
-
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 68 5,508 1,836 1,700 136 0
- 69 5,616 1,944 1,800 144 0
- 70 5,724 2,052 1,900 152 0
- 71 5,724 2,052 1,900 152 0
-92.59% (1900B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->87.72% (1800B) 0x80483DE: main (peak.c:8)
+ 68 2,142 1,836 1,700 136 0
+ 69 2,250 1,944 1,800 144 0
+ 70 2,259 1,953 1,801 152 0
+ 71 2,259 1,953 1,801 152 0
+92.22% (1801B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.17% (1800B) 0x80483DE: main (peak.c:8)
|
-->04.87% (100B) 0x80483EE: main (peak.c:9)
-
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 72 5,832 1,944 1,800 144 0
- 73 5,940 2,052 1,900 152 0
- 74 6,048 2,160 2,000 160 0
- 75 6,048 2,160 2,000 160 0
-92.59% (2000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->87.96% (1900B) 0x80483DE: main (peak.c:8)
+ 72 2,268 1,944 1,800 144 0
+ 73 2,376 2,052 1,900 152 0
+ 74 2,385 2,061 1,901 160 0
+ 75 2,385 2,061 1,901 160 0
+92.24% (1901B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.19% (1900B) 0x80483DE: main (peak.c:8)
|
-->04.63% (100B) 0x80483EE: main (peak.c:9)
-
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 76 6,156 2,052 1,900 152 0
- 77 6,264 2,160 2,000 160 0
- 78 6,372 2,268 2,100 168 0
- 79 6,372 2,268 2,100 168 0
-92.59% (2100B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->88.18% (2000B) 0x80483DE: main (peak.c:8)
+ 76 2,394 2,052 1,900 152 0
+ 77 2,502 2,160 2,000 160 0
+ 78 2,511 2,169 2,001 168 0
+ 79 2,511 2,169 2,001 168 0
+92.25% (2001B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.21% (2000B) 0x80483DE: main (peak.c:8)
|
-->04.41% (100B) 0x80483EE: main (peak.c:9)
-
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
- 80 6,480 2,160 2,000 160 0
+ 80 2,520 2,160 2,000 160 0
Modified: branches/MASSIF2/massif/tests/peak.vgtest
===================================================================
--- branches/MASSIF2/massif/tests/peak.vgtest 2007-10-17 05:10:26 UTC (rev 7012)
+++ branches/MASSIF2/massif/tests/peak.vgtest 2007-10-17 06:01:21 UTC (rev 7013)
@@ -1,4 +1,4 @@
prog: peak
-vgopts: --stacks=no --time-unit=B
+vgopts: --stacks=no --time-unit=B --peak-inaccuracy=0
post: perl ../../massif/ms_print massif.out
cleanup: rm massif.out
Added: branches/MASSIF2/massif/tests/peak2.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/peak2.post.exp (rev 0)
+++ branches/MASSIF2/massif/tests/peak2.post.exp 2007-10-17 06:01:21 UTC (rev 7013)
@@ -0,0 +1,232 @@
+--------------------------------------------------------------------------------
+Command: ./peak
+Massif arguments: --stacks=no --time-unit=B --peak-inaccuracy=1000
+ms_print arguments: massif.out
+--------------------------------------------------------------------------------
+
+
+ KB
+2.118^ #
+ | .. #
+ | @ :: #
+ | :. @ :: #
+ | @ :: @ :: #
+ | . @ :: @ :: #
+ | .@ : @ :: @ :: #
+ | . :@ : @ :: @ :: #
+ | @. : :@ : @ :: @ :: #
+ | . @: : :@ : @ :: @ :: #
+ | @ : @: : :@ : @ :: @ :: #
+ | .@ @ : @: : :@ : @ :: @ :: #
+ | @ :@ @ : @: : :@ : @ :: @ :: #
+ | @. @ :@ @ : @: : :@ : @ :: @ :: #
+ | @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ | @ @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ | .@ @ @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ | @ :@ @ @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ | @. @ :@ @ @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ | @ @: @ :@ @ @ @: @ :@ @ : @: : :@ : @ :: @ :: #
+ 0 +---@--@---@---@--@---@--@---@---@--@------@-------@------@------@------#KB
+ 0 2.461
+
+Number of snapshots: 76
+ Detailed snapshots: [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 46, 53, 60, 67, 74 (peak)]
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 0 0 0 0 0 0
+ 1 108 108 100 8 0
+ 2 117 117 101 16 0
+ 3 117 117 101 16 0
+86.32% (101B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->85.47% (100B) 0x80483DE: main (peak.c:8)
+|
+->00.85% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 4 126 108 100 8 0
+ 5 234 216 200 16 0
+ 6 243 225 201 24 0
+ 7 243 225 201 24 0
+89.33% (201B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->88.89% (200B) 0x80483DE: main (peak.c:8)
+|
+->00.44% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 8 252 216 200 16 0
+ 9 360 324 300 24 0
+ 10 369 333 301 32 0
+ 11 369 333 301 32 0
+90.39% (301B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.09% (300B) 0x80483DE: main (peak.c:8)
+|
+->00.30% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 12 378 324 300 24 0
+ 13 486 432 400 32 0
+ 14 495 441 401 40 0
+ 15 495 441 401 40 0
+90.93% (401B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.70% (400B) 0x80483DE: main (peak.c:8)
+|
+->00.23% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 16 504 432 400 32 0
+ 17 612 540 500 40 0
+ 18 621 549 501 48 0
+ 19 621 549 501 48 0
+91.26% (501B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.07% (500B) 0x80483DE: main (peak.c:8)
+|
+->00.18% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 20 630 540 500 40 0
+ 21 738 648 600 48 0
+ 22 747 657 601 56 0
+ 23 747 657 601 56 0
+91.48% (601B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.32% (600B) 0x80483DE: main (peak.c:8)
+|
+->00.15% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 24 756 648 600 48 0
+ 25 864 756 700 56 0
+ 26 873 765 701 64 0
+ 27 873 765 701 64 0
+91.63% (701B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.50% (700B) 0x80483DE: main (peak.c:8)
+|
+->00.13% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 28 882 756 700 56 0
+ 29 990 864 800 64 0
+ 30 999 873 801 72 0
+ 31 999 873 801 72 0
+91.75% (801B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.64% (800B) 0x80483DE: main (peak.c:8)
+|
+->00.11% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 32 1,008 864 800 64 0
+ 33 1,116 972 900 72 0
+ 34 1,125 981 901 80 0
+ 35 1,125 981 901 80 0
+91.85% (901B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.74% (900B) 0x80483DE: main (peak.c:8)
+|
+->00.10% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 36 1,134 972 900 72 0
+ 37 1,242 1,080 1,000 80 0
+ 38 1,251 1,089 1,001 88 0
+ 39 1,251 1,089 1,001 88 0
+91.92% (1001B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.83% (1000B) 0x80483DE: main (peak.c:8)
+|
+->00.09% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 40 1,260 1,080 1,000 80 0
+ 41 1,368 1,188 1,100 88 0
+ 42 1,377 1,197 1,101 96 0
+ 43 1,386 1,188 1,100 88 0
+ 44 1,494 1,296 1,200 96 0
+ 45 1,503 1,305 1,201 104 0
+ 46 1,503 1,305 1,201 104 0
+92.03% (1201B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.95% (1200B) 0x80483DE: main (peak.c:8)
+|
+->00.08% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 47 1,512 1,296 1,200 96 0
+ 48 1,620 1,404 1,300 104 0
+ 49 1,629 1,413 1,301 112 0
+ 50 1,638 1,404 1,300 104 0
+ 51 1,746 1,512 1,400 112 0
+ 52 1,755 1,521 1,401 120 0
+ 53 1,755 1,521 1,401 120 0
+92.11% (1401B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.04% (1400B) 0x80483DE: main (peak.c:8)
+|
+->00.07% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 54 1,764 1,512 1,400 112 0
+ 55 1,872 1,620 1,500 120 0
+ 56 1,881 1,629 1,501 128 0
+ 57 1,890 1,620 1,500 120 0
+ 58 1,998 1,728 1,600 128 0
+ 59 2,007 1,737 1,601 136 0
+ 60 2,007 1,737 1,601 136 0
+92.17% (1601B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.11% (1600B) 0x80483DE: main (peak.c:8)
+|
+->00.06% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 61 2,016 1,728 1,600 128 0
+ 62 2,124 1,836 1,700 136 0
+ 63 2,133 1,845 1,701 144 0
+ 64 2,142 1,836 1,700 136 0
+ 65 2,250 1,944 1,800 144 0
+ 66 2,259 1,953 1,801 152 0
+ 67 2,259 1,953 1,801 152 0
+92.22% (1801B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.17% (1800B) 0x80483DE: main (peak.c:8)
+|
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 68 2,268 1,944 1,800 144 0
+ 69 2,376 2,052 1,900 152 0
+ 70 2,385 2,061 1,901 160 0
+ 71 2,394 2,052 1,900 152 0
+ 72 2,502 2,160 2,000 160 0
+ 73 2,511 2,169 2,001 168 0
+ 74 2,511 2,169 2,001 168 0
+92.25% (2001B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.21% (2000B) 0x80483DE: main (peak.c:8)
+|
+->00.05% (1B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 75 2,520 2,160 2,000 160 0
Added: branches/MASSIF2/massif/tests/peak2.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/peak2.stderr.exp (rev 0)
+++ branches/MASSIF2/massif/tests/peak2.stderr.exp 2007-10-17 06:01:21 UTC (rev 7013)
@@ -0,0 +1,190 @@
+
+Command line
+ ./peak
+Startup, with flags:
+ --command-line-only=yes
+ --memcheck:leak-check=no
+ --tool=massif
+ --stacks=no
+ --time-unit=B
+ -v
+ -v
+ --peak-inaccuracy=1000
+Contents of /proc/version:
+ Linux version 2.6.15-1.1833_FC4 (bhc...@hs...) (gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)) #1 Wed Mar 1 23:41:37 EST 2006
+Arch and hwcaps: X86, x86-sse1-sse2
+Page sizes: currently 4096, max supported 4096
+Valgrind library directory: /home/njn/grind/massif3/.in_place
+Massif: alloc-fns:
+Massif: 0: malloc
+Massif: 1: __builtin_new
+Massif: 2: operator new(unsigned)
+Massif: 3: operator new(unsigned long)
+Massif: 4: __builtin_vec_new
+Massif: 5: operator new[](unsigned)
+Massif: 6: operator new[](unsigned long)
+Massif: 7: calloc
+Massif: 8: realloc
+Massif: 9: memalign
+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&)
+TT/TC: VG_(init_tt_tc) (startup of code management)
+TT/TC: cache: 8 sectors of 9644544 bytes each = 77156352 total
+TT/TC: table: 524168 total entries, max occupancy 419328 (80%)
+Reading syms from /lib/ld-2.3.5.so (0x23C000)
+ svma 0x000023C000, avma 0x000023C000
+summarise_context(loc_start = 0x5D): cannot summarise(why=1):
+0x66: 44(r3) u u u c-36 u u c-44 c-40 c-4 u u u u u u u u u u u
+summarise_context(loc_start = 0x66): cannot summarise(why=1):
+0x69: 44(r3) u u u c-36 u u u c-40 c-4 u u u u u u u u u u u
+summarise_context(loc_start = 0x69): cannot summarise(why=1):
+0x78: 44(r3) u u u c-36 u u u u c-4 u u u u u u u u u u u
+Reading syms from /home/njn/grind/massif3/massif/tests/peak (0x8048000)
+ svma 0x0008048000, avma 0x0008048000
+Reading syms from /home/njn/grind/massif3/massif/massif-x86-linux (0x38000000)
+ svma 0x0038000000, avma 0x0038000000
+ object doesn't have a dynamic symbol table
+Massif: startup S. 0 (t:0, hp:0, ad:0, st:0)
+TT/TC: initialise sector 0
+Reading syms from /home/njn/grind/massif3/coregrind/vgpreload_core-x86-linux.so (0x4001000)
+ svma 0x0000000000, avma 0x0004001000
+Reading syms from /home/njn/grind/massif3/massif/vgpreload_massif-x86-linux.so (0x4003000)
+ svma 0x0000000000, avma 0x0004003000
+Reading syms from /lib/libc-2.3.5.so (0x25A000)
+ svma 0x000025A000, avma 0x000025A000
+summarise_context(loc_start = 0x34): cannot summarise(why=1):
+0x4d: 0(r0) u c60 c56 c52 u c44 c40 c36 c-4 u u u u u u u u u u u
+REDIR: 0x2bf41e (malloc) redirected to 0x4003e13 (malloc)
+Massif: alloc S. 1 (t:108, hp:100, ad:8, st:0)
+Massif: alloc S. 2 (t:117, hp:101, ad:16, st:0)
+REDIR: 0x2bd5e8 (free) redirected to 0x40049a4 (free)
+Massif: de-PEAK Sp 3 (t:117, hp:101, ad:16, st:0)
+Massif: dealloc S. 4 (t:126, hp:100, ad:8, st:0)
+Massif: alloc S. 5 (t:234, hp:200, ad:16, st:0)
+Massif: alloc S. 6 (t:243, hp:201, ad:24, st:0)
+Massif: de-PEAK Sp 7 (t:243, hp:201, ad:24, st:0)
+Massif: dealloc S. 8 (t:252, hp:200, ad:16, st:0)
+Massif: alloc S. 9 (t:360, hp:300, ad:24, st:0)
+Massif: alloc S. 10 (t:369, hp:301, ad:32, st:0)
+Massif: de-PEAK Sp 11 (t:369, hp:301, ad:32, st:0)
+Massif: dealloc S. 12 (t:378, hp:300, ad:24, st:0)
+Massif: alloc S. 13 (t:486, hp:400, ad:32, st:0)
+Massif: alloc S. 14 (t:495, hp:401, ad:40, st:0)
+Massif: de-PEAK Sp 15 (t:495, hp:401, ad:40, st:0)
+Massif: dealloc S. 16 (t:504, hp:400, ad:32, st:0)
+Massif: alloc S. 17 (t:612, hp:500, ad:40, st:0)
+Massif: alloc S. 18 (t:621, hp:501, ad:48, st:0)
+Massif: de-PEAK Sp 19 (t:621, hp:501, ad:48, st:0)
+Massif: dealloc S. 20 (t:630, hp:500, ad:40, st:0)
+Massif: alloc S. 21 (t:738, hp:600, ad:48, st:0)
+Massif: alloc S. 22 (t:747, hp:601, ad:56, st:0)
+Massif: de-PEAK Sp 23 (t:747, hp:601, ad:56, st:0)
+Massif: dealloc S. 24 (t:756, hp:600, ad:48, st:0)
+Massif: alloc S. 25 (t:864, hp:700, ad:56, st:0)
+Massif: alloc S. 26 (t:873, hp:701, ad:64, st:0)
+Massif: de-PEAK Sp 27 (t:873, hp:701, ad:64, st:0)
+Massif: dealloc S. 28 (t:882, hp:700, ad:56, st:0)
+Massif: alloc S. 29 (t:990, hp:800, ad:64, st:0)
+Massif: alloc S. 30 (t:999, hp:801, ad:72, st:0)
+Massif: de-PEAK Sp 31 (t:999, hp:801, ad:72, st:0)
+Massif: dealloc S. 32 (t:1008, hp:800, ad:64, st:0)
+Massif: alloc S. 33 (t:1116, hp:900, ad:72, st:0)
+Massif: alloc S. 34 (t:1125, hp:901, ad:80, st:0)
+Massif: de-PEAK Sp 35 (t:1125, hp:901, ad:80, st:0)
+Massif: dealloc S. 36 (t:1134, hp:900, ad:72, st:0)
+Massif: alloc S. 37 (t:1242, hp:1000, ad:80, st:0)
+Massif: alloc S. 38 (t:1251, hp:1001, ad:88, st:0)
+Massif: de-PEAK Sp 39 (t:1251, hp:1001, ad:88, st:0)
+Massif: dealloc S. 40 (t:1260, hp:1000, ad:80, st:0)
+Massif: alloc S. 41 (t:1368, hp:1100, ad:88, st:0)
+Massif: alloc S. 42 (t:1377, hp:1101, ad:96, st:0)
+Massif: dealloc S. 43 (t:1386, hp:1100, ad:88, st:0)
+Massif: alloc S. 44 (t:1494, hp:1200, ad:96, st:0)
+Massif: alloc S. 45 (t:1503, hp:1201, ad:104, st:0)
+Massif: de-PEAK Sp 46 (t:1503, hp:1201, ad:104, st:0)
+Massif: dealloc S. 47 (t:1512, hp:1200, ad:96, st:0)
+Massif: alloc S. 48 (t:1620, hp:1300, ad:104, st:0)
+Massif: alloc S. 49 (t:1629, hp:1301, ad:112, st:0)
+Massif: dealloc S. 50 (t:1638, hp:1300, ad:104, st:0)
+Massif: alloc S. 51 (t:1746, hp:1400, ad:112, st:0)
+Massif: alloc S. 52 (t:1755, hp:1401, ad:120, st:0)
+Massif: de-PEAK Sp 53 (t:1755, hp:1401, ad:120, st:0)
+Massif: dealloc S. 54 (t:1764, hp:1400, ad:112, st:0)
+Massif: alloc S. 55 (t:1872, hp:1500, ad:120, st:0)
+Massif: alloc S. 56 (t:1881, hp:1501, ad:128, st:0)
+Massif: dealloc S. 57 (t:1890, hp:1500, ad:120, st:0)
+Massif: alloc S. 58 (t:1998, hp:1600, ad:128, st:0)
+Massif: alloc S. 59 (t:2007, hp:1601, ad:136, st:0)
+Massif: de-PEAK Sp 60 (t:2007, hp:1601, ad:136, st:0)
+Massif: dealloc S. 61 (t:2016, hp:1600, ad:128, st:0)
+Massif: alloc S. 62 (t:2124, hp:1700, ad:136, st:0)
+Massif: alloc S. 63 (t:2133, hp:1701, ad:144, st:0)
+Massif: dealloc S. 64 (t:2142, hp:1700, ad:136, st:0)
+Massif: alloc S. 65 (t:2250, hp:1800, ad:144, st:0)
+Massif: alloc S. 66 (t:2259, hp:1801, ad:152, st:0)
+Massif: de-PEAK Sp 67 (t:2259, hp:1801, ad:152, st:0)
+Massif: dealloc S. 68 (t:2268, hp:1800, ad:144, st:0)
+Massif: alloc S. 69 (t:2376, hp:1900, ad:152, st:0)
+Massif: alloc S. 70 (t:2385, hp:1901, ad:160, st:0)
+Massif: dealloc S. 71 (t:2394, hp:1900, ad:152, st:0)
+Massif: alloc S. 72 (t:2502, hp:2000, ad:160, st:0)
+Massif: alloc S. 73 (t:2511, hp:2001, ad:168, st:0)
+Massif: de-PEAK Sp 74 (t:2511, hp:2001, ad:168, st:0)
+Massif: dealloc S. 75 (t:2520, hp:2000, ad:160, st:0)
+Caught __NR_exit; running __libc_freeres()
+
+Massif: heap allocs: 40
+Massif: heap reallocs: 0
+Massif: heap frees: 20
+Massif: stack allocs: 0
+Massif: stack frees: 0
+Massif: XPts: 7
+Massif: top-XPts: 2 (28%)
+Massif: XPt-init-expansions: 5
+Massif: XPt-later-expansions: 0
+Massif: SXPt allocs: 77
+Massif: SXPt frees: 0
+Massif: skipped snapshots: 0
+Massif: real snapshots: 76
+Massif: detailed snapshots: 15
+Massif: peak snapshots: 15
+Massif: cullings: 0
+Massif: XCon_redos: 0
+translate: fast SP updates identified: 0 ( --%)
+translate: generic_known SP updates identified: 0 ( --%)
+translate: generic_unknown SP updates identified: 0 ( --%)
+ tt/tc: 2,987 tt lookups requiring 2,996 probes
+ tt/tc: 2,987 fast-cache updates, 2 flushes
+ transtab: new 1,489 (32,900 -> 182,505; ratio 55:10) [0 scs]
+ transtab: dumped 0 (0 -> ??)
+ transtab: discarded 0 (0 -> ??)
+scheduler: 21,885 jumps (bb entries).
+scheduler: 0/1,610 major/minor sched events.
+ sanity: 1 cheap, 1 expensive checks.
+ exectx: 30,011 lists, 0 contexts (avg 0 per list)
+ exectx: 0 searches, 0 full compares (0 per 1000)
+ exectx: 0 cmp2, 0 cmp4, 0 cmpAll
+ errormgr: 0 supplist searches, 0 comparisons during search
+ errormgr: 0 errlist searches, 0 comparisons during search
+
+------ Valgrind's internal memory use stats follow ------
+core : 1 sbs, 3 bs, 1/1 free bs, 1048576 mmap, 65552 loan
+tool : 1 sbs, 161 bs, 2/2 free bs, 1048576 mmap, 325904 loan
+symtab : 3 sbs, 199 bs, 7/7 free bs, 3145728 mmap, 1949288 loan
+client : 1 sbs, 21 bs, 1/1 free bs, 1048576 mmap, 2080 loan
+demangle: 0 sbs, 0 bs, 0/0 free bs, 0 mmap, 0 loan
+exectxt : 0 sbs, 0 bs, 0/0 free bs, 0 mmap, 0 loan
+errors : 0 sbs, 0 bs, 0/0 free bs, 0 mmap, 0 loan
+ttaux : 1 sbs, 75 bs, 13/13 free bs, 65536 mmap, 4624 loan
+------
+core : 1048576 mmap'd, 65552/ 65552 max/curr
+tool : 1048576 mmap'd, 325920/ 325904 max/curr
+symtab : 3145728 mmap'd, 2020528/ 1949288 max/curr
+client : 1048576 mmap'd, 2088/ 2080 max/curr
+demangle: 0 mmap'd, 0/ 0 max/curr
+exect...
[truncated message content] |
|
From: <sv...@va...> - 2007-10-17 05:10:24
|
Author: njn
Date: 2007-10-17 06:10:26 +0100 (Wed, 17 Oct 2007)
New Revision: 7012
Log:
Minimise number of divisions. Shaves a few more seconds off konqueror
startup.
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-17 04:36:39 UTC (rev 7011)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-17 05:10:26 UTC (rev 7012)
@@ -87,7 +87,15 @@
// many-xpts 0.09s ma: 2.0s (22.3x, -----)
// konqueror 0:42 real 0:34 user
//
+// Don't do the significance test (which involves a division) for every
+// child, instead compute a threshold (which involves a division) which can
+// be reused for every child of an XPt (r7012):
+// heap 0.60s ma:12.4s (20.6x, -----)
+// tinycc 0.48s ma: 4.8s (10.1x, -----)
+// many-xpts 0.10s ma: 2.2s (22.1x, -----)
+// konqueror 37.7s real 0:29.5s user
//
+//
// Todo:
// - for regtests, need to filter out code addresses in *.post.* files
// - do snapshots on client requests
@@ -632,21 +640,6 @@
: 0);
}
-// Does the xpt account for >= 1% (or so) of total memory used?
-static Bool is_significant_XPt(XPt* xpt, SizeT total_szB)
-{
- // clo_threshold is measured in hundredths of a percent of total size,
- // ie. 10,000ths of total size. So clo_threshold=100 means that the
- // threshold is 1% of total size. If total_szB is zero, we consider
- // every XPt significant. We also always consider the alloc_xpt to be
- // significant.
- tl_assert(xpt->szB <= total_szB);
- return xpt == alloc_xpt || 0 == clo_threshold ||
- (0 != total_szB &&
- // Nb: 10000 is a ULong to avoid possible overflow problems.
- xpt->szB * 10000ULL / total_szB >= clo_threshold);
-}
-
//------------------------------------------------------------//
//--- XTree Operations ---//
//------------------------------------------------------------//
@@ -655,7 +648,7 @@
static SXPt* dup_XTree(XPt* xpt, SizeT total_szB)
{
Int i, n_sig_children, n_insig_children, n_child_sxpts;
- SizeT insig_children_szB;
+ SizeT insig_children_szB, sig_child_threshold_szB;
SXPt* sxpt;
// Number of XPt children Action for SXPT
@@ -665,10 +658,24 @@
// N sig, M insig alloc N+1, dup first N, aggregate remaining M
// 0 sig, M insig alloc 1, aggregate M
+ // Work out how big a child must be to be significant. If the current
+ // total_szB is zero, then we set it to 1, which means everything will be
+ // judged insignificant -- this is sensible, as there's no point showing
+ // any detail for this case. Unless they used --threshold=0, in which
+ // case we show them everything because that's what they asked for.
+ //
+ // Nb: We do this once now, rather than once per child, because if we do
+ // that the cost of all the divisions adds up to something significant.
+ if (total_szB == 0 && clo_threshold != 0) {
+ sig_child_threshold_szB = 1;
+ } else {
+ sig_child_threshold_szB = (((ULong)total_szB) * clo_threshold) / 10000ULL;
+ }
+
// How many children are significant? And do we need an aggregate SXPt?
n_sig_children = 0;
for (i = 0; i < xpt->n_children; i++) {
- if (is_significant_XPt(xpt->children[i], total_szB)) {
+ if (xpt->children[i]->szB >= sig_child_threshold_szB) {
n_sig_children++;
}
}
@@ -692,7 +699,7 @@
// Duplicate the significant children.
j = 0;
for (i = 0; i < xpt->n_children; i++) {
- if (is_significant_XPt(xpt->children[i], total_szB)) {
+ if (xpt->children[i]->szB >= sig_child_threshold_szB) {
sxpt->Sig.children[j++] = dup_XTree(xpt->children[i], total_szB);
sig_children_szB += xpt->children[i]->szB;
}
|
|
From: <sv...@va...> - 2007-10-17 04:36:38
|
Author: njn
Date: 2007-10-17 05:36:39 +0100 (Wed, 17 Oct 2007)
New Revision: 7011
Log:
Reduce the number of calls to ssort by doing them at print time, rather than
duplication time.
Added:
branches/MASSIF2/massif/tests/insig.c
branches/MASSIF2/massif/tests/insig.post.exp
branches/MASSIF2/massif/tests/insig.stderr.exp
branches/MASSIF2/massif/tests/insig.vgtest
Modified:
branches/MASSIF2/massif/ms_main.c
branches/MASSIF2/massif/tests/Makefile.am
branches/MASSIF2/massif/tests/realloc.post.exp
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-17 03:31:32 UTC (rev 7010)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-17 04:36:39 UTC (rev 7011)
@@ -74,12 +74,18 @@
// konqueror 3:45 real 3:35 user
//
// Moved main-or-below-main filtering to the end, avoiding *many* calls to
-// VG_(get_fnname):
+// VG_(get_fnname) (r7010):
// heap 0.62s ma:12.4s (20.0x, -----)
// tinycc 0.45s ma: 5.1s (11.4x, -----)
// many-xpts 0.09s ma: 2.1s (23.8x, -----)
// konqueror 0:46 real 0:36 user
//
+// Instead of sorting XPt children at duplication time, sort them at print
+// time (ie. many fewer sorts required) (r7011):
+// heap 0.36s ma:12.3s (34.1x, -----)
+// tinycc 0.46s ma: 4.8s (10.3x, -----)
+// many-xpts 0.09s ma: 2.0s (22.3x, -----)
+// konqueror 0:42 real 0:34 user
//
//
// Todo:
@@ -617,13 +623,13 @@
}
// Reverse comparison for a reverse sort -- biggest to smallest.
-static Int XPt_revcmp_szB(void* n1, void* n2)
+static Int SXPt_revcmp_szB(void* n1, void* n2)
{
- XPt* xpt1 = *(XPt**)n1;
- XPt* xpt2 = *(XPt**)n2;
- return ( xpt1->szB < xpt2->szB ? 1
- : xpt1->szB > xpt2->szB ? -1
- : 0);
+ SXPt* sxpt1 = *(SXPt**)n1;
+ SXPt* sxpt2 = *(SXPt**)n2;
+ return ( sxpt1->szB < sxpt2->szB ? 1
+ : sxpt1->szB > sxpt2->szB ? -1
+ : 0);
}
// Does the xpt account for >= 1% (or so) of total memory used?
@@ -652,9 +658,6 @@
SizeT insig_children_szB;
SXPt* sxpt;
- // Sort XPt's children by szB (reverse order: biggest to smallest).
- VG_(ssort)(xpt->children, xpt->n_children, sizeof(XPt*), XPt_revcmp_szB);
-
// Number of XPt children Action for SXPT
// ------------------ ---------------
// 0 sig, 0 insig alloc 0 children
@@ -664,10 +667,10 @@
// How many children are significant? And do we need an aggregate SXPt?
n_sig_children = 0;
- while (n_sig_children < xpt->n_children &&
- is_significant_XPt(xpt->children[n_sig_children], total_szB))
- {
- n_sig_children++;
+ for (i = 0; i < xpt->n_children; i++) {
+ if (is_significant_XPt(xpt->children[i], total_szB)) {
+ n_sig_children++;
+ }
}
n_insig_children = xpt->n_children - n_sig_children;
n_child_sxpts = n_sig_children + ( n_insig_children > 0 ? 1 : 0 );
@@ -682,13 +685,17 @@
// Create the SXPt's children.
if (n_child_sxpts > 0) {
+ Int j;
SizeT sig_children_szB = 0;
sxpt->Sig.children = VG_(malloc)(n_child_sxpts * sizeof(SXPt*));
// Duplicate the significant children.
- for (i = 0; i < n_sig_children; i++) {
- sxpt->Sig.children[i] = dup_XTree(xpt->children[i], total_szB);
- sig_children_szB += sxpt->Sig.children[i]->szB;
+ j = 0;
+ for (i = 0; i < xpt->n_children; i++) {
+ if (is_significant_XPt(xpt->children[i], total_szB)) {
+ sxpt->Sig.children[j++] = dup_XTree(xpt->children[i], total_szB);
+ sig_children_szB += xpt->children[i]->szB;
+ }
}
// Create the SXPt for the insignificant children, if any, and put it
@@ -1795,7 +1802,7 @@
SizeT snapshot_heap_szB, SizeT snapshot_total_szB)
{
#define BUF_LEN 1024
- Int i;
+ Int i, n_insig_children_sxpts;
Char* perc;
Char ip_desc_array[BUF_LEN];
Char* ip_desc = ip_desc_array;
@@ -1835,20 +1842,24 @@
depth_str[depth+0] = ' ';
depth_str[depth+1] = '\0';
+ // Sort SXPt's children by szB (reverse order: biggest to smallest).
+ // Nb: we sort them here, rather than earlier (eg. in dup_XTree), for
+ // two reasons. First, if we do it during dup_XTree, it can get
+ // expensive (eg. 15% of execution time for konqueror
+ // startup/shutdown). Second, this way we get the Insig SXPt (if one
+ // is present) in its sorted position, not at the end.
+ VG_(ssort)(sxpt->Sig.children, sxpt->Sig.n_children, sizeof(SXPt*),
+ SXPt_revcmp_szB);
+
// Print the SXPt's children. They should already be in sorted order.
+ n_insig_children_sxpts = 0;
for (i = 0; i < sxpt->Sig.n_children; i++) {
pred = child;
child = sxpt->Sig.children[i];
- // Only the last child can be an Insig SXPt.
- if (i < sxpt->Sig.n_children-1)
- tl_assert(SigSXPt == child->tag);
+ if (InsigSXPt == child->tag)
+ n_insig_children_sxpts++;
- // Sortedness check: if this child is a normal SXPt, check it's not
- // bigger than its predecessor.
- if (pred && SigSXPt == child->tag)
- tl_assert(child->szB <= pred->szB);
-
// Ok, print the child.
pp_snapshot_SXPt(fd, child, depth+1, depth_str, depth_str_len,
snapshot_heap_szB, snapshot_total_szB);
@@ -1857,6 +1868,8 @@
depth_str[depth+0] = '\0';
depth_str[depth+1] = '\0';
}
+ // There should be 0 or 1 Insig children SXPts.
+ tl_assert(n_insig_children_sxpts <= 1);
break;
case InsigSXPt: {
Modified: branches/MASSIF2/massif/tests/Makefile.am
===================================================================
--- branches/MASSIF2/massif/tests/Makefile.am 2007-10-17 03:31:32 UTC (rev 7010)
+++ branches/MASSIF2/massif/tests/Makefile.am 2007-10-17 04:36:39 UTC (rev 7011)
@@ -8,6 +8,7 @@
alloc-fns-A.post.exp alloc-fns-A.stderr.exp alloc-fns-A.vgtest \
alloc-fns-B.post.exp alloc-fns-B.stderr.exp alloc-fns-B.vgtest \
basic.post.exp basic.stderr.exp basic.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 \
@@ -48,6 +49,7 @@
custom_alloc \
deep \
ignoring \
+ insig \
long-time \
null \
one \
Added: branches/MASSIF2/massif/tests/insig.c
===================================================================
--- branches/MASSIF2/massif/tests/insig.c (rev 0)
+++ branches/MASSIF2/massif/tests/insig.c 2007-10-17 04:36:39 UTC (rev 7011)
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+
+// In this test, the size of the insignificant nodes is greater than the
+// size of two of the significant nodes. This is quite common in big
+// programs, but not so common in small tests, so we test for it here.
+int main(void)
+{
+ malloc(1000);
+ malloc(15);
+ malloc(12);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+ malloc(1);
+
+
+ return 0;
+}
Added: branches/MASSIF2/massif/tests/insig.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/insig.post.exp (rev 0)
+++ branches/MASSIF2/massif/tests/insig.post.exp 2007-10-17 04:36:39 UTC (rev 7011)
@@ -0,0 +1,84 @@
+--------------------------------------------------------------------------------
+Command: ./insig
+Massif arguments: --stacks=no --time-unit=B
+ms_print arguments: massif.out
+--------------------------------------------------------------------------------
+
+
+ KB
+1.202^ .:
+ | ..:@::
+ | ..::::@::
+ | .:::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ | : ::::@::::@::
+ 0 +----------------------------------------------------------------@----@->KB
+ 0 1.202
+
+Number of snapshots: 24
+ Detailed snapshots: [9, 19]
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 0 0 0 0 0 0
+ 1 1,008 1,008 1,000 8 0
+ 2 1,031 1,031 1,015 16 0
+ 3 1,051 1,051 1,027 24 0
+ 4 1,060 1,060 1,028 32 0
+ 5 1,069 1,069 1,029 40 0
+ 6 1,078 1,078 1,030 48 0
+ 7 1,087 1,087 1,031 56 0
+ 8 1,096 1,096 1,032 64 0
+ 9 1,105 1,105 1,033 72 0
+93.48% (1033B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.50% (1000B) 0x80483A4: main (insig.c:8)
+|
+->01.36% (15B) 0x80483B1: main (insig.c:9)
+|
+->01.09% (12B) 0x80483BE: main (insig.c:10)
+|
+->00.54% (6B) in 1+ places, all below ms_print's threshold (01.00%)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 10 1,114 1,114 1,034 80 0
+ 11 1,123 1,123 1,035 88 0
+ 12 1,132 1,132 1,036 96 0
+ 13 1,141 1,141 1,037 104 0
+ 14 1,150 1,150 1,038 112 0
+ 15 1,159 1,159 1,039 120 0
+ 16 1,168 1,168 1,040 128 0
+ 17 1,177 1,177 1,041 136 0
+ 18 1,186 1,186 1,042 144 0
+ 19 1,195 1,195 1,043 152 0
+87.28% (1043B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->83.68% (1000B) 0x80483A4: main (insig.c:8)
+|
+->01.34% (16B) in 16 places, all below massif's threshold (01.00%)
+|
+->01.26% (15B) 0x80483B1: main (insig.c:9)
+|
+->01.00% (12B) 0x80483BE: main (insig.c:10)
+
+--------------------------------------------------------------------------------
+ n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
+--------------------------------------------------------------------------------
+ 20 1,204 1,204 1,044 160 0
+ 21 1,213 1,213 1,045 168 0
+ 22 1,222 1,222 1,046 176 0
+ 23 1,231 1,231 1,047 184 0
Added: branches/MASSIF2/massif/tests/insig.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/insig.stderr.exp (rev 0)
+++ branches/MASSIF2/massif/tests/insig.stderr.exp 2007-10-17 04:36:39 UTC (rev 7011)
@@ -0,0 +1,2 @@
+
+
Added: branches/MASSIF2/massif/tests/insig.vgtest
===================================================================
--- branches/MASSIF2/massif/tests/insig.vgtest (rev 0)
+++ branches/MASSIF2/massif/tests/insig.vgtest 2007-10-17 04:36:39 UTC (rev 7011)
@@ -0,0 +1,4 @@
+prog: insig
+vgopts: --stacks=no --time-unit=B
+post: perl ../../massif/ms_print massif.out
+cleanup: rm massif.out
Modified: branches/MASSIF2/massif/tests/realloc.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/realloc.post.exp 2007-10-17 03:31:32 UTC (rev 7010)
+++ branches/MASSIF2/massif/tests/realloc.post.exp 2007-10-17 04:36:39 UTC (rev 7011)
@@ -52,10 +52,10 @@
100.00% (150B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->100.00% (150B) 0x80483E3: main (realloc.c:12)
|
+->00.00% (0B) 0x80483A7: main (realloc.c:5)
+|
->00.00% (0B) 0x80483BA: main (realloc.c:8)
|
-->00.00% (0B) 0x80483A7: main (realloc.c:5)
-|
->00.00% (0B) 0x80483CD: main (realloc.c:10)
--------------------------------------------------------------------------------
|
|
From: <sv...@va...> - 2007-10-17 03:31:32
|
Author: njn
Date: 2007-10-17 04:31:32 +0100 (Wed, 17 Oct 2007)
New Revision: 7010
Log:
Moved main-or-below-main filtering to the end, avoiding *many* calls to
VG_(get_fnname). This reduced konqueror startup time from 3.5 minutes to 36
seconds.
Modified:
branches/MASSIF2/massif/ms_main.c
branches/MASSIF2/massif/tests/culling1.stderr.exp
branches/MASSIF2/massif/tests/culling2.stderr.exp
branches/MASSIF2/massif/tests/deep-B.stderr.exp
branches/MASSIF2/massif/tests/deep-C.stderr.exp
branches/MASSIF2/massif/tests/deep-D.post.exp
branches/MASSIF2/massif/tests/deep.c
branches/MASSIF2/massif/tests/realloc.stderr.exp
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-17 03:31:32 UTC (rev 7010)
@@ -73,7 +73,15 @@
// many-xpts 0.05s ma: 1.6s (33.0x, -----)
// konqueror 3:45 real 3:35 user
//
+// Moved main-or-below-main filtering to the end, avoiding *many* calls to
+// VG_(get_fnname):
+// heap 0.62s ma:12.4s (20.0x, -----)
+// tinycc 0.45s ma: 5.1s (11.4x, -----)
+// many-xpts 0.09s ma: 2.1s (23.8x, -----)
+// konqueror 0:46 real 0:36 user
//
+//
+//
// Todo:
// - for regtests, need to filter out code addresses in *.post.* files
// - do snapshots on client requests
@@ -809,79 +817,43 @@
Char buf[BUF_LEN];
Int n_ips, i, n_alloc_fns_removed;
Int overestimate;
- Bool fewer_IPs_than_asked_for = False;
- Bool removed_below_main = False;
- Bool enough_IPs_after_filtering = False;
+ Bool redo;
- // XXX: get this properly
- Bool should_hide_below_main = /*!VG_(clo_show_below_main)*/True;
-
// We ask for a few more IPs than clo_depth suggests we need. Then we
- // remove every entry that is an alloc-fn or above an alloc-fn, and
- // remove anything below main-or-below-main functions. Depending on the
+ // remove every entry that is an alloc-fn. Depending on the
// circumstances, we may need to redo it all, asking for more IPs.
// Details:
- // - If the original stack trace is smaller than asked-for, redo=False
- // - Else if we see main-or-below-main in the stack trace, redo=False
- // - Else if after filtering we have more than clo_depth IPs, redo=False
+ // - If the original stack trace is smaller than asked-for, redo=False
+ // - Else if after filtering we have >= clo_depth IPs, redo=False
// - Else redo=True
// In other words, to redo, we'd have to get a stack trace as big as we
- // asked for, remove more than 'overestimate' alloc-fns, and not hit
- // main-or-below-main.
- //
- // Nb: it's possible that an alloc-fn may be found in the overestimate
- // portion, in which case the trace will be shrunk, even though it
- // arguably shouldn't. But it would require a very large chain of
- // alloc-fns, and the best behaviour isn't all that clear, so we don't
- // worry about it.
+ // asked for and remove more than 'overestimate' alloc-fns.
- // Main loop
- for (overestimate = 3; True; overestimate += 6) {
+ // Main loop.
+ redo = True; // Assume this to begin with.
+ for (overestimate = 3; redo; overestimate += 6) {
// This should never happen -- would require MAX_OVERESTIMATE
// alloc-fns to be removed from the stack trace.
if (overestimate > MAX_OVERESTIMATE)
VG_(tool_panic)("get_IPs: ips[] too small, inc. MAX_OVERESTIMATE?");
- // Ask for some more IPs than clo_depth suggests we need.
+ // Ask for more IPs than clo_depth suggests we need.
n_ips = VG_(get_StackTrace)( tid, ips, clo_depth + overestimate );
tl_assert(n_ips > 0);
- // If we got fewer IPs than we asked for, redo=False
- if (n_ips < clo_depth + overestimate) {
- fewer_IPs_than_asked_for = True;
- }
+ // If the original stack trace is smaller than asked-for, redo=False.
+ if (n_ips < clo_depth + overestimate) { redo = False; }
- // Filter out entries that are below main, if necessary.
- // XXX: stats -- should record how often this happens.
- // XXX: look at the "(below main)"/"__libc_start_main" mess
- // (m_stacktrace.c and m_demangle.c). Don't hard-code "(below
- // main)" in here.
- // [Nb: Josef wants --show-below-main to work for his fn entry/exit
- // tracing]
- if (should_hide_below_main) {
- for (i = n_ips-1; i >= 0; i--) {
- if (VG_(get_fnname)(ips[i], buf, BUF_LEN)) {
- if (VG_STREQ(buf, "main")) {
- // We found main. Ignore everything below it, and stop
- // looking. redo=False.
- n_ips = i+1;
- removed_below_main = True;
- break;
- } else if (VG_STREQ(buf, "(below main)")) {
- // We found "(below main)". Ignore everything below it,
- // but keep looking. redo=False.
- n_ips = i+1;
- removed_below_main = True;
- }
- }
- }
- }
+ // If it's a non-custom block, we will always remove the first stack
+ // trace entry (which will be one of malloc, __builtin_new, etc).
+ n_alloc_fns_removed = ( is_custom_alloc ? 0 : 1 );
- // Filter out alloc fns.
- n_alloc_fns_removed = 0;
- for (i = 0; i < n_ips; i++) {
+ // Filter out alloc fns. If it's a non-custom block, we remove the
+ // first entry (which will be one of malloc, __builtin_new, etc)
+ // without looking at it, because VG_(get_fnname) is expensive (it
+ // involves calls to VG_(malloc)/VG_(free)).
+ for (i = n_alloc_fns_removed; i < n_ips; i++) {
if (VG_(get_fnname)(ips[i], buf, BUF_LEN)) {
- // If it's an alloc-fn, we ignore it.
if (is_alloc_fn(buf)) {
n_alloc_fns_removed++;
} else {
@@ -889,44 +861,23 @@
}
}
}
-
- // There must be at least one alloc function, unless the client used
- // MALLOCLIKE_BLOCK.
- if (!is_custom_alloc) {
- if (n_alloc_fns_removed <= 0) {
- // Hmm. Print out the stack trace before aborting.
- for (i = 0; i < n_ips; i++) {
- if (VG_(get_fnname)(ips[i], buf, BUF_LEN)) {
- VG_(message)(Vg_DebugMsg, "--> %s", buf);
- } else {
- VG_(message)(Vg_DebugMsg, "--> ???", buf);
- }
- }
- tl_assert2(0, "Didn't find any alloc functions in the stack trace");
- }
- }
-
- // Ignore the alloc fns; shuffle the rest down.
+ // Remove the alloc fns by shuffling the rest down over them.
n_ips -= n_alloc_fns_removed;
for (i = 0; i < n_ips; i++) {
ips[i] = ips[i + n_alloc_fns_removed];
}
- // Did we get enough IPs after filtering? If so, redo=False.
+ // If after filtering we have >= clo_depth IPs, redo=False
if (n_ips >= clo_depth) {
+ redo = False;
n_ips = clo_depth; // Ignore any IPs below --depth.
- enough_IPs_after_filtering = True;
}
- if (fewer_IPs_than_asked_for ||
- removed_below_main ||
- enough_IPs_after_filtering)
- {
- return n_ips;
- } else {
+ if (redo) {
n_XCon_redos++;
}
}
+ return n_ips;
}
// Gets an XCon and puts it in the tree. Returns the XCon's bottom-XPt.
@@ -1814,14 +1765,14 @@
// XXX: do the filename properly, eventually
static Char* massif_out_file = "massif.out";
-#define BUF_SIZE 1024
-Char buf[1024];
+#define FP_BUF_SIZE 1024
+Char FP_buf[FP_BUF_SIZE];
// XXX: implement f{,n}printf in m_libcprint.c eventually, and use it here.
// Then change Cachegrind to use it too.
#define FP(format, args...) ({ \
- VG_(snprintf)(buf, BUF_SIZE, format, ##args); \
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf)); \
+ VG_(snprintf)(FP_buf, FP_BUF_SIZE, format, ##args); \
+ VG_(write)(fd, (void*)FP_buf, VG_(strlen)(FP_buf)); \
})
// Nb: uses a static buffer, each call trashes the last string returned.
@@ -1858,6 +1809,20 @@
ip_desc =
"(heap allocation functions) malloc/new/new[], --alloc-fns, etc.";
} else {
+ // If it's main-or-below-main, we (if appropriate) ignore everything
+ // below it by pretending it has no children.
+ // XXX: get this properly. Also, don't hard-code "(below main)"
+ // here -- look at the "(below main)"/"__libc_start_main" mess
+ // (m_stacktrace.c and m_demangle.c).
+ // [Nb: Josef wants --show-below-main to work for his fn entry/exit
+ // tracing]
+ Bool should_hide_below_main = /*!VG_(clo_show_below_main)*/True;
+ if (should_hide_below_main &&
+ VG_(get_fnname)(sxpt->Sig.ip, ip_desc, BUF_LEN) &&
+ (VG_STREQ(ip_desc, "main") || VG_STREQ(ip_desc, "(below main)")))
+ {
+ sxpt->Sig.n_children = 0;
+ }
// XXX: why the -1?
ip_desc = VG_(describe_IP)(sxpt->Sig.ip-1, ip_desc, BUF_LEN);
}
Modified: branches/MASSIF2/massif/tests/culling1.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/culling1.stderr.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/culling1.stderr.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -424,12 +424,12 @@
Massif: heap frees: 0
Massif: stack allocs: 0
Massif: stack frees: 0
-Massif: XPts: 2
-Massif: top-XPts: 1 (50%)
-Massif: XPt-init-expansions: 1
+Massif: XPts: 4
+Massif: top-XPts: 1 (25%)
+Massif: XPt-init-expansions: 3
Massif: XPt-later-expansions: 0
-Massif: SXPt allocs: 30
-Massif: SXPt frees: 18
+Massif: SXPt allocs: 60
+Massif: SXPt frees: 36
Massif: skipped snapshots: 51
Massif: real snapshots: 150
Massif: detailed snapshots: 15
Modified: branches/MASSIF2/massif/tests/culling2.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/culling2.stderr.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/culling2.stderr.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -527,12 +527,12 @@
Massif: heap frees: 0
Massif: stack allocs: 0
Massif: stack frees: 0
-Massif: XPts: 2
-Massif: top-XPts: 1 (50%)
-Massif: XPt-init-expansions: 1
+Massif: XPts: 4
+Massif: top-XPts: 1 (25%)
+Massif: XPt-init-expansions: 3
Massif: XPt-later-expansions: 0
-Massif: SXPt allocs: 40
-Massif: SXPt frees: 38
+Massif: SXPt allocs: 80
+Massif: SXPt frees: 76
Massif: skipped snapshots: 1
Massif: real snapshots: 200
Massif: detailed snapshots: 20
Modified: branches/MASSIF2/massif/tests/deep-B.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/deep-B.stderr.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/deep-B.stderr.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -36,11 +36,11 @@
Massif: heap frees: 0
Massif: stack allocs: 0
Massif: stack frees: 0
-Massif: XPts: 7
-Massif: top-XPts: 1 (14%)
-Massif: XPt-init-expansions: 6
+Massif: XPts: 9
+Massif: top-XPts: 1 (11%)
+Massif: XPt-init-expansions: 8
Massif: XPt-later-expansions: 0
-Massif: SXPt allocs: 7
+Massif: SXPt allocs: 9
Massif: SXPt frees: 0
Massif: skipped snapshots: 0
Massif: real snapshots: 11
Modified: branches/MASSIF2/massif/tests/deep-C.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/deep-C.stderr.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/deep-C.stderr.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -39,11 +39,11 @@
Massif: heap frees: 0
Massif: stack allocs: 0
Massif: stack frees: 0
-Massif: XPts: 4
-Massif: top-XPts: 1 (25%)
-Massif: XPt-init-expansions: 3
+Massif: XPts: 6
+Massif: top-XPts: 1 (16%)
+Massif: XPt-init-expansions: 5
Massif: XPt-later-expansions: 0
-Massif: SXPt allocs: 4
+Massif: SXPt allocs: 6
Massif: SXPt frees: 0
Massif: skipped snapshots: 0
Massif: real snapshots: 11
Modified: branches/MASSIF2/massif/tests/deep-D.post.exp
===================================================================
--- branches/MASSIF2/massif/tests/deep-D.post.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/deep-D.post.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -45,7 +45,8 @@
8 864 864 800 64 0
9 972 972 900 72 0
92.59% (900B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-
+->92.59% (900B) 0x26ED5E: (below main) (in /lib/libc-2.3.5.so)
+
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) admin-heap(B) stacks(B)
--------------------------------------------------------------------------------
Modified: branches/MASSIF2/massif/tests/deep.c
===================================================================
--- branches/MASSIF2/massif/tests/deep.c 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/deep.c 2007-10-17 03:31:32 UTC (rev 7010)
@@ -8,8 +8,8 @@
// - In deep-C.vgtest, we have --alloc-fn=a3..a12, which means that get_XCon
// ends up with an empty stack trace after removing all the alloc-fns.
// It then redoes it.
-// - In deep-D.vgtest, we have --alloc-fn=main..a12, which means we have an empty
-// stack trace. That's ok.
+// - In deep-D.vgtest, we have --alloc-fn=main..a12, which means we have a
+// stack trace with a single "(below main)" entry.
#include <stdlib.h>
Modified: branches/MASSIF2/massif/tests/realloc.stderr.exp
===================================================================
--- branches/MASSIF2/massif/tests/realloc.stderr.exp 2007-10-16 23:18:06 UTC (rev 7009)
+++ branches/MASSIF2/massif/tests/realloc.stderr.exp 2007-10-17 03:31:32 UTC (rev 7010)
@@ -26,11 +26,11 @@
Massif: heap frees: 1
Massif: stack allocs: 0
Massif: stack frees: 0
-Massif: XPts: 5
-Massif: top-XPts: 4 (80%)
-Massif: XPt-init-expansions: 1
+Massif: XPts: 13
+Massif: top-XPts: 4 (30%)
+Massif: XPt-init-expansions: 9
Massif: XPt-later-expansions: 0
-Massif: SXPt allocs: 8
+Massif: SXPt allocs: 20
Massif: SXPt frees: 0
Massif: skipped snapshots: 0
Massif: real snapshots: 8
|
|
From: Tom H. <th...@cy...> - 2007-10-17 02:31:43
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-10-17 03:15:02 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 260 tests, 27 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 260 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Oct 17 03:25:17 2007 --- new.short Wed Oct 17 03:31:46 2007 *************** *** 8,10 **** ! == 260 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) --- 8,10 ---- ! == 260 tests, 27 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/addressable (stderr) *************** *** 23,24 **** --- 23,25 ---- memcheck/tests/leak-tree (stderr) + memcheck/tests/leakotron (stdout) memcheck/tests/long_namespace_xml (stderr) |
|
From: Tom H. <th...@cy...> - 2007-10-17 02:23:52
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-10-17 03:05:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-17 02:23:29
|
Nightly build on dellow ( x86_64, Fedora 7 ) started at 2007-10-17 03:10:04 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Oct 17 03:16:53 2007 --- new.short Wed Oct 17 03:23:33 2007 *************** *** 8,10 **** ! == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 293 tests, 4 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) *************** *** 15,16 **** --- 15,17 ---- none/tests/mremap2 (stdout) + none/tests/pth_detached (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-17 02:18:50
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-10-17 03:00:02 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 295 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <js...@ac...> - 2007-10-17 00:17:18
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-10-17 02:00:01 CEST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 228 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 228 tests, 6 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/res_search (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Oct 17 02:08:56 2007 --- new.short Wed Oct 17 02:17:09 2007 *************** *** 8,10 **** ! == 228 tests, 6 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) --- 8,10 ---- ! == 228 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) *************** *** 17,19 **** none/tests/mremap2 (stdout) - none/tests/res_search (stdout) --- 17,18 ---- |