Bug 1451288 - Do not force histogram keys to be valid C++ identifiers; r?Dexter draft
authorGabriele Svelto <gsvelto@mozilla.com>
Wed, 04 Apr 2018 13:31:18 +0200
changeset 777213 ec1b1ed4aabf30bfd895e16a747892f0ae70892b
parent 777163 ff0efa4132f0efd78af0910762aec7dcc1a8de66
push id105112
push usergsvelto@mozilla.com
push dateWed, 04 Apr 2018 12:38:29 +0000
reviewersDexter
bugs1451288
milestone61.0a1
Bug 1451288 - Do not force histogram keys to be valid C++ identifiers; r?Dexter MozReview-Commit-ID: I8gxTgJrWwR
toolkit/components/telemetry/parse_histograms.py
--- a/toolkit/components/telemetry/parse_histograms.py
+++ b/toolkit/components/telemetry/parse_histograms.py
@@ -378,23 +378,16 @@ associated with the histogram.  Returns 
         if len(keys) > MAX_KEY_COUNT:
             raise ValueError('Label count for %s exceeds limit of %d' % (name, MAX_KEY_COUNT))
 
         invalid = filter(lambda k: len(k) > MAX_KEY_LENGTH, keys)
         if len(invalid) > 0:
             raise ValueError('"keys" values for %s are exceeding length "%d": %s' %
                              (name, MAX_KEY_LENGTH, ', '.join(invalid)))
 
-        # To make it easier to generate C++ identifiers from this etc., we restrict
-        # the key strings to a strict pattern.
-        invalid = filter(lambda k: not re.match(CPP_IDENTIFIER_PATTERN, k, re.IGNORECASE), keys)
-        if len(invalid) > 0:
-            raise ValueError('"keys" values for %s are not matching pattern "%s": %s' %
-                             (name, CPP_IDENTIFIER_PATTERN, ', '.join(invalid)))
-
     def check_whitelisted_kind(self, name, definition):
         # We don't need to run any of these checks on the server.
         if not self._strict_type_checks or whitelists is None:
             return
 
         # Disallow "flag" and "count" histograms on desktop, suggest to use
         # scalars instead. Allow using these histograms on Android, as we
         # don't support scalars there yet.