tools/android/native_lib_memory/process_residency.py
def ParseDump(filename):
  """Parses a residency dump, as generated from orderfile_instrumentation.cc.

  Args:
    filename: (str) dump filename.

  Returns:
    {"start": offset, "end": offset,
     "residency": {timestamp (int): data ([bool])}}
  """
  result = {}
  with open(filename, 'r') as f:
    (start, end) = f.readline().strip().split(' ')
    result = {'start': int(start), 'end': int(end), 'residency': {}}
    for line in f:
      line = line.strip()
      timestamp, data = line.split(' ')
      data_array = [x == '1' for x in data]
      result['residency'][int(timestamp)] = data_array
  return result
Parses a residency dump, as generated from orderfile_instrumentation.cc.

  Args:
    filename: (str) dump filename.

  Returns:
    {"start": offset, "end": offset,
     "residency": {timestamp (int): data ([bool])}}
  
Parses a residency dump, as generated from orderfile_instrumentation.cc.
Parses a residency dump as generated from orderfile_instrumentation . cc .
def ParseDump(filename):
  result = {}
  with open(filename, 'r') as f:
    (start, end) = f.readline().strip().split(' ')
    result = {'start': int(start), 'end': int(end), 'residency': {}}
    for line in f:
      line = line.strip()
      timestamp, data = line.split(' ')
      data_array = [x == '1' for x in data]
      result['residency'][int(timestamp)] = data_array
  return result
def ParseDump ( filename ) : result = { } with open ( filename , 'r' ) as f : ( start , end ) = f . readline ( ) . strip ( ) . split ( ' ' ) result = { 'start' : int ( start ) , 'end' : int ( end ) , 'residency' : { } } for line in f : line = line . strip ( ) timestamp , data = line . split ( ' ' ) data_array = [ x == '1' for x in data ] result [ 'residency' ] [ int ( timestamp ) ] = data_array return result
Parses a residency dump, as generated from orderfile_instrumentation.cc.
Parses a residency dump as generated from orderfile_instrumentation . cc .
"""Parses a residency dump, as generated from orderfile_instrumentation.cc.

  Args:
    filename: (str) dump filename.

  Returns:
    {"start": offset, "end": offset,
     "residency": {timestamp (int): data ([bool])}}
  """
offset, "end": offset,
"residency": {timestamp (int): data ([bool])}}
offset " end " : offset " residency " : { timestamp ( int ) : data ( [ bool ] ) }}
{"start"
filename
(str) dump filename.
( str ) dump filename .