Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/top/dist/machine add pool usage to the output, ...



details:   https://anonhg.NetBSD.org/src/rev/0bd3f936da70
branches:  trunk
changeset: 368484:0bd3f936da70
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Jul 15 06:39:06 2022 +0000

description:
add pool usage to the output, sharing the line with swap data.

looks like, eg:

Swap: 64G Total, 135M Used, 64G Free / Pools: 16G Used


future work:  figure out the utilisation percentage like vmstat -m

diffstat:

 external/bsd/top/dist/machine/m_netbsd.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r 385bddf5f364 -r 0bd3f936da70 external/bsd/top/dist/machine/m_netbsd.c
--- a/external/bsd/top/dist/machine/m_netbsd.c  Fri Jul 15 05:26:08 2022 +0000
+++ b/external/bsd/top/dist/machine/m_netbsd.c  Fri Jul 15 06:39:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $   */
+/*     $NetBSD: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $        */
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *             Andrew Doran <ad%NetBSD.org@localhost>
  *
  *
- * $Id: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $
+ * $Id: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $
  */
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $");
 #endif
 
 #include <sys/param.h>
@@ -166,9 +166,9 @@
        NULL
 };
 
-long swap_stats[4];
+long swap_stats[6];
 const char *swapnames[] = {
-       "K Total, ", "K Used, ", "K Free, ",
+       "K Total, ", "K Used, ", "K Free ", " Pools: ", "K Used, ",
        NULL
 };
 
@@ -529,8 +529,10 @@
                swap_stats[2] = dbtob(totalsize) / 1024 - swap_stats[1];
        } while (0);
 
+       swap_stats[4] = pagetok(uvmexp.poolpages);
+
        memory_stats[6] = -1;
-       swap_stats[3] = -1;
+       swap_stats[3] = swap_stats[5] = -1;
 
        /* set arrays and strings */
        si->cpustates = cpu_states;



Home | Main Index | Thread Index | Old Index