1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-20 19:42:53 -08:00

Add time series for fraction of generations condemned in chain.

Copied from Perforce
 Change: 194541
This commit is contained in:
Gareth Rees 2018-07-09 16:56:16 +01:00
parent 23cb9aa226
commit 91efa65199
4 changed files with 39 additions and 10 deletions

View file

@ -36,7 +36,7 @@
*/
#define EVENT_VERSION_MAJOR ((unsigned)2)
#define EVENT_VERSION_MEDIAN ((unsigned)0)
#define EVENT_VERSION_MEDIAN ((unsigned)1)
#define EVENT_VERSION_MINOR ((unsigned)0)
@ -67,7 +67,7 @@
*/
#define EventNameMAX ((size_t)19)
#define EventCodeMAX ((EventCode)0x008E)
#define EventCodeMAX ((EventCode)0x008F)
#define EVENT_LIST(EVENT, X) \
/* 0123456789012345678 <- don't exceed without changing EventNameMAX */ \
@ -200,7 +200,8 @@
EVENT(X, ArenaPollEnd , 0x008B, TRUE, Arena) \
EVENT(X, SegSetSummary , 0x008C, TRUE, Seg) \
EVENT(X, GenInit , 0x008D, TRUE, Arena) \
EVENT(X, GenFinish , 0x008E, TRUE, Arena)
EVENT(X, GenFinish , 0x008E, TRUE, Arena) \
EVENT(X, TraceCondemnAll , 0x008F, TRUE, Trace)
/* Remember to update EventNameMAX and EventCodeMAX above!
@ -335,7 +336,8 @@
PARAM(X, 1, W, stringId) /* string identifier of its label */
#define EVENT_TraceDestroy_PARAMS(PARAM, X) \
PARAM(X, 0, P, trace)
PARAM(X, 0, P, arena) /* arena owning trace */ \
PARAM(X, 1, P, trace) /* the trace */
#define EVENT_SegSetGrey_PARAMS(PARAM, X) \
PARAM(X, 0, P, arena) \
@ -609,9 +611,11 @@
#define EVENT_MessagesExist_PARAMS(PARAM, X)
#define EVENT_ChainCondemnAuto_PARAMS(PARAM, X) \
PARAM(X, 0, P, chain) /* chain with gens being condemned */ \
PARAM(X, 1, W, topCondemnedGenIndex) /* condemned gens [0..this] */ \
PARAM(X, 2, W, genCount) /* total gens in chain */
PARAM(X, 0, P, arena) /* arena owning chain */ \
PARAM(X, 1, P, chain) /* chain with gens being condemned */ \
PARAM(X, 2, W, ti) /* index of trace for which gens condemned */ \
PARAM(X, 3, W, topCondemnedGenIndex) /* condemned gens [0..this] */ \
PARAM(X, 4, W, genCount) /* total gens in chain */
#define EVENT_TraceFindGrey_PARAMS(PARAM, X) \
PARAM(X, 0, P, arena) \
@ -747,6 +751,10 @@
PARAM(X, 1, P, gen) /* the generation */ \
PARAM(X, 2, U, serial) /* serial number within arena */
#define EVENT_TraceCondemnAll_PARAMS(PARAM, X) \
PARAM(X, 0, P, arena) /* arena owning trace */ \
PARAM(X, 1, W, ti) /* index of trace */
#endif /* eventdef_h */
/* C. COPYRIGHT AND LICENSE

View file

@ -217,6 +217,7 @@ static Res policyCondemnChain(double *mortalityReturn, Chain chain, Trace trace)
AVERT(Chain, chain);
AVERT(Trace, trace);
AVER(chain->arena == trace->arena);
/* Find the highest generation that's over capacity. We will condemn
* this and all lower generations in the chain. */
@ -257,7 +258,8 @@ static Res policyCondemnChain(double *mortalityReturn, Chain chain, Trace trace)
}
TraceCondemnEnd(trace);
EVENT3(ChainCondemnAuto, chain, topCondemnedGen, chain->genCount);
EVENT5(ChainCondemnAuto, chain->arena, chain, trace->ti, topCondemnedGen,
chain->genCount);
*mortalityReturn = 1.0 - (double)survivorSize / condemnedSize;
return ResOK;

View file

@ -756,7 +756,7 @@ static void traceDestroyCommon(Trace trace)
* manually allocated objects that were freed). See job003999. */
ArenaCompact(trace->arena, trace);
EVENT1(TraceDestroy, trace);
EVENT2(TraceDestroy, trace->arena, trace);
/* Hopefully the trace reclaimed some memory, so clear any emergency.
* Do this before removing the trace from busyTraces, to avoid
@ -1511,6 +1511,8 @@ static Res traceCondemnAll(Trace trace)
if (TraceIsEmpty(trace))
return ResFAIL;
EVENT2(TraceCondemnAll, arena, trace->ti);
return ResOK;
failBegin:

View file

@ -351,6 +351,10 @@ class Arena(EventHandler):
self.model.add_time_series(
self, self._univ_ref_size, "bytes", "zone-univ.ref",
"size of segments referencing the universe")
self._condemned_gens = TimeSeries()
self.model.add_time_series(
self, self._condemned_gens, "fraction", "condemned.gens",
"proportion of chain condemned by trace")
@property
def name(self):
@ -422,6 +426,16 @@ class Arena(EventHandler):
def ArenaPollEnd(self, t, event):
self._poll.off(t)
def ChainCondemnAuto(self, t, event):
f = event.topCondemnedGenIndex / (event.genCount + 1)
self._condemned_gens.append(t, f)
def TraceCondemnAll(self, t, event):
self._condemned_gens.append(t, 1.0)
def TraceDestroy(self, t, event):
self._condemned_gens.append(t, 0.0)
def TraceStart(self, t, event):
for gen in self._gen.values():
gen.update_ref_size(t, self._seg_summary, self._seg_size)
@ -582,14 +596,17 @@ class Model(EventHandler):
ArenaFree = \
ArenaPollBegin = \
ArenaPollEnd = \
ChainCondemnAuto = \
GenInit = \
GenFinish = \
GenZoneSet = \
PoolFinish = \
PoolInit = \
SegSetSummary = \
TraceStart = \
TraceCondemnAll = \
TraceDestroy = \
TraceEndGen = \
TraceStart = \
delegate_to_arena
def EventClockSync(self, t, event):