Mercurial > illumos > illumos-gate
changeset 12607:2bc0f474d551
PSARC 2004/445 EOF of vmstat -c option
4801975 remove flushmeter + kstats after EOF period (PSARC 2004/445)
5034996 remove vmstat -c (after EOF period for PSARC 2004/445)
author | John Levon <john.levon@sun.com> |
---|---|
date | Thu, 10 Jun 2010 18:27:18 -0700 |
parents | 3c942b164456 |
children | 708c1594201d |
files | usr/src/cmd/avs/sdbc/sdbc_dynmem.c usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs usr/src/cmd/stat/common/acquire.c usr/src/cmd/stat/common/statcommon.h usr/src/cmd/stat/vmstat/vmstat.c usr/src/pkg/manifests/system-header.mf usr/src/uts/common/fs/ufs/ufs_filio.c usr/src/uts/common/fs/ufs/ufs_lockfs.c usr/src/uts/common/os/kstat_fr.c usr/src/uts/common/sys/Makefile usr/src/uts/common/sys/vm.h usr/src/uts/common/sys/vmmeter.h usr/src/uts/common/vm/vm_pvn.c usr/src/uts/sun4/ml/offsets.in |
diffstat | 14 files changed, 25 insertions(+), 242 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/avs/sdbc/sdbc_dynmem.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/cmd/avs/sdbc/sdbc_dynmem.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -49,7 +48,6 @@ #include <sys/buf.h> #include <sys/vfs.h> #include <sys/dnlc.h> -#include <sys/vmmeter.h> #define TRUE 1 #define FALSE 0
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs Thu Jun 10 18:27:18 2010 -0700 @@ -20,12 +20,9 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Kstat.xs is a Perl XS (eXStension module) that makes the Solaris * kstat(3KSTAT) facility available to Perl scripts. Kstat is a general-purpose @@ -80,7 +77,6 @@ #include <sys/sysinfo.h> #include <sys/flock.h> #include <sys/dnlc.h> -#include <sys/vmmeter.h> #include <nfs/nfs.h> #include <nfs/nfs_clnt.h> @@ -326,27 +322,6 @@ } /* - * Definition in /usr/include/sys/vmmeter.h - */ - -static void -save_flushmeter(HV *self, kstat_t *kp, int strip_str) -{ - struct flushmeter *flushmeterp; - - /* PERL_ASSERT(kp->ks_ndata == 1); */ - PERL_ASSERT(kp->ks_data_size == sizeof (struct flushmeter)); - flushmeterp = (struct flushmeter *)(kp->ks_data); - - SAVE_UINT32(self, flushmeterp, f_ctx); - SAVE_UINT32(self, flushmeterp, f_segment); - SAVE_UINT32(self, flushmeterp, f_page); - SAVE_UINT32(self, flushmeterp, f_partial); - SAVE_UINT32(self, flushmeterp, f_usr); - SAVE_UINT32(self, flushmeterp, f_region); -} - -/* * Definition in /usr/include/sys/dnlc.h */ @@ -760,7 +735,6 @@ SAVE_FNP(raw_kstat_lookup, save_cpu_stat, "cpu_stat:cpu_stat"); SAVE_FNP(raw_kstat_lookup, save_var, "unix:var"); - SAVE_FNP(raw_kstat_lookup, save_flushmeter, "unix:flushmeter"); SAVE_FNP(raw_kstat_lookup, save_ncstats, "unix:ncstats"); SAVE_FNP(raw_kstat_lookup, save_sysinfo, "unix:sysinfo"); SAVE_FNP(raw_kstat_lookup, save_vminfo, "unix:vminfo");
--- a/usr/src/cmd/stat/common/acquire.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/cmd/stat/common/acquire.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "statcommon.h" #include "dsr.h" @@ -158,7 +155,7 @@ ps->ps_id = pids[i - 1]; ps->ps_cpus = - calloc(ss->s_nr_cpus, sizeof (struct cpu_snapshot *)); + calloc(ss->s_nr_cpus, sizeof (struct cpu_snapshot *)); if (ps->ps_cpus == NULL) goto out; } @@ -227,7 +224,7 @@ ki = KSTAT_INTR_PTR(ksp); (void) strlcpy(ss->s_intrs[i].is_name, ksp->ks_name, - KSTAT_STRLEN); + KSTAT_STRLEN); ss->s_intrs[i].is_total = 0; for (j = 0; j < KSTAT_NUM_INTRS; j++) @@ -322,17 +319,6 @@ fail(1, "kstat_chain_update failed"); } - if (types & SNAP_FLUSHES) { - kstat_t *ksp; - ksp = kstat_lookup(kc, "unix", 0, "flushmeter"); - if (ksp == NULL) { - fail(0, "This machine does not have " - "a virtual address cache"); - } - if (kstat_read(kc, ksp, &ss->s_flushes) == -1) - err = errno; - } - if (!err && (types & SNAP_INTERRUPTS)) err = acquire_intrs(ss, kc); @@ -488,7 +474,7 @@ for (i = 0; i < src->ks_ndata; i++) { /* "addition" makes little sense for strings */ if (from->data_type != KSTAT_DATA_CHAR && - from->data_type != KSTAT_DATA_STRING) + from->data_type != KSTAT_DATA_STRING) (to)->value.ui64 += (from)->value.ui64; from++; to++;
--- a/usr/src/cmd/stat/common/statcommon.h Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/cmd/stat/common/statcommon.h Thu Jun 10 18:27:18 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * * Common routines for acquiring snapshots of kstats for * iostat, mpstat, and vmstat. @@ -40,7 +39,6 @@ #include <sys/buf.h> #include <sys/dnlc.h> #include <sys/sysinfo.h> -#include <sys/vmmeter.h> #include <sys/processor.h> #include <sys/pset.h> #include <sys/avl.h> @@ -72,22 +70,20 @@ SNAP_SYSTEM = 1 << 2, /* interrupt sources and counts */ SNAP_INTERRUPTS = 1 << 3, - /* cache flushes */ - SNAP_FLUSHES = 1 << 4, /* disk etc. stats */ - SNAP_IODEVS = 1 << 5, + SNAP_IODEVS = 1 << 4, /* disk controller aggregates */ - SNAP_CONTROLLERS = 1 << 6, + SNAP_CONTROLLERS = 1 << 5, /* mpxio L I (multipath) paths: -X: Lun,LunInitiator */ - SNAP_IOPATHS_LI = 1 << 7, + SNAP_IOPATHS_LI = 1 << 6, /* mpxio LTI (multipath) paths: -Y: Lun,LunTarget,LunTargetInitiator */ - SNAP_IOPATHS_LTI = 1 << 8, + SNAP_IOPATHS_LTI = 1 << 7, /* disk error stats */ - SNAP_IODEV_ERRORS = 1 << 9, + SNAP_IODEV_ERRORS = 1 << 8, /* pretty names for iodevs */ - SNAP_IODEV_PRETTY = 1 << 10, + SNAP_IODEV_PRETTY = 1 << 9, /* devid for iodevs */ - SNAP_IODEV_DEVID = 1 << 11 + SNAP_IODEV_DEVID = 1 << 10 }; struct cpu_snapshot { @@ -225,7 +221,6 @@ size_t s_iodevs_is_name_maxlen; struct sys_snapshot s_sys; struct biostats s_biostats; - struct flushmeter s_flushes; }; /* print a message and exit with failure */
--- a/usr/src/cmd/stat/vmstat/vmstat.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/cmd/stat/vmstat/vmstat.c Thu Jun 10 18:27:18 2010 -0700 @@ -1,6 +1,5 @@ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -37,7 +36,7 @@ static int pagesize; static double etime; static int lines = 1; -static int swflag = 0, cflag = 0, pflag = 0; +static int swflag = 0, pflag = 0; static int suppress_state; static long iter = 0; static hrtime_t period_n = 0; @@ -53,7 +52,6 @@ static void printhdr(int); static void dosum(struct sys_snapshot *ss); static void dointr(struct snapshot *ss); -static void docachestats(kstat_ctl_t *kc, hrtime_t interval, int forever); static void usage(void); int @@ -77,7 +75,7 @@ pagesize = sysconf(_SC_PAGESIZE); hz = sysconf(_SC_CLK_TCK); - while ((c = getopt(argc, argv, "cipqsST:")) != EOF) + while ((c = getopt(argc, argv, "ipqsST:")) != EOF) switch (c) { case 'S': swflag = !swflag; @@ -88,9 +86,6 @@ case 'i': intr = 1; break; - case 'c': - cflag++; - break; case 'q': suppress_state = 1; break; @@ -121,8 +116,6 @@ if (intr) types |= SNAP_INTERRUPTS; - if (cflag) - types |= SNAP_FLUSHES; if (!intr) types |= SNAP_IODEVS; @@ -184,12 +177,6 @@ usage(); } - if (cflag) { - free_snapshot(ss); - docachestats(kc, period_n, forever); - exit(0); - } - (void) sigset(SIGCONT, printhdr); dovmstats(old, ss); @@ -512,56 +499,10 @@ } static void -docachestats(kstat_ctl_t *kc, hrtime_t interval, int forever) -{ - struct snapshot *old; - struct snapshot *new; - int i; - hrtime_t start; - - start = gethrtime(); - old = acquire_snapshot(kc, SNAP_FLUSHES, NULL); - - if (iter == 0) { - (void) printf("flush statistics: (totals)\n"); - (void) printf("%8s%8s%8s%8s%8s%8s\n", - "usr", "ctx", "rgn", "seg", "pag", "par"); - (void) printf(" %7d %7d %7d %7d %7d %7d\n", - old->s_flushes.f_usr, old->s_flushes.f_ctx, - old->s_flushes.f_region, old->s_flushes.f_segment, - old->s_flushes.f_page, old->s_flushes.f_partial); - return; - } - - (void) printf("flush statistics: (interval based)\n"); - for (i = 0; i < iter; i++) { - if (i % REPRINT == 0) - (void) printf("%8s%8s%8s%8s%8s%8s\n", - "usr", "ctx", "rgn", "seg", "pag", "par"); - - /* Have a kip */ - sleep_until(&start, interval, forever, &caught_cont); - - new = acquire_snapshot(kc, SNAP_FLUSHES, NULL); - - (void) printf(" %7d %7d %7d %7d %7d %7d\n", - new->s_flushes.f_usr - old->s_flushes.f_usr, - new->s_flushes.f_ctx - old->s_flushes.f_ctx, - new->s_flushes.f_region - old->s_flushes.f_region, - new->s_flushes.f_segment - old->s_flushes.f_segment, - new->s_flushes.f_page - old->s_flushes.f_page, - new->s_flushes.f_partial- old->s_flushes.f_partial); - (void) fflush(stdout); - free_snapshot(old); - old = new; - } -} - -static void usage(void) { (void) fprintf(stderr, - "Usage: vmstat [-cipqsS] [-T d|u] [disk ...] " + "Usage: vmstat [-ipqsS] [-T d|u] [disk ...] " "[interval [count]]\n"); exit(1); }
--- a/usr/src/pkg/manifests/system-header.mf Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/pkg/manifests/system-header.mf Thu Jun 10 18:27:18 2010 -0700 @@ -1574,7 +1574,6 @@ file path=usr/include/sys/vmem.h file path=usr/include/sys/vmem_impl.h file path=usr/include/sys/vmem_impl_user.h -file path=usr/include/sys/vmmeter.h file path=usr/include/sys/vmparam.h file path=usr/include/sys/vmsystm.h file path=usr/include/sys/vnode.h
--- a/usr/src/uts/common/fs/ufs/ufs_filio.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/fs/ufs/ufs_filio.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/t_lock.h> #include <sys/param.h> @@ -50,7 +47,6 @@ #include <sys/mman.h> #include <sys/pathname.h> #include <sys/debug.h> -#include <sys/vmmeter.h> #include <sys/vmsystm.h> #include <sys/cmn_err.h> #include <sys/filio.h>
--- a/usr/src/uts/common/fs/ufs/ufs_lockfs.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/fs/ufs/ufs_lockfs.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/types.h> @@ -48,7 +47,6 @@ #include <sys/mman.h> #include <sys/pathname.h> #include <sys/debug.h> -#include <sys/vmmeter.h> #include <sys/vmsystm.h> #include <sys/cmn_err.h> #include <sys/acct.h>
--- a/usr/src/uts/common/os/kstat_fr.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/os/kstat_fr.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -46,7 +45,6 @@ #include <sys/vfs.h> #include <sys/dnlc.h> #include <sys/var.h> -#include <sys/vmmeter.h> #include <sys/debug.h> #include <sys/kobj.h> #include <sys/avl.h> @@ -546,15 +544,6 @@ kstat_install(ksp); } -#ifdef VAC - ksp = kstat_create("unix", 0, "flushmeter", "hat", KSTAT_TYPE_RAW, - sizeof (struct flushmeter), KSTAT_FLAG_VIRTUAL); - if (ksp) { - ksp->ks_data = (void *) &flush_cnt; - kstat_install(ksp); - } -#endif /* VAC */ - ksp = kstat_create("unix", 0, "var", "misc", KSTAT_TYPE_RAW, sizeof (struct var), KSTAT_FLAG_VIRTUAL); if (ksp) {
--- a/usr/src/uts/common/sys/Makefile Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/sys/Makefile Thu Jun 10 18:27:18 2010 -0700 @@ -628,7 +628,6 @@ vm_usage.h \ vmem.h \ vmem_impl.h \ - vmmeter.h \ vmsystm.h \ vnic.h \ vnic_impl.h \
--- a/usr/src/uts/common/sys/vm.h Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/sys/vm.h Thu Jun 10 18:27:18 2010 -0700 @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2001 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -40,10 +38,7 @@ #ifndef _SYS_VM_H #define _SYS_VM_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/vmparam.h> -#include <sys/vmmeter.h> #include <sys/vmsystm.h> #include <sys/sysmacros.h>
--- a/usr/src/uts/common/sys/vmmeter.h Thu Jun 10 16:27:13 2010 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1996 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - -/* - * University Copyright- Copyright (c) 1982, 1986, 1988 - * The Regents of the University of California - * All Rights Reserved - * - * University Acknowledgment- Portions of this document are derived from - * software developed by the University of California, Berkeley, and its - * contributors. - */ - -#ifndef _SYS_VMMETER_H -#define _SYS_VMMETER_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Virtual Address Cache flush instrumentation. - * - * Everything from f_first to f_last must be unsigned [int]. - */ -struct flushmeter { -#define f_first f_ctx - unsigned f_ctx; /* No. of context flushes */ - unsigned f_segment; /* No. of segment flushes */ - unsigned f_page; /* No. of complete page flushes */ - unsigned f_partial; /* No. of partial page flushes */ - unsigned f_usr; /* No. of non-supervisor flushes */ - unsigned f_region; /* No. of region flushes */ -#define f_last f_region -}; - -#ifdef _KERNEL -#ifdef VAC -/* cnt is 1 sec accum; rate is 5 sec avg; sum is grand total */ -struct flushmeter flush_cnt; -#endif /* VAC */ -#endif /* _KERNEL */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_VMMETER_H */
--- a/usr/src/uts/common/vm/vm_pvn.c Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/common/vm/vm_pvn.c Thu Jun 10 18:27:18 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -50,7 +49,6 @@ #include <sys/buf.h> #include <sys/vnode.h> #include <sys/uio.h> -#include <sys/vmmeter.h> #include <sys/vmsystm.h> #include <sys/mman.h> #include <sys/vfs.h>
--- a/usr/src/uts/sun4/ml/offsets.in Thu Jun 10 16:27:13 2010 -0700 +++ b/usr/src/uts/sun4/ml/offsets.in Thu Jun 10 18:27:18 2010 -0700 @@ -73,7 +73,6 @@ #define SIZES 1 -#include <sys/vmmeter.h> #include <sys/mutex_impl.h> #include <sys/lockstat.h> #include <sys/ddi_isa.h> @@ -326,14 +325,6 @@ \ XXX - doesn't preserve case up above \#define nPC_OFF NPC_OFF -flushmeter FM_SIZE - f_ctx FM_CTX - f_usr FM_USR - f_region FM_REGION - f_segment FM_SEGMENT - f_page FM_PAGE - f_partial FM_PARTIAL - autovec AUTOVECSIZE av_vector av_intarg