vmstat.c (101590) | vmstat.c (109097) |
---|---|
1/* 2 * Copyright (c) 1980, 1986, 1991, 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 --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 | 1/* 2 * Copyright (c) 1980, 1986, 1991, 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 --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 |
36__FBSDID("$FreeBSD: head/usr.bin/vmstat/vmstat.c 101590 2002-08-09 15:47:43Z tmm $"); | 36__FBSDID("$FreeBSD: head/usr.bin/vmstat/vmstat.c 109097 2003-01-11 07:29:47Z dillon $"); |
37 38#ifndef lint 39static const char copyright[] = 40"@(#) Copyright (c) 1980, 1986, 1991, 1993\n\ 41 The Regents of the University of California. All rights reserved.\n"; 42#endif 43 44#ifndef lint --- 422 unchanged lines hidden (view full) --- 467 } 468 default: 469 break; 470 } 471 472 kread(X_SUM, &sum, sizeof(sum)); 473 size = sizeof(total); 474 mib[0] = CTL_VM; | 37 38#ifndef lint 39static const char copyright[] = 40"@(#) Copyright (c) 1980, 1986, 1991, 1993\n\ 41 The Regents of the University of California. All rights reserved.\n"; 42#endif 43 44#ifndef lint --- 422 unchanged lines hidden (view full) --- 467 } 468 default: 469 break; 470 } 471 472 kread(X_SUM, &sum, sizeof(sum)); 473 size = sizeof(total); 474 mib[0] = CTL_VM; |
475 mib[1] = VM_METER; | 475 mib[1] = VM_TOTAL; |
476 if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) { 477 (void)printf("Can't get kerninfo: %s\n", 478 strerror(errno)); 479 bzero(&total, sizeof(total)); 480 } 481 (void)printf("%2d %1d %1d", 482 total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); 483#define vmstat_pgtok(a) ((a) * sum.v_page_size >> 10) --- 339 unchanged lines hidden --- | 476 if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) { 477 (void)printf("Can't get kerninfo: %s\n", 478 strerror(errno)); 479 bzero(&total, sizeof(total)); 480 } 481 (void)printf("%2d %1d %1d", 482 total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); 483#define vmstat_pgtok(a) ((a) * sum.v_page_size >> 10) --- 339 unchanged lines hidden --- |