_pslinux.py disk activity fields incorrect for kernel 5.0.0

Bug #1846460 reported by Tony Travis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-psutil (Ubuntu)
New
Undecided
Unassigned

Bug Description

Re: "glances" DISK I/O display under Ubuntu 18.04 LTS and Linux 5.0.0 HWE kernel

There is a bug in _pslinux.py present in both python-psutil and python3-psutil packages that prevents "glances" from displaying disk i/o activity:

lsb_release -d
Description: Ubuntu 18.04.3 LTS

uname -a
Linux beluga 5.0.0-29-generic #31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

apt policy glances
glances:
  Installed: 2.11.1-3
  Candidate: 2.11.1-3
  Version table:
 *** 2.11.1-3 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status

head -1 /usr/bin/glances
#!/usr/bin/python3

dpkg -S _pslinux.py
python3-psutil: /usr/lib/python3/dist-packages/psutil/_pslinux.py
python-psutil: /usr/lib/python2.7/dist-packages/psutil/_pslinux.py
root@beluga:~# diff /usr/lib/python3/dist-packages/psutil/_pslinux.py /usr/lib/python2.7/dist-packages/psutil/_pslinux.py

apt policy python3-psutil
python3-psutil:
  Installed: 5.4.2-1
  Candidate: 5.4.2-1
  Version table:
 *** 5.4.2-1 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

Fix taken from: https://github.com/mykmelez/gecko/commit/76ea9067f0a83c38f192fa10e70be7fc063473db

fdiff _pslinux.py
--- .old/_pslinux.py.201712071156 2017-12-07 11:56:04.000000000 +0000
+++ _pslinux.py 2019-10-02 16:33:05.900067400 +0100
@@ -1062,7 +1062,7 @@
             reads = int(fields[2])
             (reads_merged, rbytes, rtime, writes, writes_merged,
                 wbytes, wtime, _, busy_time, _) = map(int, fields[4:14])
- elif fields_len == 14:
+ elif fields_len == 14 or fields_len == 18:
             # Linux 2.6+, line referring to a disk
             name = fields[2]
             (reads, reads_merged, rbytes, rtime, writes, writes_merged,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.