Re: vmstat -m/-z field parsing

From: grarpamp <grarpamp_at_gmail.com>
Date: Thu, 15 Oct 2009 15:47:59 -0400
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"
Received on Thu Oct 15 2009 - 17:48:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:57 UTC