3 * hotspot.d - plot disk event by location, look for hotspots.
4 * Written in DTrace (Solaris 10 3/05).
6 * This simple DTrace script determines if disk activity is occuring in
7 * the one place - a "hotspot". This helps us understand the system's usage
8 * of a disk, it does not imply that the existance or not of a hotspot is
9 * good or bad (often may be good, less seeking).
11 * $Id: hotspot.d 3 2007-08-01 10:50:08Z brendan $
13 * USAGE: hotspot.d # hit Ctrl-C to end
16 * Disk disk instance name
17 * Major driver major number
18 * Minor driver minor number
19 * value location, by megabyte
20 * count number of I/O operations
22 * COPYRIGHT: Copyright (c) 2005, 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 * 07-May-2005 Brendan Gregg Created this.
39 * 20-Apr-2006 " " Last update.
42 #pragma D option quiet
44 inline int DISK_MB_MAX = 1000000; /* max size of a single disk */
45 inline int REPORT_SCALE_MB = 1000; /* output step size for report */
52 printf("Tracing... Hit Ctrl-C to end.\n");
60 this->mb = args[0]->b_blkno / 2048;
61 @Block[args[1]->dev_statname, args[1]->dev_major, args[1]->dev_minor] =
62 lquantize(this->mb, 0, DISK_MB_MAX, REPORT_SCALE_MB);
70 printa("Disk: %s Major,Minor: %d,%d\n%@d\n", @Block);