diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2018-03-30 23:50:48 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2018-03-30 23:50:48 +0200 |
commit | 9c73cf15dc3cd06cdc20850ee5c9664ee9a74241 (patch) | |
tree | 89199ad5e3aaa53040817aed9e1ca429321b3e98 | |
parent | 768bb995652dc7de4d8a836954bfe8b37fb53fda (diff) | |
download | psutil-9c73cf15dc3cd06cdc20850ee5c9664ee9a74241.tar.gz |
return None if phys cpu count cant' be determined; update HISTORY
-rw-r--r-- | HISTORY.rst | 6 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index 65cad58e..adf8731c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,12 @@ XXXX-XX-XX - 694_: [SunOS] cmdline() could be truncated at the 15th character when reading it from /proc. An extra effort is made by reading it from process address space first. (patch by Georg Sauthoff) +- 771_: [Windows] cpu_count() (both logical and physical) return a wrong + (smaller) number on systems using process groups (> 64 cores). +- 771_: [Windows] cpu_times(percpu=True) return fewer CPUs on systems using + process groups (> 64 cores). +- 771_: [Windows] cpu_stats() and cpu_freq() may return incorrect results on + systems using process groups (> 64 cores). - 1193_: [SunOS] Return uid/gid from /proc/pid/psinfo if there aren't enough permissions for /proc/pid/cred. (patch by Georg Sauthoff) - 1194_: [SunOS] Return nice value from psinfo as getpriority() doesn't diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 65fc4406..9312125f 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -660,6 +660,7 @@ psutil_cpu_count_phys(PyObject *self, PyObject *args) { } } else { + // TODO: debug message goto return_none; } } @@ -677,7 +678,10 @@ psutil_cpu_count_phys(PyObject *self, PyObject *args) { } free(buffer); - return Py_BuildValue("I", ncpu); + if (ncpus != 0) + return Py_BuildValue("I", ncpus); + else + Py_RETURN_NONE; // mimick os.cpu_count() return_none: if (buffer != NULL) |