def _GetPssInKb(mappings, app_package, verbose):
  """Returns the total PSS from mappings.

  Args:
    mappings: ([parse_smaps.Mapping]) List of mappings.
    app_package: (str) App package to look for.
    verbose: (bool) Verbose output or not.

  Returns:
    (executable_pss (int), other_pss (int)) Executable mappings and others,
                                            in kB.
  """
  executable_pss, other_pss = (0, 0)
  for mapping in mappings:
    if app_package in mapping.pathname:
      if mapping.permissions == 'r-xp':
        executable_pss += mapping.fields['Pss']
      else:
        other_pss += mapping.fields['Pss']
      if verbose:
        print(mapping.ToString())
  return (executable_pss, other_pss)