From owner-freebsd-current@FreeBSD.ORG Thu Oct 15 19:48:01 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EC251065676 for ; Thu, 15 Oct 2009 19:48:01 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.145]) by mx1.freebsd.org (Postfix) with ESMTP id F3F048FC19 for ; Thu, 15 Oct 2009 19:48:00 +0000 (UTC) Received: by ey-out-1920.google.com with SMTP id 3so266073eyh.18 for ; Thu, 15 Oct 2009 12:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LrUsAbH8cXTZm3YCGW9WGfCYaClIaMgFQPGOLPPMmKg=; b=JpWt/TXRSeo6Fvfj59tO2k4V0Bn+xLNLUycR8bq4+wUYT4WVYfPL3e2vLwBHMOiLza m/PhJw9ZhInngQyMFQz1+m1U9vF+IHHdU+m/q4N9FB9ZJgttjV4rSCrOMKUqR62lhFRq PfqoTtyNmg/J+3TsfQX/TwAaOW9n8gPvkpYhc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OsqN7ODNezLvsvwfZEHkUjIKs2o7MJAMYW3cEvzo2hWe8wIPoM4BbinsYvrA2MyxsY llIdEqTzmfLzMFb97Q1OYkx9kSScmksobE7ne7YnemWgJfAGHZeHx4BwDe+2aB2bzKYf JddS6gOy6cOPhOuSs2qgTsYb7ZuhDW5YHo0UQ= MIME-Version: 1.0 Received: by 10.211.130.15 with SMTP id h15mr9629622ebn.82.1255636079895; Thu, 15 Oct 2009 12:47:59 -0700 (PDT) In-Reply-To: <200910150747.55101.jhb@freebsd.org> References: <200910150747.55101.jhb@freebsd.org> Date: Thu, 15 Oct 2009 15:47:59 -0400 Message-ID: From: grarpamp To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Thu, 15 Oct 2009 20:21:33 +0000 Subject: Re: vmstat -m/-z field parsing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 19:48:01 -0000 Sure, it's a workaround for vmstat -z, but not easy for vmstat -m which has no handy colons/commas to key from. Shouldn't stats be easy to parse in order to be useful to many rather than a test of a few users script fu ? :) So why not hunt up, check for potential new collisions to fix and change the strings in a lint run? See below... Thank you for pointing out that I had to do 'size * (used + free)', not just 'used'. And for the fu tips too :) I guess 'free' are not returned to the system for other uses then. Are there detailed docs on what all the fields mean in the various tools... vmstat -z/-m, systat -vm, netstat -m, top, ps. Most docs seem to just list the field names a command line switch will display, instead what sense to make of them. /me, grokking with wild abandon... # sys/vm/uma_core.c: args.name = "UMA Kegs"; args.name = "UMA Zones"; struct uma_bucket_zone bucket_zones[] = { { NULL, "16 Bucket", 16 }, { NULL, "32 Bucket", 32 }, { NULL, "64 Bucket", 64 }, { NULL, "128 Bucket", 128 }, { NULL, NULL, 0} }; # find -s sys -type f | xargs egrep MALLOC_DEFINE | sed -E 's/,[^,]{1,}$//' | egrep '".* .*"' sys/arm/xscale/pxa/pxa_smi.c:MALLOC_DEFINE(M_PXASMI, "PXA SMI" sys/arm/xscale/pxa/pxa_space.c:MALLOC_DEFINE(M_PXATAG, "PXA bus_space tags" sys/cam/cam_periph.c:MALLOC_DEFINE(M_CAMPERIPH, "CAM periph" sys/cam/cam_queue.c:MALLOC_DEFINE(M_CAMQ, "CAM queue" sys/cam/cam_queue.c:MALLOC_DEFINE(M_CAMDEVQ, "CAM dev queue" sys/cam/cam_queue.c:MALLOC_DEFINE(M_CAMCCBQ, "CAM ccb queue" sys/cam/cam_sim.c:MALLOC_DEFINE(M_CAMSIM, "CAM SIM" sys/cam/cam_xpt.c:MALLOC_DEFINE(M_CAMXPT, "CAM XPT" sys/cam/scsi/scsi_low.c:MALLOC_DEFINE(M_SCSILOW, "SCSI low" sys/cam/scsi/scsi_sa.c:MALLOC_DEFINE(M_SCSISA, "SCSI sa" sys/cam/scsi/scsi_ses.c:MALLOC_DEFINE(M_SCSISES, "SCSI SES" sys/cam/scsi/scsi_targ_bh.c:MALLOC_DEFINE(M_SCSIBH, "SCSI bh" sys/compat/linux/linux_futex.c:MALLOC_DEFINE(M_FUTEX_WP, "futex wp" sys/dev/ahci/ahci.c:MALLOC_DEFINE(M_AHCI, "AHCI driver" sys/dev/siis/siis.c:MALLOC_DEFINE(M_SIIS, "SIIS driver" sys/dev/sound/midi/midi.c:MALLOC_DEFINE(M_MIDI, "midi buffers" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSRVCACHE, "NFSD srvcache" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSDCLIENT, "NFSD V4client" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSDSTATE, "NFSD V4state", "NFSD V4 State (Openowner, Open, Lockowner sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSDLOCK, "NFSD V4lock" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSDLOCKFILE, "NFSD lckfile" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSSTRING, "NFSD string" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSUSERGROUP, "NFSD usrgroup" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSDREQ, "NFS req" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSFH, "NFS fh" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLOWNER, "NFSCL owner" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLOPEN, "NFSCL open" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLDELEG, "NFSCL deleg" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLCLIENT, "NFSCL client" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown" sys/fs/nfs/nfs_commonport.c:MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck" sys/fs/tmpfs/tmpfs_vfsops.c:MALLOC_DEFINE(M_TMPFSMNT, "tmpfs mount" sys/fs/tmpfs/tmpfs_vfsops.c:MALLOC_DEFINE(M_TMPFSNAME, "tmpfs name" sys/fs/unionfs/union_subr.c:static MALLOC_DEFINE(M_UNIONFSHASH, "UNIONFS hash" sys/fs/unionfs/union_subr.c:MALLOC_DEFINE(M_UNIONFSNODE, "UNIONFS node" sys/fs/unionfs/union_subr.c:MALLOC_DEFINE(M_UNIONFSPATH, "UNIONFS path" sys/fs/unionfs/union_vfsops.c:static MALLOC_DEFINE(M_UNIONFSMNT, "UNIONFS mount" sys/geom/eli/g_eli.c:MALLOC_DEFINE(M_ELI, "eli data" sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c:MALLOC_DEFINE(M_XFSNODE, "XFS node" sys/kern/kern_cons.c:static MALLOC_DEFINE(M_TTYCONS, "tty console" sys/kern/kern_fail.c:MALLOC_DEFINE(M_FAIL_POINT, "Fail Points" sys/kern/subr_bus.c:static MALLOC_DEFINE(M_BUS_SC, "bus-sc", "Bus data structures sys/nfsserver/nfs_fha.c:static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA" # find -s sys -type f | xargs egrep uma_zcreate | sed 's/,.*$//' | egrep '".* .*"' sys/arm/arm/pmap.c: pvzone = uma_zcreate("PV ENTRY" sys/arm/arm/pmap.c: l2zone = uma_zcreate("L2 Table" sys/arm/arm/pmap.c: l2table_zone = uma_zcreate("L2 Table" sys/compat/ndis/subr_ntoskrnl.c: mdl_zone = uma_zcreate("Windows MDL" sys/compat/ndis/subr_ntoskrnl.c: iw_zone = uma_zcreate("Windows WorkItem" sys/dev/en/midway.c: sc->map_zone = uma_zcreate("en dma maps" sys/dev/en/midway.c: en_vcc_zone = uma_zcreate("EN vccs" sys/dev/fatm/if_fatm.c: sc->vcc_zone = uma_zcreate("FATM vccs" sys/dev/hatm/if_hatm.c: if ((sc->vcc_zone = uma_zcreate("HE vccs" sys/dev/iscsi/initiator/iscsi.c: printf("iscsi_initiator: uma_zcreate failed"); sys/dev/patm/if_patm_attach.c: if ((sc->vcc_zone = uma_zcreate("PATM vccs" sys/dev/patm/if_patm_attach.c: if ((sc->tx_mapzone = uma_zcreate("PATM tx maps" sys/fs/tmpfs/tmpfs_vfsops.c: tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent" sys/fs/tmpfs/tmpfs_vfsops.c: tmp->tm_node_pool = uma_zcreate("TMPFS node" sys/fs/udf/udf_vfsops.c: udf_zone_node = uma_zcreate("UDF Node zone" sys/fs/udf/udf_vfsops.c: udf_zone_ds = uma_zcreate("UDF Dirstream zone" sys/ia64/ia64/pmap.c: pvzone = uma_zcreate("PV ENTRY" sys/ia64/ia64/pmap.c: ptezone = uma_zcreate("PT ENTRY" sys/kern/kern_umtx.c: umtx_pi_zone = uma_zcreate("umtx pi" sys/kern/vfs_cache.c: cache_zone_small = uma_zcreate("S VFS Cache" sys/kern/vfs_cache.c: cache_zone_large = uma_zcreate("L VFS Cache" sys/mips/mips/pmap.c: pvzone = uma_zcreate("PV ENTRY" sys/netgraph/netflow/netflow.c: priv->zone = uma_zcreate("NetFlow cache" sys/netgraph/ng_base.c: ng_qzone = uma_zcreate("NetGraph items" sys/netgraph/ng_base.c: ng_qdzone = uma_zcreate("NetGraph data items" sys/netinet/ipfw/ip_fw2.c: ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule" sys/powerpc/aim/mmu_oea.c: moea_upvo_zone = uma_zcreate("UPVO entry" sys/powerpc/aim/mmu_oea.c: moea_mpvo_zone = uma_zcreate("MPVO entry" sys/powerpc/aim/mmu_oea64.c: moea64_upvo_zone = uma_zcreate("UPVO entry" sys/powerpc/aim/mmu_oea64.c: moea64_mpvo_zone = uma_zcreate("MPVO entry" sys/powerpc/booke/pmap.c: pvzone = uma_zcreate("PV ENTRY" sys/security/mac/mac_label.c: zone_label = uma_zcreate("MAC labels" sys/sun4v/sun4v/pmap.c: pvzone = uma_zcreate("PV ENTRY" sys/ufs/ffs/ffs_vfsops.c: uma_inode = uma_zcreate("FFS inode" sys/ufs/ffs/ffs_vfsops.c: uma_ufs1 = uma_zcreate("FFS1 dinode" sys/ufs/ffs/ffs_vfsops.c: uma_ufs2 = uma_zcreate("FFS2 dinode" sys/vm/device_pager.c: fakepg_zone = uma_zcreate("DP fakepg" sys/vm/sg_pager.c: fakepg_zone = uma_zcreate("SG fakepg" sys/vm/uma_core.c: slabzone = uma_zcreate("UMA Slabs" sys/vm/uma_core.c: slabrefzone = uma_zcreate("UMA RCntSlabs" sys/vm/uma_core.c: hashzone = uma_zcreate("UMA Hash" sys/vm/vm_map.c: kmapentzone = uma_zcreate("KMAP ENTRY" sys/vm/vm_map.c: mapentzone = uma_zcreate("MAP ENTRY" sys/vm/vm_object.c: obj_zone = uma_zcreate("VM OBJECT"