Bug 679945: Add whether or not the DLL blocklist hook was installed successfully to telemetry. r=bsmedberg
authorKyle Huey <khuey@kylehuey.com>
Mon, 29 Aug 2011 13:38:27 -0400
changeset 77591 1b2c92b52298bd4a5a848202195bf527adced1b8
parent 77590 cf4d258fd0f617240a18fa3199b950085d100f78
child 77592 ccc8a52f68b02783255fe61c611d98c64084c237
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs679945
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 679945: Add whether or not the DLL blocklist hook was installed successfully to telemetry. r=bsmedberg
toolkit/components/telemetry/TelemetryHistograms.h
toolkit/xre/nsWindowsDllBlocklist.cpp
--- a/toolkit/components/telemetry/TelemetryHistograms.h
+++ b/toolkit/components/telemetry/TelemetryHistograms.h
@@ -46,16 +46,17 @@
  * The other data reported by telemetry is listed on https://wiki.mozilla.org/Privacy/Reviews/Telemetry/Measurements
  *
  */
 
 /**
  * a11y telemetry
  */
 HISTOGRAM(A11Y_INSTANTIATED, 0, 1, 2, BOOLEAN, "has accessibility support been instantiated")
+HISTOGRAM(DLLBLOCKLIST_HOOK_INSTALLED, 0, 1, 2, BOOLEAN, "was the DLL blocklist hook installed successfully")
 
 HISTOGRAM(CYCLE_COLLECTOR, 1, 10000, 50, EXPONENTIAL, "Time spent on one cycle collection (ms)")
 HISTOGRAM(CYCLE_COLLECTOR_VISITED_REF_COUNTED, 1, 300000, 50, EXPONENTIAL, "Number of ref counted objects visited by the cycle collector")
 HISTOGRAM(CYCLE_COLLECTOR_VISITED_GCED, 1, 300000, 50, EXPONENTIAL, "Number of JS objects visited by the cycle collector")
 HISTOGRAM(CYCLE_COLLECTOR_COLLECTED, 1, 100000, 50, EXPONENTIAL, "Number of objects collected by the cycle collector")
 HISTOGRAM(TELEMETRY_PING, 1, 3000, 10, EXPONENTIAL, "Time taken to submit telemetry info (ms)")
 HISTOGRAM(TELEMETRY_SUCCESS, 0, 1, 2, BOOLEAN,  "Successful telemetry submission")
 HISTOGRAM(MEMORY_JS_COMPARTMENTS_SYSTEM, 1, 1000, 10, EXPONENTIAL, "Total JavaScript compartments used for add-ons and internals.")
--- a/toolkit/xre/nsWindowsDllBlocklist.cpp
+++ b/toolkit/xre/nsWindowsDllBlocklist.cpp
@@ -50,16 +50,20 @@
 
 #include "prlog.h"
 
 #include "nsWindowsDllInterceptor.h"
 
 #define IN_WINDOWS_DLL_BLOCKLIST
 #include "nsWindowsDllBlocklist.h"
 
+#include "mozilla/Telemetry.h"
+
+using namespace mozilla;
+
 #ifndef STATUS_DLL_NOT_FOUND
 #define STATUS_DLL_NOT_FOUND ((DWORD)0xC0000135L)
 #endif
 
 // define this for very verbose dll load debug spew
 #undef DEBUG_very_verbose
 
 typedef NTSTATUS (NTAPI *LdrLoadDll_func) (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle);
@@ -217,13 +221,14 @@ WindowsDllInterceptor NtDllIntercept;
 
 void
 XRE_SetupDllBlocklist()
 {
   NtDllIntercept.Init("ntdll.dll");
 
   bool ok = NtDllIntercept.AddHook("LdrLoadDll", reinterpret_cast<intptr_t>(patched_LdrLoadDll), (void**) &stub_LdrLoadDll);
 
+  Telemetry::Accumulate(Telemetry::DLLBLOCKLIST_HOOK_INSTALLED, ok ? 1 : 0);
 #ifdef DEBUG
   if (!ok)
     printf_stderr ("LdrLoadDll hook failed, no dll blocklisting active\n");
 #endif
 }