Skip to content

Commit

Permalink
Merge branch 'master' of github.com:giampaolo/psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Nov 7, 2018
2 parents e2596ab + 8f99f37 commit a3d6a28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,8 @@ def read_procfs():
# ...unless (Linux 2.6) the line refers to a partition instead
# of a disk, in which case the line has less fields (7):
# "3 1 hda1 8 8 8 8"
# 4.18+ has 4 fields added:
# "3 0 hda 8 8 8 8 8 8 8 8 8 8 8 0 0 0 0"
# See:
# https://www.kernel.org/doc/Documentation/iostats.txt
# https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
Expand All @@ -1074,7 +1076,7 @@ def read_procfs():
reads = int(fields[2])
(reads_merged, rbytes, rtime, writes, writes_merged,
wbytes, wtime, _, busy_time, _) = map(int, fields[4:14])
elif flen == 14:
elif flen == 14 or flen == 18:
# Linux 2.6+, line referring to a disk
name = fields[2]
(reads, reads_merged, rbytes, rtime, writes, writes_merged,
Expand Down

0 comments on commit a3d6a28

Please sign in to comment.