Bug 1637642 - Add telemetry for weak marking phases r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D75149
This commit is contained in:
Jon Coppeard 2020-05-15 07:17:25 +00:00
Родитель be8edb839f
Коммит 03014d6e7c
4 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -1065,6 +1065,8 @@ void Statistics::sendGCTelemetry() {
TimeDuration prepareTotal = SumPhase(PhaseKind::PREPARE, phaseTimes);
TimeDuration markTotal = SumPhase(PhaseKind::MARK, phaseTimes);
TimeDuration markRootsTotal = SumPhase(PhaseKind::MARK_ROOTS, phaseTimes);
TimeDuration markWeakTotal = phaseTimes[Phase::SWEEP_MARK_WEAK] +
phaseTimes[Phase::SWEEP_MARK_GRAY_WEAK];
size_t markCount = gc->marker.getMarkCount();
double markRate = markCount / t(markTotal);
runtime->addTelemetry(JS_TELEMETRY_GC_PREPARE_MS, t(prepareTotal));
@ -1078,6 +1080,7 @@ void Statistics::sendGCTelemetry() {
runtime->addTelemetry(JS_TELEMETRY_GC_MARK_ROOTS_MS, t(markRootsTotal));
runtime->addTelemetry(JS_TELEMETRY_GC_MARK_GRAY_MS,
t(phaseTimes[Phase::SWEEP_MARK_GRAY]));
runtime->addTelemetry(JS_TELEMETRY_GC_MARK_WEAK_MS, t(markWeakTotal));
runtime->addTelemetry(JS_TELEMETRY_GC_NON_INCREMENTAL, nonincremental());
if (nonincremental()) {
runtime->addTelemetry(JS_TELEMETRY_GC_NON_INCREMENTAL_REASON,

Просмотреть файл

@ -154,6 +154,7 @@ enum {
JS_TELEMETRY_GC_COMPACT_MS,
JS_TELEMETRY_GC_MARK_ROOTS_MS,
JS_TELEMETRY_GC_MARK_GRAY_MS,
JS_TELEMETRY_GC_MARK_WEAK_MS,
JS_TELEMETRY_GC_SLICE_MS,
JS_TELEMETRY_GC_SLOW_PHASE,
JS_TELEMETRY_GC_SLOW_TASK,

Просмотреть файл

@ -2621,6 +2621,9 @@ static void AccumulateTelemetryCallback(int id, uint32_t sample,
case JS_TELEMETRY_GC_MARK_GRAY_MS:
Telemetry::Accumulate(Telemetry::GC_MARK_GRAY_MS, sample);
break;
case JS_TELEMETRY_GC_MARK_WEAK_MS:
Telemetry::Accumulate(Telemetry::GC_MARK_WEAK_MS, sample);
break;
case JS_TELEMETRY_GC_SLICE_MS:
Telemetry::Accumulate(Telemetry::GC_SLICE_MS, sample);
break;

Просмотреть файл

@ -773,6 +773,18 @@
"n_buckets": 50,
"description": "Time spent marking gray GC objects (ms)"
},
"GC_MARK_WEAK_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox"],
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org", "jcoppeard@mozilla.com"],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "exponential",
"high": 10000,
"n_buckets": 50,
"description": "Time spent marking GC objects held live through weakmaps (ms)",
"bug_numbers": [1637642]
},
"GC_SLICE_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],