Bug 1284240 - Use boolean rather than flag for Sandboxing Telemetry. r=gfritzsche
authorGian-Carlo Pascutto <gcp@mozilla.com>
Thu, 21 Jul 2016 09:39:09 +0200
changeset 348190 0ce00a7b3b5869a7eef4d3ccf787d9e8ed0a5954
parent 347958 29ead859749af91a4e70d10a278a0ca3fca9d2b4
child 348191 d93b95e192e9be54084b62c6ef547b4e3cb5b4c2
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1284240
milestone50.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 1284240 - Use boolean rather than flag for Sandboxing Telemetry. r=gfritzsche MozReview-Commit-ID: EsXFAbEyxYs
security/sandbox/linux/common/SandboxInfo.cpp
toolkit/components/telemetry/Histograms.json
--- a/security/sandbox/linux/common/SandboxInfo.cpp
+++ b/security/sandbox/linux/common/SandboxInfo.cpp
@@ -254,33 +254,23 @@ SandboxInfo::ThreadingCheck()
   flags &= ~(kHasUserNamespaces | kHasPrivilegedUserNamespaces);
   sSingleton.mFlags = static_cast<Flags>(flags);
 }
 
 /* static */ void
 SandboxInfo::SubmitTelemetry()
 {
   SandboxInfo sandboxInfo = Get();
-  if (sandboxInfo.Test(SandboxInfo::kHasSeccompBPF)) {
-    Telemetry::Accumulate(Telemetry::SANDBOX_CAPABILITIES_SECCOMP_BPF, true);
-  }
-  if (sandboxInfo.Test(SandboxInfo::kHasSeccompTSync)) {
-    Telemetry::Accumulate(Telemetry::SANDBOX_CAPABILITIES_SECCOMP_TSYNC, true);
-  }
-  if (sandboxInfo.Test(SandboxInfo::kHasPrivilegedUserNamespaces)) {
-    Telemetry::Accumulate(
-      Telemetry::SANDBOX_CAPABILITIES_USER_NAMESPACES_PRIVILEGED, true);
-  }
-  if (sandboxInfo.Test(SandboxInfo::kHasUserNamespaces)) {
-    Telemetry::Accumulate(
-      Telemetry::SANDBOX_CAPABILITIES_USER_NAMESPACES, true);
-  }
-  if (sandboxInfo.Test(SandboxInfo::kEnabledForContent)) {
-    Telemetry::Accumulate(
-      Telemetry::SANDBOX_CAPABILITIES_ENABLED_CONTENT, true);
-  }
-  if (sandboxInfo.Test(SandboxInfo::kEnabledForMedia)) {
-    Telemetry::Accumulate(
-      Telemetry::SANDBOX_CAPABILITIES_ENABLED_MEDIA, true);
-  }
+  Telemetry::Accumulate(Telemetry::SANDBOX_HAS_SECCOMP_BPF,
+                        sandboxInfo.Test(SandboxInfo::kHasSeccompBPF));
+  Telemetry::Accumulate(Telemetry::SANDBOX_HAS_SECCOMP_TSYNC,
+                        sandboxInfo.Test(SandboxInfo::kHasSeccompTSync));
+  Telemetry::Accumulate(Telemetry::SANDBOX_HAS_USER_NAMESPACES_PRIVILEGED,
+                        sandboxInfo.Test(SandboxInfo::kHasPrivilegedUserNamespaces));
+  Telemetry::Accumulate(Telemetry::SANDBOX_HAS_USER_NAMESPACES,
+                        sandboxInfo.Test(SandboxInfo::kHasUserNamespaces));
+  Telemetry::Accumulate(Telemetry::SANDBOX_CONTENT_ENABLED,
+                        sandboxInfo.Test(SandboxInfo::kEnabledForContent));
+  Telemetry::Accumulate(Telemetry::SANDBOX_MEDIA_ENABLED,
+                        sandboxInfo.Test(SandboxInfo::kEnabledForMedia));
 }
 
 } // namespace mozilla
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9824,61 +9824,61 @@
   },
   "SANDBOX_BROKER_INITIALIZED": {
     "alert_emails": ["bowen@mozilla.com"],
     "bug_numbers": [1256992],
     "expires_in_version": "55",
     "kind": "boolean",
     "description": "Result of call to SandboxBroker::Initialize"
   },
-  "SANDBOX_CAPABILITIES_SECCOMP_BPF": {
+  "SANDBOX_HAS_SECCOMP_BPF": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether the system has seccomp-bpf capability"
   },
-  "SANDBOX_CAPABILITIES_SECCOMP_TSYNC": {
+  "SANDBOX_HAS_SECCOMP_TSYNC": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether the system has seccomp-bpf thread-sync capability"
   },
-  "SANDBOX_CAPABILITIES_USER_NAMESPACES": {
+  "SANDBOX_HAS_USER_NAMESPACES": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether our process succedeed in creating a user namespace"
   },
-  "SANDBOX_CAPABILITIES_USER_NAMESPACES_PRIVILEGED": {
+  "SANDBOX_HAS_USER_NAMESPACES_PRIVILEGED": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether the system has the capability to create privileged user namespaces"
   },
- "SANDBOX_CAPABILITIES_ENABLED_MEDIA": {
+ "SANDBOX_MEDIA_ENABLED": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether the sandbox is enabled for media/GMP plugins"
   },
- "SANDBOX_CAPABILITIES_ENABLED_CONTENT": {
+ "SANDBOX_CONTENT_ENABLED": {
     "alert_emails": ["gcp@mozilla.com"],
     "bug_numbers": [1098428],
     "expires_in_version": "55",
-    "kind": "flag",
+    "kind": "boolean",
     "cpp_guard": "XP_LINUX",
     "description": "Whether the sandbox is enabled for the content process"
   },
   "SYNC_WORKER_OPERATION": {
     "alert_emails": ["amarchesini@mozilla.com", "khuey@mozilla.com" ],
     "bug_numbers": [1267904],
     "expires_in_version": "never",
     "kind": "exponential",