tst.genericevent.d revision 210753
117651Speter/*
217651Speter * CDDL HEADER START
317651Speter *
492111Sgreen * The contents of this file are subject to the terms of the
592111Sgreen * Common Development and Distribution License (the "License").
692111Sgreen * You may not use this file except in compliance with the License.
792111Sgreen *
892111Sgreen * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
992111Sgreen * or http://www.opensolaris.org/os/licensing.
1092111Sgreen * See the License for the specific language governing permissions
1192111Sgreen * and limitations under the License.
1292111Sgreen *
1392111Sgreen * When distributing Covered Code, include this CDDL HEADER in each
1442468Speter * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1542468Speter * If applicable, add the following below this CDDL HEADER, with the
1642468Speter * fields enclosed by brackets "[]" replaced with your own identifying
1742468Speter * information: Portions Copyright [yyyy] [name of copyright owner]
1842468Speter *
1942468Speter * CDDL HEADER END
2042468Speter */
2142468Speter/*
2242468Speter * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
2342468Speter * Use is subject to license terms.
2442468Speter */
2542468Speter
2642468Speter/*
2742468Speter * Test that we can successfully enable a probe using a generic event.
2842468Speter * Currently, all platforms implement 'PAPI_tot_ins' so we'll use that.
2942468Speter * Note that this test will fail if the system under test does not
3042468Speter * implement that event.
3142468Speter *
3242468Speter * This test will fail if:
3342468Speter *	1) The system under test does not define the 'PAPI_tot_ins' event.
3442468Speter */
3542468Speter
3642468Speter#pragma D option quiet
3742468Speter#pragma D option bufsize=128k
3842468Speter
3942468Spetercpc:::PAPI_tot_ins-all-10000
4042468Speter{
4142468Speter	@[probename] = count();
4242468Speter}
4342468Speter
4442468Spetertick-1s
4542468Speter/n++ > 10/
4642468Speter{
4742468Speter	exit(0);
4842468Speter}
4942468Speter