summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* data.py get_cmdline: use errors=replace for unicode errorsHEADmasterDominique Martinet2023-04-031-1/+1
| | | | | | | /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
* Update manual page modification datePaul Wise2022-03-081-1/+1
| | | | Suggested-by: mandoc -T lint
* Promote the packages of both of the Python/C iotop implementationsPaul Wise2022-02-011-0/+5
| | | | These are easier to install and use for many people.
* Promote the new iotop implementation that is written in CPaul Wise2022-02-011-0/+6
| | | | It uses less resources (useful on embedded systems) and has more features.
* Automatically hide the SWAPIN/IO columns when they are unavailablePaul Wise2022-02-011-7/+24
| | | | | | | | | | | | | | | | | | 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>
* Update URLs for redirects and other location changesPaul Wise2022-02-013-4/+3
|
* Document the new #iotop channel on the libera.chat IRC network.Paul Wise2021-10-081-0/+2
|
* Workaround crashes due to non-UTF-8 characters in process command-linesYanichkin Alexander2021-10-081-1/+1
| | | | | | | | | | | 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
* Detect the kernel.task_delayacct sysctl valuePaul Wise2021-10-022-3/+19
| | | | | | | | | | 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>
* Document the new kernel.task_delayacct sysctl requirement in Linux 5.14Paul Wise2021-10-014-4/+8
| | | | | | Fixes: https://github.com/Tomas-M/iotop/issues/21 Reported-by: @ManuLinares Forwarded-by: Boian Bonev <bbonev@ipacct.com>
* Handle errors setting up curses by printing the errorPaul Wise2021-09-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* Add a _ioprio C extension module for exporting SYS_ioprio_* syscall numbersPaul Wise2021-05-133-3/+66
| | | | | | The Linux kernel doesn't have a way to get the syscall numbers at runtime. Suggested-by: Adrian Bunk
* Fix possessive form for "process" in the manual pagePaul Wise2020-01-081-1/+1
| | | | Suggested-by: codespell
* Fix indefinite article to be "an x86_64 kernel" instead of "a x86_64 kernel"Paul Wise2020-01-081-1/+1
| | | | Suggested-by: anorack
* Actually skip invalid lines in /proc/*/statusPaul Wise2018-05-251-1/+1
| | | | Fixes: commit 0392b205b5c3973a326721c2e9f97f0fa2eefa82
* Ignore invalid lines in /proc/*/status filesPaul Wise2018-05-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix crash due to syntax errorPaul Jaros2018-05-241-1/+1
| | | | | | | | | | | | 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>
* Improve the message that is printed when Linux taskstats are not foundPaul Wise2018-05-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch from python to python3Paul Wise2018-04-295-5/+5
| | | | | | Python 2 will be EOL in 2020 so Python 3 is preferrable. See-also: https://pythonclock.org/
* Add ioprio_* syscall numbers for mipsJames Cowgill2017-06-171-0/+4
| | | | Fixes: https://bugs.debian.org/864886
* Support Python versions and platforms with no time.monotonic() functionPaul Wise2017-05-042-0/+23
| | | | | | | | 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.
* Use monotonic time to calculate durationsPaul Wise2017-05-042-4/+4
| | | | | | | Prevents incorrect calculations when the system time is set backwards. Reported-by: Andrei Costin <zveriu@gmail.com> Fixes: https://bugs.launchpad.net/bugs/1685512
* Fix typo: alignementPaul Wise2017-02-261-1/+1
|
* Add a footer listing keyboard shortcutsPaul Wise2016-08-042-5/+64
| | | | | | This makes the program more friendly to new users. Implements: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1429645
* Check the column title is not empty before using itPaul Wise2016-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Hide UI elements on smaller terminalsPaul Wise2016-08-041-13/+27
| | | | | | | 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.
* Print the titles at specific locationsPaul Wise2016-08-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Correct the location of the status messagePaul Wise2016-08-041-2/+2
| | | | | It wasn't taking into account the titles line. It was placed one line above the bottom of the screen.
* Correct the alignment of the headerPaul Wise2016-08-041-1/+1
| | | | It looks ugly without correct alignment.
* Strip obsolete comment from the manual pagePaul Wise2016-07-281-1/+0
|
* Add the full fingerprint for the release signing keyPaul Wise2016-07-281-1/+2
| | | | See-also: https://evil32.com/
* Only split /proc/*/status lines on the : character.Paul Wise2016-07-281-1/+1
| | | | | | | | | 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
* Use long command-line options instead of short onesPaul Wise2016-07-281-2/+2
| | | | This makes scripts easier to read.
* Also ignore the dist/ directory, which is created by `setup.py sdist`Paul Wise2016-07-281-0/+1
|
* Refer to Python using the correct capitalisationPaul Wise2016-07-282-4/+4
| | | | Suggested-by: spellintian --picky
* Use ./* instead of * for globsPaul Wise2016-07-281-1/+1
| | | | | | Prevents accidentally using filenames as options Suggested-by: shellcheck
* Switch URLs from http to httpsPaul Wise2016-07-283-3/+3
| | | | | | http URLs are insecure and can be manipulated by attackers. Suggested-by: check-all-the-things
* Convert .install-rpm.sh from a Bash script to a POSIX shell scriptPaul Wise2016-07-281-1/+1
| | | | | | It uses no bash-specific features so it shouldn't use bash. Suggested-by: checkbashisms
* Fix build error with Python 3 caused by itervalues() in setup.pyChristophe Vu-Brugier2014-10-181-1/+1
| | | | | | | | | 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>
* Fix two typosPaul Wise2014-05-141-2/+2
|
* Fix terminology, replace 'actual' by 'current'.Paul Wise2014-04-204-11/+11
| | | | Closes: https://bugs.debian.org/739642
* Be specific about which exceptions are being caught.Paul Wise2013-06-072-2/+2
| | | | http://docs.python.org/2/howto/doanddont.html#except
* Make pep8 happy.Guillaume Chazarain2013-05-277-86/+169
|
* Document signatureiotop-0.6Guillaume Chazarain2013-05-271-0/+1
|
* GPG sign all released filesGuillaume Chazarain2013-05-271-0/+1
|
* Version bump.Guillaume Chazarain2013-05-262-1/+8
|
* Clean exit also on SIGTERM otherwise the terminal is unusable.Guillaume Chazarain2013-05-261-1/+4
|
* Python3 can print UTF-8 to curses, python2 can't so let's handle both.Guillaume Chazarain2013-05-261-1/+8
|
* Cleanly exit on SIGINT otherwise python3 will leave the terminal in anGuillaume Chazarain2013-05-261-0/+2
| | | | unusable state.
* No need to make the RPM install script move bin/ to sbin/ now that setup.pyGuillaume Chazarain2013-05-261-6/+0
| | | | installs to sbin/.