Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] disk_io_counters() broken on Linux kernel 5.5 #1687

Closed
jonringer opened this issue Feb 11, 2020 · 2 comments
Closed

[Linux] disk_io_counters() broken on Linux kernel 5.5 #1687

jonringer opened this issue Feb 11, 2020 · 2 comments

Comments

@jonringer
Copy link

jonringer commented Feb 11, 2020

Platform

  • Linux 5.5
  • psutil==5.6.7
  • python3.7

Bug description
linux 5.4

$ cat /proc/diskstats
   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   1       1 ram1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   1       2 ram2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

linux 5.5

$ cat /proc/diskstats
   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   1       1 ram1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   1       2 ram2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Error
It produces the following:

  File "/nix/store/3zqd997wmhxl1r8dhwjwgczx5rrxg18n-python3.7-psutil-5.6.7/lib/python3.7/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
    rawdict = _psplatform.disk_io_counters(**kwargs)
  File "/nix/store/3zqd997wmhxl1r8dhwjwgczx5rrxg18n-python3.7-psutil-5.6.7/lib/python3.7/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
    for entry in gen:
  File "/nix/store/3zqd997wmhxl1r8dhwjwgczx5rrxg18n-python3.7-psutil-5.6.7/lib/python3.7/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
    raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line '   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n'

Additional context:
according to: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
they added two new fields:

		Kernel 5.5+ appends two more fields for flush requests:

		19 - flush requests completed successfully
		20 - time spent flushing
@jonringer jonringer added the bug label Feb 11, 2020
@logan2611
Copy link

Was just about to come here and write this bug report, lol.
Can confirm I am also having this issue on kernel 5.5.3, psutil 5.6.7 and python 3.8.1

@jonringer
Copy link
Author

jonringer commented Feb 12, 2020

actually, this looks to be resolved by 2e0952e I was about to make a PR.

They just need to cut a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants