зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1164982 - Record telemetry for GC max pause during animations; r=sfink
--HG-- extra : rebase_source : 1a774dca8b27f9280dc41676c58307e74eb47441
This commit is contained in:
Родитель
6152c0e865
Коммит
e2e18c19e1
|
@ -70,9 +70,9 @@ struct JS_PUBLIC_API(SliceBudget)
|
|||
return checkOverBudget();
|
||||
}
|
||||
|
||||
bool isUnlimited() const {
|
||||
return deadline == unlimitedDeadline;
|
||||
}
|
||||
bool isWorkBudget() const { return deadline == 0; }
|
||||
bool isTimeBudget() const { return deadline > 0 && !isUnlimited(); }
|
||||
bool isUnlimited() const { return deadline == unlimitedDeadline; }
|
||||
|
||||
int describe(char* buffer, size_t maxlen) const;
|
||||
|
||||
|
|
|
@ -771,28 +771,30 @@ class GCRuntime
|
|||
JS::Zone* getCurrentZoneGroup() { return currentZoneGroup; }
|
||||
void setFoundBlackGrayEdges() { foundBlackGrayEdges = true; }
|
||||
|
||||
uint64_t gcNumber() { return number; }
|
||||
uint64_t gcNumber() const { return number; }
|
||||
void incGcNumber() { ++number; }
|
||||
|
||||
uint64_t minorGCCount() { return minorGCNumber; }
|
||||
uint64_t minorGCCount() const { return minorGCNumber; }
|
||||
void incMinorGcNumber() { ++minorGCNumber; }
|
||||
|
||||
uint64_t majorGCCount() { return majorGCNumber; }
|
||||
uint64_t majorGCCount() const { return majorGCNumber; }
|
||||
void incMajorGcNumber() { ++majorGCNumber; }
|
||||
|
||||
bool isIncrementalGc() { return isIncremental; }
|
||||
bool isFullGc() { return isFull; }
|
||||
int64_t defaultSliceBudget() const { return sliceBudget; }
|
||||
|
||||
bool isIncrementalGc() const { return isIncremental; }
|
||||
bool isFullGc() const { return isFull; }
|
||||
|
||||
bool shouldCleanUpEverything() { return cleanUpEverything; }
|
||||
|
||||
bool areGrayBitsValid() { return grayBitsValid; }
|
||||
bool areGrayBitsValid() const { return grayBitsValid; }
|
||||
void setGrayBitsInvalid() { grayBitsValid = false; }
|
||||
|
||||
bool minorGCRequested() const { return minorGCTriggerReason != JS::gcreason::NO_REASON; }
|
||||
bool majorGCRequested() const { return majorGCTriggerReason != JS::gcreason::NO_REASON; }
|
||||
bool isGcNeeded() { return minorGCRequested() || majorGCRequested(); }
|
||||
|
||||
bool fullGCForAtomsRequested() { return fullGCForAtomsRequested_; }
|
||||
bool fullGCForAtomsRequested() const { return fullGCForAtomsRequested_; }
|
||||
|
||||
double computeHeapGrowthFactor(size_t lastBytes);
|
||||
size_t computeTriggerBytes(double growthFactor, size_t lastBytes);
|
||||
|
@ -1161,7 +1163,7 @@ class GCRuntime
|
|||
*/
|
||||
bool interFrameGC;
|
||||
|
||||
/* Default budget for incremental GC slice. See SliceBudget in jsgc.h. */
|
||||
/* Default budget for incremental GC slice. See js/SliceBudget.h. */
|
||||
int64_t sliceBudget;
|
||||
|
||||
/*
|
||||
|
|
|
@ -954,8 +954,16 @@ Statistics::endSlice()
|
|||
slices.back().end = PRMJ_Now();
|
||||
slices.back().endFaults = GetPageFaultCount();
|
||||
|
||||
runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(slices.back().end - slices.back().start));
|
||||
int64_t sliceTime = slices.back().end - slices.back().start;
|
||||
runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(sliceTime));
|
||||
runtime->addTelemetry(JS_TELEMETRY_GC_RESET, !!slices.back().resetReason);
|
||||
|
||||
if (slices.back().budget.isTimeBudget()) {
|
||||
int64_t budget = slices.back().budget.timeBudget.budget;
|
||||
runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_MS, t(budget));
|
||||
if (budget == runtime->gc.defaultSliceBudget())
|
||||
runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime));
|
||||
}
|
||||
}
|
||||
|
||||
bool last = !runtime->gc.isIncrementalGCInProgress();
|
||||
|
|
|
@ -104,6 +104,8 @@ enum {
|
|||
JS_TELEMETRY_GC_REASON,
|
||||
JS_TELEMETRY_GC_IS_COMPARTMENTAL,
|
||||
JS_TELEMETRY_GC_MS,
|
||||
JS_TELEMETRY_GC_BUDGET_MS,
|
||||
JS_TELEMETRY_GC_ANIMATION_MS,
|
||||
JS_TELEMETRY_GC_MAX_PAUSE_MS,
|
||||
JS_TELEMETRY_GC_MARK_MS,
|
||||
JS_TELEMETRY_GC_SWEEP_MS,
|
||||
|
|
|
@ -3004,7 +3004,7 @@ SliceBudget::describe(char* buffer, size_t maxlen) const
|
|||
{
|
||||
if (isUnlimited())
|
||||
return JS_snprintf(buffer, maxlen, "unlimited");
|
||||
else if (deadline == 0)
|
||||
else if (isWorkBudget())
|
||||
return JS_snprintf(buffer, maxlen, "work(%lld)", workBudget.budget);
|
||||
else
|
||||
return JS_snprintf(buffer, maxlen, "%lldms", timeBudget.budget);
|
||||
|
|
|
@ -3107,6 +3107,12 @@ AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
|
|||
case JS_TELEMETRY_GC_MS:
|
||||
Telemetry::Accumulate(Telemetry::GC_MS, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_GC_BUDGET_MS:
|
||||
Telemetry::Accumulate(Telemetry::GC_BUDGET_MS, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_GC_ANIMATION_MS:
|
||||
Telemetry::Accumulate(Telemetry::GC_ANIMATION_MS, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_GC_MAX_PAUSE_MS:
|
||||
Telemetry::Accumulate(Telemetry::GC_MAX_PAUSE_MS, sample);
|
||||
break;
|
||||
|
|
|
@ -275,6 +275,22 @@
|
|||
"n_buckets": 50,
|
||||
"description": "Time spent running JS GC (ms)"
|
||||
},
|
||||
"GC_BUDGET_MS": {
|
||||
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
|
||||
"expires_in_version": "never",
|
||||
"kind": "linear",
|
||||
"high": "100",
|
||||
"n_buckets": 10,
|
||||
"description": "Requested GC slice budget (ms)"
|
||||
},
|
||||
"GC_ANIMATION_MS": {
|
||||
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "10000",
|
||||
"n_buckets": 50,
|
||||
"description": "Time spent running JS GC when animating (ms)"
|
||||
},
|
||||
"GC_MAX_PAUSE_MS": {
|
||||
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
|
||||
"expires_in_version": "never",
|
||||
|
|
Загрузка…
Ссылка в новой задаче