3 * kstat_types.d - Trace kstat reads with type info.
4 * Written using DTrace (Solaris 10 3/05)
6 * kstat is the Kernel Statistics framework, which is used by tools
7 * such as vmstat, iostat, mpstat and sar. Try running vmstat while
8 * kstat_types.d is tracing - you should see details of the kstat
11 * $Id: kstat_types.d 3 2007-08-01 10:50:08Z brendan $
13 * USAGE: kstat_types.d (early release, check for updates)
17 * CLASS kstat class (ks_class)
18 * TYPE kstat type as a string (ks_type)
19 * MOD:INS:NAME kstat module:instance:name
21 * COPYRIGHT: Copyright (c) 2006 Brendan Gregg.
25 * The contents of this file are subject to the terms of the
26 * Common Development and Distribution License, Version 1.0 only
27 * (the "License"). You may not use this file except in compliance
30 * You can obtain a copy of the license at Docs/cddl1.txt
31 * or http://www.opensolaris.org/os/licensing.
32 * See the License for the specific language governing permissions
33 * and limitations under the License.
37 * 11-Feb-2006 Brendan Gregg Created this.
38 * 11-Feb-2006 " " Last update.
41 #include <sys/isa_defs.h>
43 #pragma D option quiet
47 printf("%-16s %-16s %-6s %s\n",
48 "CMD", "CLASS", "TYPE", "MOD:INS:NAME");
51 fbt::read_kstat_data:entry
53 #ifdef _MULTI_DATAMODEL
54 self->uk = (kstat32_t *)copyin((uintptr_t)arg1, sizeof (kstat32_t));
56 self->uk = (kstat_t *)copyin((uintptr_t)arg1, sizeof (kstat_t));
58 printf("%-16s %-16s %-6s %s:%d:%s\n", execname,
59 self->uk->ks_class == "" ? "." : self->uk->ks_class,
60 self->uk->ks_type == 0 ? "raw"
61 : self->uk->ks_type == 1 ? "named"
62 : self->uk->ks_type == 2 ? "intr"
63 : self->uk->ks_type == 3 ? "io"
64 : self->uk->ks_type == 4 ? "timer" : "?",
65 self->uk->ks_module, self->uk->ks_instance, self->uk->ks_name);