Bug 1457127 - Do not reflect histograms that are not for the current product. r=chutten,janerik
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Wed, 16 May 2018 13:09:33 +0200
changeset 419066 f97a89b40a5f736e85e76160e788a4b5cc4ed4fd
parent 419065 164e7e5c55eb306781f813fc1d2de5853523b505
child 419067 b49beaf72b1d69e0b6e0a982d74e8f02a0f4df9d
push id34025
push userapavel@mozilla.com
push dateMon, 21 May 2018 09:46:09 +0000
treeherdermozilla-central@8850728602d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, janerik
bugs1457127
milestone62.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 1457127 - Do not reflect histograms that are not for the current product. r=chutten,janerik This ensures that histograms that are not allowed on a product will not be present in a snapshot. This is mainly to work around the fact that legacy flag histograms are always reported, even if they are not set. MozReview-Commit-ID: EyR6KhjPC4o
toolkit/components/telemetry/TelemetryHistogram.cpp
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -752,16 +752,21 @@ internal_ShouldReflectHistogram(Histogra
   // This has historical reasons, changing this will require downstream changes.
   // The cheaper path here is to just deprecate flag histograms in favor
   // of scalars.
   uint32_t type = gHistogramInfos[id].histogramType;
   if (internal_IsEmpty(h) && type != nsITelemetry::HISTOGRAM_FLAG) {
     return false;
   }
 
+  // Don't reflect the histogram if it's not allowed in this product.
+  if (!CanRecordProduct(gHistogramInfos[id].products)) {
+    return false;
+  }
+
   return true;
 }
 
 /**
  * Helper function to get a snapshot of the histograms.
  *
  * @param {aLock} the lock proof.
  * @param {aDataset} the dataset for which the snapshot is being requested.