3 * runocc.d - run queue occupancy by CPU.
4 * Written using DTrace (Solaris 10 3/05).
6 * This prints the dispatcher run queue occupancy by CPU each second.
7 * A consistant run queue occupancy is a sign of CPU saturation.
9 * The value is similar to that seen in "sar -q", however this is
10 * calculated in a more accurate manner - sampling at 1000 Hertz.
12 * $Id: runocc.d 3 2007-08-01 10:50:08Z brendan $
18 * %runocc % run queue occupancy, sampled at 1000 Hertz
20 * SEE ALSO: Solaris Internals 2nd Ed, vol 2, CPU chapter.
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 * 02-Mar-2006 Brendan Gregg Created this.
39 * 24-Apr-2006 " " Last update.
42 #pragma D option quiet
45 /curthread->t_cpu->cpu_disp->disp_nrunnable/
53 printf("\n%8s %8s\n", "CPU", "%runocc");
54 printa("%8d %@8d\n", @qocc);