зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1520357 - Rename the JSON formatting entry points r=jonco
I'm always forgetting which code path is which. So give both these functions clearer names that say if they're used by profiling or telemetry. --HG-- extra : rebase_source : 8edcabba510bcf7170b7e071f7cb3a21be23b0e4
This commit is contained in:
Родитель
b141aa3e7b
Коммит
793ed8be23
|
@ -2174,7 +2174,7 @@ static void DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress,
|
|||
if (StaticPrefs::javascript_options_mem_notify() ||
|
||||
Telemetry::CanRecordExtended()) {
|
||||
nsString json;
|
||||
json.Adopt(aDesc.formatJSON(aCx, PR_Now()));
|
||||
json.Adopt(aDesc.formatJSONTelemetry(aCx, PR_Now()));
|
||||
RefPtr<NotifyGCEndRunnable> notify =
|
||||
new NotifyGCEndRunnable(std::move(json));
|
||||
SystemGroup::Dispatch(TaskCategory::GarbageCollection,
|
||||
|
|
|
@ -634,15 +634,16 @@ struct JS_PUBLIC_API GCDescription {
|
|||
|
||||
char16_t* formatSliceMessage(JSContext* cx) const;
|
||||
char16_t* formatSummaryMessage(JSContext* cx) const;
|
||||
char16_t* formatJSON(JSContext* cx, uint64_t timestamp) const;
|
||||
|
||||
mozilla::TimeStamp startTime(JSContext* cx) const;
|
||||
mozilla::TimeStamp endTime(JSContext* cx) const;
|
||||
mozilla::TimeStamp lastSliceStart(JSContext* cx) const;
|
||||
mozilla::TimeStamp lastSliceEnd(JSContext* cx) const;
|
||||
|
||||
JS::UniqueChars sliceToJSON(JSContext* cx) const;
|
||||
JS::UniqueChars summaryToJSON(JSContext* cx) const;
|
||||
char16_t* formatJSONTelemetry(JSContext* cx, uint64_t timestamp) const;
|
||||
|
||||
JS::UniqueChars sliceToJSONProfiler(JSContext* cx) const;
|
||||
JS::UniqueChars formatJSONProfiler(JSContext* cx) const;
|
||||
|
||||
JS::dbg::GarbageCollectionEvent::Ptr toGCEvent(JSContext* cx) const;
|
||||
};
|
||||
|
|
|
@ -8592,8 +8592,8 @@ JS::dbg::GarbageCollectionEvent::Ptr JS::GCDescription::toGCEvent(
|
|||
cx->runtime()->gc.majorGCCount());
|
||||
}
|
||||
|
||||
char16_t* JS::GCDescription::formatJSON(JSContext* cx,
|
||||
uint64_t timestamp) const {
|
||||
char16_t* JS::GCDescription::formatJSONTelemetry(JSContext* cx,
|
||||
uint64_t timestamp) const {
|
||||
UniqueChars cstr = cx->runtime()->gc.stats().renderJsonMessage(timestamp);
|
||||
|
||||
size_t nchars = strlen(cstr.get());
|
||||
|
@ -8623,13 +8623,13 @@ TimeStamp JS::GCDescription::lastSliceEnd(JSContext* cx) const {
|
|||
return cx->runtime()->gc.stats().slices().back().end;
|
||||
}
|
||||
|
||||
JS::UniqueChars JS::GCDescription::sliceToJSON(JSContext* cx) const {
|
||||
JS::UniqueChars JS::GCDescription::sliceToJSONProfiler(JSContext* cx) const {
|
||||
size_t slices = cx->runtime()->gc.stats().slices().length();
|
||||
MOZ_ASSERT(slices > 0);
|
||||
return cx->runtime()->gc.stats().renderJsonSlice(slices - 1);
|
||||
}
|
||||
|
||||
JS::UniqueChars JS::GCDescription::summaryToJSON(JSContext* cx) const {
|
||||
JS::UniqueChars JS::GCDescription::formatJSONProfiler(JSContext* cx) const {
|
||||
return cx->runtime()->gc.stats().renderJsonMessage(0, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ static void NonIncrementalGCSliceCallback(JSContext* cx,
|
|||
if (progress == GC_CYCLE_END) {
|
||||
mozilla::UniquePtr<char16_t> summary(desc.formatSummaryMessage(cx));
|
||||
mozilla::UniquePtr<char16_t> message(desc.formatSliceMessage(cx));
|
||||
mozilla::UniquePtr<char16_t> json(desc.formatJSON(cx, 0));
|
||||
mozilla::UniquePtr<char16_t> json(desc.formatJSONTelemetry(cx, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -800,12 +800,12 @@ void CycleCollectedJSRuntime::TraverseNativeRoots(
|
|||
profiler_add_marker(
|
||||
"GCMajor", MakeUnique<GCMajorMarkerPayload>(
|
||||
aDesc.startTime(aContext), aDesc.endTime(aContext),
|
||||
aDesc.summaryToJSON(aContext)));
|
||||
aDesc.formatJSONProfiler(aContext)));
|
||||
} else if (aProgress == JS::GC_SLICE_END) {
|
||||
profiler_add_marker("GCSlice", MakeUnique<GCSliceMarkerPayload>(
|
||||
aDesc.lastSliceStart(aContext),
|
||||
aDesc.lastSliceEnd(aContext),
|
||||
aDesc.sliceToJSON(aContext)));
|
||||
aDesc.sliceToJSONProfiler(aContext)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче