3 * priclass.d - priority distribution by scheduling class.
4 * Written using DTrace (Solaris 10 3/05)
6 * This is a simple DTrace script that samples at 1000 Hz the current
7 * thread's scheduling class and priority. A distribution plot is printed.
9 * With priorities, the higher the priority the better chance the thread
10 * has of being scheduled.
12 * This idea came from the script /usr/demo/dtrace/pri.d, which
13 * produces similar output for priority changes, not samples.
15 * $Id: priclass.d 3 2007-08-01 10:50:08Z brendan $
17 * USAGE: priclass.d # hit Ctrl-C to end sampling
20 * value process priority
21 * count number of samples of at least this priority
23 * Also printed is the scheduling class,
29 * FSS fair share schedular
31 * BASED ON: /usr/demo/dtrace/pri.d
33 * SEE ALSO: DTrace Guide "profile Provider" chapter (docs.sun.com)
36 * PORTIONS: Copyright (c) 2006 Brendan Gregg.
40 * The contents of this file are subject to the terms of the
41 * Common Development and Distribution License, Version 1.0 only
42 * (the "License"). You may not use this file except in compliance
45 * You can obtain a copy of the license at Docs/cddl1.txt
46 * or http://www.opensolaris.org/os/licensing.
47 * See the License for the specific language governing permissions
48 * and limitations under the License.
52 * 12-Feb-2006 Brendan Gregg Created this.
53 * 22-Apr-2006 " " Last update.
56 #pragma D option quiet
60 printf("Sampling... Hit Ctrl-C to end.\n");
63 profile:::profile-1000hz
65 @count[stringof(curlwpsinfo->pr_clname)]
66 = lquantize(curlwpsinfo->pr_pri, 0, 170, 10);