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
--- 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.