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

Fix: cpuidle check directory name when numerating idle states

Do not assume that all directories under cpuidle/ represent states;
check that the directory name starts with "state" before trying to parse
it.
This commit is contained in:
Sergei Trofimov 2015-04-28 12:52:05 +01:00
parent 9d5e0cdc00
commit 49d7072440

View File

@ -98,7 +98,8 @@ class Cpuidle(Module):
states_dir = self.device.path.join(self.device.path.dirname(self.root_path), cpu, 'cpuidle')
idle_states = []
for state in self.device.listdir(states_dir):
idle_states.append(CpuidleState(self.device, self.device.path.join(states_dir, state)))
if state.startswith('state'):
idle_states.append(CpuidleState(self.device, self.device.path.join(states_dir, state)))
return idle_states
def _on_device_init(self, context): # pylint: disable=unused-argument