psuilt.cpu_freq(percpu=True)
may not return all CPUs on linux
#1269
Labels
psuilt.cpu_freq(percpu=True)
may not return all CPUs on linux
#1269
The implementation for
cpu_freq
for linux (in _pslinux.py) parses the policy files under/sys/devices/system/cpu/cpufreq/policy*
and assumes there's a one-to-one mapping from these to online CPUs. However, it may be the case that a single policy applies to multiple online CPUs, in which case these CPUs will be listed in/sys/devices/system/cpu/cpufreq/policy*/affected_cpus
and a separate policy for this CPU may not be listed (https://www.kernel.org/doc/html/v4.14/admin-guide/pm/cpufreq.html#policy-interface-in-sysfs).This can cause the
psutil.tests.test_system.TestSystemAPIs.test_cpu_freq
test to fail.The text was updated successfully, but these errors were encountered: