mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695213 - Add total time to MOZ_GCTIMER output.
This commit is contained in:
parent
e9e02c73ec
commit
52c3cb2132
@ -77,15 +77,27 @@ Statistics::Statistics(JSRuntime *rt)
|
||||
}
|
||||
|
||||
PodArrayZero(counts);
|
||||
PodArrayZero(totals);
|
||||
|
||||
startupTime = PRMJ_Now();
|
||||
}
|
||||
|
||||
Statistics::~Statistics()
|
||||
{
|
||||
if (fp && fp != stdout && fp != stderr)
|
||||
if (fp) {
|
||||
if (fullFormat)
|
||||
fprintf(fp,
|
||||
"------>TOTAL "
|
||||
"%6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f\n",
|
||||
total(PHASE_GC), total(PHASE_MARK), total(PHASE_SWEEP),
|
||||
total(PHASE_SWEEP_OBJECT), total(PHASE_SWEEP_STRING),
|
||||
total(PHASE_SWEEP_SCRIPT), total(PHASE_SWEEP_SHAPE),
|
||||
total(PHASE_DESTROY));
|
||||
|
||||
if (fp != stdout && fp != stderr)
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
struct GCCrashData
|
||||
{
|
||||
@ -119,6 +131,12 @@ Statistics::t(Phase phase)
|
||||
return double(phaseTimes[phase]) / PRMJ_USEC_PER_MSEC;
|
||||
}
|
||||
|
||||
double
|
||||
Statistics::total(Phase phase)
|
||||
{
|
||||
return double(totals[phase]) / PRMJ_USEC_PER_MSEC;
|
||||
}
|
||||
|
||||
double
|
||||
Statistics::beginDelay(Phase phase1, Phase phase2)
|
||||
{
|
||||
@ -163,6 +181,9 @@ Statistics::endGC()
|
||||
endPhase(PHASE_GC);
|
||||
crash::SnapshotGCStack();
|
||||
|
||||
for (int i = 0; i < PHASE_LIMIT; i++)
|
||||
totals[i] += phaseTimes[i];
|
||||
|
||||
if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) {
|
||||
(*cb)(JS_TELEMETRY_GC_REASON, triggerReason);
|
||||
(*cb)(JS_TELEMETRY_GC_IS_COMPARTMENTAL, compartment ? 1 : 0);
|
||||
|
@ -125,9 +125,11 @@ struct Statistics {
|
||||
uint64 phaseStarts[PHASE_LIMIT];
|
||||
uint64 phaseEnds[PHASE_LIMIT];
|
||||
uint64 phaseTimes[PHASE_LIMIT];
|
||||
uint64 totals[PHASE_LIMIT];
|
||||
unsigned int counts[STAT_LIMIT];
|
||||
|
||||
double t(Phase phase);
|
||||
double total(Phase phase);
|
||||
double beginDelay(Phase phase1, Phase phase2);
|
||||
double endDelay(Phase phase1, Phase phase2);
|
||||
void printStats();
|
||||
|
Loading…
Reference in New Issue
Block a user