1235368Sgnn#!/usr/sbin/dtrace -s
2235368Sgnn/*
3235368Sgnn * cputypes.d - list CPU type info.
4235368Sgnn *              Written using DTrace (Solaris 10 3/05).
5235368Sgnn *
6235368Sgnn * $Id: cputypes.d 3 2007-08-01 10:50:08Z brendan $
7235368Sgnn *
8235368Sgnn * USAGE:	cputypes.d
9235368Sgnn *
10235368Sgnn * FIELDS:
11235368Sgnn *		CPU		CPU ID
12235368Sgnn *		CHIP		chip ID
13235368Sgnn *		PSET		processor set ID
14235368Sgnn *		LGRP		latency group ID
15235368Sgnn *		CLOCK		clock speed, MHz
16235368Sgnn *		TYPE		CPU type
17235368Sgnn *		FPU		floating point identifier types
18235368Sgnn *
19235368Sgnn * SEE ALSO:	psrinfo(1M)
20235368Sgnn *		/usr/include/sys/processor.h
21235368Sgnn *
22235368Sgnn * COPYRIGHT: Copyright (c) 2005 Brendan Gregg.
23235368Sgnn *
24235368Sgnn * CDDL HEADER START
25235368Sgnn *
26235368Sgnn *  The contents of this file are subject to the terms of the
27235368Sgnn *  Common Development and Distribution License, Version 1.0 only
28235368Sgnn *  (the "License").  You may not use this file except in compliance
29235368Sgnn *  with the License.
30235368Sgnn *
31235368Sgnn *  You can obtain a copy of the license at Docs/cddl1.txt
32235368Sgnn *  or http://www.opensolaris.org/os/licensing.
33235368Sgnn *  See the License for the specific language governing permissions
34235368Sgnn *  and limitations under the License.
35235368Sgnn *
36235368Sgnn * CDDL HEADER END
37235368Sgnn *
38235368Sgnn * 27-Jun-2005  Brendan Gregg   Created this.
39235368Sgnn * 27-Jun-2005     "      "	Last update.
40235368Sgnn */
41235368Sgnn
42235368Sgnn#pragma D option quiet
43235368Sgnn#pragma D option bufsize=64k
44235368Sgnn
45235368Sgnndtrace:::BEGIN
46235368Sgnn{
47235368Sgnn	printf("%4s %4s %4s %4s %6s  %-16s %s\n",
48235368Sgnn	    "CPU", "CHIP", "PSET", "LGRP", "CLOCK", "TYPE", "FPU");
49235368Sgnn	done[0] = 0;
50235368Sgnn}
51235368Sgnn
52235368Sgnnprofile:::profile-10ms
53235368Sgnn/done[cpu] == 0/
54235368Sgnn{
55235368Sgnn	printf("%4d %4d %4d %4d %6d  %-16s %s\n",
56235368Sgnn	    cpu, curcpu->cpu_chip, curcpu->cpu_pset,
57235368Sgnn	    curcpu->cpu_lgrp, curcpu->cpu_info.pi_clock,
58235368Sgnn	    stringof(curcpu->cpu_info.pi_processor_type),
59235368Sgnn	    stringof(curcpu->cpu_info.pi_fputypes));
60235368Sgnn	done[cpu]++;
61235368Sgnn}
62235368Sgnn
63235368Sgnnprofile:::tick-100ms
64235368Sgnn{
65235368Sgnn	exit(0);
66235368Sgnn}
67