app/extras/undervolt.py
def read_msr(msr=0x150, cpu=0):
    """
    Read a value from single msr node on given CPU (defaults to first)
    """
    n = '/dev/cpu/%d/msr' % (cpu,)
    f = os.open(n, os.O_RDONLY)
    os.lseek(f, msr, os.SEEK_SET)
    val, = unpack('Q', os.read(f, 8))
    logging.info("Read {val} from {n}".format(val=hex(val), n=n))
    os.close(f)
    return val

    Read a value from single msr node on given CPU (defaults to first)
    
Read a value from single msr node on given CPU (defaults to first)
Read a value from single msr node on given CPU ( defaults to first )
def read_msr(msr=0x150, cpu=0):
    n = '/dev/cpu/%d/msr' % (cpu,)
    f = os.open(n, os.O_RDONLY)
    os.lseek(f, msr, os.SEEK_SET)
    val, = unpack('Q', os.read(f, 8))
    logging.info("Read {val} from {n}".format(val=hex(val), n=n))
    os.close(f)
    return val
def read_msr ( msr = 0x150 , cpu = 0 ) : n = '/dev/cpu/%d/msr' % ( cpu , ) f = os . open ( n , os . O_RDONLY ) os . lseek ( f , msr , os . SEEK_SET ) val , = unpack ( 'Q' , os . read ( f , 8 ) ) logging . info ( "Read {val} from {n}" . format ( val = hex ( val ) , n = n ) ) os . close ( f ) return val
Read a value from single msr node on given CPU (defaults to first)
Read a value from single msr node on given CPU ( defaults to first )
"""
    Read a value from single msr node on given CPU (defaults to first)
    """
msr
cpu