Issue #21 - Remove Telemetry plumbing and fix build.

Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
This commit is contained in:
Moonchild 2021-10-29 11:02:27 +00:00 • committed by roytam1
commit 8d800b1cb0
205 changed files with 45 additions and 40519 deletions

View file

@ -40,7 +40,6 @@
fun:malloc fun:malloc
fun:moz_xmalloc fun:moz_xmalloc
fun:operator new fun:operator new
fun:_Z21XRE_CreateStatsObjectv
... ...
} }

View file

@ -129,9 +129,6 @@ private:
* *
* File blobs are copies of the underlying data string since we cannot adopt * File blobs are copies of the underlying data string since we cannot adopt
* char* chunks embedded within the larger body without significant effort. * char* chunks embedded within the larger body without significant effort.
* FIXME(nsm): Bug 1127552 - We should add telemetry to calls to formData() and
* friends to figure out if Fetch ends up copying big blobs to see if this is
* worth optimizing.
*/ */
class MOZ_STACK_CLASS FormDataParser class MOZ_STACK_CLASS FormDataParser
{ {

View file

@ -4,7 +4,6 @@
#include "mozilla/dom/DocGroup.h" #include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h" #include "mozilla/dom/TabGroup.h"
#include "mozilla/Telemetry.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsIEffectiveTLDService.h" #include "nsIEffectiveTLDService.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"

View file

@ -127,7 +127,6 @@
#include "nsWrapperCacheInlines.h" #include "nsWrapperCacheInlines.h"
#include "xpcpublic.h" #include "xpcpublic.h"
#include "nsIScriptError.h" #include "nsIScriptError.h"
#include "mozilla/Telemetry.h"
#include "mozilla/CORSMode.h" #include "mozilla/CORSMode.h"
#include "mozilla/dom/ShadowRoot.h" #include "mozilla/dom/ShadowRoot.h"

View file

@ -117,7 +117,6 @@
#include "nsCycleCollector.h" #include "nsCycleCollector.h"
#include "xpcpublic.h" #include "xpcpublic.h"
#include "nsIScriptError.h" #include "nsIScriptError.h"
#include "mozilla/Telemetry.h"
#include "mozilla/CORSMode.h" #include "mozilla/CORSMode.h"

View file

@ -28,7 +28,6 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#ifdef MOZ_GAMEPAD #ifdef MOZ_GAMEPAD
#include "mozilla/dom/GamepadServiceTest.h" #include "mozilla/dom/GamepadServiceTest.h"
#endif #endif
@ -1629,9 +1628,7 @@ Navigator::RequestMediaKeySystemAccess(const nsAString& aKeySystem,
nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow); nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
RefPtr<DetailedPromise> promise = RefPtr<DetailedPromise> promise =
DetailedPromise::Create(go, aRv, DetailedPromise::Create(go, aRv,
NS_LITERAL_CSTRING("navigator.requestMediaKeySystemAccess"), NS_LITERAL_CSTRING("navigator.requestMediaKeySystemAccess"));
Telemetry::VIDEO_EME_REQUEST_SUCCESS_LATENCY_MS,
Telemetry::VIDEO_EME_REQUEST_FAILURE_LATENCY_MS);
if (aRv.Failed()) { if (aRv.Failed()) {
return nullptr; return nullptr;
} }

View file

@ -8,7 +8,6 @@
#include "mozilla/dom/DocGroup.h" #include "mozilla/dom/DocGroup.h"
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/ThrottledEventQueue.h" #include "mozilla/ThrottledEventQueue.h"
#include "nsIDocShell.h" #include "nsIDocShell.h"
#include "nsIEffectiveTLDService.h" #include "nsIEffectiveTLDService.h"

View file

@ -20,7 +20,6 @@
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/ServoBindings.h" #include "mozilla/ServoBindings.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/css/StyleRule.h" #include "mozilla/css/StyleRule.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"

View file

@ -56,7 +56,6 @@
#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptSettings.h"
#include "nsAXPCNativeCallContext.h" #include "nsAXPCNativeCallContext.h"
#include "mozilla/CycleCollectedJSContext.h" #include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/Telemetry.h"
#include "nsJSPrincipals.h" #include "nsJSPrincipals.h"
@ -2007,7 +2006,7 @@ DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress, const JS::GCDescrip
} }
if (!sShuttingDown) { if (!sShuttingDown) {
if (sPostGCEventsToObserver || Telemetry::CanRecordExtended()) { if (sPostGCEventsToObserver) {
nsString json; nsString json;
json.Adopt(aDesc.formatJSON(aCx, PR_Now())); json.Adopt(aDesc.formatJSON(aCx, PR_Now()));
RefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json); RefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json);

View file

@ -10,7 +10,6 @@
#include "nsNodeInfoManager.h" #include "nsNodeInfoManager.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/NodeInfo.h" #include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/NodeInfoInlines.h" #include "mozilla/dom/NodeInfoInlines.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"

View file

@ -32,7 +32,6 @@
#include "mozilla/dom/DOMStringList.h" #include "mozilla/dom/DOMStringList.h"
#include "mozilla/dom/ShadowRoot.h" #include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/Selection.h" #include "mozilla/dom/Selection.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "nsCSSFrameConstructor.h" #include "nsCSSFrameConstructor.h"
#include "nsStyleStruct.h" #include "nsStyleStruct.h"

View file

@ -7,30 +7,6 @@ Cu.import("resource://gre/modules/Services.jsm");
const gHttpTestRoot = "http://example.com/browser/dom/base/test/"; const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
/**
* Enable local telemetry recording for the duration of the tests.
*/
var gOldContentCanRecord = false;
var gOldParentCanRecord = false;
add_task(function* test_initialize() {
let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
gOldParentCanRecord = Telemetry.canRecordExtended
Telemetry.canRecordExtended = true;
// Because canRecordExtended is a per-process variable, we need to make sure
// that all of the pages load in the same content process. Limit the number
// of content processes to at most 1 (or 0 if e10s is off entirely).
yield SpecialPowers.pushPrefEnv({ set: [[ "dom.ipc.processCount", 1 ]] });
gOldContentCanRecord = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
let old = telemetry.canRecordExtended;
telemetry.canRecordExtended = true;
return old;
});
info("canRecord for content: " + gOldContentCanRecord);
});
add_task(function* () { add_task(function* () {
// Check that use counters are incremented by SVGs loaded directly in iframes. // Check that use counters are incremented by SVGs loaded directly in iframes.
yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg", yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
@ -73,20 +49,6 @@ add_task(function* () {
// "PROPERTY_FILL_OPACITY"); // "PROPERTY_FILL_OPACITY");
}); });
add_task(function* () {
let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
Telemetry.canRecordExtended = gOldParentCanRecord;
yield ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, function (arg) {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
yield new Promise(resolve => {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
telemetry.canRecordExtended = arg.oldCanRecord;
resolve();
});
});
});
function waitForDestroyedDocuments() { function waitForDestroyedDocuments() {
let deferred = promise.defer(); let deferred = promise.defer();
@ -108,17 +70,6 @@ function waitForPageLoad(browser) {
} }
function grabHistogramsFromContent(use_counter_middlefix, page_before = null) { function grabHistogramsFromContent(use_counter_middlefix, page_before = null) {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
let suffix = Services.appinfo.browserTabsRemoteAutostart ? "#content" : "";
let gather = () => [
telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_PAGE" + suffix).snapshot().sum,
telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_DOCUMENT" + suffix).snapshot().sum,
telemetry.getHistogramById("CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
telemetry.getHistogramById("TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
];
return BrowserTestUtils.waitForCondition(() => {
return page_before != telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_PAGE" + suffix).snapshot().sum;
}).then(gather, gather);
} }
var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix, check_documents=true) { var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix, check_documents=true) {
@ -128,12 +79,6 @@ var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix
gBrowser.selectedTab = newTab; gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop(); newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html"); gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
yield waitForPageLoad(gBrowser.selectedBrowser); yield waitForPageLoad(gBrowser.selectedBrowser);
@ -151,7 +96,7 @@ var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix
// We flush the main document first, then the iframe's document to // We flush the main document first, then the iframe's document to
// ensure any propagation that might happen from content->parent should // ensure any propagation that might happen from content->parent should
// have already happened when counters are reported to telemetry. // have already happened.
wu.forceUseCounterFlush(content.document); wu.forceUseCounterFlush(content.document);
wu.forceUseCounterFlush(iframe.contentDocument); wu.forceUseCounterFlush(iframe.contentDocument);
@ -192,12 +137,6 @@ var check_use_counter_img = Task.async(function* (file, use_counter_middlefix) {
gBrowser.selectedTab = newTab; gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop(); newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html"); gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
yield waitForPageLoad(gBrowser.selectedBrowser); yield waitForPageLoad(gBrowser.selectedBrowser);
@ -258,12 +197,6 @@ var check_use_counter_direct = Task.async(function* (file, use_counter_middlefix
gBrowser.selectedTab = newTab; gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop(); newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file); gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file);
yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() { yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
Cu.import("resource://gre/modules/PromiseUtils.jsm"); Cu.import("resource://gre/modules/PromiseUtils.jsm");

View file

@ -95,7 +95,6 @@
#include "mozilla/layers/PersistentBufferProvider.h" #include "mozilla/layers/PersistentBufferProvider.h"
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -15,7 +14,6 @@
#include "mozilla/layers/AsyncCanvasRenderer.h" #include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/layers/CanvasClient.h" #include "mozilla/layers/CanvasClient.h"
#include "mozilla/layers/ImageBridgeChild.h" #include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/Telemetry.h"
#include "CanvasRenderingContext2D.h" #include "CanvasRenderingContext2D.h"
#include "CanvasUtils.h" #include "CanvasUtils.h"
#include "GLContext.h" #include "GLContext.h"

View file

@ -9,7 +9,6 @@
#include "GLContext.h" #include "GLContext.h"
#include "mozilla/dom/WebGL2RenderingContextBinding.h" #include "mozilla/dom/WebGL2RenderingContextBinding.h"
#include "mozilla/ArrayUtils.h" #include "mozilla/ArrayUtils.h"
#include "mozilla/Telemetry.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "WebGLBuffer.h" #include "WebGLBuffer.h"
#include "WebGLFormats.h" #include "WebGLFormats.h"

View file

@ -31,7 +31,6 @@
#include "mozilla/ProcessPriorityManager.h" #include "mozilla/ProcessPriorityManager.h"
#include "mozilla/ScopeExit.h" #include "mozilla/ScopeExit.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsError.h" #include "nsError.h"

View file

@ -11,7 +11,6 @@
#include "nsProxyRelease.h" #include "nsProxyRelease.h"
#include "jsapi.h" #include "jsapi.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/CryptoBuffer.h" #include "mozilla/dom/CryptoBuffer.h"
#include "mozilla/dom/CryptoKey.h" #include "mozilla/dom/CryptoKey.h"
#include "mozilla/dom/KeyAlgorithmProxy.h" #include "mozilla/dom/KeyAlgorithmProxy.h"
@ -45,56 +44,6 @@ using mozilla::dom::workers::Status;
using mozilla::dom::workers::WorkerHolder; using mozilla::dom::workers::WorkerHolder;
using mozilla::dom::workers::WorkerPrivate; using mozilla::dom::workers::WorkerPrivate;
// Pre-defined identifiers for telemetry histograms
enum TelemetryMethod {
TM_ENCRYPT = 0,
TM_DECRYPT = 1,
TM_SIGN = 2,
TM_VERIFY = 3,
TM_DIGEST = 4,
TM_GENERATEKEY = 5,
TM_DERIVEKEY = 6,
TM_DERIVEBITS = 7,
TM_IMPORTKEY = 8,
TM_EXPORTKEY = 9,
TM_WRAPKEY = 10,
TM_UNWRAPKEY = 11
};
enum TelemetryAlgorithm {
// Please make additions at the end of the list,
// to preserve comparability of histograms over time
TA_UNKNOWN = 0,
// encrypt / decrypt
TA_AES_CBC = 1,
TA_AES_CFB = 2,
TA_AES_CTR = 3,
TA_AES_GCM = 4,
TA_RSAES_PKCS1 = 5, // NB: This algorithm has been removed
TA_RSA_OAEP = 6,
// sign/verify
TA_RSASSA_PKCS1 = 7,
TA_RSA_PSS = 8,
TA_HMAC_SHA_1 = 9,
TA_HMAC_SHA_224 = 10,
TA_HMAC_SHA_256 = 11,
TA_HMAC_SHA_384 = 12,
TA_HMAC_SHA_512 = 13,
// digest
TA_SHA_1 = 14,
TA_SHA_224 = 15,
TA_SHA_256 = 16,
TA_SHA_384 = 17,
TA_SHA_512 = 18,
// Later additions
TA_AES_KW = 19,
TA_ECDH = 20,
TA_PBKDF2 = 21,
TA_ECDSA = 22,
TA_HKDF = 23,
};
// Convenience functions for extracting / converting information // Convenience functions for extracting / converting information
// OOM-safe CryptoBuffer initialization, suitable for constructors // OOM-safe CryptoBuffer initialization, suitable for constructors
@ -577,12 +526,10 @@ public:
} }
// Cache parameters depending on the specific algorithm // Cache parameters depending on the specific algorithm
TelemetryAlgorithm telemetryAlg;
if (algName.EqualsLiteral(WEBCRYPTO_ALG_AES_CBC)) { if (algName.EqualsLiteral(WEBCRYPTO_ALG_AES_CBC)) {
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CBC); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CBC);
mMechanism = CKM_AES_CBC_PAD; mMechanism = CKM_AES_CBC_PAD;
telemetryAlg = TA_AES_CBC;
RootedDictionary<AesCbcParams> params(aCx); RootedDictionary<AesCbcParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm); nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -599,7 +546,6 @@ public:
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CTR); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CTR);
mMechanism = CKM_AES_CTR; mMechanism = CKM_AES_CTR;
telemetryAlg = TA_AES_CTR;
RootedDictionary<AesCtrParams> params(aCx); RootedDictionary<AesCtrParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm); nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -618,7 +564,6 @@ public:
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_GCM); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_GCM);
mMechanism = CKM_AES_GCM; mMechanism = CKM_AES_GCM;
telemetryAlg = TA_AES_GCM;
RootedDictionary<AesGcmParams> params(aCx); RootedDictionary<AesGcmParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm); nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -1033,16 +978,6 @@ public:
mEarlyRv = NS_ERROR_DOM_DATA_ERR; mEarlyRv = NS_ERROR_DOM_DATA_ERR;
return; return;
} }
TelemetryAlgorithm telemetryAlg;
switch (mMechanism) {
case CKM_SHA_1_HMAC: telemetryAlg = TA_HMAC_SHA_1; break;
case CKM_SHA224_HMAC: telemetryAlg = TA_HMAC_SHA_224; break;
case CKM_SHA256_HMAC: telemetryAlg = TA_HMAC_SHA_256; break;
case CKM_SHA384_HMAC: telemetryAlg = TA_HMAC_SHA_384; break;
case CKM_SHA512_HMAC: telemetryAlg = TA_HMAC_SHA_512; break;
default: telemetryAlg = TA_UNKNOWN;
}
} }
private: private:
@ -1333,15 +1268,11 @@ public:
return; return;
} }
TelemetryAlgorithm telemetryAlg; if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA1) ||
if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA1)) { algName.EqualsLiteral(WEBCRYPTO_ALG_SHA256) ||
telemetryAlg = TA_SHA_1; algName.EqualsLiteral(WEBCRYPTO_ALG_SHA384) ||
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA256)) { algName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
telemetryAlg = TA_SHA_224; // All good, fall through.
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA384)) {
telemetryAlg = TA_SHA_256;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
telemetryAlg = TA_SHA_384;
} else { } else {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR; mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return; return;

View file

@ -53,7 +53,6 @@
#include "mozilla/ipc/MessageChannel.h" #include "mozilla/ipc/MessageChannel.h"
#include "mozilla/MiscEvents.h" #include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TextEvents.h" #include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h" #include "mozilla/TouchEvents.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"

View file

@ -25,7 +25,6 @@
#include "mozilla/layers/AsyncCanvasRenderer.h" #include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsAttrValueInlines.h" #include "nsAttrValueInlines.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -14,7 +13,6 @@
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/StaticMutex.h" #include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "CubebUtils.h" #include "CubebUtils.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -11,7 +10,6 @@
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/HTMLMediaElement.h" #include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "nsSize.h" #include "nsSize.h"

View file

@ -24,8 +24,6 @@
using mozilla::ipc::GeckoChildProcessHost; using mozilla::ipc::GeckoChildProcessHost;
#include "mozilla/Telemetry.h"
#ifdef XP_WIN #ifdef XP_WIN
#include "WMFDecoderModule.h" #include "WMFDecoderModule.h"
#endif #endif

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -10,7 +9,6 @@
#include "WMFUtils.h" #include "WMFUtils.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "TimeUnits.h" #include "TimeUnits.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) #define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
@ -250,10 +248,6 @@ WMFAudioMFTManager::Output(int64_t aStreamOffset,
if (!sample) { if (!sample) {
LOG("Audio MFTDecoder returned success but null output."); LOG("Audio MFTDecoder returned success but null output.");
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([]() -> void {
LOG("Reporting telemetry AUDIO_MFT_OUTPUT_NULL_SAMPLES");
});
AbstractThread::MainThread()->Dispatch(task.forget());
return E_FAIL; return E_FAIL;
} }

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -25,7 +24,6 @@
#include "gfxWindowsPlatform.h" #include "gfxWindowsPlatform.h"
#include "IMFYCbCrImage.h" #include "IMFYCbCrImage.h"
#include "mozilla/WindowsVersion.h" #include "mozilla/WindowsVersion.h"
#include "mozilla/Telemetry.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place. #include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place.
#include "MP4Decoder.h" #include "MP4Decoder.h"
@ -116,19 +114,6 @@ WMFVideoMFTManager::~WMFVideoMFTManager()
if (mDXVA2Manager) { if (mDXVA2Manager) {
DeleteOnMainThread(mDXVA2Manager); DeleteOnMainThread(mDXVA2Manager);
} }
// Record whether the video decoder successfully decoded, or output null
// samples but did/didn't recover.
uint32_t telemetry = (mNullOutputCount == 0) ? 0 :
(mGotValidOutputAfterNullOutput && mGotExcessiveNullOutput) ? 1 :
mGotExcessiveNullOutput ? 2 :
mGotValidOutputAfterNullOutput ? 3 :
4;
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([=]() -> void {
LOG(nsPrintfCString("Reporting telemetry VIDEO_MFT_OUTPUT_NULL_SAMPLES=%d", telemetry).get());
});
AbstractThread::MainThread()->Dispatch(task.forget());
} }
const GUID& const GUID&

View file

@ -88,7 +88,6 @@
#include "nsIContentPolicy.h" #include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h" #include "nsContentPolicyUtils.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "nsIImageLoadingContent.h" #include "nsIImageLoadingContent.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "nsVersionComparator.h" #include "nsVersionComparator.h"

View file

@ -11,7 +11,6 @@
#include "mozilla/plugins/PluginInstanceParent.h" #include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/plugins/PluginModuleParent.h" #include "mozilla/plugins/PluginModuleParent.h"
#include "mozilla/plugins/PluginScriptableObjectParent.h" #include "mozilla/plugins/PluginScriptableObjectParent.h"
#include "mozilla/Telemetry.h"
#include "nsJSNPRuntime.h" #include "nsJSNPRuntime.h"
#include "nsNPAPIPlugin.h" #include "nsNPAPIPlugin.h"
#include "nsNPAPIPluginInstance.h" #include "nsNPAPIPluginInstance.h"

View file

@ -30,33 +30,6 @@ using mozilla::widget::WidgetUtils;
using std::string; using std::string;
using std::vector; using std::vector;
namespace {
class nsPluginHangUITelemetry : public mozilla::Runnable
{
public:
nsPluginHangUITelemetry(int aResponseCode, int aDontAskCode,
uint32_t aResponseTimeMs, uint32_t aTimeoutMs)
: mResponseCode(aResponseCode),
mDontAskCode(aDontAskCode),
mResponseTimeMs(aResponseTimeMs),
mTimeoutMs(aTimeoutMs)
{
}
NS_IMETHOD
Run() override
{
return NS_OK;
}
private:
int mResponseCode;
int mDontAskCode;
uint32_t mResponseTimeMs;
uint32_t mTimeoutMs;
};
} // namespace
namespace mozilla { namespace mozilla {
namespace plugins { namespace plugins {
@ -358,11 +331,6 @@ PluginHangUIParent::RecvUserResponse(const unsigned int& aResponse)
responseCode = 3; responseCode = 3;
} }
int dontAskCode = (aResponse & HANGUI_USER_RESPONSE_DONT_SHOW_AGAIN) ? 1 : 0; int dontAskCode = (aResponse & HANGUI_USER_RESPONSE_DONT_SHOW_AGAIN) ? 1 : 0;
nsCOMPtr<nsIRunnable> workItem = new nsPluginHangUITelemetry(responseCode,
dontAskCode,
LastShowDurationMs(),
mTimeoutPrefMs);
NS_DispatchToMainThread(workItem);
return true; return true;
} }

View file

@ -769,8 +769,6 @@ PluginInstanceParent::SetCurrentImage(Image* aImage)
gfx::IntRect rect = aImage->GetPictureRect(); gfx::IntRect rect = aImage->GetPictureRect();
NPRect nprect = {uint16_t(rect.x), uint16_t(rect.y), uint16_t(rect.width), uint16_t(rect.height)}; NPRect nprect = {uint16_t(rect.x), uint16_t(rect.y), uint16_t(rect.width), uint16_t(rect.height)};
RecvNPN_InvalidateRect(nprect); RecvNPN_InvalidateRect(nprect);
RecordDrawingModel();
} }
bool bool
@ -907,7 +905,6 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
PLUGIN_LOG_DEBUG((" (RecvShow invalidated for surface %p)", PLUGIN_LOG_DEBUG((" (RecvShow invalidated for surface %p)",
mFrontSurface.get())); mFrontSurface.get()));
RecordDrawingModel();
return true; return true;
} }
@ -1273,7 +1270,6 @@ PluginInstanceParent::NPP_SetWindow(const NPWindow* aWindow)
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
} }
RecordDrawingModel();
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
} }
@ -2232,28 +2228,3 @@ PluginInstanceParent::RecvOnWindowedPluginKeyEvent(
owner->OnWindowedPluginKeyEvent(aKeyEventData); owner->OnWindowedPluginKeyEvent(aKeyEventData);
return true; return true;
} }
void
PluginInstanceParent::RecordDrawingModel()
{
int mode = -1;
switch (mWindowType) {
case NPWindowTypeWindow:
// We use 0=windowed since there is no specific NPDrawingModel value.
mode = 0;
break;
case NPWindowTypeDrawable:
mode = mDrawingModel + 1;
break;
default:
MOZ_ASSERT_UNREACHABLE("bad window type");
return;
}
if (mode == mLastRecordedDrawingModel) {
return;
}
MOZ_ASSERT(mode >= 0);
mLastRecordedDrawingModel = mode;
}

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -387,9 +386,6 @@ private:
void SetCurrentImage(layers::Image* aImage); void SetCurrentImage(layers::Image* aImage);
// Update Telemetry with the current drawing model.
void RecordDrawingModel();
private: private:
PluginModuleParent* mParent; PluginModuleParent* mParent;
RefPtr<PluginAsyncSurrogate> mSurrogate; RefPtr<PluginAsyncSurrogate> mSurrogate;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -11,7 +10,6 @@
#include "mozilla/ipc/BrowserProcessSubThread.h" #include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/plugins/PluginMessageUtils.h" #include "mozilla/plugins/PluginMessageUtils.h"
#include "mozilla/Telemetry.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
using std::vector; using std::vector;

View file

@ -7,7 +7,6 @@
#define mozilla_dom_workers_ServiceWorkerRegistrar_h #define mozilla_dom_workers_ServiceWorkerRegistrar_h
#include "mozilla/Monitor.h" #include "mozilla/Monitor.h"
#include "mozilla/Telemetry.h"
#include "nsClassHashtable.h" #include "nsClassHashtable.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"

View file

@ -65,7 +65,6 @@
#include "nsAsyncRedirectVerifyHelper.h" #include "nsAsyncRedirectVerifyHelper.h"
#include "nsStringBuffer.h" #include "nsStringBuffer.h"
#include "nsIFileChannel.h" #include "nsIFileChannel.h"
#include "mozilla/Telemetry.h"
#include "jsfriendapi.h" #include "jsfriendapi.h"
#include "GeckoProfiler.h" #include "GeckoProfiler.h"
#include "mozilla/dom/EncodingUtils.h" #include "mozilla/dom/EncodingUtils.h"

View file

@ -21,7 +21,6 @@
#include "mozilla/dom/ProgressEvent.h" #include "mozilla/dom/ProgressEvent.h"
#include "mozilla/dom/StructuredCloneHolder.h" #include "mozilla/dom/StructuredCloneHolder.h"
#include "mozilla/dom/URLSearchParams.h" #include "mozilla/dom/URLSearchParams.h"
#include "mozilla/Telemetry.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsJSUtils.h" #include "nsJSUtils.h"

View file

@ -26,7 +26,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/scache/StartupCache.h" #include "mozilla/scache/StartupCache.h"
#include "mozilla/scache/StartupCacheUtils.h" #include "mozilla/scache/StartupCacheUtils.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::scache; using namespace mozilla::scache;

View file

@ -561,10 +561,6 @@ typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog;
#define gfxWarning mozilla::gfx::WarningLog #define gfxWarning mozilla::gfx::WarningLog
#define gfxWarningOnce static gfxWarning GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxWarning #define gfxWarningOnce static gfxWarning GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxWarning
// In the debug build, this is equivalent to the default gfxCriticalError.
// In the non-debug build, on nightly and dev edition, it will MOZ_CRASH.
// On beta and release versions, it will telemetry count, but proceed.
//
// You should create a (new) enum in the LogReason and use it for the reason // You should create a (new) enum in the LogReason and use it for the reason
// parameter to ensure uniqueness. // parameter to ensure uniqueness.
#define gfxDevCrash(reason) gfxCriticalError(int(gfx::LogOptions::AutoPrefix) | int(gfx::LogOptions::AssertOnCall) | int(gfx::LogOptions::CrashAction), (reason)) #define gfxDevCrash(reason) gfxCriticalError(int(gfx::LogOptions::AutoPrefix) | int(gfx::LogOptions::AssertOnCall) | int(gfx::LogOptions::CrashAction), (reason))

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sts=8 sw=2 ts=2 tw=99 et :
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -85,10 +84,8 @@ public:
return !!mGPUChild; return !!mGPUChild;
} }
// Return the time stamp for when we tried to launch the GPU process. This is // Return the time stamp for when we tried to launch the GPU process.
// currently used for Telemetry so that we can determine how long GPU processes // Note this doesn't denote a successful launch, just when we attempted launch.
// take to spin up. Note this doesn't denote a successful launch, just when we
// attempted launch.
TimeStamp GetLaunchTime() const { TimeStamp GetLaunchTime() const {
return mLaunchTime; return mLaunchTime;
} }

View file

@ -228,14 +228,14 @@ public:
uint32_t GetCheckerboardMagnitude() const; uint32_t GetCheckerboardMagnitude() const;
/** /**
* Report the number of CSSPixel-milliseconds of checkerboard to telemetry. * Report the number of CSSPixel-milliseconds of checkerboard.
*/ */
void ReportCheckerboard(const TimeStamp& aSampleTime); void ReportCheckerboard(const TimeStamp& aSampleTime);
/** /**
* Flush any active checkerboard report that's in progress. This basically * Flush any active checkerboard report that's in progress. This basically
* pretends like any in-progress checkerboard event has terminated, and pushes * pretends like any in-progress checkerboard event has terminated, and pushes
* out the report to the checkerboard reporting service and telemetry. If the * out the report to the checkerboard reporting service. If the
* checkerboard event has not really finished, it will start a new event * checkerboard event has not really finished, it will start a new event
* on the next composite. * on the next composite.
*/ */

View file

@ -157,8 +157,7 @@ private:
private: private:
/** /**
* If true, we should log the various properties during the checkerboard * If true, we should log the various properties during the checkerboard
* event. If false, we only need to record things we need for telemetry * event.
* measures.
*/ */
const bool mRecordTrace; const bool mRecordTrace;
/** /**

View file

@ -46,7 +46,7 @@ InputBlockState::SetConfirmedTargetApzc(const RefPtr<AsyncPanZoomController>& aT
aState == TargetConfirmationState::eConfirmed) { aState == TargetConfirmationState::eConfirmed) {
// The main thread finally responded. We had already timed out the // The main thread finally responded. We had already timed out the
// confirmation, but we want to update the state internally so that we // confirmation, but we want to update the state internally so that we
// can record the time for telemetry purposes. // can record the time.
mTargetConfirmed = TargetConfirmationState::eTimedOutAndMainThreadResponded; mTargetConfirmed = TargetConfirmationState::eTimedOutAndMainThreadResponded;
} }
if (mTargetConfirmed != TargetConfirmationState::eUnconfirmed) { if (mTargetConfirmed != TargetConfirmationState::eUnconfirmed) {

View file

@ -143,8 +143,7 @@ public:
/** /**
* This should be called when a content response notification has been * This should be called when a content response notification has been
* delivered to this block. If all the notifications have arrived, this * delivered to this block.
* will report the total time take to telemetry.
*/ */
void RecordContentResponseTime(); void RecordContentResponseTime();

View file

@ -11,7 +11,6 @@ namespace layers {
/** /**
* An enumeration that lists various input methods used to trigger scrolling. * An enumeration that lists various input methods used to trigger scrolling.
* Used as the values for the SCROLL_INPUT_METHODS telemetry histogram.
*/ */
enum class ScrollInputMethod { enum class ScrollInputMethod {

View file

@ -25,7 +25,6 @@
#include "mozilla/widget/WinCompositorWidget.h" #include "mozilla/widget/WinCompositorWidget.h"
#include "mozilla/EnumeratedArray.h" #include "mozilla/EnumeratedArray.h"
#include "mozilla/Telemetry.h"
#include "BlendShaderConstants.h" #include "BlendShaderConstants.h"
#include "D3D11ShareHandleImage.h" #include "D3D11ShareHandleImage.h"
@ -1376,9 +1375,6 @@ DeviceAttachmentsD3D11::InitSyncObject()
if (FAILED(hr) || !mSyncHandle) { if (FAILED(hr) || !mSyncHandle) {
gfxCriticalError() << "Failed to get SharedHandle for sync texture. Result: " gfxCriticalError() << "Failed to get SharedHandle for sync texture. Result: "
<< hexa(hr); << hexa(hr);
NS_DispatchToMainThread(NS_NewRunnableFunction([] () -> void {
Accumulate(Telemetry::D3D11_SYNC_HANDLE_FAILURE, 1);
}));
return false; return false;
} }

View file

@ -49,7 +49,6 @@
#include "mozilla/layout/RenderFrameParent.h" #include "mozilla/layout/RenderFrameParent.h"
#include "mozilla/media/MediaSystemResourceService.h" // for MediaSystemResourceService #include "mozilla/media/MediaSystemResourceService.h" // for MediaSystemResourceService
#include "mozilla/mozalloc.h" // for operator new, etc #include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/Telemetry.h"
#ifdef MOZ_WIDGET_GTK #ifdef MOZ_WIDGET_GTK
#include "basic/X11BasicCompositor.h" // for X11BasicCompositor #include "basic/X11BasicCompositor.h" // for X11BasicCompositor
#endif #endif
@ -70,7 +69,6 @@
#include "mozilla/Hal.h" #include "mozilla/Hal.h"
#include "mozilla/HalTypes.h" #include "mozilla/HalTypes.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/VsyncDispatcher.h" #include "mozilla/VsyncDispatcher.h"
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
#include "VsyncSource.h" #include "VsyncSource.h"

View file

@ -70,8 +70,6 @@ public:
// Force gfxDevCrash to use MOZ_CRASH in Beta and Release // Force gfxDevCrash to use MOZ_CRASH in Beta and Release
DECL_GFX_ENV("MOZ_GFX_CRASH_MOZ_CRASH", GfxDevCrashMozCrash); DECL_GFX_ENV("MOZ_GFX_CRASH_MOZ_CRASH", GfxDevCrashMozCrash);
// Force gfxDevCrash to use telemetry in Nightly and Aurora
DECL_GFX_ENV("MOZ_GFX_CRASH_TELEMETRY", GfxDevCrashTelemetry);
DECL_GFX_ENV("MOZ_GFX_VR_NO_DISTORTION", VRNoDistortion); DECL_GFX_ENV("MOZ_GFX_VR_NO_DISTORTION", VRNoDistortion);

View file

@ -34,7 +34,6 @@
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "gfxSVGGlyphs.h" #include "gfxSVGGlyphs.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"

View file

@ -28,7 +28,6 @@
#include "GeckoProfiler.h" #include "GeckoProfiler.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsVersion.h" #include "mozilla/WindowsVersion.h"
#include <usp10.h> #include <usp10.h>

View file

@ -159,9 +159,7 @@ public:
static gfxPlatform *GetPlatform(); static gfxPlatform *GetPlatform();
/** /**
* Returns whether or not graphics has been initialized yet. This is * Returns whether or not graphics has been initialized yet.
* intended for Telemetry where we don't necessarily want to initialize
* graphics just to observe its state.
*/ */
static bool Initialized(); static bool Initialized();

View file

@ -17,7 +17,6 @@
#include "gfxFontConstants.h" #include "gfxFontConstants.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "gfxPlatformFontList.h" #include "gfxPlatformFontList.h"

View file

@ -13,7 +13,6 @@
#include "nsProxyRelease.h" #include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "mozilla/Telemetry.h"
using mozilla::gfx::IntSize; using mozilla::gfx::IntSize;
using mozilla::gfx::SurfaceFormat; using mozilla::gfx::SurfaceFormat;
@ -21,29 +20,6 @@ using mozilla::gfx::SurfaceFormat;
namespace mozilla { namespace mozilla {
namespace image { namespace image {
class MOZ_STACK_CLASS AutoRecordDecoderTelemetry final
{
public:
explicit AutoRecordDecoderTelemetry(Decoder* aDecoder)
: mDecoder(aDecoder)
{
MOZ_ASSERT(mDecoder);
// Begin recording telemetry data.
mStartTime = TimeStamp::Now();
}
~AutoRecordDecoderTelemetry()
{
// Finish telemetry.
mDecoder->mDecodeTime += (TimeStamp::Now() - mStartTime);
}
private:
Decoder* mDecoder;
TimeStamp mStartTime;
};
Decoder::Decoder(RasterImage* aImage) Decoder::Decoder(RasterImage* aImage)
: mImageData(nullptr) : mImageData(nullptr)
, mImageDataLength(0) , mImageDataLength(0)
@ -124,7 +100,6 @@ Decoder::Decode(IResumable* aOnResume /* = nullptr */)
LexerResult lexerResult(TerminalState::FAILURE); LexerResult lexerResult(TerminalState::FAILURE);
{ {
PROFILER_LABEL("ImageDecoder", "Decode", js::ProfileEntry::Category::GRAPHICS); PROFILER_LABEL("ImageDecoder", "Decode", js::ProfileEntry::Category::GRAPHICS);
AutoRecordDecoderTelemetry telemetry(this);
lexerResult = DoDecode(*mIterator, aOnResume); lexerResult = DoDecode(*mIterator, aOnResume);
}; };
@ -267,16 +242,6 @@ Decoder::FinalStatus() const
ShouldReportError()); ShouldReportError());
} }
DecoderTelemetry
Decoder::Telemetry() const
{
MOZ_ASSERT(mIterator);
return DecoderTelemetry(SpeedHistogram(),
mIterator->ByteCount(),
mIterator->ChunkCount(),
mDecodeTime);
}
nsresult nsresult
Decoder::AllocateFrame(const gfx::IntSize& aOutputSize, Decoder::AllocateFrame(const gfx::IntSize& aOutputSize,
const gfx::IntRect& aFrameRect, const gfx::IntRect& aFrameRect,

View file

@ -66,7 +66,6 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Capture the decoder's state. // Capture the decoder's state.
DecoderFinalStatus finalStatus = aDecoder->FinalStatus(); DecoderFinalStatus finalStatus = aDecoder->FinalStatus();
ImageMetadata metadata = aDecoder->GetImageMetadata(); ImageMetadata metadata = aDecoder->GetImageMetadata();
DecoderTelemetry telemetry = aDecoder->Telemetry();
Progress progress = aDecoder->TakeProgress(); Progress progress = aDecoder->TakeProgress();
IntRect invalidRect = aDecoder->TakeInvalidRect(); IntRect invalidRect = aDecoder->TakeInvalidRect();
Maybe<uint32_t> frameCount = aDecoder->TakeCompleteFrameCount(); Maybe<uint32_t> frameCount = aDecoder->TakeCompleteFrameCount();
@ -75,7 +74,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Synchronously notify if we can. // Synchronously notify if we can.
if (NS_IsMainThread() && !(decoderFlags & DecoderFlags::ASYNC_NOTIFY)) { if (NS_IsMainThread() && !(decoderFlags & DecoderFlags::ASYNC_NOTIFY)) {
aImage->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress, aImage->NotifyDecodeComplete(finalStatus, metadata, progress,
invalidRect, frameCount, decoderFlags, invalidRect, frameCount, decoderFlags,
surfaceFlags); surfaceFlags);
return; return;
@ -84,7 +83,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// We're forced to notify asynchronously. // We're forced to notify asynchronously.
NotNull<RefPtr<RasterImage>> image = aImage; NotNull<RefPtr<RasterImage>> image = aImage;
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void { NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
image->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress, image->NotifyDecodeComplete(finalStatus, metadata, progress,
invalidRect, frameCount, decoderFlags, invalidRect, frameCount, decoderFlags,
surfaceFlags); surfaceFlags);
})); }));

View file

@ -40,7 +40,6 @@
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include <stdint.h> #include <stdint.h>
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tuple.h" #include "mozilla/Tuple.h"
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/gfx/Scale.h" #include "mozilla/gfx/Scale.h"
@ -1558,7 +1557,6 @@ RasterImage::NotifyProgress(Progress aProgress,
void void
RasterImage::NotifyDecodeComplete(const DecoderFinalStatus& aStatus, RasterImage::NotifyDecodeComplete(const DecoderFinalStatus& aStatus,
const ImageMetadata& aMetadata, const ImageMetadata& aMetadata,
const DecoderTelemetry& aTelemetry,
Progress aProgress, Progress aProgress,
const IntRect& aInvalidRect, const IntRect& aInvalidRect,
const Maybe<uint32_t>& aFrameCount, const Maybe<uint32_t>& aFrameCount,

View file

@ -224,7 +224,6 @@ public:
*/ */
void NotifyDecodeComplete(const DecoderFinalStatus& aStatus, void NotifyDecodeComplete(const DecoderFinalStatus& aStatus,
const ImageMetadata& aMetadata, const ImageMetadata& aMetadata,
const DecoderTelemetry& aTelemetry,
Progress aProgress, Progress aProgress,
const gfx::IntRect& aInvalidRect, const gfx::IntRect& aInvalidRect,
const Maybe<uint32_t>& aFrameCount, const Maybe<uint32_t>& aFrameCount,

View file

@ -52,7 +52,6 @@ mailing address.
#include "gfxPlatform.h" #include "gfxPlatform.h"
#include "qcms.h" #include "qcms.h"
#include <algorithm> #include <algorithm>
#include "mozilla/Telemetry.h"
using namespace mozilla::gfx; using namespace mozilla::gfx;
@ -1088,11 +1087,5 @@ nsGIFDecoder2::SkipSubBlocks(const char* aData)
nextSubBlockLength); nextSubBlockLength);
} }
Maybe<Telemetry::ID>
nsGIFDecoder2::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_GIF);
}
} // namespace image } // namespace image
} // namespace mozilla } // namespace mozilla

View file

@ -29,8 +29,6 @@ protected:
IResumable* aOnResume) override; IResumable* aOnResume) override;
nsresult FinishInternal() override; nsresult FinishInternal() override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
private: private:
friend class DecoderFactory; friend class DecoderFactory;

View file

@ -24,7 +24,6 @@
#include "gfxPlatform.h" #include "gfxPlatform.h"
#include "mozilla/EndianUtils.h" #include "mozilla/EndianUtils.h"
#include "mozilla/Telemetry.h"
extern "C" { extern "C" {
#include "iccjpeg.h" #include "iccjpeg.h"
@ -123,12 +122,6 @@ nsJPEGDecoder::~nsJPEGDecoder()
this)); this));
} }
Maybe<Telemetry::ID>
nsJPEGDecoder::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_JPEG);
}
nsresult nsresult
nsJPEGDecoder::InitInternal() nsJPEGDecoder::InitInternal()
{ {

View file

@ -65,8 +65,6 @@ protected:
IResumable* aOnResume) override; IResumable* aOnResume) override;
nsresult FinishInternal() override; nsresult FinishInternal() override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
protected: protected:
Orientation ReadOrientationFromEXIF(); Orientation ReadOrientationFromEXIF();
void OutputScanlines(bool* suspend); void OutputScanlines(bool* suspend);

View file

@ -22,7 +22,6 @@
#include "RasterImage.h" #include "RasterImage.h"
#include "SurfacePipeFactory.h" #include "SurfacePipeFactory.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
using namespace mozilla::gfx; using namespace mozilla::gfx;
@ -1087,12 +1086,6 @@ nsPNGDecoder::warning_callback(png_structp png_ptr, png_const_charp warning_msg)
MOZ_LOG(sPNGLog, LogLevel::Warning, ("libpng warning: %s\n", warning_msg)); MOZ_LOG(sPNGLog, LogLevel::Warning, ("libpng warning: %s\n", warning_msg));
} }
Maybe<Telemetry::ID>
nsPNGDecoder::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_PNG);
}
bool bool
nsPNGDecoder::IsValidICO() const nsPNGDecoder::IsValidICO() const
{ {

View file

@ -30,8 +30,6 @@ protected:
LexerResult DoDecode(SourceBufferIterator& aIterator, LexerResult DoDecode(SourceBufferIterator& aIterator,
IResumable* aOnResume) override; IResumable* aOnResume) override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
private: private:
friend class DecoderFactory; friend class DecoderFactory;

View file

@ -5,7 +5,6 @@
#ifndef nsShiftJISToUnicode_h__ #ifndef nsShiftJISToUnicode_h__
#define nsShiftJISToUnicode_h__ #define nsShiftJISToUnicode_h__
#include "nsUCSupport.h" #include "nsUCSupport.h"
#include "mozilla/Telemetry.h"
class nsShiftJISToUnicode : public nsBasicDecoderSupport class nsShiftJISToUnicode : public nsBasicDecoderSupport
{ {

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsCP866ToUnicode.h" #include "nsCP866ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsISO88595ToUnicode.h" #include "nsISO88595ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsKOI8UToUnicode.h" #include "nsKOI8UToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacCEToUnicode.h" #include "nsMacCEToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:ts=2:et:sw=2:
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -54,7 +53,6 @@
#include "nsCSSRenderingBorders.h" #include "nsCSSRenderingBorders.h"
#include "mozilla/css/ImageLoader.h" #include "mozilla/css/ImageLoader.h"
#include "ImageContainer.h" #include "ImageContainer.h"
#include "mozilla/Telemetry.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "gfxGradientCache.h" #include "gfxGradientCache.h"
#include "nsInlineFrame.h" #include "nsInlineFrame.h"

View file

@ -124,7 +124,6 @@
#include <stdio.h> #include <stdio.h>
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;

View file

@ -43,7 +43,6 @@
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include <stdint.h> #include <stdint.h>
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
#include "mozilla/Telemetry.h"
#include "FrameLayerBuilder.h" #include "FrameLayerBuilder.h"
#include "nsSMILKeySpline.h" #include "nsSMILKeySpline.h"
#include "nsSubDocumentFrame.h" #include "nsSubDocumentFrame.h"
@ -1706,8 +1705,6 @@ public:
, mCallee(nullptr) , mCallee(nullptr)
, mOneDevicePixelInAppUnits(aPresContext->DevPixelsToAppUnits(1)) , mOneDevicePixelInAppUnits(aPresContext->DevPixelsToAppUnits(1))
{ {
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, true);
} }
NS_INLINE_DECL_REFCOUNTING(AsyncSmoothMSDScroll, override) NS_INLINE_DECL_REFCOUNTING(AsyncSmoothMSDScroll, override)
@ -1808,8 +1805,6 @@ private:
// Private destructor, to discourage deletion outside of Release(): // Private destructor, to discourage deletion outside of Release():
~AsyncSmoothMSDScroll() { ~AsyncSmoothMSDScroll() {
RemoveObserver(); RemoveObserver();
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, false);
} }
nsRefreshDriver* RefreshDriver(ScrollFrameHelper* aCallee) { nsRefreshDriver* RefreshDriver(ScrollFrameHelper* aCallee) {
@ -1836,16 +1831,12 @@ public:
: AsyncScrollBase(aStartPos) : AsyncScrollBase(aStartPos)
, mCallee(nullptr) , mCallee(nullptr)
{ {
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, true);
} }
private: private:
// Private destructor, to discourage deletion outside of Release(): // Private destructor, to discourage deletion outside of Release():
~AsyncScroll() { ~AsyncScroll() {
RemoveObserver(); RemoveObserver();
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, false);
} }
public: public:

View file

@ -78,7 +78,6 @@ static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID);
#include "mozilla/ErrorResult.h" #include "mozilla/ErrorResult.h"
#include "mozilla/dom/SelectionBinding.h" #include "mozilla/dom/SelectionBinding.h"
#include "mozilla/AsyncEventDispatcher.h" #include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/layers/ScrollInputMethods.h"
#include "nsViewManager.h" #include "nsViewManager.h"

View file

@ -18,7 +18,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/SizePrintfMacros.h" #include "mozilla/SizePrintfMacros.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsContentPolicyUtils.h" #include "nsContentPolicyUtils.h"
#include "nsCSSParser.h" #include "nsCSSParser.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:ts=2:et:sw=2:
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -13,7 +12,6 @@
#include "nsError.h" #include "nsError.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "FontFaceSet.h" #include "FontFaceSet.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIPrincipal.h" #include "nsIPrincipal.h"

View file

@ -22,7 +22,6 @@
#include "nsRepeatService.h" #include "nsRepeatService.h"
#include "mozilla/LookAndFeel.h" #include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/layers/ScrollInputMethods.h"
using namespace mozilla; using namespace mozilla;

View file

@ -41,7 +41,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/LookAndFeel.h" #include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/APZCCallbackHelper.h" #include "mozilla/layers/APZCCallbackHelper.h"
#include "mozilla/layers/AsyncDragMetrics.h" #include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/InputAPZContext.h" #include "mozilla/layers/InputAPZContext.h"

View file

@ -12,7 +12,6 @@
#include "mozilla/EndianUtils.h" #include "mozilla/EndianUtils.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "VideoUtils.h" #include "VideoUtils.h"
#include "mp4_demuxer/MoofParser.h" #include "mp4_demuxer/MoofParser.h"

View file

@ -38,7 +38,6 @@
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/net/NeckoCommon.h" #include "mozilla/net/NeckoCommon.h"
#include "mozilla/net/NeckoParent.h" #include "mozilla/net/NeckoParent.h"
@ -1079,9 +1078,6 @@ Predictor::CalculateConfidence(uint32_t hitCount, uint32_t hitsPossible,
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
Telemetry::AutoCounter<Telemetry::PREDICTOR_PREDICTIONS_CALCULATED> predictionsCalculated;
++predictionsCalculated;
if (!hitsPossible) { if (!hitsPossible) {
return 0; return 0;
} }
@ -1316,18 +1312,11 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
preconnects.SwapElements(mPreconnects); preconnects.SwapElements(mPreconnects);
preresolves.SwapElements(mPreresolves); preresolves.SwapElements(mPreresolves);
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PREDICTIONS> totalPredictions;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PREFETCHES> totalPrefetches;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS> totalPreconnects;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRERESOLVES> totalPreresolves;
len = prefetches.Length(); len = prefetches.Length();
for (i = 0; i < len; ++i) { for (i = 0; i < len; ++i) {
PREDICTOR_LOG((" doing prefetch")); PREDICTOR_LOG((" doing prefetch"));
nsCOMPtr<nsIURI> uri = prefetches[i]; nsCOMPtr<nsIURI> uri = prefetches[i];
if (NS_SUCCEEDED(Prefetch(uri, referrer, verifier))) { if (NS_SUCCEEDED(Prefetch(uri, referrer, verifier))) {
++totalPredictions;
++totalPrefetches;
predicted = true; predicted = true;
} }
} }
@ -1336,8 +1325,6 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
for (i = 0; i < len; ++i) { for (i = 0; i < len; ++i) {
PREDICTOR_LOG((" doing preconnect")); PREDICTOR_LOG((" doing preconnect"));
nsCOMPtr<nsIURI> uri = preconnects[i]; nsCOMPtr<nsIURI> uri = preconnects[i];
++totalPredictions;
++totalPreconnects;
mSpeculativeService->SpeculativeConnect2(uri, nullptr, this); mSpeculativeService->SpeculativeConnect2(uri, nullptr, this);
predicted = true; predicted = true;
if (verifier) { if (verifier) {
@ -1350,8 +1337,6 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
nsCOMPtr<nsIThread> mainThread = do_GetMainThread(); nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
for (i = 0; i < len; ++i) { for (i = 0; i < len; ++i) {
nsCOMPtr<nsIURI> uri = preresolves[i]; nsCOMPtr<nsIURI> uri = preresolves[i];
++totalPredictions;
++totalPreresolves;
nsAutoCString hostname; nsAutoCString hostname;
uri->GetAsciiHost(hostname); uri->GetAsciiHost(hostname);
PREDICTOR_LOG((" doing preresolve %s", hostname.get())); PREDICTOR_LOG((" doing preresolve %s", hostname.get()));
@ -1482,9 +1467,6 @@ Predictor::Learn(nsIURI *targetURI, nsIURI *sourceURI,
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
} }
Telemetry::AutoCounter<Telemetry::PREDICTOR_LEARN_ATTEMPTS> learnAttempts;
++learnAttempts;
Predictor::Reason argReason; Predictor::Reason argReason;
argReason.mLearn = reason; argReason.mLearn = reason;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -11,7 +10,6 @@
#include "mozilla/LoadInfo.h" #include "mozilla/LoadInfo.h"
#include "mozilla/BasePrincipal.h" #include "mozilla/BasePrincipal.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
#include "nsNetUtilInlines.h" #include "nsNetUtilInlines.h"
#include "mozIApplicationClearPrivateDataParams.h" #include "mozIApplicationClearPrivateDataParams.h"

View file

@ -21,7 +21,6 @@
#include "nsRefPtrHashtable.h" #include "nsRefPtrHashtable.h"
#include "mozilla/CondVar.h" #include "mozilla/CondVar.h"
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#include "mozilla/Telemetry.h"
class nsCacheRequest; class nsCacheRequest;
class nsCacheProfilePrefObserver; class nsCacheProfilePrefObserver;
@ -254,7 +253,6 @@ private:
*/ */
static void Lock(); static void Lock();
static void Lock(::mozilla::Telemetry::ID mainThreadLockerID);
static void Unlock(); static void Unlock();
void LockAcquired(); void LockAcquired();
void LockReleased(); void LockReleased();

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -7,7 +6,6 @@
#include "nsDeleteDir.h" #include "nsDeleteDir.h"
#include "nsIFile.h" #include "nsIFile.h"
#include "nsString.h" #include "nsString.h"
#include "mozilla/Telemetry.h"
#include "nsITimer.h" #include "nsITimer.h"
#include "nsISimpleEnumerator.h" #include "nsISimpleEnumerator.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"

View file

@ -45,7 +45,6 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
static const char DISK_CACHE_DEVICE_ID[] = { "disk" }; static const char DISK_CACHE_DEVICE_ID[] = { "disk" };
using namespace mozilla; using namespace mozilla;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -46,8 +45,6 @@
#include "nsICacheVisitor.h" #include "nsICacheVisitor.h"
#include "nsISeekableStream.h" #include "nsISeekableStream.h"
#include "mozilla/Telemetry.h"
#include "sqlite3.h" #include "sqlite3.h"
#include "mozilla/storage.h" #include "mozilla/storage.h"
#include "nsVariant.h" #include "nsVariant.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 cin et: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -1243,8 +1242,7 @@ nsDiskCacheMap::InitCacheClean(nsIFile * cacheDirectory,
rv = cacheCleanFile->AppendNative( rv = cacheCleanFile->AppendNative(
NS_LITERAL_CSTRING("_CACHE_CLEAN_")); NS_LITERAL_CSTRING("_CACHE_CLEAN_"));
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
// Check if the file already exists, if it does, we will later read the // Check if the file already exists.
// value and report it to telemetry.
cacheCleanFile->Exists(&cacheCleanFileExists); cacheCleanFile->Exists(&cacheCleanFileExists);
} }
} }
@ -1406,14 +1404,9 @@ nsDiskCacheMap::RevalidateCache()
"cache not in a safe state\n")); "cache not in a safe state\n"));
// Normally we would return an error here, but there is a bug where // Normally we would return an error here, but there is a bug where
// the doom list sometimes gets an entry 'stuck' and doens't clear it // the doom list sometimes gets an entry 'stuck' and doens't clear it
// until browser shutdown. So we allow revalidation for the time being // until browser shutdown. So we allow revalidation for the time being.
// to get proper telemetry data of how much the cache corruption plan
// would help.
} }
// If telemetry data shows it is worth it, we'll be flushing headers and
// records before flushing the clean cache file.
// Write out the _CACHE_CLEAN_ file with '1' // Write out the _CACHE_CLEAN_ file with '1'
rv = WriteCacheClean(true); rv = WriteCacheClean(true);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {

View file

@ -13,7 +13,6 @@
#include "mozilla/FileUtils.h" #include "mozilla/FileUtils.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include <algorithm> #include <algorithm>

View file

@ -12,7 +12,6 @@
#include "nsCRT.h" #include "nsCRT.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
#include "mozilla/Telemetry.h"
#include <algorithm> #include <algorithm>
// The memory cache implements the "LRU-SP" caching algorithm // The memory cache implements the "LRU-SP" caching algorithm

View file

@ -25,7 +25,6 @@
#include "nsProxyRelease.h" #include "nsProxyRelease.h"
#include "nsSerializationHelper.h" #include "nsSerializationHelper.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/Telemetry.h"
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>
@ -408,12 +407,7 @@ bool CacheEntry::Load(bool aTruncate, bool aPriority)
bool directLoad = aTruncate || !mUseDisk; bool directLoad = aTruncate || !mUseDisk;
if (directLoad) { if (directLoad) {
// mLoadStart will be used to calculate telemetry of life-time of this entry.
// Low resulution is then enough.
mLoadStart = TimeStamp::NowLoRes();
mPinningKnown = true; mPinningKnown = true;
} else {
mLoadStart = TimeStamp::Now();
} }
{ {
@ -451,8 +445,6 @@ NS_IMETHODIMP CacheEntry::OnFileReady(nsresult aResult, bool aIsNew)
LOG(("CacheEntry::OnFileReady [this=%p, rv=0x%08x, new=%d]", LOG(("CacheEntry::OnFileReady [this=%p, rv=0x%08x, new=%d]",
this, aResult, aIsNew)); this, aResult, aIsNew));
MOZ_ASSERT(!mLoadStart.IsNull());
// OnFileReady, that is the only code that can transit from LOADING // OnFileReady, that is the only code that can transit from LOADING
// to any follow-on state and can only be invoked ones on an entry. // to any follow-on state and can only be invoked ones on an entry.
// Until this moment there is no consumer that could manipulate // Until this moment there is no consumer that could manipulate

View file

@ -88,8 +88,6 @@ public:
bool CanRegister() const; bool CanRegister() const;
void SetRegistered(bool aRegistered); void SetRegistered(bool aRegistered);
TimeStamp const& LoadStart() const { return mLoadStart; }
enum EPurge { enum EPurge {
PURGE_DATA_ONLY_DISK_BACKED, PURGE_DATA_ONLY_DISK_BACKED,
PURGE_WHOLE_ONLY_DISK_BACKED, PURGE_WHOLE_ONLY_DISK_BACKED,
@ -376,7 +374,6 @@ private:
nsCOMPtr<nsISupports> mSecurityInfo; nsCOMPtr<nsISupports> mSecurityInfo;
int64_t mPredictedDataSize; int64_t mPredictedDataSize;
mozilla::TimeStamp mLoadStart;
uint32_t mUseCount; uint32_t mUseCount;
}; };

View file

@ -18,8 +18,6 @@
#include "Http2Push.h" #include "Http2Push.h"
#include "Http2Session.h" #include "Http2Session.h"
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace net { namespace net {

View file

@ -105,7 +105,7 @@ public:
// determine if a version of the protocol is enabled for index < kCount // determine if a version of the protocol is enabled for index < kCount
bool ProtocolEnabled(uint32_t index) const; bool ProtocolEnabled(uint32_t index) const;
uint8_t Version[kCount]; // telemetry enum e.g. SPDY_VERSION_31 uint8_t Version[kCount]; // enum e.g. SPDY_VERSION_31
nsCString VersionString[kCount]; // npn string e.g. "spdy/3.1" nsCString VersionString[kCount]; // npn string e.g. "spdy/3.1"
// the ALPNCallback function allows the protocol stack to decide whether or // the ALPNCallback function allows the protocol stack to decide whether or

View file

@ -13,7 +13,6 @@
#include "nsDeque.h" #include "nsDeque.h"
#include "nsString.h" #include "nsString.h"
#include "nsIMemoryReporter.h" #include "nsIMemoryReporter.h"
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace net { namespace net {
@ -85,10 +84,6 @@ protected:
uint32_t mPeakSize; uint32_t mPeakSize;
uint32_t mPeakCount; uint32_t mPeakCount;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakSizeID;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakCountID;
private: private:
RefPtr<HpackDynamicTableReporter> mDynamicReporter; RefPtr<HpackDynamicTableReporter> mDynamicReporter;
@ -101,8 +96,6 @@ class Http2Decompressor final : public Http2BaseCompressor
public: public:
Http2Decompressor() Http2Decompressor()
{ {
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_DECOMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_DECOMPRESSOR;
}; };
virtual ~Http2Decompressor() { } ; virtual ~Http2Decompressor() { } ;
@ -159,8 +152,6 @@ public:
mBufferSizeChangeWaiting(false), mBufferSizeChangeWaiting(false),
mLowestBufferSizeWaiting(0) mLowestBufferSizeWaiting(0)
{ {
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_COMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_COMPRESSOR;
}; };
virtual ~Http2Compressor() { } virtual ~Http2Compressor() { }

View file

@ -19,7 +19,6 @@
#include "Http2Push.h" #include "Http2Push.h"
#include "mozilla/EndianUtils.h" #include "mozilla/EndianUtils.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "nsHttp.h" #include "nsHttp.h"
#include "nsHttpHandler.h" #include "nsHttpHandler.h"
@ -97,7 +96,6 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
, mGoAwayID(0) , mGoAwayID(0)
, mOutgoingGoAwayID(0) , mOutgoingGoAwayID(0)
, mConcurrent(0) , mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin) , mServerInitialStreamWindow(kDefaultRwin)
, mLocalSessionWindow(kDefaultRwin) , mLocalSessionWindow(kDefaultRwin)
, mServerSessionWindow(kDefaultRwin) , mServerSessionWindow(kDefaultRwin)
@ -1628,7 +1626,6 @@ Http2Session::RecvPushPromise(Http2Session *self)
return rv; return rv;
Http2Stream *associatedStream = self->mInputFrameDataStream; Http2Stream *associatedStream = self->mInputFrameDataStream;
++(self->mServerPushedResources);
// Anytime we start using the high bit of stream ID (either client or server) // Anytime we start using the high bit of stream ID (either client or server)
// begin to migrate to a new session. // begin to migrate to a new session.

View file

@ -441,9 +441,6 @@ private:
// below the current value // below the current value
uint32_t mConcurrent; uint32_t mConcurrent;
// The number of server initiated promises, tracked for telemetry
uint32_t mServerPushedResources;
// The server rwin for new streams as determined from a SETTINGS frame // The server rwin for new streams as determined from a SETTINGS frame
uint32_t mServerInitialStreamWindow; uint32_t mServerInitialStreamWindow;

View file

@ -6585,7 +6585,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
mTransferSize = mTransaction->GetTransferSize(); mTransferSize = mTransaction->GetTransferSize();
// If we are using the transaction to serve content, we also save the // If we are using the transaction to serve content, we also save the
// time since async open in the cache entry so we can compare telemetry // time since async open in the cache entry so we can compare time
// between cache and net response. // between cache and net response.
if (request == mTransactionPump && mCacheEntry && if (request == mTransactionPump && mCacheEntry &&
!mAsyncOpenTime.IsNull() && !mOnStartRequestTimestamp.IsNull()) { !mAsyncOpenTime.IsNull() && !mOnStartRequestTimestamp.IsNull()) {

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set et cin ts=4 sw=4 sts=4: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -28,7 +27,6 @@
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsILoadContext.h" #include "nsILoadContext.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "mozilla/Telemetry.h"
#include "nsIProxiedChannel.h" #include "nsIProxiedChannel.h"
#include "nsIProxyInfo.h" #include "nsIProxyInfo.h"

View file

@ -11,7 +11,6 @@
#include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ContentParent.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "nsAppDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceUtils.h"

View file

@ -8,7 +8,6 @@
#include "NSSCertDBTrustDomain.h" #include "NSSCertDBTrustDomain.h"
#include "ScopedNSSTypes.h" #include "ScopedNSSTypes.h"
#include "SharedSSLState.h" #include "SharedSSLState.h"
#include "mozilla/Telemetry.h"
#include "nsAppDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h"
#include "nsCRT.h" #include "nsCRT.h"
#include "nsILineInputStream.h" #include "nsILineInputStream.h"
@ -150,7 +149,6 @@ nsCertOverrideService::Observe(nsISupports *,
mSettingsFile = nullptr; mSettingsFile = nullptr;
} }
Read(); Read();
CountPermanentOverrideTelemetry();
} }
return NS_OK; return NS_OK;
@ -597,20 +595,6 @@ nsCertOverrideService::ClearValidityOverride(const nsACString & aHostName, int32
return NS_OK; return NS_OK;
} }
void
nsCertOverrideService::CountPermanentOverrideTelemetry()
{
ReentrantMonitorAutoEnter lock(monitor);
uint32_t overrideCount = 0;
for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) {
if (!iter.Get()->mSettings.mIsTemporary) {
overrideCount++;
}
}
Telemetry::Accumulate(Telemetry::SSL_PERMANENT_CERT_ERROR_OVERRIDES,
overrideCount);
}
static bool static bool
matchesDBKey(nsIX509Cert* cert, const nsCString& matchDbKey) matchesDBKey(nsIX509Cert* cert, const nsCString& matchDbKey)
{ {

View file

@ -1,4 +1,3 @@
/* vim:set ts=2 sw=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -17,7 +16,6 @@
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsICryptoHMAC.h" #include "nsICryptoHMAC.h"
@ -1007,11 +1005,6 @@ nsNTLMAuthModule::Init(const char *serviceName,
mPassword = password; mPassword = password;
mNTLMNegotiateSent = false; mNTLMNegotiateSent = false;
static bool sTelemetrySent = false;
if (!sTelemetrySent) {
sTelemetrySent = true;
}
return NS_OK; return NS_OK;
} }

View file

@ -8,7 +8,6 @@
#include "mozilla/Casting.h" #include "mozilla/Casting.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsIMutableArray.h" #include "nsIMutableArray.h"

View file

@ -31,11 +31,12 @@
#include "nsZipArchive.h" #include "nsZipArchive.h"
#include "mozilla/Omnijar.h" #include "mozilla/Omnijar.h"
#include "prenv.h" #include "prenv.h"
#include "mozilla/Telemetry.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
#include "nsIProtocolHandler.h" #include "nsIProtocolHandler.h"
#include "GeckoProfiler.h"
#ifdef IS_BIG_ENDIAN #ifdef IS_BIG_ENDIAN
#define SC_ENDIAN "big" #define SC_ENDIAN "big"
#else #else
@ -420,8 +421,7 @@ StartupCache::WriteToDisk()
// If we didn't have an mArchive member, that means that we failed to // If we didn't have an mArchive member, that means that we failed to
// open the startup cache for reading. Therefore, we need to record // open the startup cache for reading. Therefore, we need to record
// the time of creation in a zipfile comment; this will be useful for // the time of creation in a zipfile comment.
// Telemetry statistics.
PRTime now = PR_Now(); PRTime now = PR_Now();
if (!mArchive) { if (!mArchive) {
nsCString comment; nsCString comment;

View file

@ -1,11 +1,15 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* This is a passthrough module initially set up to record telemetry via
an IO interposer. While the interposing plumbing is still intact to
avoid storage issues, telemetry recording has been removed
MCFIXME: Rewrite calls to go directly to SQLite and no longer through
this plumbing... */
#include <string.h> #include <string.h>
#include "mozilla/Telemetry.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "sqlite3.h" #include "sqlite3.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
@ -37,20 +41,10 @@ using namespace mozilla::dom::quota;
struct Histograms { struct Histograms {
const char *name; const char *name;
const Telemetry::ID readB;
const Telemetry::ID writeB;
const Telemetry::ID readMS;
const Telemetry::ID writeMS;
const Telemetry::ID syncMS;
}; };
#define SQLITE_TELEMETRY(FILENAME, HGRAM) \ #define SQLITE_TELEMETRY(FILENAME, HGRAM) \
{ FILENAME, \ { FILENAME, \
Telemetry::MOZ_SQLITE_ ## HGRAM ## _READ_B, \
Telemetry::MOZ_SQLITE_ ## HGRAM ## _WRITE_B, \
Telemetry::MOZ_SQLITE_ ## HGRAM ## _READ_MS, \
Telemetry::MOZ_SQLITE_ ## HGRAM ## _WRITE_MS, \
Telemetry::MOZ_SQLITE_ ## HGRAM ## _SYNC_MS \
} }
Histograms gHistograms[] = { Histograms gHistograms[] = {
@ -70,31 +64,12 @@ public:
* automatically determines whether IO is happening on the main * automatically determines whether IO is happening on the main
* thread and picks an appropriate histogram. * thread and picks an appropriate histogram.
* *
* @param id takes a telemetry histogram id. The id+1 must be an
* equivalent histogram for the main thread. Eg, MOZ_SQLITE_OPEN_MS
* is followed by MOZ_SQLITE_OPEN_MAIN_THREAD_MS.
*
* @param aOp optionally takes an IO operation to report through the * @param aOp optionally takes an IO operation to report through the
* IOInterposer. Filename will be reported as NULL, and reference will be * IOInterposer. Filename will be reported as NULL, and reference will be
* either "sqlite-mainthread" or "sqlite-otherthread". * either "sqlite-mainthread" or "sqlite-otherthread".
*/ */
explicit IOThreadAutoTimer(Telemetry::ID aId,
IOInterposeObserver::Operation aOp = IOInterposeObserver::OpNone)
: start(TimeStamp::Now()),
id(aId),
op(aOp)
{
}
/**
* This constructor is for when we want to report an operation to
* IOInterposer but do not require a telemetry probe.
*
* @param aOp IO Operation to report through the IOInterposer.
*/
explicit IOThreadAutoTimer(IOInterposeObserver::Operation aOp) explicit IOThreadAutoTimer(IOInterposeObserver::Operation aOp)
: start(TimeStamp::Now()), : start(TimeStamp::Now()),
id(Telemetry::HistogramCount),
op(aOp) op(aOp)
{ {
} }
@ -108,7 +83,6 @@ public:
private: private:
const TimeStamp start; const TimeStamp start;
const Telemetry::ID id;
IOInterposeObserver::Operation op; IOInterposeObserver::Operation op;
}; };
@ -351,7 +325,6 @@ int
xRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst) xRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst)
{ {
telemetry_file *p = (telemetry_file *)pFile; telemetry_file *p = (telemetry_file *)pFile;
IOThreadAutoTimer ioTimer(p->histograms->readMS, IOInterposeObserver::OpRead);
int rc; int rc;
rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst); rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst);
// sqlite likes to read from empty files, this is normal, ignore it. // sqlite likes to read from empty files, this is normal, ignore it.
@ -378,7 +351,6 @@ int
xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, sqlite_int64 iOfst) xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, sqlite_int64 iOfst)
{ {
telemetry_file *p = (telemetry_file *)pFile; telemetry_file *p = (telemetry_file *)pFile;
IOThreadAutoTimer ioTimer(p->histograms->writeMS, IOInterposeObserver::OpWrite);
int rc; int rc;
if (p->quotaObject) { if (p->quotaObject) {
MOZ_ASSERT(INT64_MAX - iOfst >= iAmt); MOZ_ASSERT(INT64_MAX - iOfst >= iAmt);
@ -404,7 +376,6 @@ xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, sqlite_int64 iOfst)
int int
xTruncate(sqlite3_file *pFile, sqlite_int64 size) xTruncate(sqlite3_file *pFile, sqlite_int64 size)
{ {
IOThreadAutoTimer ioTimer(Telemetry::MOZ_SQLITE_TRUNCATE_MS);
telemetry_file *p = (telemetry_file *)pFile; telemetry_file *p = (telemetry_file *)pFile;
int rc; int rc;
if (p->quotaObject) { if (p->quotaObject) {
@ -420,14 +391,7 @@ xTruncate(sqlite3_file *pFile, sqlite_int64 size)
} }
rc = p->pReal->pMethods->xTruncate(p->pReal, size); rc = p->pReal->pMethods->xTruncate(p->pReal, size);
if (p->quotaObject) { if (p->quotaObject) {
if (rc == SQLITE_OK) { if (rc != SQLITE_OK) {
#ifdef DEBUG
// Make sure xTruncate set the size exactly as we calculated above.
sqlite_int64 newSize;
MOZ_ASSERT(xFileSize(pFile, &newSize) == SQLITE_OK);
MOZ_ASSERT(newSize == size);
#endif
} else {
NS_WARNING("xTruncate failed on a quota-controlled file, attempting to " NS_WARNING("xTruncate failed on a quota-controlled file, attempting to "
"update its current size..."); "update its current size...");
if (xFileSize(pFile, &size) == SQLITE_OK) { if (xFileSize(pFile, &size) == SQLITE_OK) {
@ -445,7 +409,6 @@ int
xSync(sqlite3_file *pFile, int flags) xSync(sqlite3_file *pFile, int flags)
{ {
telemetry_file *p = (telemetry_file *)pFile; telemetry_file *p = (telemetry_file *)pFile;
IOThreadAutoTimer ioTimer(p->histograms->syncMS, IOInterposeObserver::OpFSync);
return p->pReal->pMethods->xSync(p->pReal, flags); return p->pReal->pMethods->xSync(p->pReal, flags);
} }
@ -513,19 +476,6 @@ xFileControl(sqlite3_file *pFile, int op, void *pArg)
if (op == SQLITE_FCNTL_CHUNK_SIZE && rc == SQLITE_OK) { if (op == SQLITE_FCNTL_CHUNK_SIZE && rc == SQLITE_OK) {
p->fileChunkSize = *static_cast<int*>(pArg); p->fileChunkSize = *static_cast<int*>(pArg);
} }
#ifdef DEBUG
if (op == SQLITE_FCNTL_SIZE_HINT && p->quotaObject && rc == SQLITE_OK) {
sqlite3_int64 hintSize = *static_cast<sqlite3_int64*>(pArg);
if (p->fileChunkSize > 0) {
hintSize =
((hintSize + p->fileChunkSize - 1) / p->fileChunkSize) *
p->fileChunkSize;
}
sqlite3_int64 currentSize;
MOZ_ASSERT(xFileSize(pFile, &currentSize) == SQLITE_OK);
MOZ_ASSERT(currentSize >= hintSize);
}
#endif
return rc; return rc;
} }
@ -606,8 +556,6 @@ int
xOpen(sqlite3_vfs* vfs, const char *zName, sqlite3_file* pFile, xOpen(sqlite3_vfs* vfs, const char *zName, sqlite3_file* pFile,
int flags, int *pOutFlags) int flags, int *pOutFlags)
{ {
IOThreadAutoTimer ioTimer(Telemetry::MOZ_SQLITE_OPEN_MS,
IOInterposeObserver::OpCreateOrOpen);
sqlite3_vfs *orig_vfs = static_cast<sqlite3_vfs*>(vfs->pAppData); sqlite3_vfs *orig_vfs = static_cast<sqlite3_vfs*>(vfs->pAppData);
int rc; int rc;
telemetry_file *p = (telemetry_file *)pFile; telemetry_file *p = (telemetry_file *)pFile;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -20,7 +19,6 @@
#include "mozStorageAsyncStatementExecution.h" #include "mozStorageAsyncStatementExecution.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace storage { namespace storage {

View file

@ -13,7 +13,6 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsIFile.h" #include "nsIFile.h"
#include "nsIFileURL.h" #include "nsIFileURL.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#include "mozilla/CondVar.h" #include "mozilla/CondVar.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
@ -708,36 +707,11 @@ Connection::initializeInternal()
if (mFileURL) { if (mFileURL) {
const char* dbPath = ::sqlite3_db_filename(mDBConn, "main"); const char* dbPath = ::sqlite3_db_filename(mDBConn, "main");
MOZ_ASSERT(dbPath); MOZ_ASSERT(dbPath);
const char* telemetryFilename =
::sqlite3_uri_parameter(dbPath, "telemetryFilename");
if (telemetryFilename) {
if (NS_WARN_IF(*telemetryFilename == '\0')) {
return NS_ERROR_INVALID_ARG;
}
mTelemetryFilename = telemetryFilename;
}
}
if (mTelemetryFilename.IsEmpty()) {
mTelemetryFilename = getFilename();
MOZ_ASSERT(!mTelemetryFilename.IsEmpty());
} }
// Properly wrap the database handle's mutex. // Properly wrap the database handle's mutex.
sharedDBMutex.initWithMutex(sqlite3_db_mutex(mDBConn)); sharedDBMutex.initWithMutex(sqlite3_db_mutex(mDBConn));
// SQLite tracing can slow down queries (especially long queries)
// significantly. Don't trace unless the user is actively monitoring SQLite.
if (MOZ_LOG_TEST(gStorageLog, LogLevel::Debug)) {
::sqlite3_trace_v2(mDBConn,
SQLITE_TRACE_STMT | SQLITE_TRACE_PROFILE,
tracefunc, this);
MOZ_LOG(gStorageLog, LogLevel::Debug, ("Opening connection to '%s' (%p)",
mTelemetryFilename.get(), this));
}
int64_t pageSize = Service::getDefaultPageSize(); int64_t pageSize = Service::getDefaultPageSize();
// Set page_size to the preferred default value. This is effective only if // Set page_size to the preferred default value. This is effective only if
@ -1093,17 +1067,6 @@ Connection::stepStatement(sqlite3 *aNativeConnection, sqlite3_stmt *aStatement)
::sqlite3_reset(aStatement); ::sqlite3_reset(aStatement);
} }
// Report very slow SQL statements to Telemetry
TimeDuration duration = TimeStamp::Now() - startTime;
const uint32_t threshold =
NS_IsMainThread() ? Telemetry::kSlowSQLThresholdForMainThread
: Telemetry::kSlowSQLThresholdForHelperThreads;
if (duration.ToMilliseconds() >= threshold) {
nsDependentCString statementString(::sqlite3_sql(aStatement));
Telemetry::RecordSlowSQLStatement(statementString, mTelemetryFilename,
duration.ToMilliseconds());
}
(void)::sqlite3_extended_result_codes(aNativeConnection, 0); (void)::sqlite3_extended_result_codes(aNativeConnection, 0);
// Drop off the extended result bits of the result code. // Drop off the extended result bits of the result code.
return srv & 0xFF; return srv & 0xFF;
@ -1179,17 +1142,6 @@ Connection::executeSql(sqlite3 *aNativeConnection, const char *aSqlString)
int srv = ::sqlite3_exec(aNativeConnection, aSqlString, nullptr, nullptr, int srv = ::sqlite3_exec(aNativeConnection, aSqlString, nullptr, nullptr,
nullptr); nullptr);
// Report very slow SQL statements to Telemetry
TimeDuration duration = TimeStamp::Now() - startTime;
const uint32_t threshold =
NS_IsMainThread() ? Telemetry::kSlowSQLThresholdForMainThread
: Telemetry::kSlowSQLThresholdForHelperThreads;
if (duration.ToMilliseconds() >= threshold) {
nsDependentCString statementString(aSqlString);
Telemetry::RecordSlowSQLStatement(statementString, mTelemetryFilename,
duration.ToMilliseconds());
}
return srv; return srv;
} }

Some files were not shown because too many files have changed in this diff Show more