3 * bitesize.d - analyse disk I/O size by process.
4 * Written using DTrace (Solaris 10 3/05).
6 * This produces a report for the size of disk events caused by
7 * processes. These are the disk events sent by the block I/O driver.
9 * If applications must use the disks, we generally prefer they do so
10 * with large I/O sizes.
12 * $Id: bitesize.d 3 2007-08-01 10:50:08Z brendan $
14 * USAGE: bitesize.d # wait several seconds, then hit Ctrl-C
18 * CMD command and argument list
20 * count number of I/O operations
24 * The application may be requesting smaller sized operations, which
25 * are being rounded up to the nearest sector size or UFS block size.
26 * To analyse what the application is requesting, DTraceToolkit programs
27 * such as Proc/fddist may help.
29 * SEE ALSO: seeksize.d, iosnoop
31 * COPYRIGHT: Copyright (c) 2006 Brendan Gregg.
35 * The contents of this file are subject to the terms of the
36 * Common Development and Distribution License, Version 1.0 only
37 * (the "License"). You may not use this file except in compliance
40 * You can obtain a copy of the license at Docs/cddl1.txt
41 * or http://www.opensolaris.org/os/licensing.
42 * See the License for the specific language governing permissions
43 * and limitations under the License.
47 * 31-Mar-2004 Brendan Gregg Created this, build 51.
48 * 10-Oct-2004 " " Rewrote to use the io provider, build 63.
49 * 18-Feb-2006 " " Last update.
52 #pragma D option quiet
59 printf("Tracing... Hit Ctrl-C to end.\n");
68 this->size = args[0]->b_bcount;
71 @Size[pid, curpsinfo->pr_psargs] = quantize(this->size);
79 printf("\n%8s %s\n", "PID", "CMD");
80 printa("%8d %S\n%@d\n", @Size);