mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
module/sched: Fix get_capacities() on !SCHED_DEBUG kernels
While reading the DT-provided capacity values (exposed in sysfs) is sufficient, get_capacities() also unconditionally fetches data from the sched_domain procfs, which is only populated on kernels compiled with CONFIG_SCHED_DEBUG. Tweak the logic to only call get_sd_info() if it is both possible and required.
This commit is contained in:
parent
eb0661a6b4
commit
01dd80df34
@ -469,12 +469,26 @@ class SchedModule(Module):
|
||||
cpus = self.target.list_online_cpus()
|
||||
|
||||
capacities = {}
|
||||
sd_info = self.get_sd_info()
|
||||
|
||||
for cpu in cpus:
|
||||
if self.has_dmips_capacity(cpu):
|
||||
capacities[cpu] = self.get_dmips_capacity(cpu)
|
||||
elif self.has_em(cpu, sd_info.cpus[cpu]):
|
||||
|
||||
missing_cpus = set(cpus).difference(capacities.keys())
|
||||
if not missing_cpus:
|
||||
return capacities
|
||||
|
||||
if not SchedProcFSData.available(self.target):
|
||||
if default != None:
|
||||
capacities.update({cpu : default for cpu in missing_cpus})
|
||||
return capacities
|
||||
else:
|
||||
raise RuntimeError(
|
||||
'No capacity data for cpus {}'.format(sorted(missing_cpus)))
|
||||
|
||||
sd_info = self.get_sd_info()
|
||||
for cpu in missing_cpus:
|
||||
if self.has_em(cpu, sd_info.cpus[cpu]):
|
||||
capacities[cpu] = self.get_em_capacity(cpu, sd_info.cpus[cpu])
|
||||
else:
|
||||
if default != None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user