1#!/usr/sbin/dtrace -s
2/*
3 * cputypes.d - list CPU type info.
4 *              Written using DTrace (Solaris 10 3/05).
5 *
6 * 27-Jun-2005, ver 0.80
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 */
40
41#pragma D option quiet
42#pragma D option bufsize=64k
43
44dtrace:::BEGIN
45{
46	printf("%4s %4s %4s %4s %6s  %-16s %s\n",
47	    "CPU", "CHIP", "PSET", "LGRP", "CLOCK", "TYPE", "FPU");
48	done[0] = 0;
49}
50
51profile:::profile-10ms
52/done[cpu] == 0/
53{
54	printf("%4d %4d %4d %4d %6d  %-16s %s\n",
55	    cpu, curcpu->cpu_chip, curcpu->cpu_pset,
56	    curcpu->cpu_lgrp, curcpu->cpu_info.pi_clock,
57	    stringof(curcpu->cpu_info.pi_processor_type),
58	    stringof(curcpu->cpu_info.pi_fputypes));
59	done[cpu]++;
60}
61
62profile:::tick-100ms
63{
64	exit(0);
65}
66