mirror of
https://github.com/erpalma/throttled.git
synced 2026-03-09 22:43:54 +01:00
Print a warning if different MSR values are read. Fix #231
This commit is contained in:
parent
1fd44fdc30
commit
03fd246825
|
|
@ -182,7 +182,9 @@ def readmsr(msr, from_bit=0, to_bit=63, cpu=None, flatten=False):
|
|||
os.close(f)
|
||||
output.append(get_value_for_bits(val, from_bit, to_bit))
|
||||
if flatten:
|
||||
return output[0] if len(set(output)) == 1 else output
|
||||
if len(set(output)) > 1:
|
||||
warning('Found multiple values for {:s} (0x{:x}). This should never happen.')
|
||||
return output[0]
|
||||
return output[cpu] if cpu is not None else output
|
||||
except (IOError, OSError) as e:
|
||||
if e.errno == EPERM or e.errno == EACCES:
|
||||
|
|
|
|||
Loading…
Reference in a new issue