tools/android/native_lib_memory/parse_smaps.py
def _PrintMappingsMetric(mappings, field_name):
  """Shows a summary of mappings for a given metric.

  For the given field, compute its aggregate value over all mappings, and
  prints the mappings sorted by decreasing metric value.

  Args:
    mappings: ([Mapping]) all process mappings.
    field_name: (str) Mapping field to process.
  """
  total_kb = sum(m.fields[field_name] for m in mappings)
  print('Total Size (kB) = %d' % total_kb)
  sorted_by_metric = sorted(mappings,
                            key=lambda m: m.fields[field_name], reverse=True)
  for mapping in sorted_by_metric:
    metric = mapping.fields[field_name]
    if not metric:
      break
    print(_SummarizeMapping(mapping, metric))
Shows a summary of mappings for a given metric.

  For the given field, compute its aggregate value over all mappings, and
  prints the mappings sorted by decreasing metric value.

  Args:
    mappings: ([Mapping]) all process mappings.
    field_name: (str) Mapping field to process.
  
Shows a summary of mappings for a given metric.
For the given field, compute its aggregate value over all mappings, and
prints the mappings sorted by decreasing metric value.
Shows a summary of mappings for a given metric . For the given field compute its aggregate value over all mappings and prints the mappings sorted by decreasing metric value .
def _PrintMappingsMetric(mappings, field_name):
  total_kb = sum(m.fields[field_name] for m in mappings)
  print('Total Size (kB) = %d' % total_kb)
  sorted_by_metric = sorted(mappings,
                            key=lambda m: m.fields[field_name], reverse=True)
  for mapping in sorted_by_metric:
    metric = mapping.fields[field_name]
    if not metric:
      break
    print(_SummarizeMapping(mapping, metric))
def _PrintMappingsMetric ( mappings , field_name ) : total_kb = sum ( m . fields [ field_name ] for m in mappings ) print ( 'Total Size (kB) = %d' % total_kb ) sorted_by_metric = sorted ( mappings , key = lambda m : m . fields [ field_name ] , reverse = True ) for mapping in sorted_by_metric : metric = mapping . fields [ field_name ] if not metric : break print ( _SummarizeMapping ( mapping , metric ) )
Shows a summary of mappings for a given metric.
Shows a summary of mappings for a given metric .
"""Shows a summary of mappings for a given metric.

  For the given field, compute its aggregate value over all mappings, and
  prints the mappings sorted by decreasing metric value.

  Args:
    mappings: ([Mapping]) all process mappings.
    field_name: (str) Mapping field to process.
  """
mappings
([Mapping]) all process mappings.
( [ Mapping ] ) all process mappings .
field_name
(str) Mapping field to process.
( str ) Mapping field to process .