mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 05:30:44 +00:00
module/sched: Expose the remote CPU capacity sysfs path
A later change needs to access this outside of a SchedModule instance, so make the information available as a classmethod.
This commit is contained in:
parent
2d86474682
commit
03a469fc38
@ -401,13 +401,22 @@ class SchedModule(Module):
|
|||||||
|
|
||||||
return sd.procfs["domain0"].get("group0", {}).get("energy", {}).get("cap_states") != None
|
return sd.procfs["domain0"].get("group0", {}).get("energy", {}).get("cap_states") != None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def cpu_dmips_capacity_path(cls, target, cpu):
|
||||||
|
"""
|
||||||
|
:returns: The target sysfs path where the dmips capacity data should be
|
||||||
|
"""
|
||||||
|
return target.path.join(
|
||||||
|
cls.cpu_sysfs_root,
|
||||||
|
'cpu{}/cpu_capacity'.format(cpu))
|
||||||
|
|
||||||
@memoized
|
@memoized
|
||||||
def has_dmips_capacity(self, cpu):
|
def has_dmips_capacity(self, cpu):
|
||||||
"""
|
"""
|
||||||
:returns: Whether dmips capacity data is available for 'cpu'
|
:returns: Whether dmips capacity data is available for 'cpu'
|
||||||
"""
|
"""
|
||||||
return self.target.file_exists(
|
return self.target.file_exists(
|
||||||
self.target.path.join(self.cpu_sysfs_root, 'cpu{}/cpu_capacity'.format(cpu))
|
self.cpu_dmips_capacity_path(self.target, cpu)
|
||||||
)
|
)
|
||||||
|
|
||||||
@memoized
|
@memoized
|
||||||
@ -430,11 +439,7 @@ class SchedModule(Module):
|
|||||||
:returns: The capacity value generated from the capacity-dmips-mhz DT entry
|
:returns: The capacity value generated from the capacity-dmips-mhz DT entry
|
||||||
"""
|
"""
|
||||||
return self.target.read_value(
|
return self.target.read_value(
|
||||||
self.target.path.join(
|
self.cpu_dmips_capacity_path(self.target, cpu), int
|
||||||
self.cpu_sysfs_root,
|
|
||||||
'cpu{}/cpu_capacity'.format(cpu)
|
|
||||||
),
|
|
||||||
int
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_capacities(self, default=None):
|
def get_capacities(self, default=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user