diff --git a/wlauto/common/linux/device.py b/wlauto/common/linux/device.py index 47c952c9..8e81080e 100644 --- a/wlauto/common/linux/device.py +++ b/wlauto/common/linux/device.py @@ -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 [] diff --git a/wlauto/instrumentation/energy_model/__init__.py b/wlauto/instrumentation/energy_model/__init__.py index 6ce94740..b4a9fd28 100644 --- a/wlauto/instrumentation/energy_model/__init__.py +++ b/wlauto/instrumentation/energy_model/__init__.py @@ -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):