sysctl.c (109097) | sysctl.c (109113) |
---|---|
1/* 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93"; 43#endif 44static const char rcsid[] = | 1/* 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93"; 43#endif 44static const char rcsid[] = |
45 "$FreeBSD: head/sbin/sysctl/sysctl.c 109097 2003-01-11 07:29:47Z dillon $"; | 45 "$FreeBSD: head/sbin/sysctl/sysctl.c 109113 2003-01-11 20:03:43Z dillon $"; |
46#endif /* not lint */ 47 48#ifdef __i386__ 49#include <sys/diskslice.h> /* used for bootdev parsing */ 50#include <sys/reboot.h> /* used for bootdev parsing */ 51#endif 52#include <sys/param.h> 53#include <sys/time.h> --- 268 unchanged lines hidden (view full) --- 322 fputs(p1, stdout); 323 return (0); 324} 325 326static int 327S_vmtotal(int l2, void *p) 328{ 329 struct vmtotal *v = (struct vmtotal *)p; | 46#endif /* not lint */ 47 48#ifdef __i386__ 49#include <sys/diskslice.h> /* used for bootdev parsing */ 50#include <sys/reboot.h> /* used for bootdev parsing */ 51#endif 52#include <sys/param.h> 53#include <sys/time.h> --- 268 unchanged lines hidden (view full) --- 322 fputs(p1, stdout); 323 return (0); 324} 325 326static int 327S_vmtotal(int l2, void *p) 328{ 329 struct vmtotal *v = (struct vmtotal *)p; |
330 int pageKilo = getpagesize() / 1024; |
|
330 331 if (l2 != sizeof(*v)) { 332 warnx("S_vmtotal %d != %d", l2, sizeof(*v)); 333 return (0); 334 } 335 | 331 332 if (l2 != sizeof(*v)) { 333 warnx("S_vmtotal %d != %d", l2, sizeof(*v)); 334 return (0); 335 } 336 |
336 printf("\nSystem wide totals computed every five seconds:\n"); | 337 printf( 338 "\nSystem wide totals computed every five seconds:" 339 " (values in kilobytes)\n"); |
337 printf("===============================================\n"); | 340 printf("===============================================\n"); |
338 printf("Processes: (RUNQ:\t %hu Disk Wait: %hu Page Wait: %hu Sleep: %hu)\n", 339 v->t_rq, v->t_dw, v->t_pw, v->t_sl); 340 printf("Virtual Memory:\t\t (Total: %hu Active %hu)\n", v->t_vm, v->t_avm); 341 printf("Real Memory:\t\t (Total: %hu Active %hu)\n", v->t_rm, v->t_arm); 342 printf("Shared Virtual Memory:\t (Total: %hu Active: %hu)\n", v->t_vmshr, v->t_avmshr); 343 printf("Shared Real Memory:\t (Total: %hu Active: %hu)\n", v->t_rmshr, v->t_armshr); 344 printf("Free Memory Pages:\t %hu\n", v->t_free); | 341 printf( 342 "Processes:\t\t(RUNQ: %hu Disk Wait: %hu Page Wait: " 343 "%hu Sleep: %hu)\n", 344 v->t_rq, v->t_dw, v->t_pw, v->t_sl); 345 printf( 346 "Virtual Memory:\t\t(Total: %luK, Active %lldK)\n", 347 (unsigned long)v->t_vm / 1024, 348 (long long)v->t_avm * pageKilo); 349 printf("Real Memory:\t\t(Total: %lldK Active %lldK)\n", 350 (long long)v->t_rm * pageKilo, (long long)v->t_arm * pageKilo); 351 printf("Shared Virtual Memory:\t(Total: %lldK Active: %lldK)\n", 352 (long long)v->t_vmshr * pageKilo, 353 (long long)v->t_avmshr * pageKilo); 354 printf("Shared Real Memory:\t(Total: %lldK Active: %lldK)\n", 355 (long long)v->t_rmshr * pageKilo, 356 (long long)v->t_armshr * pageKilo); 357 printf("Free Memory Pages:\t%ldK\n", (long long)v->t_free * pageKilo); |
345 346 return (0); 347} 348 349static int 350T_dev_t(int l2, void *p) 351{ 352 dev_t *d = (dev_t *)p; --- 332 unchanged lines hidden --- | 358 359 return (0); 360} 361 362static int 363T_dev_t(int l2, void *p) 364{ 365 dev_t *d = (dev_t *)p; --- 332 unchanged lines hidden --- |