1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

module/sched: Fix incorrect SchedProcFSData usage

Rather than using the conveniently provided `get_cpu_sd_info()` helper
method, `has_em()` and `get_em_capacity()` would build a
`SchedProcFSData` with `path=<CPU number>`, which is obviously broken.

Do the right thing and use `get_cpu_sd_info()` in those places.
This commit is contained in:
Valentin Schneider 2019-07-09 14:15:58 +01:00 committed by Marc Bonnici
parent a9b9938b0f
commit b8f7b24790

View File

@ -393,7 +393,7 @@ class SchedModule(Module):
:returns: Whether energy model data is available for 'cpu'
"""
if not sd:
sd = SchedProcFSData(self.target, cpu)
sd = self.get_cpu_sd_info(cpu)
return sd.procfs["domain0"].get("group0", {}).get("energy", {}).get("cap_states") != None
@ -412,7 +412,7 @@ class SchedModule(Module):
:returns: The maximum capacity value exposed by the EAS energy model
"""
if not sd:
sd = SchedProcFSData(self.target, cpu)
sd = self.get_cpu_sd_info(cpu)
cap_states = sd.domains[0].groups[0].energy.cap_states
cap_states_list = cap_states.split('\t')