1#!/usr/sbin/dtrace -s
2/*
3 * cputypes.d - list CPU type info.
4 *              Written using DTrace (Solaris 10 3/05).
5 *
6 * $Id: cputypes.d 3 2007-08-01 10:50:08Z brendan $
7 *
8 * USAGE:	cputypes.d
9 *
10 * FIELDS:
11 *		CPU		CPU ID
12 *		CHIP		chip ID
13 *		PSET		processor set ID
14 *		LGRP		latency group ID
15 *		CLOCK		clock speed, MHz
16 *		TYPE		CPU type
17 *		FPU		floating point identifier types
18 *
19 * SEE ALSO:	psrinfo(1M)
20 *		/usr/include/sys/processor.h
21 *
22 * COPYRIGHT: Copyright (c) 2005 Brendan Gregg.
23 *
24 * CDDL HEADER START
25 *
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
29 *  with the License.
30 *
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.
35 *
36 * CDDL HEADER END
37 *
38 * 27-Jun-2005  Brendan Gregg   Created this.
39 * 27-Jun-2005     "      "	Last update.
40 */
41
42#pragma D option quiet
43#pragma D option bufsize=64k
44
45dtrace:::BEGIN
46{
47	printf("%4s %4s %4s %4s %6s  %-16s %s\n",
48	    "CPU", "CHIP", "PSET", "LGRP", "CLOCK", "TYPE", "FPU");
49	done[0] = 0;
50}
51
52profile:::profile-10ms
53/done[cpu] == 0/
54{
55	printf("%4d %4d %4d %4d %6d  %-16s %s\n",
56	    cpu, curcpu->cpu_chip, curcpu->cpu_pset,
57	    curcpu->cpu_lgrp, curcpu->cpu_info.pi_clock,
58	    stringof(curcpu->cpu_info.pi_processor_type),
59	    stringof(curcpu->cpu_info.pi_fputypes));
60	done[cpu]++;
61}
62
63profile:::tick-100ms
64{
65	exit(0);
66}
67