summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-04-22 11:30:38 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 18:57:42 -0400
commit94238295fcc7accae431d1a85bfb0dd4fa3c50ee (patch)
tree981c9d70126e01afa57747b4f963875edd55a18e
parent00fc14500b34c99e19e6012ba04164fdbe64ef3e (diff)
downloadhaskell-94238295fcc7accae431d1a85bfb0dd4fa3c50ee.tar.gz
XXX: Indirection counting
-rw-r--r--rts/Stats.c4
-rw-r--r--rts/StgMiscClosures.cmm4
2 files changed, 8 insertions, 0 deletions
diff --git a/rts/Stats.c b/rts/Stats.c
index 41427d0430..14556e64be 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -492,6 +492,8 @@ stat_endGC (Capability *cap, gc_thread *gct, W_ live, W_ copied, W_ slop,
}
}
+StgWord ben_IND=0;
+
/* -----------------------------------------------------------------------------
Called at the beginning of each Retainer Profiliing
-------------------------------------------------------------------------- */
@@ -657,6 +659,8 @@ static void free_RTSSummaryStats(RTSSummaryStats * sum)
static void report_summary(const RTSSummaryStats* sum)
{
+ statsPrintf("ben_IND %lu\n", ben_IND);
+
// We should do no calculation, other than unit changes and formatting, and
// we should not not use any data from outside of globals, sum and stats
// here. See Note [RTS Stats Reporting]
diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm
index 03ea91fcb6..e9c0aa68f3 100644
--- a/rts/StgMiscClosures.cmm
+++ b/rts/StgMiscClosures.cmm
@@ -244,6 +244,7 @@ INFO_TABLE(stg_IND,1,0,IND,"IND","IND")
TICK_ENT_DYN_IND(); /* tick */
node = UNTAG(StgInd_indirectee(node));
TICK_ENT_VIA_NODE();
+ W_[ben_IND] = W_[ben_IND] + 1;
jump %GET_ENTRY(node) (node);
}
#else
@@ -252,6 +253,7 @@ INFO_TABLE(stg_IND,1,0,IND,"IND","IND")
TICK_ENT_DYN_IND(); /* tick */
R1 = UNTAG(StgInd_indirectee(R1));
TICK_ENT_VIA_NODE();
+ W_[ben_IND] = W_[ben_IND] + 1;
jump %GET_ENTRY(R1) [R1];
}
#endif
@@ -262,6 +264,7 @@ INFO_TABLE(stg_IND_direct,1,0,IND,"IND","IND")
TICK_ENT_DYN_IND(); /* tick */
node = StgInd_indirectee(node);
TICK_ENT_VIA_NODE();
+ W_[ben_IND] = W_[ben_IND] + 1;
jump %ENTRY_CODE(Sp(0)) (node);
}
@@ -290,6 +293,7 @@ INFO_TABLE(stg_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE")
P_ p, bq, msg;
TICK_ENT_DYN_IND(); /* tick */
+ W_[ben_IND] = W_[ben_IND] + 1;
retry:
prim_read_barrier;