]> granicus.if.org Git - procps-ng/commitdiff
misc: adapted programs impacted by header file changes
authorJim Warner <james.warner@comcast.net>
Wed, 13 Mar 2019 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Tue, 26 Mar 2019 08:55:30 +0000 (19:55 +1100)
Signed-off-by: Jim Warner <james.warner@comcast.net>
free.c
ps/common.h
ps/global.c
ps/output.c
slabtop.c
vmstat.c

diff --git a/free.c b/free.c
index d10ec6c876d593d56ee3ef949259224d988cea77..8724956477f89d43b616b5915aa8303fd27cebb4 100644 (file)
--- a/free.c
+++ b/free.c
@@ -380,15 +380,15 @@ int main(int argc, char **argv)
                 */
                if (flags & FREE_LOHI) {
                        printf("%-7s", _("Low:"));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMLO_TOTAL, ul_int), flags, args));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMLO_USED, ul_int), flags, args));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMLO_FREE, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_TOTAL, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_USED, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_FREE, ul_int), flags, args));
                        printf("\n");
 
                        printf("%-7s", _("High:"));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMHI_TOTAL, ul_int), flags, args));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMHI_USED, ul_int), flags, args));
-                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEMHI_FREE, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_TOTAL, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_USED, ul_int), flags, args));
+                       printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_FREE, ul_int), flags, args));
                        printf("\n");
                }
 
index 5bf8cb749f1f0c298508f72535951e2746b38fec..31a2c566cb968f6ee62f56f2df12990459f6671f 100644 (file)
@@ -114,11 +114,11 @@ makEXT(NS_PID)
 makEXT(NS_USER)
 makEXT(NS_UTS)
 makEXT(PRIORITY)
+makEXT(PRIORITY_RT)
 makEXT(PROCESSOR)
 makEXT(PROCESSOR_NODE)
 makEXT(RSS)
 makEXT(RSS_RLIM)
-makEXT(RTPRIO)
 makEXT(SCHED_CLASS)
 makEXT(SD_MACH)
 makEXT(SD_OUID)
index 3ef8926d49da4ac2eb5998dc8c7447c54265fc3b..c6b107b278e6624319eeb216ee26b68c1993adf5 100644 (file)
@@ -104,11 +104,11 @@ makREL(NS_PID)
 makREL(NS_USER)
 makREL(NS_UTS)
 makREL(PRIORITY)
+makREL(PRIORITY_RT)
 makREL(PROCESSOR)
 makREL(PROCESSOR_NODE)
 makREL(RSS)
 makREL(RSS_RLIM)
-makREL(RTPRIO)
 makREL(SCHED_CLASS)
 makREL(SD_MACH)
 makREL(SD_OUID)
index ef05b6cc1aaa38743c950c5d6cbda8aa237bfc54..b5945924c4f70a9546012f6f97c0aa615d711613 100644 (file)
@@ -626,9 +626,9 @@ setREL1(SCHED_CLASS)
 //    default   "%u:%u", type, prio
 // We just print the priority, and have other keywords for type.
 static int pr_rtprio(char *restrict const outbuf, const proc_t *restrict const pp){
-setREL2(SCHED_CLASS,RTPRIO)
+setREL2(SCHED_CLASS,PRIORITY_RT)
   if(rSv(SCHED_CLASS, s_int, pp)==0 || rSv(SCHED_CLASS, s_int, pp)==-1) return snprintf(outbuf, COLWID, "-");
-  return snprintf(outbuf, COLWID, "%d", rSv(RTPRIO, s_int, pp));
+  return snprintf(outbuf, COLWID, "%d", rSv(PRIORITY_RT, s_int, pp));
 }
 
 static int pr_sched(char *restrict const outbuf, const proc_t *restrict const pp){
@@ -1551,7 +1551,7 @@ static const format_struct format_array[] = { /*
 {"rss",       "RSS",     pr_rss,           PIDS_VM_RSS,              5,    XXX,  PO|RIGHT}, /* was 5 wide */
 {"rssize",    "RSS",     pr_rss,           PIDS_VM_RSS,              5,    DEC,  PO|RIGHT}, /*rsz*/
 {"rsz",       "RSZ",     pr_rss,           PIDS_VM_RSS,              5,    BSD,  PO|RIGHT}, /*rssize*/
-{"rtprio",    "RTPRIO",  pr_rtprio,        PIDS_RTPRIO,              6,    BSD,  TO|RIGHT},
+{"rtprio",    "RTPRIO",  pr_rtprio,        PIDS_PRIORITY_RT,         6,    BSD,  TO|RIGHT},
 {"ruid",      "RUID",    pr_ruid,          PIDS_ID_RUID,             5,    XXX,  ET|RIGHT},
 {"ruser",     "RUSER",   pr_ruser,         PIDS_ID_RUSER,            8,    U98,  ET|USER},
 {"s",         "S",       pr_s,             PIDS_STATE,               1,    SUN,  TO|LEFT},  /*stat,state*/
index 8497d6c738a18f7060324fba20e701e293ea93ef..af96a4f067a5f3b3d9a30e2730f5d7d3495e42dc 100644 (file)
--- a/slabtop.c
+++ b/slabtop.c
@@ -44,7 +44,7 @@
 #include "strutils.h"
 #include <proc/procps.h>
 
-#define DEFAULT_SORT  SLABNODE_OBJS
+#define DEFAULT_SORT  SLAB_NUM_OBJS
 #define CHAINS_ALLOC  150
 #define MAXTBL(t) (int)( sizeof(t) / sizeof(t[0]) )
 
@@ -59,12 +59,12 @@ enum slabinfo_item Sort_item = DEFAULT_SORT;
 enum slabinfo_sort_order Sort_Order = SLABINFO_SORT_DESCEND;
 
 enum slabinfo_item Node_items[] = {
-    SLABNODE_OBJS,     SLABNODE_AOBJS, SLABNODE_USE,
-    SLABNODE_OBJ_SIZE, SLABNODE_SLABS, SLABNODE_OBJS_PER_SLAB,
-    SLABNODE_SIZE,     SLABNODE_NAME,
+    SLAB_NUM_OBJS,   SLAB_ACTIVE_OBJS, SLAB_PERCENT_USED,
+    SLAB_OBJ_SIZE,   SLAB_NUMS_SLABS,  SLAB_OBJ_PER_SLAB,
+    SLAB_SIZE_TOTAL, SLAB_NAME,
     /* next 2 are sortable but are not displayable,
        thus they need not be represented in the Relative_enums */
-    SLABNODE_PAGES_PER_SLAB, SLABNODE_ASLABS };
+    SLAB_PAGES_PER_SLAB, SLAB_ACTIVE_SLABS };
 
 enum Relative_node {
     nod_OBJS,  nod_AOBJS, nod_USE,  nod_OSIZE,
@@ -131,35 +131,35 @@ static void set_sort_stuff (const char key)
 
     switch (tolower(key)) {
     case 'n':
-        Sort_item = SLABNODE_NAME;
+        Sort_item = SLAB_NAME;
         Sort_Order = SLABINFO_SORT_ASCEND;
         break;
     case 'o':
-        Sort_item = SLABNODE_OBJS;
+        Sort_item = SLAB_NUM_OBJS;
         break;
     case 'a':
-        Sort_item = SLABNODE_AOBJS;
+        Sort_item = SLAB_ACTIVE_OBJS;
         break;
     case 's':
-        Sort_item = SLABNODE_OBJ_SIZE;
+        Sort_item = SLAB_OBJ_SIZE;
         break;
     case 'b':
-        Sort_item = SLABNODE_OBJS_PER_SLAB;
+        Sort_item = SLAB_OBJ_PER_SLAB;
         break;
     case 'p':
-        Sort_item = SLABNODE_PAGES_PER_SLAB;
+        Sort_item = SLAB_PAGES_PER_SLAB;
         break;
     case 'l':
-        Sort_item = SLABNODE_SLABS;
+        Sort_item = SLAB_NUMS_SLABS;
         break;
     case 'v':
-        Sort_item = SLABNODE_ASLABS;
+        Sort_item = SLAB_ACTIVE_SLABS;
         break;
     case 'c':
-        Sort_item = SLABNODE_SIZE;
+        Sort_item = SLAB_SIZE_TOTAL;
         break;
     case 'u':
-        Sort_item = SLABNODE_USE;
+        Sort_item = SLAB_PERCENT_USED;
         break;
     default:
         break;
@@ -207,12 +207,12 @@ static void print_summary (void)
 {
  #define totalVAL(e,t) SLABINFO_VAL(e, t, p, Slab_info)
     enum slabinfo_item items[] = {
-        SLABS_AOBJS,       SLABS_OBJS,
-        SLABS_ASLABS,      SLABS_SLABS,
-        SLABS_ACACHES,     SLABS_CACHES,
-        SLABS_SIZE_ACTIVE, SLABS_SIZE_TOTAL,
-        SLABS_SIZE_MIN,    SLABS_SIZE_AVG,
-        SLABS_SIZE_MAX
+        SLABS_ACTIVE_OBJS,   SLABS_NUM_OBJS,
+        SLABS_ACTIVE_SLABS,  SLABS_NUMS_SLABS,
+        SLABS_CACHES_ACTIVE, SLABS_CACHES_TOTAL,
+        SLABS_SIZE_ACTIVE,   SLABS_SIZE_TOTAL,
+        SLABS_OBJ_SIZE_MIN,  SLABS_OBJ_SIZE_AVG,
+        SLABS_OBJ_SIZE_MAX
     };
     enum rel_items {
         tot_AOBJS,   tot_OBJS,   tot_ASLABS, tot_SLABS,
index b46812a2cacfe28aea40e81cd5e1b503e667de35..27d2b26a478715b9f3a8d36e49821fd58ff109f0 100644 (file)
--- a/vmstat.c
+++ b/vmstat.c
@@ -143,7 +143,7 @@ static enum diskstats_item Disk_items[] = {
     DISKSTATS_WRITE_TIME,
     DISKSTATS_IO_INPROGRESS,
     DISKSTATS_IO_TIME,
-    DISKSTATS_IO_WTIME
+    DISKSTATS_WEIGHTED_TIME
 };
 enum Rel_diskitems {
     disk_TYPE,  disk_NAME,
@@ -719,9 +719,9 @@ static void slabformat (void)
     struct slabinfo_reap *reaped;
     int i, j;
     enum slabinfo_item node_items[] = {
-        SLABNODE_AOBJS,    SLABNODE_OBJS,
-        SLABNODE_OBJ_SIZE, SLABNODE_OBJS_PER_SLAB,
-        SLABNODE_NAME };
+        SLAB_ACTIVE_OBJS, SLAB_NUM_OBJS,
+        SLAB_OBJ_SIZE,    SLAB_OBJ_PER_SLAB,
+        SLAB_NAME };
     enum rel_enums {
         slab_AOBJS, slab_OBJS, slab_OSIZE, slab_OPS, slab_NAME };
 
@@ -734,7 +734,7 @@ static void slabformat (void)
     for (i = 0; infinite_updates || i < num_updates; i++) {
         if (!(reaped = procps_slabinfo_reap(slab_info, node_items, MAX_ITEMS)))
             xerrx(EXIT_FAILURE, _("Unable to get slabinfo node data"));
-        if (!(procps_slabinfo_sort(slab_info, reaped->stacks, reaped->total, SLABNODE_NAME, SLABINFO_SORT_ASCEND)))
+        if (!(procps_slabinfo_sort(slab_info, reaped->stacks, reaped->total, SLAB_NAME, SLABINFO_SORT_ASCEND)))
             xerrx(EXIT_FAILURE, _("Unable to sort slab nodes"));
 
         for (j = 0; j < reaped->total; j++) {