1N/A#!/usr/sbin/dtrace -s
1N/A/*
1N/A * bitesize.d - analyse disk I/O size by process.
1N/A * Written using DTrace (Solaris 10 3/05).
1N/A *
1N/A * This produces a report for the size of disk events caused by
1N/A * processes. These are the disk events sent by the block I/O driver.
1N/A *
1N/A * If applications must use the disks, we generally prefer they do so
1N/A * with large I/O sizes.
1N/A *
1N/A * $Id: bitesize.d 3 2007-08-01 10:50:08Z brendan $
1N/A *
1N/A * USAGE: bitesize.d # wait several seconds, then hit Ctrl-C
1N/A *
1N/A * FIELDS:
1N/A * PID process ID
1N/A * CMD command and argument list
1N/A * value size in bytes
1N/A * count number of I/O operations
1N/A *
1N/A * NOTES:
1N/A *
1N/A * The application may be requesting smaller sized operations, which
1N/A * are being rounded up to the nearest sector size or UFS block size.
1N/A * To analyse what the application is requesting, DTraceToolkit programs
1N/A * such as Proc/fddist may help.
1N/A *
1N/A * SEE ALSO: seeksize.d, iosnoop
1N/A *
1N/A * COPYRIGHT: Copyright (c) 2006 Brendan Gregg.
1N/A *
1N/A * CDDL HEADER START
1N/A *
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 * with the License.
1N/A *
1N/A * You can obtain a copy of the license at Docs/cddl1.txt
1N/A * or http://www.opensolaris.org/os/licensing.
1N/A * See the License for the specific language governing permissions
1N/A * and limitations under the License.
1N/A *
1N/A * CDDL HEADER END
1N/A *
1N/A * 31-Mar-2004 Brendan Gregg Created this, build 51.
1N/A * 10-Oct-2004 " " Rewrote to use the io provider, build 63.
1N/A * 18-Feb-2006 " " Last update.
1N/A */
1N/A
1N/A#pragma D option quiet
1N/A
1N/A/*
1N/A * Print header
1N/A */
1N/Adtrace:::BEGIN
1N/A{
1N/A printf("Tracing... Hit Ctrl-C to end.\n");
1N/A}
1N/A
1N/A/*
1N/A * Process io start
1N/A */
1N/Aio:::start
1N/A{
1N/A /* fetch details */
1N/A this->size = args[0]->b_bcount;
1N/A
1N/A /* store details */
1N/A @Size[pid, curpsinfo->pr_psargs] = quantize(this->size);
1N/A}
1N/A
1N/A/*
1N/A * Print final report
1N/A */
1N/Adtrace:::END
1N/A{
1N/A printf("\n%8s %s\n", "PID", "CMD");
1N/A printa("%8d %S\n%@d\n", @Size);
1N/A}