3 * dispqlen.d - dispatcher queue length by CPU.
4 * Written using DTrace (Solaris 10 3/05).
6 * $Id: dispqlen.d 3 2007-08-01 10:50:08Z brendan $
8 * USAGE: dispqlen.d # hit Ctrl-C to end sample
10 * NOTES: The dispatcher queue length is an indication of CPU saturation.
11 * It is not an indicatior of utilisation - the CPUs may or may not be
12 * utilised when the dispatcher queue reports a length of zero.
14 * SEE ALSO: uptime(1M)
16 * COPYRIGHT: Copyright (c) 2005 Brendan Gregg.
20 * The contents of this file are subject to the terms of the
21 * Common Development and Distribution License, Version 1.0 only
22 * (the "License"). You may not use this file except in compliance
25 * You can obtain a copy of the license at Docs/cddl1.txt
26 * or http://www.opensolaris.org/os/licensing.
27 * See the License for the specific language governing permissions
28 * and limitations under the License.
32 * 27-Jun-2005 Brendan Gregg Created this.
33 * 14-Feb-2006 " " Last update.
36 #pragma D option quiet
40 printf("Sampling... Hit Ctrl-C to end.\n");
43 profile:::profile-1000hz
46 lquantize(curthread->t_cpu->cpu_disp->disp_nrunnable, 0, 64, 1);
51 printa(" CPU %d%@d\n", @queue);