desktop/wmmon: Support NVME devices.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-02-14 00:44:48 -05:00 committed by Willy Sudiarto Raharjo
parent 73bde3008b
commit e40d57b685
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 21 additions and 1 deletions

12
desktop/wmmon/nvme.diff Normal file
View File

@ -0,0 +1,12 @@
diff -Naur wmmon-1.4/wmmon.c wmmon-1.4.patched/wmmon.c
--- wmmon-1.4/wmmon.c 2018-04-10 18:22:59.000000000 -0400
+++ wmmon-1.4.patched/wmmon.c 2023-02-14 00:38:41.868867398 -0500
@@ -800,7 +800,7 @@
* limited buffer. Or just divide by 2 (inefficient). Shouldn't
* matter for graphing (we care about proportions, not numbers). */
while ((getline(&line, &line_size, fp_diskstats)) > 0) {
- if (strstr(line, "sd") || strstr(line, "sr")) {
+ if (strstr(line, "sd") || strstr(line, "sr") || strstr(line, "nvme")) {
p = strtok(line, tokens);
/* skip 3 tokens, then use fields from
`* linux/Documentation/iostats.txt */

View File

@ -6,6 +6,9 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20230214 bkw: BUILD=2
# - add patch to detect I/O on NVME devices (in -i mode).
# 20191211 bkw: Update for v1.4. Script can no longer build the old version.
# - add libdockapp dep
# - get rid of patches (no longer needed)
@ -25,7 +28,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=wmmon
VERSION=${VERSION:-1.4}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -66,6 +69,11 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# I/O monitoring works by checking /proc/diskstats. Each line is
# a device name, and nvme devices weren't invented yet when the
# code was originally written...
patch -p1 < $CWD/nvme.diff
# Man page taken from Debian, slightly corrected, and -c option added.
cat $CWD/$PRGNAM.1 > $PRGNAM.1