-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIX support #1123
AIX support #1123
Changes from 5 commits
6d733e0
ba8bfa7
fe5cde3
db52909
52816c9
e2e6600
a4b4387
fbb3d62
cdbb9d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
AIX support is experimental and incomplete at this time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just say it's experimental at this point, but not incomplete. |
||
The following functions and methods are UNSUPPORTED on the AIX platform: | ||
|
||
psutil.Process.memory_maps | ||
psutil.Process.num_ctx_switches | ||
|
||
Known limitations: | ||
psutil.Process.io_counters read count is always 0 | ||
psutil.cpu_stats ctx_switches and soft_interrupts are always 0 | ||
|
||
The following unit tests may fail: | ||
test_fetch_all `cwd` can return None (also on Solaris) | ||
test_proc_cmdline unicode name tests don't work, name is empty (also on Solaris) | ||
test_proc_exe unicode name tests don't work, name is empty (also on Solaris) | ||
test_proc_name unicode name tests don't work, name is empty (also on Solaris) | ||
test_prog_w_funky_name funky name tests don't work, name is empty (also on Solaris) | ||
test_setup_script TBD (also on Solaris) | ||
test_cmdline long args are cut from cmdline in /proc/pid/psinfo and getargs | ||
test_io_counters io_counters read count is always 0 | ||
test_zombie_process trying to create a zombie process doesn't create a zombie process on AIX | ||
test_create_zombie_proc trying to create a zombie process doesn't create a zombie process on AIX | ||
test_procinfo missing API | ||
test_cpu_stats cpu_stats always returns ctx_switches=0 | ||
test_disk_usage df returns "-" for all procfs fields but API returns something real | ||
test_pid_exists_2 there are pids in /proc that don't really exist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still worries me and should be discussed. I suppose I'll have a better idea of what this means once I look at the test results. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ | |
from ._common import NIC_DUPLEX_HALF | ||
from ._common import NIC_DUPLEX_UNKNOWN | ||
|
||
from ._common import AIX | ||
from ._common import BSD | ||
from ._common import FREEBSD # NOQA | ||
from ._common import LINUX | ||
|
@@ -158,6 +159,13 @@ | |
# _pssunos.py via sys.modules. | ||
PROCFS_PATH = "/proc" | ||
|
||
elif AIX: | ||
from . import _psaix as _psplatform | ||
|
||
# This is public API and it will be retrieved from _pslinux.py | ||
# via sys.modules. | ||
PROCFS_PATH = "/proc" | ||
|
||
else: # pragma: no cover | ||
raise NotImplementedError('platform %s is not supported' % sys.platform) | ||
|
||
|
@@ -185,7 +193,7 @@ | |
"POWER_TIME_UNKNOWN", "POWER_TIME_UNLIMITED", | ||
|
||
"BSD", "FREEBSD", "LINUX", "NETBSD", "OPENBSD", "OSX", "POSIX", "SUNOS", | ||
"WINDOWS", | ||
"WINDOWS", "AIX", | ||
|
||
# classes | ||
"Process", "Popen", | ||
|
@@ -785,7 +793,7 @@ def num_fds(self): | |
""" | ||
return self._proc.num_fds() | ||
|
||
# Linux, BSD and Windows only | ||
# Linux, BSD, AIX and Windows only | ||
if hasattr(_psplatform.Process, "io_counters"): | ||
|
||
def io_counters(self): | ||
|
@@ -890,11 +898,12 @@ def num_handles(self): | |
""" | ||
return self._proc.num_handles() | ||
|
||
def num_ctx_switches(self): | ||
"""Return the number of voluntary and involuntary context | ||
switches performed by this process. | ||
""" | ||
return self._proc.num_ctx_switches() | ||
if not AIX: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest using |
||
def num_ctx_switches(self): | ||
"""Return the number of voluntary and involuntary context | ||
switches performed by this process. | ||
""" | ||
return self._proc.num_ctx_switches() | ||
|
||
def num_threads(self): | ||
"""Return the number of threads used by this process.""" | ||
|
@@ -1171,7 +1180,6 @@ def memory_percent(self, memtype="rss"): | |
|
||
if hasattr(_psplatform.Process, "memory_maps"): | ||
# Available everywhere except OpenBSD and NetBSD. | ||
|
||
def memory_maps(self, grouped=True): | ||
"""Return process' mapped memory regions as a list of namedtuples | ||
whose fields are variable depending on the platform. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add the new
AIX
constant in the doc and mark it as.. versionadded:: 5.4.0
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs have a section called
.. _const-oses:
. Is it ok if I addAIX
to this section with:in order to keep this const in the same group as the rest?