mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
cgroups: fix Controller.tasks()
Fix cgroups tasks parsing in Controller.tasks() method, to ignore lines that are not formatted properly.
This commit is contained in:
parent
e3d9c4b2fd
commit
f515420387
@ -210,7 +210,15 @@ class Controller(object):
|
|||||||
entries = output.splitlines()
|
entries = output.splitlines()
|
||||||
tasks = {}
|
tasks = {}
|
||||||
for task in entries:
|
for task in entries:
|
||||||
tid_str, tname, tcmdline = task.split(',', 2)
|
fields = task.split(',', 2)
|
||||||
|
nr_fields = len(fields)
|
||||||
|
if nr_fields < 2:
|
||||||
|
continue
|
||||||
|
elif nr_fields == 2:
|
||||||
|
tid_str, tname = fields
|
||||||
|
tcmdline = ''
|
||||||
|
else:
|
||||||
|
tid_str, tname, tcmdline = fields
|
||||||
|
|
||||||
if not re.search(filter_tid, tid_str):
|
if not re.search(filter_tid, tid_str):
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user