/*
* swapinfo.d - print virtual memory info (swap).
* Written using DTrace (Solaris 10 3/05)
*
* Prints swap usage details for RAM and disk based swap.
* This script is UNDER CONSTRUCTION, check for newer versions.
*
* $Id: swapinfo.d 3 2007-08-01 10:50:08Z brendan $
*
* USAGE: swapinfo.d (check for newer versions)
*
* FIELDS:
* RAM Total Total RAM installed
* RAM Unusable RAM consumed by the OBP and TSBs
* RAM Kernel Kernel resident in RAM (and usually locked)
* RAM Locked Locked memory pages from swap (Anon)
* RAM Used anon + exec + file pages used
* RAM Free free memory + page cache free
* Disk Total Total disk swap configured
* Disk Resv Disk swap allocated + reserved
* Disk Avail Disk swap available for reservation
* Swap Total Total Virtual Memory usable
* Swap Resv VM allocated + reserved
* Swap Avail VM available for reservation
* Swap MinFree VM kept free from reservations
*
* SEE ALSO: swapinfo - K9Toolkit, http://www.brendangregg.com/k9toolkit.html
* vmstat 1 2; swap -s; echo ::memstat | mdb -k
* RMCmem - The MemTool Package
* RICHPse - The SE Toolkit
* "Clearing up swap space confusion" Unix Insider, Adrian Cockcroft
* "Solaris Internals", Jim Mauro, Richard McDougall
*
* COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg.
*
* 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.
*
* See the License for the specific language governing permissions
* and limitations under the License.
*
* CDDL HEADER END
*
* Author: Brendan Gregg [Sydney, Australia]
*
* 11-Jun-2005 Brendan Gregg Created this.
* 24-Apr-2006 " " Improved disk measurements; changed terms.
* 24-Apr-2006 " " Last update.
*/
inline int DEBUG = 0;
{
/* Debug stats */
/* RAM stats */
/* Disk stats */
/* Total Swap stats */
(`availrmem - `swapfs_minfree > 0 ?
`availrmem - `swapfs_minfree : 0);
(`availrmem - `swapfs_minfree > 0 ?
`availrmem - `swapfs_minfree : 0);
/* Convert to Mbytes */
/* Print debug */
/* Print report */
printf("\n");
printf("\n");
}