xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d (revision 8803:8c01b39012c9)
1*8803SJonathan.Haslam@Sun.COM /*
2*8803SJonathan.Haslam@Sun.COM  * CDDL HEADER START
3*8803SJonathan.Haslam@Sun.COM  *
4*8803SJonathan.Haslam@Sun.COM  * The contents of this file are subject to the terms of the
5*8803SJonathan.Haslam@Sun.COM  * Common Development and Distribution License (the "License").
6*8803SJonathan.Haslam@Sun.COM  * You may not use this file except in compliance with the License.
7*8803SJonathan.Haslam@Sun.COM  *
8*8803SJonathan.Haslam@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*8803SJonathan.Haslam@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*8803SJonathan.Haslam@Sun.COM  * See the License for the specific language governing permissions
11*8803SJonathan.Haslam@Sun.COM  * and limitations under the License.
12*8803SJonathan.Haslam@Sun.COM  *
13*8803SJonathan.Haslam@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*8803SJonathan.Haslam@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*8803SJonathan.Haslam@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*8803SJonathan.Haslam@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*8803SJonathan.Haslam@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*8803SJonathan.Haslam@Sun.COM  *
19*8803SJonathan.Haslam@Sun.COM  * CDDL HEADER END
20*8803SJonathan.Haslam@Sun.COM  */
21*8803SJonathan.Haslam@Sun.COM /*
22*8803SJonathan.Haslam@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*8803SJonathan.Haslam@Sun.COM  * Use is subject to license terms.
24*8803SJonathan.Haslam@Sun.COM  */
25*8803SJonathan.Haslam@Sun.COM 
26*8803SJonathan.Haslam@Sun.COM /*
27*8803SJonathan.Haslam@Sun.COM  * Test that we can successfully enable a probe using a generic event.
28*8803SJonathan.Haslam@Sun.COM  * Currently, all platforms implement 'PAPI_tot_ins' so we'll use that.
29*8803SJonathan.Haslam@Sun.COM  * Note that this test will fail if the system under test does not
30*8803SJonathan.Haslam@Sun.COM  * implement that event.
31*8803SJonathan.Haslam@Sun.COM  *
32*8803SJonathan.Haslam@Sun.COM  * This test will fail if:
33*8803SJonathan.Haslam@Sun.COM  *	1) The system under test does not define the 'PAPI_tot_ins' event.
34*8803SJonathan.Haslam@Sun.COM  */
35*8803SJonathan.Haslam@Sun.COM 
36*8803SJonathan.Haslam@Sun.COM #pragma D option quiet
37*8803SJonathan.Haslam@Sun.COM #pragma D option bufsize=128k
38*8803SJonathan.Haslam@Sun.COM 
39*8803SJonathan.Haslam@Sun.COM cpc:::PAPI_tot_ins-all-10000
40*8803SJonathan.Haslam@Sun.COM {
41*8803SJonathan.Haslam@Sun.COM 	@[probename] = count();
42*8803SJonathan.Haslam@Sun.COM }
43*8803SJonathan.Haslam@Sun.COM 
44*8803SJonathan.Haslam@Sun.COM tick-1s
45*8803SJonathan.Haslam@Sun.COM /n++ > 10/
46*8803SJonathan.Haslam@Sun.COM {
47*8803SJonathan.Haslam@Sun.COM 	exit(0);
48*8803SJonathan.Haslam@Sun.COM }
49