Replace list by generator (#23077)

old-commit-hash: 91f87e3675
commatwo_master
grekiki 4 years ago committed by GitHub
parent 63bb9e9dc4
commit 3ab7943f97
  1. 2
      selfdrive/debug/cpu_usage_stat.py

@ -66,7 +66,7 @@ if __name__ == "__main__":
for p in psutil.process_iter(): for p in psutil.process_iter():
if p == psutil.Process(): if p == psutil.Process():
continue continue
matched = any(l for l in p.cmdline() if any([pn for pn in monitored_proc_names if re.match(r'.*{}.*'.format(pn), l, re.M | re.I)])) matched = any(l for l in p.cmdline() if any(pn for pn in monitored_proc_names if re.match(r'.*{}.*'.format(pn), l, re.M | re.I)))
if matched: if matched:
k = ' '.join(p.cmdline()) k = ' '.join(p.cmdline())
print('Add monitored proc:', k) print('Add monitored proc:', k)

Loading…
Cancel
Save