| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Micro optimization in reference to #1852 and #1851.
Use glob.glob(), which internally relies on os.scandir()
in order to list /sys/devices/system/cpu/cpufreq files.
In doing so, we avoid os.path.exists() for each CPU, which
internally uses os.stat().
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>
|
| |
|
| |
Fixes giampaolo/psutil#1708
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"seconds since the epoch" (value returned by `time.time()`) doesn't
depend on the local time zone. It is the same time instance around the
world. It is not in any particular time zone:
```python
import datetime as DT
import zoneinfo
local_time = DT.datetime.fromtimestamp(seconds_since_epoch) # naive datetime object representing local time
utc_time = DT.datetime.utcfromtimestamp(seconds_since_epoch) # naive datetime object representing utc time
la_time = DT.datetime.fromtimestamp(seconds_since_epoch, zoneinfo.ZoneInfo("America/Los_Angeles")) # timezone aware dt
```
Here `local_time`, `utc_time`, `la_time` may correspond to different
clock times but it is exactly the same time instance.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
account
/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list is
deprecated
/sys/devices/system/cpu/cpu[0-9]*/topology/core_cpus_list is the new
name
also add test which makes sure method 1 and 2 return the same result
|
| |\ |
|
| | |
| |
| |
| | |
than one processor (#1727)
|
| |/ |
|
| |
|
| |
Co-authored-by: Arnon Yaari <arnony@infinidat.com>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
/proc/cpuinfo uses spaces rather than tabs on ia64. Since there seems
not to be any reason to require specific kind of whitespace before ':'
on 'cpu mhz' line, just split on ':'.
See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/ia64/kernel/setup.c#n700
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes:
```
======================================================================
ERROR: psutil.tests.test_linux.TestSystemDiskIoCounters.test_emulate_use_sysfs
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/giampaolo/svn/psutil/psutil/tests/test_linux.py", line 1195, in test_emulate_use_sysfs
wsysfs = psutil.disk_io_counters(perdisk=True)
File "/home/giampaolo/svn/psutil/psutil/__init__.py", line 2065, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/home/giampaolo/svn/psutil/psutil/_pslinux.py", line 1124, in disk_io_counters
for entry in gen:
File "/home/giampaolo/svn/psutil/psutil/_pslinux.py", line 1110, in read_sysfs
wbytes, wtime, _, busy_time, _) = map(int, fields)
ValueError: too many values to unpack (expected 11)
```
|
| |
|
|
| |
found (print debug msg instead)
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Kernel 5.5 added 2 more fields to /proc/diskstats, requiring another
change after the one for 4.18, which recently added 4 fields.
At this point in time, the meaning of the existing fields is unlikely to
change, and psutil is not using any of the newer ones. By considering
18 fields and more to have the current layout, psutil will continue to
work as newer kernels add more fields.
|
| | |
|
| | |
|
| |
|
|
| |
temperatures (#1648)
|
| | |
|
| |
|
|
| |
with null byte but args are separated by spaces
|
| |
|
|
|
|
| |
Remove cpu_affinity() support for CentOS 5 (it's 8 years old anyway);
remove the dual implementation. Recent manylinux versions should use
CentOS 6.
|
| | |
|
| | |
|
| | |
|
| |
|
| |
This reverts commit 6b994c625db2abaaadf58a0425f9daaf3e4ad9e5.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
/sys/devices/system/cpu/cpufreq/ exists but is empty.
|
| |
|
| |
This reverts commit 01e00a6629a78a7277aac627c8b025cb753d6fee.
|
| | |
|
| | |
|
| | |
|
| | |
|