From b95f6e9680dbd12af6872b0d4bd2289bf42036c7 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sun, 23 Sep 2018 19:12:58 -0700 Subject: [PATCH] #334: remove Telemetry from JS-DOM-XPConnect runtime --- dom/base/nsJSEnvironment.cpp | 6 ++++-- js/xpconnect/src/XPCJSRuntime.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 34af20a0d..5ac1e500d 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1684,6 +1684,7 @@ nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults) endCCTime = PR_Now(); } +#if(0) // Log information about the CC via telemetry, JSON and the console. Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_FINISH_IGC, gCCStats.mAnyLockedOut); Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_SYNC_SKIPPABLE, gCCStats.mRanSyncForgetSkippable); @@ -1695,10 +1696,11 @@ nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults) uint32_t timeBetween = TimeBetween(sLastCCEndTime, gCCStats.mBeginTime) / 1000; Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_TIME_BETWEEN, timeBetween); } +#endif sLastCCEndTime = endCCTimeStamp; - Telemetry::Accumulate(Telemetry::FORGET_SKIPPABLE_MAX, - sMaxForgetSkippableTime / PR_USEC_PER_MSEC); +// Telemetry::Accumulate(Telemetry::FORGET_SKIPPABLE_MAX, +// sMaxForgetSkippableTime / PR_USEC_PER_MSEC); PRTime delta = GetCollectionTimeDelta(); diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index c82966cf5..d501a2a2c 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -144,10 +144,10 @@ class AsyncFreeSnowWhite : public nsRunnable public: NS_IMETHOD Run() { - TimeStamp start = TimeStamp::Now(); + //TimeStamp start = TimeStamp::Now(); bool hadSnowWhiteObjects = nsCycleCollector_doDeferredDeletion(); - Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_ASYNC_SNOW_WHITE_FREEING, - uint32_t((TimeStamp::Now() - start).ToMilliseconds())); + //Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_ASYNC_SNOW_WHITE_FREEING, + // uint32_t((TimeStamp::Now() - start).ToMilliseconds())); if (hadSnowWhiteObjects && !mContinuation) { mContinuation = true; if (NS_FAILED(NS_DispatchToCurrentThread(this))) { @@ -3096,6 +3096,7 @@ JSSizeOfTab(JSObject* objArg, size_t* jsObjectsSize, size_t* jsStringsSize, static void AccumulateTelemetryCallback(int id, uint32_t sample, const char* key) { +#if(0) switch (id) { case JS_TELEMETRY_GC_REASON: Telemetry::Accumulate(Telemetry::GC_REASON_2, sample); @@ -3172,6 +3173,7 @@ AccumulateTelemetryCallback(int id, uint32_t sample, const char* key) default: MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id"); } +#endif } static void @@ -3491,7 +3493,7 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect) if (PseudoStack* stack = mozilla_get_pseudo_stack()) stack->sampleRuntime(runtime); #endif - JS_SetAccumulateTelemetryCallback(runtime, AccumulateTelemetryCallback); + //JS_SetAccumulateTelemetryCallback(runtime, AccumulateTelemetryCallback); js::SetScriptEnvironmentPreparer(runtime, &mEnvironmentPreparer); js::SetActivityCallback(runtime, ActivityCallback, this); JS_SetInterruptCallback(runtime, InterruptCallback);