tools/metrics/histograms/find_unmapped_histograms.py
def logNonLiteralHistogram(filename, histogram):
  """Logs a statement warning about a non-literal histogram name found in the
  Chromium source.

  Filters out known acceptable exceptions.

  Args:
    filename: The filename for the file containing the histogram, e.g.
              'chrome/browser/memory_details.cc'
    histogram: The expression that evaluates to the name of the histogram, e.g.
               '"FakeHistogram" + variant'

  Returns:
    None
  """
  # Ignore histogram macros, which typically contain backslashes so that they
  # can be formatted across lines.
  if '\\' in histogram:
    return

  # Ignore histogram names that have been pulled out into C++ constants.
  if CONSTANT_REGEX.match(histogram):
    return

  # A blank value wouldn't compile unless it was in a comment.
  if histogram == '':
    return

  # String concatenations involving macros are always constant.
  if MACRO_STRING_CONCATENATION_REGEX.match(histogram):
    return

  # TODO(isherman): This is still a little noisy... needs further filtering to
  # reduce the noise.
  logging.warning('%s contains non-literal histogram name <%s>', filename,
                  histogram)
Logs a statement warning about a non-literal histogram name found in the
  Chromium source.

  Filters out known acceptable exceptions.

  Args:
    filename: The filename for the file containing the histogram, e.g.
              'chrome/browser/memory_details.cc'
    histogram: The expression that evaluates to the name of the histogram, e.g.
               '"FakeHistogram" + variant'

  Returns:
    None
  
Logs a statement warning about a non-literal histogram name found in the
Chromium source.

Filters out known acceptable exceptions.
Logs a statement warning about a non - literal histogram name found in the Chromium source . Filters out known acceptable exceptions .
def logNonLiteralHistogram(filename, histogram):
  if '\\' in histogram:
    return
  if CONSTANT_REGEX.match(histogram):
    return
  if histogram == '':
    return
  if MACRO_STRING_CONCATENATION_REGEX.match(histogram):
    return
  logging.warning('%s contains non-literal histogram name <%s>', filename,
                  histogram)
def logNonLiteralHistogram ( filename , histogram ) : if '\\' in histogram : return if CONSTANT_REGEX . match ( histogram ) : return if histogram == '' : return if MACRO_STRING_CONCATENATION_REGEX . match ( histogram ) : return logging . warning ( '%s contains non-literal histogram name <%s>' , filename , histogram )
Logs a statement warning about a non-literal histogram name found in the
Chromium source.
Logs a statement warning about a non - literal histogram name found in the Chromium source .
"""Logs a statement warning about a non-literal histogram name found in the
  Chromium source.

  Filters out known acceptable exceptions.

  Args:
    filename: The filename for the file containing the histogram, e.g.
              'chrome/browser/memory_details.cc'
    histogram: The expression that evaluates to the name of the histogram, e.g.
               '"FakeHistogram" + variant'

  Returns:
    None
  """ # Ignore histogram macros, which typically contain backslashes so that they # can be formatted across lines. # Ignore histogram names that have been pulled out into C++ constants. # A blank value wouldn't compile unless it was in a comment. # String concatenations involving macros are always constant. # TODO(isherman): This is still a little noisy... needs further filtering to # reduce the noise.
None
filename
The filename for the file containing the histogram, e.g.
'chrome/browser/memory_details.cc'
The filename for the file containing the histogram e . g . ' chrome / browser / memory_details . cc '
histogram
The expression that evaluates to the name of the histogram, e.g.
'"FakeHistogram" + variant'
The expression that evaluates to the name of the histogram e . g . ' " FakeHistogram " + variant '