Closed leahneukirchen closed 1 year ago
I realized this issue occurs all over the code base and fixed it everywhere.
Apologies... Github was not sending me alerts for issues and pull requests on this repo. I did not see this until just now.
Is this still relevant? I'm working through some backlog.
Yes, it's still relevant (even more so as people don't run <4.17 kernels anymore really).
Thank you for the contribution. I am happy to see people actually using dool
in the wild. I didn't know anyone other than myself was using it. Merging now!
Python is not my primary language, can you help me understand exactly what this is doing?
if set(l[3:]) == {'0'}: continue
I'm thinking it's saying "if the array elements of l
beyond the 4th (5,6,7+) item are all 0
skip this loop"? The set()
syntax is throwing me off a bit.
it means "make a set out of the items from the 4th" and "check it's the same set that contains only "0", i.e. it checks all items are "0".
Thanks for the explanation.
ISSUE TYPE
DSTAT VERSION
SUMMARY
The format of /proc/diskstats has changed over the years: Until kernel 4.17 there were 14 fields (which this code assumed) Since 4.18 there are 18 fields, since 5.5 there are 20 fields.
Assume unused devices have all fields zero.
Fixes #1. Fixes #5. Fixes #7.