1*e5803b76SAdam H. Leventhal#
2*e5803b76SAdam H. Leventhal# CDDL HEADER START
3*e5803b76SAdam H. Leventhal#
4*e5803b76SAdam H. Leventhal# The contents of this file are subject to the terms of the
5*e5803b76SAdam H. Leventhal# Common Development and Distribution License (the "License").
6*e5803b76SAdam H. Leventhal# You may not use this file except in compliance with the License.
7*e5803b76SAdam H. Leventhal#
8*e5803b76SAdam H. Leventhal# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*e5803b76SAdam H. Leventhal# or http://www.opensolaris.org/os/licensing.
10*e5803b76SAdam H. Leventhal# See the License for the specific language governing permissions
11*e5803b76SAdam H. Leventhal# and limitations under the License.
12*e5803b76SAdam H. Leventhal#
13*e5803b76SAdam H. Leventhal# When distributing Covered Code, include this CDDL HEADER in each
14*e5803b76SAdam H. Leventhal# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*e5803b76SAdam H. Leventhal# If applicable, add the following below this CDDL HEADER, with the
16*e5803b76SAdam H. Leventhal# fields enclosed by brackets "[]" replaced with your own identifying
17*e5803b76SAdam H. Leventhal# information: Portions Copyright [yyyy] [name of copyright owner]
18*e5803b76SAdam H. Leventhal#
19*e5803b76SAdam H. Leventhal# CDDL HEADER END
20*e5803b76SAdam H. Leventhal#
21*e5803b76SAdam H. Leventhal
22*e5803b76SAdam H. Leventhal#
23*e5803b76SAdam H. Leventhal# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*e5803b76SAdam H. Leventhal# Use is subject to license terms.
25*e5803b76SAdam H. Leventhal#
26*e5803b76SAdam H. Leventhal
27*e5803b76SAdam H. Leventhal#
28*e5803b76SAdam H. Leventhal# Copyright (c) 2012 by Delphix. All rights reserved.
29*e5803b76SAdam H. Leventhal#
30*e5803b76SAdam H. Leventhal
31*e5803b76SAdam H. Leventhal#
32*e5803b76SAdam H. Leventhal# Test the output for stable translations.
33*e5803b76SAdam H. Leventhal#
34*e5803b76SAdam H. Leventhal
35*e5803b76SAdam H. Leventhalif [ $# != 1 ]; then
36*e5803b76SAdam H. Leventhal	echo expected one argument: '<'dtrace-path'>'
37*e5803b76SAdam H. Leventhal	exit 2
38*e5803b76SAdam H. Leventhalfi
39*e5803b76SAdam H. Leventhal
40*e5803b76SAdam H. Leventhaldtrace=$1
41*e5803b76SAdam H. Leventhal
42*e5803b76SAdam H. Leventhal$dtrace -v -s /dev/stdin <<EOF
43*e5803b76SAdam H. Leventhal
44*e5803b76SAdam H. Leventhal#pragma D option quiet
45*e5803b76SAdam H. Leventhal
46*e5803b76SAdam H. Leventhalinline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
47*e5803b76SAdam H. Leventhal
48*e5803b76SAdam H. Leventhal#pragma D attributes Stable/Stable/Common myinfo
49*e5803b76SAdam H. Leventhal
50*e5803b76SAdam H. LeventhalBEGIN
51*e5803b76SAdam H. Leventhal{
52*e5803b76SAdam H. Leventhal	this->a = myinfo->pr_flag;
53*e5803b76SAdam H. Leventhal	exit(0);
54*e5803b76SAdam H. Leventhal}
55*e5803b76SAdam H. Leventhal
56*e5803b76SAdam H. LeventhalBEGIN
57*e5803b76SAdam H. Leventhal{
58*e5803b76SAdam H. Leventhal	exit(1);
59*e5803b76SAdam H. Leventhal}
60*e5803b76SAdam H. LeventhalEOF
61*e5803b76SAdam H. Leventhal
62*e5803b76SAdam H. Leventhalexit $?
63