Home | History | Annotate | Download | only in massif

Lines Matching refs:SXPt

537 // XXX: make XPt and SXPt extensible arrays, to avoid having to do two
567 typedef struct _SXPt SXPt;
572 // An SXPt representing a single significant code location. Much like
577 SXPt** children;
581 // An SXPt representing one or more code locations, all below the
665 SXPt* sxpt1 = *(SXPt**)n1;
666 SXPt* sxpt2 = *(SXPt**)n2;
677 static SXPt* dup_XTree(XPt* xpt, SizeT total_szB)
681 SXPt* sxpt;
683 // Number of XPt children Action for SXPT
704 // How many children are significant? And do we need an aggregate SXPt?
715 sxpt = VG_(malloc)("ms.main.dX.1", sizeof(SXPt));
717 sxpt->tag = SigSXPt;
718 sxpt->szB = xpt->szB;
719 sxpt->Sig.ip = xpt->ip;
720 sxpt->Sig.n_children = n_child_sxpts;
722 // Create the SXPt's children.
726 sxpt->Sig.children = VG_(malloc)("ms.main.dX.2",
727 n_child_sxpts * sizeof(SXPt*));
734 sxpt->Sig.children[j++] = dup_XTree(xpt->children[i], total_szB);
741 // Create the SXPt for the insignificant children, if any, and put it
744 // Nb: We 'n_sxpt_allocs' here because creating an Insig SXPt
746 SXPt* insig_sxpt = VG_(malloc)("ms.main.dX.3", sizeof(SXPt));
751 sxpt->Sig.children[n_sig_children] = insig_sxpt;
754 sxpt->Sig.children = NULL;
757 return sxpt;
760 static void free_SXTree(SXPt* sxpt)
763 tl_assert(sxpt != NULL);
765 switch (sxpt->tag) {
768 for (i = 0; i < sxpt->Sig.n_children; i++) {
769 free_SXTree(sxpt->Sig.children[i]);
770 sxpt->Sig.children[i] = NULL;
772 VG_(free)(sxpt->Sig.children); sxpt->Sig.children = NULL;
778 default: tl_assert2(0, "free_SXTree: unknown SXPt tag");
781 // Free the SXPt itself.
782 VG_(free)(sxpt); sxpt = NULL;
806 static void sanity_check_SXTree(SXPt* sxpt)
810 tl_assert(sxpt != NULL);
812 // Check the sum of any children szBs equals the SXPt's szB. Check the
814 switch (sxpt->tag) {
816 if (sxpt->Sig.n_children > 0) {
817 for (i = 0; i < sxpt->Sig.n_children; i++) {
818 sanity_check_SXTree(sxpt->Sig.children[i]);
826 default: tl_assert2(0, "sanity_check_SXTree: unknown SXPt tag");
1063 SXPt* alloc_sxpt; // Heap XTree root, if a detailed snapshot,
1139 SXPt* tmp_sxpt = snapshot->alloc_sxpt;
2163 static void pp_snapshot_SXPt(Int fd, SXPt* sxpt, Int depth, Char* depth_str,
2168 SXPt* child = NULL;
2176 switch (sxpt->tag) {
2178 // Print the SXPt itself.
2193 Vg_FnNameKind kind = VG_(get_fnname_kind_from_IP)(sxpt->Sig.ip);
2195 sxpt->Sig.n_children = 0;
2200 ip_desc = VG_(describe_IP)(sxpt->Sig.ip-1, ip_desc, BUF_LEN);
2204 FP("%sn%d: %lu ", depth_str, sxpt->Sig.n_children, sxpt->szB);
2246 // Sort SXPt's children by szB (reverse order: biggest to smallest).
2250 // startup/shutdown). Second, this way we get the Insig SXPt (if one
2252 VG_(ssort)(sxpt->Sig.children, sxpt->Sig.n_children, sizeof(SXPt*),
2255 // Print the SXPt's children. They should already be in sorted order.
2257 for (i = 0; i < sxpt->Sig.n_children; i++) {
2258 child = sxpt->Sig.children[i];
2279 Char* s = ( 1 == sxpt->Insig.n_xpts ? "," : "s, all" );
2281 depth_str, sxpt->szB, sxpt->Insig.n_xpts, s,
2287 tl_assert2(0, "pp_snapshot_SXPt: unrecognised SXPt tag");
2464 STATS("SXPt allocs: %u\n", n_sxpt_allocs);
2465 STATS("SXPt frees: %u\n", n_sxpt_frees);