mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 09:40:50 +01: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:
parent
9d5e0cdc00
commit
49d7072440
@ -98,7 +98,8 @@ class Cpuidle(Module):
|
|||||||
states_dir = self.device.path.join(self.device.path.dirname(self.root_path), cpu, 'cpuidle')
|
states_dir = self.device.path.join(self.device.path.dirname(self.root_path), cpu, 'cpuidle')
|
||||||
idle_states = []
|
idle_states = []
|
||||||
for state in self.device.listdir(states_dir):
|
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
|
return idle_states
|
||||||
|
|
||||||
def _on_device_init(self, context): # pylint: disable=unused-argument
|
def _on_device_init(self, context): # pylint: disable=unused-argument
|
||||||
|
Loading…
x
Reference in New Issue
Block a user