3 * minfbypid.d - minor faults by PID.
4 * Written using DTrace (Solaris 10 3/05)
6 * This program prints a report of minor faults by PID. Minor faults are
7 * an indiction of memory consumption. This script could be used to help
8 * determine which process was consuming the most memory during the sample.
10 * $Id: minfbypid.d 3 2007-08-01 10:50:08Z brendan $
12 * USAGE: minfbypid.d # hit Ctrl-C to end sample
17 * MINFAULTS number of minor faults
19 * This is based on a script from DExplorer.
21 * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg.
25 * The contents of this file are subject to the terms of the
26 * Common Development and Distribution License, Version 1.0 only
27 * (the "License"). You may not use this file except in compliance
30 * You can obtain a copy of the license at Docs/cddl1.txt
31 * or http://www.opensolaris.org/os/licensing.
32 * See the License for the specific language governing permissions
33 * and limitations under the License.
37 * 28-Jun-2005 Brendan Gregg Created this.
38 * 20-Apr-2006 " " Last update.
41 #pragma D option quiet
45 printf("Tracing... Hit Ctrl-C to end.\n");
50 @mem[pid, execname] = sum(arg0);
55 printf("%6s %-16s %16s\n", "PID", "CMD", "MINFAULTS");
56 printa("%6d %-16s %@16d\n", @mem);