diff options
author | dillon <dillon@FreeBSD.org> | 2003-01-11 20:03:43 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2003-01-11 20:03:43 +0000 |
commit | 8eb42e5ece9fc5bd4909eaf2f875938ade30af90 (patch) | |
tree | 8991c5492dd617a0de7b57b006604702eefef0c6 /sbin/sysctl | |
parent | 85ec7b37f502caac2483537b92508939cb1fe3b3 (diff) | |
download | FreeBSD-src-8eb42e5ece9fc5bd4909eaf2f875938ade30af90.zip FreeBSD-src-8eb42e5ece9fc5bd4909eaf2f875938ade30af90.tar.gz |
Cleanup the formatting from the last commit, convert everything to
a more human-readable 'kilobytes' instead of pages.
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 5dc53a3..927e7a4 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -327,21 +327,34 @@ static int S_vmtotal(int l2, void *p) { struct vmtotal *v = (struct vmtotal *)p; + int pageKilo = getpagesize() / 1024; if (l2 != sizeof(*v)) { warnx("S_vmtotal %d != %d", l2, sizeof(*v)); return (0); } - printf("\nSystem wide totals computed every five seconds:\n"); + printf( + "\nSystem wide totals computed every five seconds:" + " (values in kilobytes)\n"); printf("===============================================\n"); - printf("Processes: (RUNQ:\t %hu Disk Wait: %hu Page Wait: %hu Sleep: %hu)\n", - v->t_rq, v->t_dw, v->t_pw, v->t_sl); - printf("Virtual Memory:\t\t (Total: %hu Active %hu)\n", v->t_vm, v->t_avm); - printf("Real Memory:\t\t (Total: %hu Active %hu)\n", v->t_rm, v->t_arm); - printf("Shared Virtual Memory:\t (Total: %hu Active: %hu)\n", v->t_vmshr, v->t_avmshr); - printf("Shared Real Memory:\t (Total: %hu Active: %hu)\n", v->t_rmshr, v->t_armshr); - printf("Free Memory Pages:\t %hu\n", v->t_free); + printf( + "Processes:\t\t(RUNQ: %hu Disk Wait: %hu Page Wait: " + "%hu Sleep: %hu)\n", + v->t_rq, v->t_dw, v->t_pw, v->t_sl); + printf( + "Virtual Memory:\t\t(Total: %luK, Active %lldK)\n", + (unsigned long)v->t_vm / 1024, + (long long)v->t_avm * pageKilo); + printf("Real Memory:\t\t(Total: %lldK Active %lldK)\n", + (long long)v->t_rm * pageKilo, (long long)v->t_arm * pageKilo); + printf("Shared Virtual Memory:\t(Total: %lldK Active: %lldK)\n", + (long long)v->t_vmshr * pageKilo, + (long long)v->t_avmshr * pageKilo); + printf("Shared Real Memory:\t(Total: %lldK Active: %lldK)\n", + (long long)v->t_rmshr * pageKilo, + (long long)v->t_armshr * pageKilo); + printf("Free Memory Pages:\t%ldK\n", (long long)v->t_free * pageKilo); return (0); } |