Example #1
0
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
Example #2
0
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
Example #3
0
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