3 * iofileb.d - I/O bytes by filename and process.
4 * Written using DTrace (Solaris 10 3/05).
6 * This prints a summary of requested disk activity by pathname,
7 * providing totals of the I/O events in bytes. It is a companion to the
8 * iofile.d script - which prints in terms of I/O wait time, not bytes.
9 * I/O wait time is a better metric for understanding performance issues.
10 * Both disk and NFS I/O are measured.
12 * $Id: iofileb.d 3 2007-08-01 10:50:08Z brendan $
14 * USAGE: iofileb.d # wait several seconds, then hit Ctrl-C
19 * KB Kilobytes of disk I/O
20 * FILE Full pathname of the file
22 * COPYRIGHT: Copyright (c) 2006 Brendan Gregg.
26 * The contents of this file are subject to the terms of the
27 * Common Development and Distribution License, Version 1.0 only
28 * (the "License"). You may not use this file except in compliance
31 * You can obtain a copy of the license at Docs/cddl1.txt
32 * or http://www.opensolaris.org/os/licensing.
33 * See the License for the specific language governing permissions
34 * and limitations under the License.
38 * 20-Feb-2006 Brendan Gregg Created this.
39 * 20-Feb-2006 " " Last update.
42 #pragma D option quiet
46 printf("Tracing... Hit Ctrl-C to end.\n");
51 @files[pid, execname, args[2]->fi_pathname] = sum(args[0]->b_bcount);
56 normalize(@files, 1024);
57 printf("%6s %-12s %6s %s\n", "PID", "CMD", "KB", "FILE");
58 printa("%6d %-12.12s %@6d %s\n", @files);