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

def powermanage::PowerManage::getCpuState (   self,

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
            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['max'] = max(state['steps'])
        state['min'] = min(state['steps'])        
        return state
    def getLidClosedState(self):

Generated by  Doxygen 1.6.0   Back to index