diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2014-09-26 22:20:04 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2014-09-26 22:20:04 +0200 |
commit | 29b0a61f60abfd4bdb2f1afc28172d0595ba24be (patch) | |
tree | 4b24bd43429802da06cf135388703838faec66d8 | |
parent | defd86562d9842ed5396849ce37541e0aa6fde71 (diff) | |
download | psutil-29b0a61f60abfd4bdb2f1afc28172d0595ba24be.tar.gz |
pre-release commitrelease-2.1.3
-rw-r--r-- | CREDITS | 2 | ||||
-rw-r--r-- | HISTORY.rst | 8 | ||||
-rw-r--r-- | README.rst | 1 | ||||
-rw-r--r-- | psutil/_psutil_linux.c | 31 |
4 files changed, 22 insertions, 20 deletions
@@ -54,7 +54,7 @@ C: USA E: david.daeschler@gmail.com W: http://daviddaeschler.com D: some contributions to initial design/bootstrap plus occasional bug fixing -I: 522 +I: 522, 536 N: cjgohlke E: cjgohlke@gmail.com diff --git a/HISTORY.rst b/HISTORY.rst index 270714c1..65309c1b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,9 +1,11 @@ Bug tracker at https://github.com/giampaolo/psutil/issues -2.1.3 (unreleased) -================== +2.1.3 2014-09-26 +================ + +**Bug fixes** -XXX +- #536: [Linux]: fix "undefined symbol: CPU_ALLOC" compilation error. 2.1.2 - 2014-09-21 @@ -319,6 +319,7 @@ http://groups.google.com/group/psutil/ Timeline ======== +- 2014-09-26: `psutil-2.1.3.tar.gz <https://pypi.python.org/packages/source/p/psutil/psutil-2.1.3.tar.gz>`_ - 2014-09-21: `psutil-2.1.2.tar.gz <https://pypi.python.org/packages/source/p/psutil/psutil-2.1.2.tar.gz>`_ - 2014-04-30: `psutil-2.1.1.tar.gz <https://pypi.python.org/packages/source/p/psutil/psutil-2.1.1.tar.gz>`_ - 2014-04-08: `psutil-2.1.0.tar.gz <https://pypi.python.org/packages/source/p/psutil/psutil-2.1.0.tar.gz>`_ diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c index dcbd6ad2..4602178e 100644 --- a/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c @@ -251,11 +251,14 @@ psutil_linux_sysinfo(PyObject *self, PyObject *args) } -#ifdef CPU_ALLOC - /* * Return process CPU affinity as a Python list + * The dual implementation exists because of: + * https://github.com/giampaolo/psutil/issues/536 */ + +#ifdef CPU_ALLOC + static PyObject * psutil_proc_cpu_affinity_get(PyObject *self, PyObject *args) { @@ -291,7 +294,7 @@ psutil_proc_cpu_affinity_get(PyObject *self, PyObject *args) res = PyList_New(0); if (res == NULL) goto error; - + cpucount_s = CPU_COUNT_S(setsize, mask); for (cpu = 0, count = cpucount_s; count; cpu++) { if (CPU_ISSET_S(cpu, setsize, mask)) { @@ -321,9 +324,7 @@ error: } #else -/* - * Return process CPU affinity as a Python list (when the system doesnt support CPU_ALLOC) - */ + static PyObject * psutil_proc_cpu_affinity_get(PyObject *self, PyObject *args) { @@ -332,26 +333,24 @@ psutil_proc_cpu_affinity_get(PyObject *self, PyObject *args) long pid; int i; PyObject* ret_list; - + if (!PyArg_ParseTuple(args, "i", &pid)) { return NULL; } - + CPU_ZERO(&cpuset); if (sched_getaffinity(pid, len, &cpuset) < 0) { return PyErr_SetFromErrno(PyExc_OSError); } - + ret_list = PyList_New(0); - - for (i = 0; i < CPU_SETSIZE; ++i) - { - if (CPU_ISSET(i, &cpuset)) - { + + for (i = 0; i < CPU_SETSIZE; ++i) { + if (CPU_ISSET(i, &cpuset)) { PyList_Append(ret_list, Py_BuildValue("i", i)); } } - + return ret_list; } #endif @@ -414,7 +413,7 @@ error: if (py_cpu_seq != NULL) { Py_DECREF(py_cpu_seq); } - + return NULL; } |