misc: adapt others to the changes in 'get' return type
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
e41b40e6b0
commit
428ef496a6
48
free.c
48
free.c
@ -367,20 +367,20 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("%-7s", _("Mem:"));
|
printf("%-7s", _("Mem:"));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_TOTAL), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_TOTAL, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_USED), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_USED, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_FREE), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_FREE, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_SHARED), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_SHARED, ul_int), flags, args));
|
||||||
if (flags & FREE_WIDE) {
|
if (flags & FREE_WIDE) {
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_BUFFERS),
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_BUFFERS, ul_int),
|
||||||
flags, args));
|
flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_CACHED)
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_CACHED, ul_int)
|
||||||
, flags, args));
|
, flags, args));
|
||||||
} else {
|
} else {
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_BUFFERS)+
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_BUFFERS, ul_int) +
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_CACHED), flags, args));
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_CACHED, ul_int), flags, args));
|
||||||
}
|
}
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_AVAILABLE), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_AVAILABLE, ul_int), flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
/*
|
/*
|
||||||
* Print low vs. high information, if the user requested it.
|
* Print low vs. high information, if the user requested it.
|
||||||
@ -390,35 +390,35 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (flags & FREE_LOHI) {
|
if (flags & FREE_LOHI) {
|
||||||
printf("%-7s", _("Low:"));
|
printf("%-7s", _("Low:"));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMLO_TOTAL), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMLO_TOTAL, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMLO_USED), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMLO_USED, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMLO_FREE), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMLO_FREE, ul_int), flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
printf("%-7s", _("High:"));
|
printf("%-7s", _("High:"));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMHI_TOTAL), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMHI_TOTAL, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMHI_USED), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMHI_USED, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEMHI_FREE), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEMHI_FREE, ul_int), flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%-7s", _("Swap:"));
|
printf("%-7s", _("Swap:"));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_TOTAL), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_TOTAL, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_USED), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_USED, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_FREE), flags, args));
|
printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_FREE, ul_int), flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if (flags & FREE_TOTAL) {
|
if (flags & FREE_TOTAL) {
|
||||||
printf("%-7s", _("Total:"));
|
printf("%-7s", _("Total:"));
|
||||||
printf(" %11s", scale_size(
|
printf(" %11s", scale_size(
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_TOTAL)+
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_TOTAL, ul_int) +
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_TOTAL), flags, args));
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_TOTAL, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(
|
printf(" %11s", scale_size(
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_USED)+
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_USED, ul_int) +
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_USED), flags, args));
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_USED, ul_int), flags, args));
|
||||||
printf(" %11s", scale_size(
|
printf(" %11s", scale_size(
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_FREE)+
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_FREE, ul_int) +
|
||||||
procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_FREE), flags, args));
|
PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_FREE, ul_int), flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@ -94,7 +94,7 @@ static void get_boot_time(void)
|
|||||||
struct procps_statinfo *stat_info = NULL;
|
struct procps_statinfo *stat_info = NULL;
|
||||||
if (procps_stat_new(&stat_info) < 0)
|
if (procps_stat_new(&stat_info) < 0)
|
||||||
xerrx(EXIT_FAILURE, _("Unable to create NEW ystem stat structure"));
|
xerrx(EXIT_FAILURE, _("Unable to create NEW ystem stat structure"));
|
||||||
boot_time = procps_stat_get(stat_info, PROCPS_STAT_SYS_TIME_OF_BOOT);
|
boot_time = PROCPS_STAT_GET(stat_info, PROCPS_STAT_SYS_TIME_OF_BOOT, ul_int);
|
||||||
procps_stat_unref(&stat_info);
|
procps_stat_unref(&stat_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ static void get_memory_total()
|
|||||||
if (procps_meminfo_new(&mem_info) < 0)
|
if (procps_meminfo_new(&mem_info) < 0)
|
||||||
xerrx(EXIT_FAILURE,
|
xerrx(EXIT_FAILURE,
|
||||||
_("Unable to create meminfo structure"));
|
_("Unable to create meminfo structure"));
|
||||||
memory_total = procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_TOTAL);
|
memory_total = PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_TOTAL, ul_int);
|
||||||
procps_meminfo_unref(&mem_info);
|
procps_meminfo_unref(&mem_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
vmstat.c
34
vmstat.c
@ -313,10 +313,10 @@ static void new_format(void)
|
|||||||
cpu_iow = TICv(stat_IOW);
|
cpu_iow = TICv(stat_IOW);
|
||||||
cpu_sto = TICv(stat_STO);
|
cpu_sto = TICv(stat_STO);
|
||||||
|
|
||||||
pgpgin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN);
|
pgpgin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int);
|
||||||
pgpgout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT);
|
pgpgout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int);
|
||||||
pswpin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN);
|
pswpin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int);
|
||||||
pswpout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT);
|
pswpout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int);
|
||||||
|
|
||||||
if ((mem_stack = procps_meminfo_select(mem_info, Mem_items, 6)) ==
|
if ((mem_stack = procps_meminfo_select(mem_info, Mem_items, 6)) ==
|
||||||
NULL)
|
NULL)
|
||||||
@ -337,10 +337,10 @@ static void new_format(void)
|
|||||||
unitConvert(MEMv(mem_FREE)),
|
unitConvert(MEMv(mem_FREE)),
|
||||||
unitConvert((a_option?MEMv(mem_INA):MEMv(mem_BUF))),
|
unitConvert((a_option?MEMv(mem_INA):MEMv(mem_BUF))),
|
||||||
unitConvert((a_option?MEMv(mem_ACT):MEMv(mem_CAC))),
|
unitConvert((a_option?MEMv(mem_ACT):MEMv(mem_CAC))),
|
||||||
(unsigned)( (unitConvert(procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN) * kb_per_page) * hz + divo2) / Div ),
|
(unsigned)( (unitConvert(PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int) * kb_per_page) * hz + divo2) / Div ),
|
||||||
(unsigned)( (unitConvert(procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT) * kb_per_page) * hz + divo2) / Div ),
|
(unsigned)( (unitConvert(PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int) * kb_per_page) * hz + divo2) / Div ),
|
||||||
(unsigned)( (procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN) * hz + divo2) / Div ),
|
(unsigned)( (PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int) * hz + divo2) / Div ),
|
||||||
(unsigned)( (procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT) * hz + divo2) / Div ),
|
(unsigned)( (PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int) * hz + divo2) / Div ),
|
||||||
(unsigned)( (SYSv(stat_INT) * hz + divo2) / Div ),
|
(unsigned)( (SYSv(stat_INT) * hz + divo2) / Div ),
|
||||||
(unsigned)( (SYSv(stat_CTX) * hz + divo2) / Div ),
|
(unsigned)( (SYSv(stat_CTX) * hz + divo2) / Div ),
|
||||||
(unsigned)( (100*cpu_use + divo2) / Div ),
|
(unsigned)( (100*cpu_use + divo2) / Div ),
|
||||||
@ -372,10 +372,10 @@ static void new_format(void)
|
|||||||
cpu_idl = DTICv(stat_IDL);
|
cpu_idl = DTICv(stat_IDL);
|
||||||
cpu_iow = DTICv(stat_IOW);
|
cpu_iow = DTICv(stat_IOW);
|
||||||
cpu_sto = DTICv(stat_STO);
|
cpu_sto = DTICv(stat_STO);
|
||||||
pgpgin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN);
|
pgpgin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int);
|
||||||
pgpgout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT);
|
pgpgout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int);
|
||||||
pswpin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN);
|
pswpin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int);
|
||||||
pswpout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT);
|
pswpout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int);
|
||||||
|
|
||||||
if (t_option) {
|
if (t_option) {
|
||||||
(void) time( &the_time );
|
(void) time( &the_time );
|
||||||
@ -846,10 +846,10 @@ static void sum_format(void)
|
|||||||
printf(_("%13lld stolen cpu ticks\n"), TICv(sstat_STO));
|
printf(_("%13lld stolen cpu ticks\n"), TICv(sstat_STO));
|
||||||
printf(_("%13lld non-nice guest cpu ticks\n"), TICv(sstat_GST));
|
printf(_("%13lld non-nice guest cpu ticks\n"), TICv(sstat_GST));
|
||||||
printf(_("%13lld nice guest cpu ticks\n"), TICv(sstat_GNI));
|
printf(_("%13lld nice guest cpu ticks\n"), TICv(sstat_GNI));
|
||||||
printf(_("%13lu pages paged in\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN));
|
printf(_("%13lu pages paged in\n"), PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int));
|
||||||
printf(_("%13lu pages paged out\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT));
|
printf(_("%13lu pages paged out\n"), PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int));
|
||||||
printf(_("%13lu pages swapped in\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN));
|
printf(_("%13lu pages swapped in\n"), PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int));
|
||||||
printf(_("%13lu pages swapped out\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT));
|
printf(_("%13lu pages swapped out\n"), PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int));
|
||||||
printf(_("%13lu interrupts\n"), SYSv(sstat_INT));
|
printf(_("%13lu interrupts\n"), SYSv(sstat_INT));
|
||||||
printf(_("%13lu CPU context switches\n"), SYSv(sstat_CTX));
|
printf(_("%13lu CPU context switches\n"), SYSv(sstat_CTX));
|
||||||
printf(_("%13lu boot time\n"), SYSv(sstat_TOB));
|
printf(_("%13lu boot time\n"), SYSv(sstat_TOB));
|
||||||
@ -872,7 +872,7 @@ static void fork_format(void)
|
|||||||
xerrx(EXIT_FAILURE,
|
xerrx(EXIT_FAILURE,
|
||||||
_("Unable to create system stat structure"));
|
_("Unable to create system stat structure"));
|
||||||
|
|
||||||
printf(_("%13lld forks\n"), procps_stat_get(sys_info, PROCPS_STAT_SYS_PROC_CREATED));
|
printf(_("%13lu forks\n"), PROCPS_STAT_GET(sys_info, PROCPS_STAT_SYS_PROC_CREATED, ul_int));
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
procps_stat_unref(&sys_info);
|
procps_stat_unref(&sys_info);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user