}
printf("\n");
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_USED), 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_SHARED), 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, ul_int), 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, ul_int), flags, args));
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));
- 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));
} else {
- printf(" %11s", scale_size(procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_BUFFERS)+
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_CACHED), flags, args));
+ printf(" %11s", scale_size(PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_BUFFERS, ul_int) +
+ 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");
/*
* Print low vs. high information, if the user requested it.
*/
if (flags & FREE_LOHI) {
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_USED), 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_TOTAL, ul_int), 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, ul_int), flags, args));
printf("\n");
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_USED), 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_TOTAL, ul_int), 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, ul_int), flags, args));
printf("\n");
}
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_USED), 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_TOTAL, ul_int), 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, ul_int), flags, args));
printf("\n");
if (flags & FREE_TOTAL) {
printf("%-7s", _("Total:"));
printf(" %11s", scale_size(
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_TOTAL)+
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_TOTAL), flags, args));
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_TOTAL, ul_int) +
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_USED)+
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_USED), flags, args));
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_USED, ul_int) +
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_USED, ul_int), flags, args));
printf(" %11s", scale_size(
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_MEM_FREE)+
- procps_meminfo_get(mem_info, PROCPS_MEMINFO_SWAP_FREE), flags, args));
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_MEM_FREE, ul_int) +
+ PROCPS_MEMINFO_GET(mem_info, PROCPS_MEMINFO_SWAP_FREE, ul_int), flags, args));
printf("\n");
}
fflush(stdout);
cpu_iow = TICv(stat_IOW);
cpu_sto = TICv(stat_STO);
- pgpgin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN);
- pgpgout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT);
- pswpin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN);
- pswpout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT);
+ pgpgin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int);
+ pgpgout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int);
+ pswpin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int);
+ pswpout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int);
if ((mem_stack = procps_meminfo_select(mem_info, Mem_items, 6)) ==
NULL)
unitConvert(MEMv(mem_FREE)),
unitConvert((a_option?MEMv(mem_INA):MEMv(mem_BUF))),
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_PSWPOUT) * 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_PGPGOUT) * 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, ul_int) * kb_per_page) * 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, ul_int) * hz + divo2) / Div ),
(unsigned)( (SYSv(stat_INT) * hz + divo2) / Div ),
(unsigned)( (SYSv(stat_CTX) * hz + divo2) / Div ),
(unsigned)( (100*cpu_use + divo2) / Div ),
cpu_idl = DTICv(stat_IDL);
cpu_iow = DTICv(stat_IOW);
cpu_sto = DTICv(stat_STO);
- pgpgin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGIN);
- pgpgout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT);
- pswpin[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN);
- pswpout[tog] = procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT);
+ pgpgin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGIN, ul_int);
+ pgpgout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PGPGOUT, ul_int);
+ pswpin[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPIN, ul_int);
+ pswpout[tog] = PROCPS_VMSTAT_GET(vm_info, PROCPS_VMSTAT_PSWPOUT, ul_int);
if (t_option) {
(void) time( &the_time );
printf(_("%13lld stolen cpu ticks\n"), TICv(sstat_STO));
printf(_("%13lld non-nice guest cpu ticks\n"), TICv(sstat_GST));
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 out\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PGPGOUT));
- printf(_("%13lu pages swapped in\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPIN));
- printf(_("%13lu pages swapped out\n"), procps_vmstat_get(vm_info, PROCPS_VMSTAT_PSWPOUT));
+ 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, ul_int));
+ 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, ul_int));
printf(_("%13lu interrupts\n"), SYSv(sstat_INT));
printf(_("%13lu CPU context switches\n"), SYSv(sstat_CTX));
printf(_("%13lu boot time\n"), SYSv(sstat_TOB));
xerrx(EXIT_FAILURE,
_("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 */
procps_stat_unref(&sys_info);
}