def get_pwr_cpus(): """ Returns list of CPU objects or None on error """ try: cpus = pwr.get_cpus() except (IOError, ValueError): return None return cpus
def is_sstbf_configured(): """ Returns SST-BF configured status """ try: cpus = pwr.get_cpus() except IOError: return False if not cpus: return False # check is it configured on all sockets configured = True for cpu in cpus: for core in cpu.core_list: core.refresh_stats() cpu.refresh_stats() configured = configured & cpu.sst_bf_configured return configured
def is_sstbf_enabled(): """ Returns SST-BF enabled status """ try: cpus = pwr.get_cpus() except IOError: return False except ValueError: return False if not cpus: return False # check is it enabled on all sockets enabled = True for cpu in cpus: cpu.read_capabilities() # refresh enabled = enabled & cpu.sst_bf_enabled return enabled