misc: adapted programs impacted by header file changes

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2019-03-13 00:00:00 -05:00 committed by Craig Small
parent 6671a3a8b7
commit 30e27d48e9
6 changed files with 37 additions and 37 deletions

12
free.c
View File

@ -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");
}

View 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)

View 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)

View 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*/

View File

@ -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_ACTIVE_OBJS, SLABS_NUM_OBJS,
SLABS_ACTIVE_SLABS, SLABS_NUMS_SLABS,
SLABS_CACHES_ACTIVE, SLABS_CACHES_TOTAL,
SLABS_SIZE_ACTIVE, SLABS_SIZE_TOTAL,
SLABS_SIZE_MIN, SLABS_SIZE_AVG,
SLABS_SIZE_MAX
SLABS_OBJ_SIZE_MIN, SLABS_OBJ_SIZE_AVG,
SLABS_OBJ_SIZE_MAX
};
enum rel_items {
tot_AOBJS, tot_OBJS, tot_ASLABS, tot_SLABS,

View File

@ -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++) {