| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Match values shown by **htop**. This is before. In here:
* available mem is almost the same as total (unrealistic)
* used is higher than total; there's also a failing test:
```
MEMORY
------
Total : 972.7M
Available : 959.1M
Percent : 1.4
Used : 1.1G
Free : 173.6M
Active : 434.3M
Inactive : 258.4M
Buffers : 509.4M
Cached : 692.9M
Shared : 0.0B
Wired : 280.0K
```
Now:
```
MEMORY
------
Total : 972.7M
Available : 538.1M
Percent : 44.7
Used : 434.5M
Free : 173.6M
Active : 434.2M
Inactive : 258.4M
Buffers : 509.4M
Cached : 692.9M
Shared : 0.0B
Wired : 280.0K
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On NetBSD "available" memory can be higher than "total". From now now calculate it exactly the same as Zabbix:
https://github.com/zabbix/zabbix/blob/af5e0f80253e585ca7082ca6bc9cc07400afe2a7/src/libs/zbxsysinfo/netbsd/memory.c
Fixes https://github.com/giampaolo/psutil/issues/2231 which produced this failure:
```
======================================================================
FAIL: psutil.tests.test_system.TestMemoryAPIs.test_virtual_memory
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/psutil/psutil/tests/test_system.py", line 275, in test_virtual_memory
assert 0 <= mem.percent <= 100, mem
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: svmem(total=1019899904, available=1046573056, percent=-2.6, used=603414528, free=545050624, active=234807296, inactive=133210112, buffers=260288512, cached=368312320, shared=0, wired=294912)
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OpenBSD is unable to recognize zombie process.
It will raise NoSuchProcess instead of ZombieProcess. Test failure:
======================================================================
ERROR: psutil.tests.test_process.TestProcess.test_zombie_process
----------------------------------------------------------------------
Traceback (most recent call last):
File "/vagrant/psutil/psutil/_psbsd.py", line 560, in wrapper
return fun(self, *args, **kwargs)
File "/vagrant/psutil/psutil/_psbsd.py", line 862, in open_files
rawlist = cext.proc_open_files(self.pid)
ProcessLookupError: [Errno 3] No such process
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/vagrant/psutil/psutil/tests/test_process.py", line 1312, in test_zombie_process
zproc.as_dict()
File "/vagrant/psutil/psutil/__init__.py", line 528, in as_dict
ret = meth()
File "/vagrant/psutil/psutil/__init__.py", line 1142, in open_files
return self._proc.open_files()
File "/vagrant/psutil/psutil/_psbsd.py", line 565, in wrapper
raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: process no longer exists (pid=67013)
This happens because OpenBSD is the only BSD defining 2 codes for zombie processes:
# According to /usr/include/sys/proc.h SZOMB is unused.
# test_zombie_process() shows that SDEAD is the right
# equivalent. Also it appears there's no equivalent of
# psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE.
# cext.SZOMB: _common.STATUS_ZOMBIE,
cext.SDEAD: _common.STATUS_ZOMBIE,
cext.SZOMB: _common.STATUS_ZOMBIE,
|
|
|
|
| |
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This has always been cause of confusion, e.g. see:
https://github.com/giampaolo/psutil/pull/1727#issuecomment-698934643
Removed the reference to "physical" from dostrings, functions and test.
I still left it in the doc though, as it's more explanatory.
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#1891)
Add a reusable `psutil_getpagesize()` utility common to all UNIXes.
Related to #1885 (`getpagesize()` is deprecated on recent macOS, POSIX.1-2001 and possibly other UNIXes).
The problem emerged on macOS but `getpagesize()` is also used in FreeBSD, NetBSD, OpenBSD and AIX, so it makes sense to do this in one place only, similarly to Windows which also provide a `psutil_getpagesize()` utility.
Follow cPython's `mmapmodule.c` and `resourcemodule.c` lead and rely on `sysconf(_SC_PAGESIZE)` instead, but leave `getpagesize()` in place as last resort/attempt for systems where it's not deprecated and/or they still legitimately rely on it.
Also provide a python wrapper so we can test the return value of this C function against Python's stdlib modules.
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* bug #1536 / NetBSD / cmdline: treat EINVAL as 'return []'
This happens with unicode test, meaning the C routine it's
unable to decode the unicode chars.
Also, fix a bug introduced in 1530 (C impl of cwd()) which does not take
ENOENT into account.
|
| |
|
|
|
|
| |
Pick KERN_PROC_CWD that is available in 8.99.43 and fallback for
older versions to readlink("/proc/$PID/cwd").
|
| |
|
| |
|
|
|
|
| |
oneshot() #1439
|
| |
|
|
|
|
| |
- which is faster)
|
| |
|
|
|
|
| |
Add CPU frequency support for FreeBSD (patch by @amanusk)
|
|
|
| |
FreeBSD: add temperature sensors
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|