forked from pool/python-psutil
- Active test suite, using skip-test-missing-warnings.patch to explicitly skip 2 tests regarding warnings, skip-flaky-i586.patch to skip a flaky i586 test, and setting TRAVIS to skip tests which upstream doesnt run in their CI - Add upstream pr_1364.patch to fix reading /sys/blocks on Linux 4.18+ - Remove tests from installed package - Use URL https://github.com/giampaolo/psutil - Use LANG=en_US.UTF-8 in %check to avoid failure in test_pmap - update to version 5.6.1 * No changes effecting Linux * Many checks added to tests to skip tests for missing features OBS-URL: https://build.opensuse.org/request/show/686918 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=105
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
From 6688d5fca0f5d19ff7741b2d1585882c4663541b Mon Sep 17 00:00:00 2001
|
|
From: Jelle van der Waa <jelle@vdwaa.nl>
|
|
Date: Sun, 18 Nov 2018 19:55:08 +0100
|
|
Subject: [PATCH] [Linux] read_sysfs() fails on Linux 4.18+
|
|
|
|
Linux kernel 4.18+ added 4 fields to /sys/block/$dev/stat, ignore them
|
|
and parse the rest as usual.
|
|
---
|
|
psutil/_pslinux.py | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
|
|
index b775d39ae..12f17e861 100644
|
|
--- a/psutil/_pslinux.py
|
|
+++ b/psutil/_pslinux.py
|
|
@@ -1099,8 +1099,13 @@ def read_sysfs():
|
|
with open_text(os.path.join(root, 'stat')) as f:
|
|
fields = f.read().strip().split()
|
|
name = os.path.basename(root)
|
|
- (reads, reads_merged, rbytes, rtime, writes, writes_merged,
|
|
- wbytes, wtime, _, busy_time, _) = map(int, fields)
|
|
+ if len(fields) == 11:
|
|
+ (reads, reads_merged, rbytes, rtime, writes, writes_merged,
|
|
+ wbytes, wtime, _, busy_time, _) = map(int, fields)
|
|
+ else: # Linux 4.18+ adds for fields for discard
|
|
+ (reads, reads_merged, rbytes, rtime, writes, writes_merged,
|
|
+ wbytes, wtime, _, busy_time, _, _, _, _, _) = map(int,
|
|
+ fields)
|
|
yield (name, reads, writes, rbytes, wbytes, rtime,
|
|
wtime, reads_merged, writes_merged, busy_time)
|
|
|