|
From: <sv...@va...> - 2008-09-06 18:57:09
|
Author: sewardj
Date: 2008-09-06 19:57:19 +0100 (Sat, 06 Sep 2008)
New Revision: 8568
Log:
Add cost-center annotations to all allocation points in Massif.
Modified:
branches/YARD/massif/ms_main.c
Modified: branches/YARD/massif/ms_main.c
===================================================================
--- branches/YARD/massif/ms_main.c 2008-09-06 18:55:41 UTC (rev 8567)
+++ branches/YARD/massif/ms_main.c 2008-09-06 18:57:19 UTC (rev 8568)
@@ -292,7 +292,8 @@
static void init_alloc_fns(void)
{
// Create the list, and add the default elements.
- alloc_fns = VG_(newXA)(VG_(malloc), VG_(free), sizeof(Char*));
+ alloc_fns = VG_(newXA)(VG_(malloc), "ms.main.iaf.1",
+ VG_(free), sizeof(Char*));
#define DO(x) { Char* s = x; VG_(addToXA)(alloc_fns, &s); }
// Ordered according to (presumed) frequency.
@@ -583,11 +584,13 @@
if (parent->n_children == parent->max_children) {
if (parent->max_children == 0) {
parent->max_children = 4;
- parent->children = VG_(malloc)( parent->max_children * sizeof(XPt*) );
+ parent->children = VG_(malloc)( "ms.main.acx.1",
+ parent->max_children * sizeof(XPt*) );
n_xpt_init_expansions++;
} else {
parent->max_children *= 2; // Double size
- parent->children = VG_(realloc)( parent->children,
+ parent->children = VG_(realloc)( "ms.main.acx.2",
+ parent->children,
parent->max_children * sizeof(XPt*) );
n_xpt_later_expansions++;
}
@@ -650,7 +653,7 @@
n_child_sxpts = n_sig_children + ( n_insig_children > 0 ? 1 : 0 );
// Duplicate the XPt.
- sxpt = VG_(malloc)(sizeof(SXPt));
+ sxpt = VG_(malloc)("ms.main.dX.1", sizeof(SXPt));
n_sxpt_allocs++;
sxpt->tag = SigSXPt;
sxpt->szB = xpt->szB;
@@ -661,7 +664,8 @@
if (n_child_sxpts > 0) {
Int j;
SizeT sig_children_szB = 0, insig_children_szB = 0;
- sxpt->Sig.children = VG_(malloc)(n_child_sxpts * sizeof(SXPt*));
+ sxpt->Sig.children = VG_(malloc)("ms.main.dX.2",
+ n_child_sxpts * sizeof(SXPt*));
// Duplicate the significant children. (Nb: sig_children_szB +
// insig_children_szB doesn't necessarily equal xpt->szB.)
@@ -680,7 +684,7 @@
if (n_insig_children > 0) {
// Nb: We 'n_sxpt_allocs' here because creating an Insig SXPt
// doesn't involve a call to dup_XTree().
- SXPt* insig_sxpt = VG_(malloc)(sizeof(SXPt));
+ SXPt* insig_sxpt = VG_(malloc)("ms.main.dX.3", sizeof(SXPt));
n_sxpt_allocs++;
insig_sxpt->tag = InsigSXPt;
insig_sxpt->szB = insig_children_szB;
@@ -1478,7 +1482,7 @@
}
// Make new HP_Chunk node, add to malloc_list
- hc = VG_(malloc)(sizeof(HP_Chunk));
+ hc = VG_(malloc)("ms.main.nb.1", sizeof(HP_Chunk));
hc->req_szB = req_szB;
hc->slop_szB = slop_szB;
hc->data = (Addr)p;
@@ -2016,7 +2020,8 @@
if (is_detailed_snapshot(snapshot)) {
// Detailed snapshot -- print heap tree.
Int depth_str_len = clo_depth + 3;
- Char* depth_str = VG_(malloc)(sizeof(Char) * depth_str_len);
+ Char* depth_str = VG_(malloc)("ms.main.pps.1",
+ sizeof(Char) * depth_str_len);
SizeT snapshot_total_szB =
snapshot->heap_szB + snapshot->heap_extra_szB + snapshot->stacks_szB;
depth_str[0] = '\0'; // Initialise depth_str to "".
@@ -2184,7 +2189,8 @@
}
// Initialise snapshot array, and sanity-check it.
- snapshots = VG_(malloc)(sizeof(Snapshot) * clo_max_snapshots);
+ snapshots = VG_(malloc)("ms.main.mpoci.1",
+ sizeof(Snapshot) * clo_max_snapshots);
// We don't want to do snapshot sanity checks here, because they're
// currently uninitialised.
for (i = 0; i < clo_max_snapshots; i++) {
@@ -2236,7 +2242,8 @@
init_alloc_fns();
// Initialise args_for_massif.
- args_for_massif = VG_(newXA)(VG_(malloc), VG_(free), sizeof(HChar*));
+ args_for_massif = VG_(newXA)(VG_(malloc), "ms.main.mprci.1",
+ VG_(free), sizeof(HChar*));
}
VG_DETERMINE_INTERFACE_VERSION(ms_pre_clo_init)
|