Logo Search packages:      
Sourcecode: guidance-power-manager version File versions

def powermanage::PowerManage::getCpuState (   self,
  cpu 
)

Reads the status of a CPU from /sys. 

Definition at line 432 of file powermanage.py.

00432                              :
        """ Reads the status of a CPU from /sys. """
        state = {}
        state['online'] = self.cpuIsOnline(cpu)
        if not state['online']:
            debug("getCpuState: "+cpu+" is offline")
            return state
        try:
            state['cpu'] = cpu
            state['cur'] = int(_readValue("/sys/devices/system/cpu/"+cpu+"/cpufreq/scaling_cur_freq"))/1000
            state['governor'] = _readValue("/sys/devices/system/cpu/"+cpu+"/cpufreq/scaling_governor")
            state['driver'] = _readValue("/sys/devices/system/cpu/"+cpu+"/cpufreq/scaling_driver")
            state['steps'] = []
            freqs = _readValue("/sys/devices/system/cpu/"+cpu+"/cpufreq/scaling_available_frequencies")
        except IOError:
            # CPUFREQ has gone away, let's disable it.
            state['online'] = False
            return state
        for v in freqs.split():
            state['steps'].append(int(v)/1000)
        state['max'] = max(state['steps'])
        state['min'] = min(state['steps'])        
        debug(state)
        return state
        
    def getLidClosedState(self):


Generated by  Doxygen 1.6.0   Back to index