summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-18 11:08:55 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-18 11:08:55 +0100
commit67c73ad93a748972bfe528e66117c766f05a4859 (patch)
treef43efacbb5fda45e5999ed114c046e642fe93ab0
parent36b3a2b00aafa9a2e3c31533a7897aa83e8c4d01 (diff)
downloadpsutil-67c73ad93a748972bfe528e66117c766f05a4859.tar.gz
add debug messages
-rw-r--r--psutil/_psutil_osx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c
index bb98c1cc..46751626 100644
--- a/psutil/_psutil_osx.c
+++ b/psutil/_psutil_osx.c
@@ -336,6 +336,7 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
err = task_for_pid(mach_task_self(), (pid_t)pid, &task);
if (err != KERN_SUCCESS) {
+ psutil_debug("task_for_pid() failed"); // TODO temporary
psutil_raise_for_pid(pid, "task_for_pid()");
goto error;
}
@@ -347,8 +348,15 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
err = vm_region_recurse_64(task, &address, &size, &depth,
(vm_region_info_64_t)&info, &count);
- if (err == KERN_INVALID_ADDRESS)
+ if (err == KERN_INVALID_ADDRESS) {
+ // TODO temporary
+ psutil_debug("vm_region_recurse_64 returned KERN_INVALID_ADDRESS");
break;
+ }
+ if (err != KERN_SUCCESS) {
+ psutil_debug("vm_region_recurse_64 returned != KERN_SUCCESS");
+ }
+
if (info.is_submap) {
depth++;
}
@@ -376,6 +384,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
errno = 0;
proc_regionfilename((pid_t)pid, address, buf, sizeof(buf));
if ((errno != 0) || ((sizeof(buf)) <= 0)) {
+ // TODO temporary
+ psutil_debug("proc_regionfilename() failed");
psutil_raise_for_pid(pid, "proc_regionfilename()");
goto error;
}