1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 19:02:31 +01:00

Adding cpuidle modules and refactoring Device cpufreq APIs.

cpuidle module implements cpuidle state discovery, query and
manipulation for a Linux device. This replaces the more primitive
get_cpuidle_states method of LinuxDevice.

Renamed APIs (and added a couple of new ones) to be more consistent:

"core" APIs take a core name as the parameter (e.g. "a15") or whatever
is listed in core_names for that device.
"cluster" APIs take a numeric cluster ID (eg. 0) as the parameter. These
get mapped using core_clusters for that device.
"cpu" APIs take a cpufreq cpu ID as a parameter. These could be
integers, e.g. 0, or full string id, e.g. "cpu0".
This commit is contained in:
Sergei Trofimov
2015-04-09 11:56:48 +01:00
parent b002505ac2
commit c82dd87830
4 changed files with 312 additions and 124 deletions

View File

@@ -64,6 +64,8 @@ class DVFS(ResultProcessor):
def initialize(self, context): # pylint: disable=R0912
self.device = context.device
if not self.device.has('cpuidle'):
raise ConfigError('Device does not appear to have cpuidle capability; is the right module installed?')
if not self.device.core_names:
message = 'Device does not specify its core types (core_names/core_clusters not set in device_config).'
raise ResultProcessorError(message)
@@ -94,9 +96,9 @@ class DVFS(ResultProcessor):
for cluster, cores_list in enumerate(listof_cores_clusters):
self.corename_of_clusters.append(self.device.core_names[total_cores])
if self.device.scheduler != 'iks':
self.idlestate_description.update(self.device.get_cpuidle_states(total_cores))
self.idlestate_description.update({s.id: s.desc for s in self.device.get_cpuidle_states(total_cores)})
else:
self.idlestate_description.update(self.device.get_cpuidle_states())
self.idlestate_description.update({s.id: s.desc for s in self.device.get_cpuidle_states()})
total_cores += len(cores_list)
self.numberofcores_in_cluster.append(len(cores_list))
for i in range(current_cores, total_cores):