xref: /onnv-gate/usr/src/lib/libdtrace_jni/java/docs/examples/intrstat.d (revision 1449:5ac202d7f3a7)
1*1449Stomee /*
2*1449Stomee  * CDDL HEADER START
3*1449Stomee  *
4*1449Stomee  * The contents of this file are subject to the terms of the
5*1449Stomee  * Common Development and Distribution License (the "License").
6*1449Stomee  * You may not use this file except in compliance with the License.
7*1449Stomee  *
8*1449Stomee  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1449Stomee  * or http://www.opensolaris.org/os/licensing.
10*1449Stomee  * See the License for the specific language governing permissions
11*1449Stomee  * and limitations under the License.
12*1449Stomee  *
13*1449Stomee  * When distributing Covered Code, include this CDDL HEADER in each
14*1449Stomee  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1449Stomee  * If applicable, add the following below this CDDL HEADER, with the
16*1449Stomee  * fields enclosed by brackets "[]" replaced with your own identifying
17*1449Stomee  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1449Stomee  *
19*1449Stomee  * CDDL HEADER END
20*1449Stomee  */
21*1449Stomee 
22*1449Stomee /*
23*1449Stomee  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*1449Stomee  * Use is subject to license terms.
25*1449Stomee  */
26*1449Stomee 
27*1449Stomee #pragma	ident	"%Z%%M%	%I%	%E% SMI"
28*1449Stomee 
29*1449Stomee sdt:::interrupt-start
30*1449Stomee {
31*1449Stomee 	self->ts = vtimestamp;
32*1449Stomee }
33*1449Stomee 
34*1449Stomee sdt:::interrupt-complete
35*1449Stomee /self->ts && arg0/
36*1449Stomee {
37*1449Stomee 	this->devi = (struct dev_info *)arg0;
38*1449Stomee 	@counts[stringof(`devnamesp[this->devi->devi_major].dn_name),
39*1449Stomee 	     this->devi->devi_instance, cpu] = count();
40*1449Stomee 	@times[stringof(`devnamesp[this->devi->devi_major].dn_name),
41*1449Stomee 	     this->devi->devi_instance, cpu] = sum(vtimestamp - self->ts);
42*1449Stomee 	self->ts = 0;
43*1449Stomee }
44