1N/A * vmstat-p.d - vmstat -p demo in DTrace. 1N/A * Written using DTrace (Solaris 10 3/05). 1N/A * This has been written to demonstrate fetching similar data as vmstat 1N/A * from DTrace. This program is intended as a starting point for other 1N/A * DTrace scripts, by beginning with familiar statistics. 1N/A * $Id: vmstat-p.d 3 2007-08-01 10:50:08Z brendan $ 1N/A * swap virtual memory free Kbytes 1N/A * free free RAM Kbytes 1N/A * re page reclaims Kbytes 1N/A * mf minor faults Kbytes 1N/A * sr scan rate pages 1N/A * epi executable page ins Kbytes 1N/A * epo executable page outs Kbytes 1N/A * epf executable frees Kbytes 1N/A * api anonymous page ins Kbytes 1N/A * apo anonymous page outs Kbytes 1N/A * apf anonymous frees Kbytes 1N/A * fpi filesystem page ins Kbytes 1N/A * fpo filesystem page outs Kbytes 1N/A * fpf filesystem frees Kbytes 1N/A * Most of the statistics are in units of kilobytes, unlike the 1N/A * original vmstat command which sometimes uses page counts. 1N/A * As this program does not use Kstat, there is no summary since 1N/A * boot line. Free RAM is both free free + cache free. 1N/A * SEE ALSO: vmstat(1M) 1N/A * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. 1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License, Version 1.0 only 1N/A * (the "License"). You may not use this file except in compliance 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * 11-Jun-2005 Brendan Gregg Created this. 1N/A * 08-Jan-2006 " " Last update. 1N/A * Initialise variables 1N/A "memory",
"page",
"executable",
"anonymous",
"filesystem");
1N/A "swap",
"free",
"re",
"mf",
"sr");
1N/A printf(
"%4s %4s %4s %4s %4s %4s %4s %4s %4s\n",
1N/A "epi",
"epo",
"epf",
"api",
"apo",
"apf",
"fpi",
"fpo",
"fpf");
1N/A /* fetch free mem */ 1N/A * MAX(ani_max - ani_resv, 0) + (availrmem - swapfs_minfree) 1N/A /* convert to Kbytes */ 1N/A printf(
"%4d %4d %4d %4d %4d %4d %4d %4d %4d\n",
1N/A /* clear counters */