| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
/proc/pid/cmdline is user-controlled and not necessarily valid unicode,
just replace bogus characters like already done for /proc/pid/status.
See-also: commit 443737ec620a699286b9b2e44dbcaac53f553812
|
|
|
|
| |
Suggested-by: mandoc -T lint
|
|
|
|
| |
These are easier to install and use for many people.
|
|
|
|
| |
It uses less resources (useful on embedded systems) and has more features.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that the Linux kernel can enable or disable data collection for them at
runtime, showing the columns when collection is disabled is even less useful,
since the previous data could still be present in the Linux kernel buffers.
Preserve the behaviour of the batch mode though, so that programs parsing
its output aren't broken by the changes to the Linux kernel, but they may
still be broken when the output changes from ?unavailable? to real data.
Since the current sorting keys code makes it hard to dynamically choose which
columns are shown or hidden, when the two columns are hidden, just skip over
displaying them or using them as sorting keys.
Rewrite the data display code to be more flexible wrt column choice though.
Suggested-by: Boian Bonev <bbonev@ipacct.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Use the Python feature of replacing non-UTF-8 characters
with the U+FFFD REPLACEMENT CHARACTER (�).
This is only a workaround, a more useful action would be to guess the
encoding using chardet or similar and coerce the bytes into Unicode.
Fixes: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523
Fixes: https://bugs.debian.org/737043
|
|
|
|
|
|
|
|
|
|
| |
If you have ever turned on the kernel.task_delayacct sysctl for the current
Linux boot, then the heuristic that iotop uses to find out if swapin/io are
available, gives a false negative, so the sysctl has to be checked too now.
Fixes: https://github.com/Tomas-M/iotop/issues/21
Reported-by: @ManuLinares
Forwarded-by: Boian Bonev <bbonev@ipacct.com>
|
|
|
|
|
|
| |
Fixes: https://github.com/Tomas-M/iotop/issues/21
Reported-by: @ManuLinares
Forwarded-by: Boian Bonev <bbonev@ipacct.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is more user-friendly than a traceback.
$ sudo env --unset TERM iotop
Traceback (most recent call last):
File "/usr/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 737, in main
main_loop()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 727, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 620, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python3.9/curses/__init__.py", line 73, in wrapper
stdscr = initscr()
File "/usr/lib/python3.9/curses/__init__.py", line 29, in initscr
setupterm(term=_os.environ.get("TERM", "unknown"),
_curses.error: setupterm: could not find terminal
Reported-by: Boian Bonev <bbonev@ipacct.com>
|
|
|
|
|
|
| |
The Linux kernel doesn't have a way to get the syscall numbers at runtime.
Suggested-by: Adrian Bunk
|
|
|
|
| |
Suggested-by: codespell
|
|
|
|
| |
Suggested-by: anorack
|
|
|
|
| |
Fixes: commit 0392b205b5c3973a326721c2e9f97f0fa2eefa82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One Ubuntu Linux kernel security fix introduced a blank line.
Some other Linux kernels may have invalid lines in the future.
See-also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1772671
Fixes: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1772856
Reported-by: Paul Jaros <jaros.paul@gmail.com>
Reported-in: <CAEh_nc0_DXTmfu16PxmVyrCi6QQeSrpnGGhtfNu60wJYfa_6Zw@mail.gmail.com>
Traceback (most recent call last):
File "/usr/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 620, in main
main_loop()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 610, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 508, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 501, in run_iotop_window
ui.run()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 155, in run
self.process_list.duration)
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 434, in refresh_display
lines = self.get_data()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 415, in get_data
return list(map(format, processes))
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 388, in format
cmdline = p.get_cmdline()
File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 292, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 196, in parse_proc_pid_status
key, value = line.split(':\t', 1)
ValueError: need more than 1 value to unpack
|
|
|
|
|
|
|
|
|
|
|
|
| |
Traceback (most recent call last):
File "./iotop.py", line 9, in <module>
from iotop.ui import main
File "./iotop/ui.py", line 642
else:
^
SyntaxError: invalid syntax
Reported-in: <CAEh_nc0_DXTmfu16PxmVyrCi6QQeSrpnGGhtfNu60wJYfa_6Zw@mail.gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usually this means that iotop is being run in a container.
The Linux kernel doesn't support taskstats outside the host net namespace.
There was a patch that looks like it may fix this but it never got merged.
Traceback (most recent call last):
File "/usr/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 737, in main
main_loop()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 727, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 618, in run_iotop
return run_iotop_window(None, options)
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 609, in run_iotop_window
taskstats_connection = TaskStatsNetlink(options)
File "/usr/lib/python3/dist-packages/iotop/data.py", line 151, in __init__
self.family_id = controller.get_family_id('TASKSTATS')
File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 76, in get_family_id
m = GeNlMessage.recv(self.conn)
File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 56, in recv
msg = conn.recv()
File "/usr/lib/python3/dist-packages/iotop/netlink.py", line 255, in recv
raise err
OSError: Netlink error: No such file or directory (2)
See-also: https://blog.outlyer.com/using-netlink-to-calculate-load-averages
See-also: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg924689.html
See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1290691
See-also: https://bugs.openvz.org/browse/OVZ-5655
|
|
|
|
|
|
| |
Python 2 will be EOL in 2020 so Python 3 is preferrable.
See-also: https://pythonclock.org/
|
|
|
|
| |
Fixes: https://bugs.debian.org/864886
|
|
|
|
|
|
|
|
| |
Python 2 and Python 3 earlier than 3.3 do not have this function.
Use the PyPI monotonic backport module if needed and available.
Fall back on non-monotonic time if neither is available.
|
|
|
|
|
|
|
| |
Prevents incorrect calculations when the system time is set backwards.
Reported-by: Andrei Costin <zveriu@gmail.com>
Fixes: https://bugs.launchpad.net/bugs/1685512
|
| |
|
|
|
|
|
|
| |
This makes the program more friendly to new users.
Implements: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1429645
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes crash with terminals that don't fit all titles.
Traceback (most recent call last):
File "./iotop.py", line 12, in <module>
main()
File "./iotop/ui.py", line 669, in main
main_loop()
File "./iotop/ui.py", line 659, in <lambda>
main_loop = lambda: run_iotop(options)
File "./iotop/ui.py", line 554, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "./iotop/ui.py", line 546, in run_iotop_window
ui.run()
File "./iotop/ui.py", line 176, in run
self.process_list.duration)
File "./iotop/ui.py", line 515, in refresh_display
self.win.addstr(len_summary, pos, title, attr)
_curses.error: addwstr() returned ERR
|
|
|
|
|
|
|
| |
This helps usability on smaller terminals.
Hide the status bar first, then the summary and then the titles,
since that is the approximate order of usefulness.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prevents a crash in a 3-line terminal:
Traceback (most recent call last):
File "./iotop.py", line 12, in <module>
main()
File "./iotop/ui.py", line 652, in main
main_loop()
File "./iotop/ui.py", line 642, in <lambda>
main_loop = lambda: run_iotop(options)
File "./iotop/ui.py", line 537, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "./iotop/ui.py", line 529, in run_iotop_window
ui.run()
File "./iotop/ui.py", line 176, in run
self.process_list.duration)
File "./iotop/ui.py", line 492, in refresh_display
self.win.addstr(title, attr)
_curses.error: addstr() returned ERR
|
|
|
|
|
| |
It wasn't taking into account the titles line.
It was placed one line above the bottom of the screen.
|
|
|
|
| |
It looks ugly without correct alignment.
|
| |
|
|
|
|
| |
See-also: https://evil32.com/
|
|
|
|
|
|
|
|
|
| |
Apparently vserver kernels have some lines that don't
appear to have the tab character so iotop crashes.
The tab character will be stripped by the next code line.
Closes: https://bugs.gentoo.org/show_bug.cgi?id=458556
|
|
|
|
| |
This makes scripts easier to read.
|
| |
|
|
|
|
| |
Suggested-by: spellintian --picky
|
|
|
|
|
|
| |
Prevents accidentally using filenames as options
Suggested-by: shellcheck
|
|
|
|
|
|
| |
http URLs are insecure and can be manipulated by attackers.
Suggested-by: check-all-the-things
|
|
|
|
|
|
| |
It uses no bash-specific features so it shouldn't use bash.
Suggested-by: checkbashisms
|
|
|
|
|
|
|
|
|
| |
The itervalues() method is not available in Python 3. As a
consequence, this patch replaces the call to itervalues() in setup.py
with a call to values() which works on both Python 2 and Python 3.
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
|
| |
|
|
|
|
| |
Closes: https://bugs.debian.org/739642
|
|
|
|
| |
http://docs.python.org/2/howto/doanddont.html#except
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
unusable state.
|
|
|
|
| |
installs to sbin/.
|