Deleted Added
full compact
vmstat.c (94239) vmstat.c (94588)
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 94239 2002-04-08 21:06:14Z asmodai $");
36__FBSDID("$FreeBSD: head/usr.bin/vmstat/vmstat.c 94588 2002-04-13 10:32:36Z asmodai $");
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

--- 737 unchanged lines hidden (view full) ---

782
783 (void)printf(
784 "\nMemory statistics by type Type Kern\n");
785 (void)printf(
786" Type InUse MemUse HighUse Limit Requests Limit Limit Size(s)\n");
787 for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
788 if (ks->ks_calls == 0)
789 continue;
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

--- 737 unchanged lines hidden (view full) ---

782
783 (void)printf(
784 "\nMemory statistics by type Type Kern\n");
785 (void)printf(
786" Type InUse MemUse HighUse Limit Requests Limit Limit Size(s)\n");
787 for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
788 if (ks->ks_calls == 0)
789 continue;
790 (void)printf("%13s%6ld%6ldK%7ldK%6ldK%9lld%5u%6u",
790 (void)printf("%13s%6ld%6ldK%7ldK%6ldK%9llu%5u%6u",
791 ks->ks_shortdesc,
792 ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
793 (ks->ks_maxused + 1023) / 1024,
791 ks->ks_shortdesc,
792 ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
793 (ks->ks_maxused + 1023) / 1024,
794 (ks->ks_limit + 1023) / 1024, (long long)ks->ks_calls,
794 (ks->ks_limit + 1023) / 1024,
795 (unsigned long long)ks->ks_calls,
795 ks->ks_limblocks, ks->ks_mapblocks);
796 first = 1;
797 for (j = 1 << MINBUCKET; j < 1 << (MINBUCKET + 16); j <<= 1) {
798 if ((ks->ks_size & j) == 0)
799 continue;
800 if (first)
801 (void)printf(" ");
802 else
803 (void)printf(",");
804 if(j<1024)
805 (void)printf("%d",j);
806 else
807 (void)printf("%dK",j>>10);
808 first = 0;
809 }
810 (void)printf("\n");
811 totuse += ks->ks_memuse;
812 totreq += ks->ks_calls;
813 }
796 ks->ks_limblocks, ks->ks_mapblocks);
797 first = 1;
798 for (j = 1 << MINBUCKET; j < 1 << (MINBUCKET + 16); j <<= 1) {
799 if ((ks->ks_size & j) == 0)
800 continue;
801 if (first)
802 (void)printf(" ");
803 else
804 (void)printf(",");
805 if(j<1024)
806 (void)printf("%d",j);
807 else
808 (void)printf("%dK",j>>10);
809 first = 0;
810 }
811 (void)printf("\n");
812 totuse += ks->ks_memuse;
813 totreq += ks->ks_calls;
814 }
814 (void)printf("\nMemory Totals: In Use Free Requests\n");
815 (void)printf(" %7ldK %6ldK %20llu\n",
816 (totuse + 1023) / 1024,
817 (totfree + 1023) / 1024, (unsigned long long)totreq);
815 (void)printf("\nMemory Totals: In Use Free Requests\n");
816 (void)printf(" %7ldK %6ldK %13llu\n",
817 (totuse + 1023) / 1024, (totfree + 1023) / 1024,
818 (unsigned long long)totreq);
818}
819
820void
821dozmem()
822{
823 char *buf;
824 size_t bufsize;
825

--- 49 unchanged lines hidden ---
819}
820
821void
822dozmem()
823{
824 char *buf;
825 size_t bufsize;
826

--- 49 unchanged lines hidden ---