Version in base suite: 1.17-1 Version in overlay suite: 1.17-1+deb11u1 Base version: iotop-c_1.17-1+deb11u1 Target version: iotop-c_1.19-1~bpo11+1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/i/iotop-c/iotop-c_1.17-1+deb11u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/i/iotop-c/iotop-c_1.19-1~bpo11+1.dsc /srv/release.debian.org/tmp/Nv5iz7rAq0/iotop-c-1.19/.sample/screenshot.png |binary iotop-c-1.19/Makefile | 19 - iotop-c-1.19/README.md | 164 +++++++--- iotop-c-1.19/TODO | 2 iotop-c-1.19/archlinux/PKGBUILD | 2 iotop-c-1.19/debian/changelog | 35 +- iotop-c-1.19/debian/control | 2 iotop-c-1.19/debian/patches/fix-OOB-on-utf.patch | 20 - iotop-c-1.19/debian/patches/series | 1 iotop-c-1.19/fedora/iotop-c.spec | 74 ++++ iotop-c-1.19/glibcvertest.h | 45 ++ iotop-c-1.19/iotop.8 | 3 iotop-c-1.19/src/iotop.h | 2 iotop-c-1.19/src/utils.c | 6 iotop-c-1.19/src/view_curses.c | 74 ++-- 15 files changed, 336 insertions(+), 113 deletions(-) Binary files /srv/release.debian.org/tmp/ZDhOyO4NEx/iotop-c-1.17/.sample/screenshot.png and /srv/release.debian.org/tmp/Nv5iz7rAq0/iotop-c-1.19/.sample/screenshot.png differ diff -Nru iotop-c-1.17/Makefile iotop-c-1.19/Makefile --- iotop-c-1.17/Makefile 2021-01-30 13:34:40.000000000 +0000 +++ iotop-c-1.19/Makefile 2021-09-21 08:24:22.000000000 +0000 @@ -25,11 +25,15 @@ ifndef NO_FLTO CFLAGS?=-O3 -fno-stack-protector -mno-stackrealign CFLAGS+=-flto -LDFLAGS+=$(CFLAGS) else CFLAGS?=-O3 -fno-stack-protector -mno-stackrealign endif +HAVESREA:=$(shell if $(CC) -mno-stackrealign -c /dev/null -o /dev/null >/dev/null 2>/dev/null;then echo yes;else echo no;fi) +ifeq ("$(HAVESREA)","no") +CFLAGS:=$(filter-out -mno-stackrealign,$(CFLAGS)) +endif + PKG_CONFIG?=pkg-config NCCC?=$(shell $(PKG_CONFIG) --cflags ncursesw) NCLD?=$(shell $(PKG_CONFIG) --libs ncursesw) @@ -42,9 +46,15 @@ NCLD:=-lncursesw endif -MYCFLAGS:=$(CPPFLAGS) $(CFLAGS) $(NCCC) -std=gnu90 -Wall -Wextra -fPIE -MYLIBS=$(LIBS) $(NCLD) -MYLDFLAGS=$(LDFLAGS) -fPIE -pie +# for glibc < 2.17, -lrt is required for clock_gettime +NEEDLRT:=$(shell if $(CC) -E glibcvertest.h -o -|grep IOTOP_NEED_LRT|grep -q yes;then echo need; fi) + +MYCFLAGS:=$(CPPFLAGS) $(CFLAGS) $(NCCC) -Wall -Wextra -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 --std=gnu90 -fPIE +MYLIBS:=$(NCLD) $(LIBS) +MYLDFLAGS:=$(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -fPIE -pie +ifeq ("$(NEEDLRT)","need") +MYLDFLAGS+=-lrt +endif STRIP?=strip PREFIX?=$(DESTDIR)/usr @@ -97,7 +107,6 @@ --exclude ./.git \ --exclude ./.gitignore \ --exclude ./debian \ - --exclude ./fedora \ -Jcvf ../iotop-c_$(VER).orig.tar.xz . -rm -f ../iotop-c_$(VER).orig.tar.xz.asc gpg -a --detach-sign ../iotop-c_$(VER).orig.tar.xz diff -Nru iotop-c-1.17/README.md iotop-c-1.19/README.md --- iotop-c-1.17/README.md 2020-10-01 06:29:16.000000000 +0000 +++ iotop-c-1.19/README.md 2021-09-21 00:07:47.000000000 +0000 @@ -1,5 +1,4 @@ -iotop -===== +# iotop Is your Linux server too slow or load is too high? One of the possible causes of such symptoms may be high IO (input/output) waiting time, @@ -24,47 +23,121 @@ [![Packaging status](https://repology.org/badge/tiny-repos/iotop-c.svg)](https://repology.org/project/iotop-c/versions) -How to make -=========== +## Sample screenshot - # apt-install build-essential ncurses-dev +![iotop screenshot](.sample/screenshot.png) + +## How to install from binary package + +Many Linux distributions already include this program under the name iotop-c. + +If your distribution is relatively new, chances are that it already has iotop packaged. Follow these instructions. + +In case it is not available, follow the [How to build from source](#how-to-build-from-source) instructions. + +
+ Debian/Devuan/Ubuntu/other derivatives +  + +Use the following command (note that `-y` disables confirmation prompts): + + sudo apt install iotop-c -y +
+ +
+ Fedora +  + +Use the following command (note that `-y` disables confirmation prompts): + + sudo dnf install iotop-c -y +
+ +
+ CentOS 7/CentOS 8/RHEL 7/RHEL 8 +  + +Use the following commands (note that `-y` disables confirmation prompts): + + sudo yum install epel-release -y + sudo yum install iotop-c -y +
+ +## How to build from source +Please note that the installation and the usage of this program require root access. + +
+ Debian/Devuan/Ubuntu/other derivatives +  + +Use the following commands (note that `-y` disables confirmation prompts): + + apt install git build-essential libncurses-dev libncursesw5-dev pkg-config -y git clone https://github.com/Tomas-M/iotop cd iotop - make + make -j +
+ +
+Fedora +  + +Use the following commands (note that `-y` disables confirmation prompts): + + dnf install git gcc make ncurses-devel pkgconfig -y + git clone https://github.com/Thomas-M/iotop + cd iotop + make -j +
+ +
+CentOS 7/CentOS 8/RHEL 7/RHEL 8 +  + +Use the following commands (note that `-y` disables confirmation prompts): + + yum install git gcc make ncurses-devel pkgconfig -y + git clone https://github.com/Thomas-M/iotop + cd iotop + make -j +
+ +### How to install as a system command +sudo make install -Options -======= +### How to update to latest version -``` --v, --version show program's version number and exit --h, --help show this help message and exit --o, --only only show processes or threads actually doing I/O --b, --batch non-interactive mode --n NUM, --iter=NUM number of iterations before ending [infinite] --d SEC, --delay=SEC delay between iterations [1 second] --p PID, --pid=PID processes/threads to monitor [all] --u USER, --user=USER users to monitor [all] --P, --processes only show processes, not all threads --a, --accumulated show accumulated I/O instead of bandwidth --k, --kilobytes use kilobytes instead of a human friendly unit --t, --time add a timestamp on each line (implies --batch) --c, --fullcmdline show full command line --1, --hide-pid hide PID/TID column --2, --hide-prio hide PRIO column --3, --hide-user hide USER column --4, --hide-read hide DISK READ column --5, --hide-write hide DISK WRITE column --6, --hide-swapin hide SWAPIN column --7, --hide-io hide IO column --8, --hide-graph hide GRAPH column --9, --hide-command hide COMMAND column --q, --quiet suppress some lines of header (implies --batch) --H, --no-help suppress listing of shortcuts -``` +cd iotop && git checkout master && git pull && make clean && make -j + +## Options + + -v, --version show program's version number and exit + -h, --help show this help message and exit + -o, --only only show processes or threads actually doing I/O + -b, --batch non-interactive mode + -n NUM, --iter=NUM number of iterations before ending [infinite] + -d SEC, --delay=SEC delay between iterations [1 second] + -p PID, --pid=PID processes/threads to monitor [all] + -u USER, --user=USER users to monitor [all] + -P, --processes only show processes, not all threads + -a, --accumulated show accumulated I/O instead of bandwidth + -k, --kilobytes use kilobytes instead of a human friendly unit + -t, --time add a timestamp on each line (implies --batch) + -c, --fullcmdline show full command line + -1, --hide-pid hide PID/TID column + -2, --hide-prio hide PRIO column + -3, --hide-user hide USER column + -4, --hide-read hide DISK READ column + -5, --hide-write hide DISK WRITE column + -6, --hide-swapin hide SWAPIN column + -7, --hide-io hide IO column + -8, --hide-graph hide GRAPH column + -9, --hide-command hide COMMAND column + -q, --quiet suppress some lines of header (implies --batch) + -H, --no-help suppress listing of shortcuts -Contribute -========== +## Contribute iotop was originally written by Vyacheslav Trushkin in 2014, distributed by Tomas Matejicek and later improved by Boian Bonev. @@ -74,18 +147,19 @@ Contacts of current maintainers are: -- Tomas Matejicek -- Boian Bonev +- Tomas Matejicek <[tomas@slax.org](mailto:tomas@slax.org)> +- Boian Bonev <[bbonev@ipacct.com](mailto:bbonev@ipacct.com)> Notable contributions (ordered by time of last contribution): -- Paul Wise - Debian packaging, man page, multiple reviews and ideas -- Rumen Jekov - Arch Linux packaging and testing -- Arthur Zamarin - Gentoo packaging and testing -- Yuriy M. Kaminskiy - code fixes and improvements -- alicektx - documentation imrpovements -- Filip Kofron - build system imrpovements +- EinProfiSpieler - README.md, build system improvements +- Paul Wise <[pabs@debian.org](mailto:pabs@debian.org)> - Debian packaging, man page, multiple reviews and ideas +- Rumen Jekov <[rvjekov@gmail.com](mailto:rvjekov@gmail.com)> - Arch Linux packaging and testing +- Arthur Zamarin <[arthurzam+gentoo@gmail.com](mailto:arthurzam+gentoo@gmail.com)> - Gentoo packaging and testing +- Yuriy M. Kaminskiy <[yumkam@gmail.com](mailto:yumkam@gmail.com)> - code fixes and improvements +- alicektx <[alicekot13@gmail.com](mailto:alicekot13@gmail.com)> - documentation imrpovements +- Filip Kofron <[filip.kofron.cz@gmail.com](mailto:filip.kofron.cz@gmail.com)> - build system imrpovements -**Thanks! This project is what it is now because the steam you have put into it** +**Thanks!** This project is what it is now because the steam you have put into it *NB. In case you have contributed to the project and do not see your name in the list, please note that the above list is updated manually and it is an omission - notify the maintainers to fix it.* diff -Nru iotop-c-1.17/TODO iotop-c-1.19/TODO --- iotop-c-1.17/TODO 2021-02-03 23:43:41.000000000 +0000 +++ iotop-c-1.19/TODO 2021-09-21 00:07:47.000000000 +0000 @@ -1,3 +1,4 @@ +- restore some form of visible help on the bottom --- history of finished TODO items --- @@ -19,3 +20,4 @@ - Rework help to be like popup window - Add all missing keys to help window - Freezed, scrollable view of procs/threads for ionice selection (abandoned idea - exited processes should be kept track of) +- ESC key close the help dialog diff -Nru iotop-c-1.17/archlinux/PKGBUILD iotop-c-1.19/archlinux/PKGBUILD --- iotop-c-1.17/archlinux/PKGBUILD 2021-02-06 01:00:35.000000000 +0000 +++ iotop-c-1.19/archlinux/PKGBUILD 2021-09-21 08:26:32.000000000 +0000 @@ -3,7 +3,7 @@ # Maintainer: Boian Bonev pkgname=iotop-c -pkgver=1.17 +pkgver=1.19 pkgrel=1 pkgdesc="simple top-like I/O monitor (implemented in C)" arch=('any') diff -Nru iotop-c-1.17/debian/changelog iotop-c-1.19/debian/changelog --- iotop-c-1.17/debian/changelog 2021-09-06 01:54:40.000000000 +0000 +++ iotop-c-1.19/debian/changelog 2021-09-28 22:51:46.000000000 +0000 @@ -1,9 +1,36 @@ -iotop-c (1.17-1+deb11u1) bullseye; urgency=medium +iotop-c (1.19-1~bpo11+1) bullseye-backports; urgency=medium - * Backport bugfix from 1.18 - - fix OOB access caused by UTF8 process names + * Rebuild for bullseye-backports. - -- Boian Bonev Mon, 06 Sep 2021 01:54:40 +0000 + -- Boian Bonev Tue, 28 Sep 2021 22:51:46 +0000 + +iotop-c (1.19-1) unstable; urgency=medium + + * Update to new upstream release of 1.19 + - Do not crash if TERM is not set + + -- Boian Bonev Tue, 21 Sep 2021 08:30:10 +0000 + +iotop-c (1.18-1~bpo11+2) bullseye-backports; urgency=medium + + * Rebuild for bullseye-backports. + * Backport fix from 1.19 + - Do not crash if TERM is not set + + -- Boian Bonev Wed, 22 Sep 2021 21:08:16 +0000 + +iotop-c (1.18-1~bpo11+1) bullseye-backports; urgency=medium + + * Rebuild for bullseye-backports. + + -- Boian Bonev Mon, 20 Sep 2021 22:47:41 +0000 + +iotop-c (1.18-1) unstable; urgency=medium + + * Update to new upstream release of 1.18 + * Update standards to 4.6.0 + + -- Boian Bonev Tue, 24 Aug 2021 02:45:57 +0000 iotop-c (1.17-1) unstable; urgency=medium diff -Nru iotop-c-1.17/debian/control iotop-c-1.19/debian/control --- iotop-c-1.17/debian/control 2021-09-06 01:54:40.000000000 +0000 +++ iotop-c-1.19/debian/control 2021-09-27 20:44:44.000000000 +0000 @@ -6,7 +6,7 @@ debhelper-compat (= 13), libncurses-dev, pkg-config, -Standards-Version: 4.5.1 +Standards-Version: 4.6.0 Rules-Requires-Root: no Homepage: https://github.com/Tomas-M/iotop Vcs-Browser: https://github.com/Tomas-M/iotop diff -Nru iotop-c-1.17/debian/patches/fix-OOB-on-utf.patch iotop-c-1.19/debian/patches/fix-OOB-on-utf.patch --- iotop-c-1.17/debian/patches/fix-OOB-on-utf.patch 2021-09-06 01:54:40.000000000 +0000 +++ iotop-c-1.19/debian/patches/fix-OOB-on-utf.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Description: Fix OOB access on some UTF input - On architectures with signed char type and input that is >=128 there is - an out-of-bounds access causing SIGSEGV. It is most probably not exploitable - but degrades user experience. ---- -Origin: upstream, https://github.com/Tomas-M/iotop/commit/8aaa4fce743cf14a5a727c6cb24c63450d317a28 -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523 -Last-Update: 2021-09-06 - ---- iotop-c-1.17.orig/src/utils.c -+++ iotop-c-1.17/src/utils.c -@@ -171,7 +171,7 @@ inline const char *esc_low_ascii1(char c - static char ehex[0x20][6]; - static int initialized=0; - -- if (c>=0x20) // no escaping needed -+ if (c<0||c>=0x20) // no escaping needed - return NULL; - if (!initialized) { - int i; diff -Nru iotop-c-1.17/debian/patches/series iotop-c-1.19/debian/patches/series --- iotop-c-1.17/debian/patches/series 2021-09-06 01:54:40.000000000 +0000 +++ iotop-c-1.19/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -fix-OOB-on-utf.patch diff -Nru iotop-c-1.17/fedora/iotop-c.spec iotop-c-1.19/fedora/iotop-c.spec --- iotop-c-1.17/fedora/iotop-c.spec 1970-01-01 00:00:00.000000000 +0000 +++ iotop-c-1.19/fedora/iotop-c.spec 2021-09-21 08:28:33.000000000 +0000 @@ -0,0 +1,74 @@ +Name: iotop-c +Version: 1.19 +Release: 1%{?dist} +Summary: Simple top-like I/O monitor (implemented in C) + +License: GPLv2+ +URL: https://github.com/Tomas-M/iotop/ +Source0: https://github.com/Tomas-M/iotop/releases/download/v%{version}/iotop-%{version}.tar.xz +Source1: https://github.com/Tomas-M/iotop/releases/download/v%{version}/iotop-%{version}.tar.xz.asc +Source2: https://raw.githubusercontent.com/Tomas-M/iotop/v%{version}/debian/upstream/signing-key.asc + +BuildRequires: gcc +BuildRequires: gnupg2 +BuildRequires: ncurses-devel +BuildRequires: make +BuildRequires: pkgconfig(ncursesw) + +%description +iotop-c does for I/O usage what top(1) does for CPU usage. It watches I/O +usage information output by the Linux kernel and displays a table of +current I/O usage by processes on the system. It is handy for answering +the question "Why is the disk churning so much?". + +iotop-c requires a Linux kernel built with the CONFIG_TASKSTATS, +CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING and +CONFIG_VM_EVENT_COUNTERS config options on. + +iotop-c is an alternative re-implementation of iotop in C, optimized for +performance. Normally a monitoring tool intended to be used on a system +under heavy stress should use the least additional resources as +possible. + +%global _hardened_build 1 + +%prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%autosetup -n iotop-%{version} + +%build +%set_build_flags +NO_FLTO=1 %make_build + +%install +V=1 STRIP=: %make_install +mv %{buildroot}%{_sbindir}/iotop %{buildroot}%{_sbindir}/iotop-c +mv %{buildroot}%{_mandir}/man8/iotop.8 %{buildroot}%{_mandir}/man8/iotop-c.8 + +%files +%license COPYING +%license LICENSE +%{_sbindir}/iotop-c +%{_mandir}/man8/iotop-c.8* + +%changelog +* Tue Sep 21 2021 Boian Bonev - 1.19-1 +- Update to latest ver 1.19 + +* Tue Aug 24 2021 Boian Bonev - 1.18-1 +- Update to latest ver 1.18 + +* Thu Jul 22 2021 Fedora Release Engineering - 1.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Feb 6 2021 Boian Bonev - 1.17-1 +- Update to latest ver 1.17 + +* Thu Jan 28 2021 Boian Bonev - 1.16-1 +- Update to latest ver 1.16 + +* Tue Jan 26 2021 Fedora Release Engineering - 1.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Sep 26 2020 Boian Bonev - 1.15-1 +- Initial packaging for Fedora diff -Nru iotop-c-1.17/glibcvertest.h iotop-c-1.19/glibcvertest.h --- iotop-c-1.17/glibcvertest.h 1970-01-01 00:00:00.000000000 +0000 +++ iotop-c-1.19/glibcvertest.h 2021-09-21 00:07:47.000000000 +0000 @@ -0,0 +1,45 @@ +/* SPDX-License-Identifer: GPL-2.0-or-later + +Copyright (C) 2014 Vyacheslav Trushkin +Copyright (C) 2020,2021 Boian Bonev + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +/* + +iotop can only run on linux +libc may vary, check if old glibc +require -lrt for clock_gettime + +*/ + +#include +#ifdef __GLIBC__ +#include +int min=__GLIBC__,maj=__GLIBC_MINOR__; +#if __GLIBC__>2 +char *IOTOP_NEED_LRT="no"; +#else // __GLIBC__>2 +#if __GLIBC__<2 +char *IOTOP_NEED_LRT="yes"; +#else // __GLIBC__<2 +#if __GLIBC__==2 +#if __GLIBC_MINOR__<=17 +char *IOTOP_NEED_LRT="yes"; +#else // __GLIBC_MINOR__<=17 +char *IOTOP_NEED_LRT="no"; +#endif // __GLIBC_MINOR__<=17 +#else // __GLIBC__==2 +char *IOTOP_NEED_LRT="no"; +#endif // __GLIBC__==2 +#endif // __GLIBC__<2 +#endif // __GLIBC__>2 +#else // def __GLIBC__ +char *IOTOP_NEED_LRT="no"; +#endif // def __GLIBC__ diff -Nru iotop-c-1.17/iotop.8 iotop-c-1.19/iotop.8 --- iotop-c-1.17/iotop.8 2021-02-06 00:59:10.000000000 +0000 +++ iotop-c-1.19/iotop.8 2021-09-20 23:54:51.000000000 +0000 @@ -196,6 +196,9 @@ \fB\fR Sort by previous column .TP +\fB\fR +Cancel ionice or filter selection. In case only the help window is open then close it +.TP \fBo\fR, \fBO\fR Toggle showing only processes with IO activity .TP diff -Nru iotop-c-1.17/src/iotop.h iotop-c-1.19/src/iotop.h --- iotop-c-1.17/src/iotop.h 2021-02-06 01:04:00.000000000 +0000 +++ iotop-c-1.19/src/iotop.h 2021-09-21 08:26:40.000000000 +0000 @@ -27,7 +27,7 @@ #include #include -#define VERSION "1.17" +#define VERSION "1.19" typedef union { struct _flags { diff -Nru iotop-c-1.17/src/utils.c iotop-c-1.19/src/utils.c --- iotop-c-1.17/src/utils.c 2021-01-30 08:17:08.000000000 +0000 +++ iotop-c-1.19/src/utils.c 2021-09-21 00:07:47.000000000 +0000 @@ -168,10 +168,14 @@ } inline const char *esc_low_ascii1(char c) { + // some architectures have char type unsigned by default + // while others have a signed char; make the check for + // printing range universal + unsigned char uc=*(unsigned char *)(void *)&c; static char ehex[0x20][6]; static int initialized=0; - if (c>=0x20) // no escaping needed + if (uc>=0x20) // no escaping needed return NULL; if (!initialized) { int i; diff -Nru iotop-c-1.17/src/view_curses.c iotop-c-1.19/src/view_curses.c --- iotop-c-1.17/src/view_curses.c 2021-02-05 23:47:34.000000000 +0000 +++ iotop-c-1.19/src/view_curses.c 2021-09-21 01:55:41.000000000 +0000 @@ -71,37 +71,38 @@ } s_helpitem; const s_helpitem thelp[]={ - {descr:"Exit",k2:"q",k3:"Q"}, - {descr:"Toggle sort order",k1:"",k2:"r",k3:"R"}, - {descr:"Scroll to the top of the list",k1:""}, - {descr:"Scroll to the bottom of the list",k1:""}, - {descr:"Scroll one screen up",k1:""}, - {descr:"Scroll one screen down",k1:""}, - {descr:"Scroll one line up",k1:""}, - {descr:"Scroll one line down",k1:""}, - {descr:"Sort by next column",k1:""}, - {descr:"Sort by previous column",k1:""}, - {descr:"Toggle showing only processes with IO activity",k2:"o",k3:"O"}, - {descr:"Toggle showing processes/threads",k2:"p",k3:"P"}, - {descr:"Toggle showing accumulated/current values",k2:"a",k3:"A"}, - {descr:"Toggle showing this help",k1:" ?",k2:"h",k3:"H"}, // padded to match - {descr:"Toggle showing full command line",k2:"c",k3:"C"}, - {descr:"Toggle showing TID",k2:"1"}, - {descr:"Toggle showing PRIO",k2:"2"}, - {descr:"Toggle showing USER",k2:"3"}, - {descr:"Toggle showing DISK READ",k2:"4"}, - {descr:"Toggle showing DISK WRITE",k2:"5"}, - {descr:"Toggle showing SWAPIN",k2:"6"}, - {descr:"Toggle showing IO",k2:"7"}, - {descr:"Toggle showing GRAPH",k2:"8"}, - {descr:"Toggle showing COMMAND",k2:"9"}, - {descr:"Show all columns",k2:"0"}, - {descr:"IOnice a process/thread",k2:"i",k3:"I"}, - {descr:"Change UID and PID filters",k2:"f",k3:"F"}, - {descr:"Toggle using Unicode/ASCII characters",k2:"u",k3:"U"}, - {descr:"Toggle exited processes x/inverse",k2:"x",k3:"X"}, - {descr:"Toggle data freeze",k2:"s",k3:"S"}, - {NULL}, + {.descr="Exit",.k2="q",.k3="Q"}, + {.descr="Toggle sort order",.k1="",.k2="r",.k3="R"}, + {.descr="Scroll to the top of the list",.k1=""}, + {.descr="Scroll to the bottom of the list",.k1=""}, + {.descr="Scroll one screen up",.k1=""}, + {.descr="Scroll one screen down",.k1=""}, + {.descr="Scroll one line up",.k1=""}, + {.descr="Scroll one line down",.k1=""}, + {.descr="Sort by next column",.k1=""}, + {.descr="Sort by previous column",.k1=""}, + {.descr="Cancel ionice/filter or close help window",.k1=""}, + {.descr="Toggle showing only processes with IO activity",.k2="o",.k3="O"}, + {.descr="Toggle showing processes/threads",.k2="p",.k3="P"}, + {.descr="Toggle showing accumulated/current values",.k2="a",.k3="A"}, + {.descr="Toggle showing this help",.k1=" ?",.k2="h",.k3="H"}, // padded to match + {.descr="Toggle showing full command line",.k2="c",.k3="C"}, + {.descr="Toggle showing TID",.k2="1"}, + {.descr="Toggle showing PRIO",.k2="2"}, + {.descr="Toggle showing USER",.k2="3"}, + {.descr="Toggle showing DISK READ",.k2="4"}, + {.descr="Toggle showing DISK WRITE",.k2="5"}, + {.descr="Toggle showing SWAPIN",.k2="6"}, + {.descr="Toggle showing IO",.k2="7"}, + {.descr="Toggle showing GRAPH",.k2="8"}, + {.descr="Toggle showing COMMAND",.k2="9"}, + {.descr="Show all columns",.k2="0"}, + {.descr="IOnice a process/thread",.k2="i",.k3="I"}, + {.descr="Change UID and PID filters",.k2="f",.k3="F"}, + {.descr="Toggle using Unicode/ASCII characters",.k2="u",.k3="U"}, + {.descr="Toggle exited processes x/inverse",.k2="x",.k3="X"}, + {.descr="Toggle data freeze",.k2="s",.k3="S"}, + {.descr=NULL}, }; static const char *column_name[]={ @@ -841,7 +842,7 @@ move(promptx,prompty); curs_set(show); draw_vscroll(maxx-1,head1row?2:3,maxy-1,dispcount,saveskip); - refresh(); + wnoutrefresh(stdscr); if (showhelp) { int rhh,rhw; @@ -874,8 +875,9 @@ wresize(whelp,rhh,rhw); mvwin(whelp,hy,hx); view_help(); - wrefresh(whelp); + wnoutrefresh(whelp); } + doupdate(); } static inline int curses_key(int ch) { @@ -1091,6 +1093,9 @@ config.f.deadx=!config.f.deadx; break; case 27: // ESC + if (showhelp&&!in_ionice&&!in_filter) + showhelp=0; + // unlike help window these cannot happen at the same time if (in_ionice) in_ionice=0; if (in_filter) @@ -1215,9 +1220,10 @@ } inline void view_curses_init(void) { + char *term=getenv("TERM"); const s_helpitem *p; - if (strcmp(getenv("TERM"),"linux")) { + if (term&&strcmp(term,"linux")) { if (setlocale(LC_CTYPE,"C.UTF-8")) has_unicode=1; else