tools/binary_size/diagnose_bloat.py
def _ResultLines(self, include_sections=None):
    """Generates diff lines for the specified sections (defaults to all)."""
    section_lines = collections.defaultdict(list)
    for section_name, section_results in self._diff.items():
      if not include_sections or section_name in include_sections:
        subsection_lines = []
        section_sum = 0
        units = ''
        for name, value, units in section_results:
          # Omit subsections with no changes for summaries.
          if value == 0 and include_sections:
            continue
          section_sum += value
          subsection_lines.append('{:>+14,} {} {}'.format(value, units, name))
        section_header = section_name
        if section_name in ResourceSizesDiff._AGGREGATE_SECTIONS:
          section_header += ' ({:+,} {})'.format(section_sum, units)
        section_header += ':'
        # Omit sections with empty subsections.
        if subsection_lines:
          section_lines[section_name].append(section_header)
          section_lines[section_name].extend(subsection_lines)
    if not section_lines:
      return ['Empty ' + self.name]
    ret = []
    for k in include_sections or sorted(section_lines):
      ret.extend(section_lines[k])
    return ret
Generates diff lines for the specified sections (defaults to all).
Generates diff lines for the specified sections (defaults to all).
Generates diff lines for the specified sections ( defaults to all ) .
def _ResultLines(self, include_sections=None):
    section_lines = collections.defaultdict(list)
    for section_name, section_results in self._diff.items():
      if not include_sections or section_name in include_sections:
        subsection_lines = []
        section_sum = 0
        units = ''
        for name, value, units in section_results:
          if value == 0 and include_sections:
            continue
          section_sum += value
          subsection_lines.append('{:>+14,} {} {}'.format(value, units, name))
        section_header = section_name
        if section_name in ResourceSizesDiff._AGGREGATE_SECTIONS:
          section_header += ' ({:+,} {})'.format(section_sum, units)
        section_header += ':'
        if subsection_lines:
          section_lines[section_name].append(section_header)
          section_lines[section_name].extend(subsection_lines)
    if not section_lines:
      return ['Empty ' + self.name]
    ret = []
    for k in include_sections or sorted(section_lines):
      ret.extend(section_lines[k])
    return ret
def _ResultLines ( self , include_sections = None ) : section_lines = collections . defaultdict ( list ) for section_name , section_results in self . _diff . items ( ) : if not include_sections or section_name in include_sections : subsection_lines = [ ] section_sum = 0 units = '' for name , value , units in section_results : if value == 0 and include_sections : continue section_sum += value subsection_lines . append ( '{:>+14,} {} {}' . format ( value , units , name ) ) section_header = section_name if section_name in ResourceSizesDiff . _AGGREGATE_SECTIONS : section_header += ' ({:+,} {})' . format ( section_sum , units ) section_header += ':' if subsection_lines : section_lines [ section_name ] . append ( section_header ) section_lines [ section_name ] . extend ( subsection_lines ) if not section_lines : return [ 'Empty ' + self . name ] ret = [ ] for k in include_sections or sorted ( section_lines ) : ret . extend ( section_lines [ k ] ) return ret
Generates diff lines for the specified sections (defaults to all).
Generates diff lines for the specified sections ( defaults to all ) .
"""Generates diff lines for the specified sections (defaults to all).""" # Omit subsections with no changes for summaries. # Omit sections with empty subsections.
self
include_sections