summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2022-01-07 12:37:35 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2022-01-07 12:37:35 +0100
commit83d7067d7568f09ad95f094d17731e643a4a7ce6 (patch)
tree02d8cfb2fc2f0c628724354d93bc779122d4e49c
parent16e65265b6850e58d3363ddde2d5ea145e3c488a (diff)
downloadpsutil-83d7067d7568f09ad95f094d17731e643a4a7ce6.tar.gz
fix #2049: [Linux] cpu_freq returns current value in GHz but min/max in MHz
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r--HISTORY.rst8
-rw-r--r--psutil/_pslinux.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index 6b16affa..03656314 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,5 +1,13 @@
*Bug tracker at https://github.com/giampaolo/psutil/issues*
+5.9.1
+=====
+
+**Bug fixes**
+
+- 2049_, [Linux]: `cpu_freq`_ erroneously returns ``curr`` value in GHz while
+ ``min`` and ``max`` are in MHz.
+
5.9.0
=====
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index 5a356912..ab1b6f1b 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -749,7 +749,7 @@ if os.path.exists("/sys/devices/system/cpu/cpufreq/policy0") or \
if len(paths) == len(cpuinfo_freqs):
# take cached value from cpuinfo if available, see:
# https://github.com/giampaolo/psutil/issues/1851
- curr = cpuinfo_freqs[i]
+ curr = cpuinfo_freqs[i] * 1000
else:
curr = cat(pjoin(path, "scaling_cur_freq"), fallback=None)
if curr is None: