aboutsummaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-02-14 00:44:48 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-02-18 10:06:58 +0700
commite40d57b685cfd6b9b9a18df5c64be3e02986d767 (patch)
tree428b5cb66ddef96082da050bc5711b3c4d04e5fc /desktop
parent73bde3008b9c3c22cb8583115c778fb2df9d3776 (diff)
desktop/wmmon: Support NVME devices.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/wmmon/nvme.diff12
-rw-r--r--desktop/wmmon/wmmon.SlackBuild10
2 files changed, 21 insertions, 1 deletions
diff --git a/desktop/wmmon/nvme.diff b/desktop/wmmon/nvme.diff
new file mode 100644
index 0000000000000..69f156a0755fe
--- /dev/null
+++ b/desktop/wmmon/nvme.diff
@@ -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 */
diff --git a/desktop/wmmon/wmmon.SlackBuild b/desktop/wmmon/wmmon.SlackBuild
index bc860934b390e..b02b781bab81e 100644
--- a/desktop/wmmon/wmmon.SlackBuild
+++ b/desktop/wmmon/wmmon.SlackBuild
@@ -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