1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Energy model: fixing sysbench taskset failure

Make sure when migrating sshd to root cgroup also migrate their
children, including the bash for the wa session. So the subsequent
processes kicked off from that shell can be taskset to any cluster.
This commit is contained in:
Vasilis Flouris 2015-05-06 19:46:20 +01:00 committed by Sergei Trofimov
parent 485ba419b3
commit 2929106049
2 changed files with 7 additions and 3 deletions

View File

@ -972,7 +972,7 @@ class LinuxDevice(BaseLinuxDevice):
# result should be a column of PIDs with the first row as "PID" header
result = self.execute('ps -C {} -o pid'.format(process_name), check_exit_code=False).strip().split()
if len(result) >= 2: # at least one row besides the header
return result[1:]
return map(int, result[1:])
else:
return []

View File

@ -540,8 +540,12 @@ class EnergyModelInstrument(Instrument):
self.cpuset.move_all_tasks_to(self.measuring_cluster)
server_process = 'adbd' if self.device.platform == 'android' else 'sshd'
server_pids = self.device.get_pids_of(server_process)
self.cpuset.root.add_tasks(server_pids)
for pid in server_pids:
children_ps = [e for e in self.device.ps()
if e.ppid in server_pids and e.name != 'sshd']
children_pids = [e.pid for e in children_ps]
pids_to_move = server_pids + children_pids
self.cpuset.root.add_tasks(pids_to_move)
for pid in pids_to_move:
self.device.execute('busybox taskset -p 0x{:x} {}'.format(list_to_mask(self.measuring_cpus), pid))
def enable_all_cores(self):