| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vmstat.c,v 1.251 2022/02/09 07:51:45 wiz Exp $ */ | | 1 | /* $NetBSD: vmstat.c,v 1.252 2022/02/27 19:00:46 rillig Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020 | | 4 | * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020 |
5 | * The NetBSD Foundation, Inc. | | 5 | * The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation by: | | 8 | * This code is derived from software contributed to The NetBSD Foundation by: |
9 | * - Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 9 | * - Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
10 | * NASA Ames Research Center. | | 10 | * NASA Ames Research Center. |
11 | * - Simon Burge and Luke Mewburn of Wasabi Systems, Inc. | | 11 | * - Simon Burge and Luke Mewburn of Wasabi Systems, Inc. |
12 | * | | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | | 13 | * Redistribution and use in source and binary forms, with or without |
14 | * modification, are permitted provided that the following conditions | | 14 | * modification, are permitted provided that the following conditions |
| @@ -61,27 +61,27 @@ | | | @@ -61,27 +61,27 @@ |
61 | * SUCH DAMAGE. | | 61 | * SUCH DAMAGE. |
62 | */ | | 62 | */ |
63 | | | 63 | |
64 | #include <sys/cdefs.h> | | 64 | #include <sys/cdefs.h> |
65 | #ifndef lint | | 65 | #ifndef lint |
66 | __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\ | | 66 | __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\ |
67 | The Regents of the University of California. All rights reserved."); | | 67 | The Regents of the University of California. All rights reserved."); |
68 | #endif /* not lint */ | | 68 | #endif /* not lint */ |
69 | | | 69 | |
70 | #ifndef lint | | 70 | #ifndef lint |
71 | #if 0 | | 71 | #if 0 |
72 | static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; | | 72 | static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; |
73 | #else | | 73 | #else |
74 | __RCSID("$NetBSD: vmstat.c,v 1.251 2022/02/09 07:51:45 wiz Exp $"); | | 74 | __RCSID("$NetBSD: vmstat.c,v 1.252 2022/02/27 19:00:46 rillig Exp $"); |
75 | #endif | | 75 | #endif |
76 | #endif /* not lint */ | | 76 | #endif /* not lint */ |
77 | | | 77 | |
78 | #define __POOL_EXPOSE | | 78 | #define __POOL_EXPOSE |
79 | #define __NAMECACHE_PRIVATE | | 79 | #define __NAMECACHE_PRIVATE |
80 | | | 80 | |
81 | #include <sys/param.h> | | 81 | #include <sys/param.h> |
82 | #include <sys/types.h> | | 82 | #include <sys/types.h> |
83 | #include <sys/mount.h> | | 83 | #include <sys/mount.h> |
84 | #include <sys/uio.h> | | 84 | #include <sys/uio.h> |
85 | | | 85 | |
86 | #include <sys/buf.h> | | 86 | #include <sys/buf.h> |
87 | #include <sys/evcnt.h> | | 87 | #include <sys/evcnt.h> |
| @@ -319,27 +319,27 @@ void hist_dodump_sysctl(int[], unsigned | | | @@ -319,27 +319,27 @@ void hist_dodump_sysctl(int[], unsigned |
319 | char **choosedrives(char **); | | 319 | char **choosedrives(char **); |
320 | | | 320 | |
321 | /* Namelist and memory file names. */ | | 321 | /* Namelist and memory file names. */ |
322 | char *nlistf, *memf; | | 322 | char *nlistf, *memf; |
323 | | | 323 | |
324 | /* allow old usage [vmstat 1] */ | | 324 | /* allow old usage [vmstat 1] */ |
325 | #define BACKWARD_COMPATIBILITY | | 325 | #define BACKWARD_COMPATIBILITY |
326 | | | 326 | |
327 | static const int clockrate_mib[] = { CTL_KERN, KERN_CLOCKRATE }; | | 327 | static const int clockrate_mib[] = { CTL_KERN, KERN_CLOCKRATE }; |
328 | static const int vmmeter_mib[] = { CTL_VM, VM_METER }; | | 328 | static const int vmmeter_mib[] = { CTL_VM, VM_METER }; |
329 | static const int uvmexp2_mib[] = { CTL_VM, VM_UVMEXP2 }; | | 329 | static const int uvmexp2_mib[] = { CTL_VM, VM_UVMEXP2 }; |
330 | static const int boottime_mib[] = { CTL_KERN, KERN_BOOTTIME }; | | 330 | static const int boottime_mib[] = { CTL_KERN, KERN_BOOTTIME }; |
331 | | | 331 | |
332 | int numdisks = 2; | | 332 | static int numdisks = 2; |
333 | | | 333 | |
334 | int | | 334 | int |
335 | main(int argc, char *argv[]) | | 335 | main(int argc, char *argv[]) |
336 | { | | 336 | { |
337 | int c, todo, verbose, wide; | | 337 | int c, todo, verbose, wide; |
338 | struct timespec interval; | | 338 | struct timespec interval; |
339 | int reps; | | 339 | int reps; |
340 | const char *histname, *hashname; | | 340 | const char *histname, *hashname; |
341 | char errbuf[_POSIX2_LINE_MAX]; | | 341 | char errbuf[_POSIX2_LINE_MAX]; |
342 | | | 342 | |
343 | histname = hashname = NULL; | | 343 | histname = hashname = NULL; |
344 | memf = nlistf = NULL; | | 344 | memf = nlistf = NULL; |
345 | reps = todo = verbose = wide = 0; | | 345 | reps = todo = verbose = wide = 0; |